yjs/build/node/Connectors/IwcConnector.js
2014-08-12 19:18:56 +02:00

2 lines
1.6 KiB
JavaScript

(function(){var t;t=function(t){var n,e,i,r,o,u;return o={},e=new DUIClient,e.connect(function(t){var n;return null!=(n=o[t.action])?n.map(function(n){return setTimeout(function(){return n(t)},0)}):void 0}),e.initOK(),u=null,n=function(){function t(t,n,i,r){var a,c,s;this.engine=t,this.HB=n,this.execution_listener=i,this.yatta=r,this.duiClient=e,this.iwcHandler=o,s=function(t){return function(n){return t.send(n)}}(this),this.execution_listener.push(s),a=function(t){return function(n){var e;return e=n.extras,t.receive(e)}}(this),this.iwcHandler.Yatta_new_operation=[a],null!=u&&this.engine.applyOpsCheckDouble(u),c=function(t){return function(){var n;return n={HB:t.yatta.getHistoryBuffer()._encode()},t.sendIwcIntent("Yatta_push_HB_element",n)}}(this),this.iwcHandler.Yatta_get_HB_element=[c]}return t.prototype.send=function(t){return t.uid.creator===this.HB.getUserId()&&"string"!=typeof t.uid.op_number?this.sendIwcIntent("Yatta_new_operation",t):void 0},t.prototype.receive=function(t){return t.uid.creator!==this.HB.getUserId()?this.engine.applyOp(t):void 0},t.prototype.sendIwcIntent=function(t,n){var e;return e={action:t,component:"",data:"",dataType:"",extras:n},this.duiClient.sendIntent(e)},t}(),i={action:"Yatta_get_HB_element",component:"",data:"",dataType:"",extras:{}},r=function(){var r,a;return e.sendIntent(i),r=!1,a=function(i){var o;return o=e.getIwcClient()._componentName,u=null!=i?i.extras.HB:void 0,r?void 0:(r=!0,t(n,o))},o.Yatta_push_HB_element=[a],setTimeout(a,0)},void setTimeout(r,0*Math.random())},module.exports=t,"undefined"!=typeof window&&null!==window&&(window.createConnector=t)}).call(this);
//# sourceMappingURL=../Connectors/IwcConnector.js.map