changed import method

This commit is contained in:
Kevin Jahns
2014-08-14 20:33:55 +02:00
parent a637633a1c
commit eb541fd473
35 changed files with 101 additions and 55 deletions

View File

@@ -115,7 +115,10 @@ createIwcConnector = function(callback, initial_user_id) {
module.exports = createIwcConnector;
if (typeof window !== "undefined" && window !== null) {
window.createIwcConnector = createIwcConnector;
if (window.Y == null) {
window.Y = {};
}
window.Y.createIwcConnector = createIwcConnector;
}

View File

@@ -1 +1 @@
!function t(e,n,i){function r(u,a){if(!n[u]){if(!e[u]){var s="function"==typeof require&&require;if(!a&&s)return s(u,!0);if(o)return o(u,!0);throw new Error("Cannot find module '"+u+"'")}var c=n[u]={exports:{}};e[u][0].call(c.exports,function(t){var n=e[u][1][t];return r(n?n:t)},c,c.exports,t,e,n,i)}return n[u].exports}for(var o="function"==typeof require&&require,u=0;u<i.length;u++)r(i[u]);return r}({1:[function(t,e){var n;n=function(t,e){var n,i,r,o,u;return o={},i=new DUIClient,i.connect(function(t){var e;return null!=(e=o[t.action])?e.map(function(e){return setTimeout(function(){return e(t)},0)}):void 0}),i.initOK(),u=null,n=function(){function t(t,e,n,r){var a,s,c,l;this.engine=t,this.HB=e,this.execution_listener=n,this.yatta=r,this.duiClient=i,this.iwcHandler=o,l=function(t){return function(e){return 0!==Object.getOwnPropertyNames(t.initialized).length?t.send(e):void 0}}(this),this.execution_listener.push(l),this.initialized={},a=function(t){return function(n){var i;return e=n.extras.HB,i=n.extras.user,t.engine.applyOpsCheckDouble(e),t.initialized[i]=!0}}(this),o.Yatta_push_HB_element=[a],this.sendIwcIntent("Yatta_get_HB_element",{}),s=function(t){return function(e){var n;return n=e.extras,null!=t.initialized[n.uid.creator]?t.receive(n):void 0}}(this),this.iwcHandler.Yatta_new_operation=[s],null!=u&&this.engine.applyOpsCheckDouble(u),c=function(t){return function(){var e;return e={HB:t.yatta.getHistoryBuffer()._encode(),user:t.yatta.getUserId()},t.sendIwcIntent("Yatta_push_HB_element",e)}}(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,e){var n;return n={action:t,component:"",data:"",dataType:"",flags:["PUBLISH_GLOBAL"],extras:e},this.duiClient.sendIntent(n)},t}(),r=function(){var i;return i=null,i=null!=e?e:Math.floor(1e6*Math.random()),t(n,i)},void setTimeout(r,5e3)},e.exports=n,"undefined"!=typeof window&&null!==window&&(window.createIwcConnector=n)},{}]},{},[1]);
!function t(n,e,i){function r(u,a){if(!e[u]){if(!n[u]){var s="function"==typeof require&&require;if(!a&&s)return s(u,!0);if(o)return o(u,!0);throw new Error("Cannot find module '"+u+"'")}var c=e[u]={exports:{}};n[u][0].call(c.exports,function(t){var e=n[u][1][t];return r(e?e:t)},c,c.exports,t,n,e,i)}return e[u].exports}for(var o="function"==typeof require&&require,u=0;u<i.length;u++)r(i[u]);return r}({1:[function(t,n){var e;e=function(t,n){var e,i,r,o,u;return o={},i=new DUIClient,i.connect(function(t){var n;return null!=(n=o[t.action])?n.map(function(n){return setTimeout(function(){return n(t)},0)}):void 0}),i.initOK(),u=null,e=function(){function t(t,n,e,r){var a,s,c,l;this.engine=t,this.HB=n,this.execution_listener=e,this.yatta=r,this.duiClient=i,this.iwcHandler=o,l=function(t){return function(n){return 0!==Object.getOwnPropertyNames(t.initialized).length?t.send(n):void 0}}(this),this.execution_listener.push(l),this.initialized={},a=function(t){return function(e){var i;return n=e.extras.HB,i=e.extras.user,t.engine.applyOpsCheckDouble(n),t.initialized[i]=!0}}(this),o.Yatta_push_HB_element=[a],this.sendIwcIntent("Yatta_get_HB_element",{}),s=function(t){return function(n){var e;return e=n.extras,null!=t.initialized[e.uid.creator]?t.receive(e):void 0}}(this),this.iwcHandler.Yatta_new_operation=[s],null!=u&&this.engine.applyOpsCheckDouble(u),c=function(t){return function(){var n;return n={HB:t.yatta.getHistoryBuffer()._encode(),user:t.yatta.getUserId()},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:"",flags:["PUBLISH_GLOBAL"],extras:n},this.duiClient.sendIntent(e)},t}(),r=function(){var i;return i=null,i=null!=n?n:Math.floor(1e6*Math.random()),t(e,i)},void setTimeout(r,5e3)},n.exports=e,"undefined"!=typeof window&&null!==window&&(null==window.Y&&(window.Y={}),window.Y.createIwcConnector=e)},{}]},{},[1]);

View File

@@ -91,7 +91,10 @@ createPeerJsConnector = function(callback) {
module.exports = createPeerJsConnector;
if (typeof window !== "undefined" && window !== null) {
window.createPeerJsConnector = createPeerJsConnector;
if (window.Y == null) {
window.Y = {};
}
window.Y.createPeerJsConnector = createPeerJsConnector;
}

View File

@@ -1 +1 @@
!function n(e,t,r){function o(u,c){if(!t[u]){if(!e[u]){var s="function"==typeof require&&require;if(!c&&s)return s(u,!0);if(i)return i(u,!0);throw new Error("Cannot find module '"+u+"'")}var f=t[u]={exports:{}};e[u][0].call(f.exports,function(n){var t=e[u][1][n];return o(t?t:n)},f,f.exports,n,e,t,r)}return t[u].exports}for(var i="function"==typeof require&&require,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(n,e){var t;t=function(n){var e,t;return t=new Peer({key:"h7nlefbgavh1tt9"}),e=function(){function n(n,e,r,o){var i;this.engine=n,this.HB=e,this.execution_listener=r,this.yatta=o,this.peer=t,this.connections=[],this.peer.on("connection",function(n){return function(e){return e.send("hey"),n.addConnection(e)}}(this)),i=function(n){return function(e){return n.send(e)}}(this),this.execution_listener.push(i)}return n.prototype.connectToPeer=function(n){return this.addConnection(t.connect(n))},n.prototype.addConnection=function(n){var e;return this.connections.push(n),n.on("data",function(n){return function(e){if("hey"!==e){if(null!=e.HB)return n.engine.applyOpsCheckDouble(e.HB);if(null!=e.op)return n.engine.applyOp(e.op);throw new Error("Can't parse this operation")}}}(this)),e=function(e){return function(){return n.send({HB:e.yatta.getHistoryBuffer()._encode()})}}(this),setTimeout(e,1e3)},n.prototype.send=function(n){var e,t,r,o,i;if(n.uid.creator===this.HB.getUserId()&&"string"!=typeof n.uid.op_number){for(o=this.connections,i=[],t=0,r=o.length;r>t;t++)e=o[t],i.push(e.send({op:n}));return i}},n.prototype.receive=function(n){return n.uid.creator!==this.HB.getUserId()?this.engine.applyOp(n):void 0},n}(),t.on("open",function(t){return n(e,t)})},e.exports=t,"undefined"!=typeof window&&null!==window&&(window.createPeerJsConnector=t)},{}]},{},[1]);
!function n(e,t,r){function o(u,c){if(!t[u]){if(!e[u]){var s="function"==typeof require&&require;if(!c&&s)return s(u,!0);if(i)return i(u,!0);throw new Error("Cannot find module '"+u+"'")}var f=t[u]={exports:{}};e[u][0].call(f.exports,function(n){var t=e[u][1][n];return o(t?t:n)},f,f.exports,n,e,t,r)}return t[u].exports}for(var i="function"==typeof require&&require,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(n,e){var t;t=function(n){var e,t;return t=new Peer({key:"h7nlefbgavh1tt9"}),e=function(){function n(n,e,r,o){var i;this.engine=n,this.HB=e,this.execution_listener=r,this.yatta=o,this.peer=t,this.connections=[],this.peer.on("connection",function(n){return function(e){return e.send("hey"),n.addConnection(e)}}(this)),i=function(n){return function(e){return n.send(e)}}(this),this.execution_listener.push(i)}return n.prototype.connectToPeer=function(n){return this.addConnection(t.connect(n))},n.prototype.addConnection=function(n){var e;return this.connections.push(n),n.on("data",function(n){return function(e){if("hey"!==e){if(null!=e.HB)return n.engine.applyOpsCheckDouble(e.HB);if(null!=e.op)return n.engine.applyOp(e.op);throw new Error("Can't parse this operation")}}}(this)),e=function(e){return function(){return n.send({HB:e.yatta.getHistoryBuffer()._encode()})}}(this),setTimeout(e,1e3)},n.prototype.send=function(n){var e,t,r,o,i;if(n.uid.creator===this.HB.getUserId()&&"string"!=typeof n.uid.op_number){for(o=this.connections,i=[],t=0,r=o.length;r>t;t++)e=o[t],i.push(e.send({op:n}));return i}},n.prototype.receive=function(n){return n.uid.creator!==this.HB.getUserId()?this.engine.applyOp(n):void 0},n}(),t.on("open",function(t){return n(e,t)})},e.exports=t,"undefined"!=typeof window&&null!==window&&(null==window.Y&&(window.Y={}),window.Y.createPeerJsConnector=t)},{}]},{},[1]);

View File

@@ -178,12 +178,15 @@ JsonYatta = (function() {
})();
if (typeof window !== "undefined" && window !== null) {
window.JsonYatta = JsonYatta;
}
module.exports = JsonYatta;
if (typeof window !== "undefined" && window !== null) {
if (window.Y == null) {
window.Y = {};
}
window.Y.JsonYatta = JsonYatta;
}
},{"../Engine":1,"../HistoryBuffer":3,"../Types/JsonTypes":5}],3:[function(require,module,exports){
var HistoryBuffer;
@@ -235,7 +238,7 @@ HistoryBuffer = (function() {
user = _ref[u_name];
for (o_number in user) {
o = user[o_number];
if (!isNaN(parseInt(o_number)) && unknown(u_name, o_number)) {
if ((!isNaN(parseInt(o_number))) && unknown(u_name, o_number)) {
o_json = o._encode();
if (o.next_cl != null) {
o_next = o.next_cl;

File diff suppressed because one or more lines are too long

View File

@@ -169,6 +169,13 @@ TextYatta = (function() {
module.exports = TextYatta;
if (typeof window !== "undefined" && window !== null) {
if (window.Y == null) {
window.Y = {};
}
window.Y.TextYatta = TextYatta;
}
},{"../Engine":1,"../HistoryBuffer":3,"../Types/TextTypes":6}],3:[function(require,module,exports){
var HistoryBuffer;
@@ -220,7 +227,7 @@ HistoryBuffer = (function() {
user = _ref[u_name];
for (o_number in user) {
o = user[o_number];
if (!isNaN(parseInt(o_number)) && unknown(u_name, o_number)) {
if ((!isNaN(parseInt(o_number))) && unknown(u_name, o_number)) {
o_json = o._encode();
if (o.next_cl != null) {
o_next = o.next_cl;

File diff suppressed because one or more lines are too long

View File

@@ -48,7 +48,7 @@ HistoryBuffer = (function() {
user = _ref[u_name];
for (o_number in user) {
o = user[o_number];
if (!isNaN(parseInt(o_number)) && unknown(u_name, o_number)) {
if ((!isNaN(parseInt(o_number))) && unknown(u_name, o_number)) {
o_json = o._encode();
if (o.next_cl != null) {
o_next = o.next_cl;

View File

@@ -115,7 +115,10 @@ createIwcConnector = function(callback, initial_user_id) {
module.exports = createIwcConnector;
if (typeof window !== "undefined" && window !== null) {
window.createIwcConnector = createIwcConnector;
if (window.Y == null) {
window.Y = {};
}
window.Y.createIwcConnector = createIwcConnector;
}
@@ -386,12 +389,15 @@ JsonYatta = (function() {
})();
if (typeof window !== "undefined" && window !== null) {
window.JsonYatta = JsonYatta;
}
module.exports = JsonYatta;
if (typeof window !== "undefined" && window !== null) {
if (window.Y == null) {
window.Y = {};
}
window.Y.JsonYatta = JsonYatta;
}
},{"../Engine":3,"../HistoryBuffer":6,"../Types/JsonTypes":8}],5:[function(require,module,exports){
var Engine, HistoryBuffer, TextYatta, text_types_uninitialized;
@@ -456,6 +462,13 @@ TextYatta = (function() {
module.exports = TextYatta;
if (typeof window !== "undefined" && window !== null) {
if (window.Y == null) {
window.Y = {};
}
window.Y.TextYatta = TextYatta;
}
},{"../Engine":3,"../HistoryBuffer":6,"../Types/TextTypes":10}],6:[function(require,module,exports){
var HistoryBuffer;
@@ -507,7 +520,7 @@ HistoryBuffer = (function() {
user = _ref[u_name];
for (o_number in user) {
o = user[o_number];
if (!isNaN(parseInt(o_number)) && unknown(u_name, o_number)) {
if ((!isNaN(parseInt(o_number))) && unknown(u_name, o_number)) {
o_json = o._encode();
if (o.next_cl != null) {
o_next = o.next_cl;

File diff suppressed because one or more lines are too long