Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

yep another console.log in a corner

	modified:   easyWebSocket-node.min.js
	modified:   easyWebSocket.min.js
	modified:   node/easyWebSocket-node.js
  • Loading branch information...
commit e0d9d72f851cb967c71f6c96c7abcec65b031962 1 parent 6274443
@jeromeetienne authored
View
2  easyWebSocket-node.min.js
@@ -102,7 +102,7 @@ function(c,e){return function(g){var l=new a;l.initEvent(e,true,true);l.target=l
"-100px"}var e=document.createElement("div");e.id="webSocketFlash";c.appendChild(e);document.body.appendChild(c);swfobject.embedSWF(WEB_SOCKET_SWF_LOCATION,"webSocketFlash","1","1","9.0.0",null,{bridgeName:"webSocket"},{hasPriority:true,allowScriptAccess:"always"},null,function(g){g.success||b.error("[WebSocket] swfobject.embedSWF failed")});FABridge.addInitializationCallback("webSocket",function(){try{WebSocket.__flash=FABridge.webSocket.root();WebSocket.__flash.setCallerUrl(location.href);WebSocket.__flash.setDebug(!!window.WEB_SOCKET_DEBUG);
for(var g=0;g<WebSocket.__tasks.length;++g)WebSocket.__tasks[g]();WebSocket.__tasks=[]}catch(l){b.error("[WebSocket] "+l.toString())}})}else b.error("[WebSocket] set WEB_SOCKET_SWF_LOCATION to location of WebSocketMain.swf")};WebSocket.__addTask=function(c){WebSocket.__flash?c():WebSocket.__tasks.push(c)};WebSocket.__isFlashLite=function(){if(!window.navigator||!window.navigator.mimeTypes)return false;var c=window.navigator.mimeTypes["application/x-shockwave-flash"];if(!c||!c.enabledPlugin||!c.enabledPlugin.filename)return false;
return c.enabledPlugin.filename.match(/flashlite/i)?true:false};window.webSocketLog=function(c){b.log(decodeURIComponent(c))};window.webSocketError=function(c){b.error(decodeURIComponent(c))};window.WEB_SOCKET_DISABLE_AUTO_INITIALIZATION||(window.addEventListener?window.addEventListener("load",WebSocket.__initialize,false):window.attachEvent("onload",WebSocket.__initialize))}else b.error("Flash Player is not installed.")}})();EasyWebSocket=function(a){var b=this;this.url=a;this.bufferedAmount=0;this.readyState=EasyWebSocket.CONNECTING;this._clientId="clientid-sio-"+this.url+"-"+Math.floor(Math.random()*999999).toString(36);this.log=EasyWebSocket.logFunction;this.onopen=function(){b.log("default onopen method")};this.onmessage=function(){b.log("default onmessage method")};this.onerror=function(){b.log("default onerror method")};this.onclose=function(){b.log("default onclose method")};this._sioCtor()};
-EasyWebSocket.prototype._sioCtor=function(){var a=this,b=this.parseUri(EasyWebSocket.serverUrl),c=b.host;b=parseInt(b.port);this._sockio=new io.Socket(c,{port:b,rememberTransport:false});this._sockio.connect();this._sockio.on("connect",function(){console.log("socket connected",a._sockio,a._clientId);a._sockio.send({type:"connect",data:{wsUrl:a.url,clientId:a._clientId}});a.readyState=EasyWebSocket.CONNECTED;a.onopen()});this._sockio.on("connect_failed",function(){a.onerror()});this._sockio.on("message",
+EasyWebSocket.prototype._sioCtor=function(){var a=this,b=this.parseUri(EasyWebSocket.serverUrl),c=b.host;b=parseInt(b.port);this._sockio=new io.Socket(c,{port:b,rememberTransport:false});this._sockio.connect();this._sockio.on("connect",function(){a.log("socket connected",a._sockio,a._clientId);a._sockio.send({type:"connect",data:{wsUrl:a.url,clientId:a._clientId}});a.readyState=EasyWebSocket.CONNECTED;a.onopen()});this._sockio.on("connect_failed",function(){a.onerror()});this._sockio.on("message",
function(e){a.log("received message",e);a.onmessage({data:e})});this._sockio.on("disconnect",function(){console.log("socket disconnected");a.onclose()})};EasyWebSocket.prototype.send=function(a){this._sockio.send({type:"message",data:{clientId:this._clientId,message:a}})};EasyWebSocket.prototype.close=function(){this._sockio.disconnect()};EasyWebSocket.CONNECTING=0;EasyWebSocket.OPEN=1;EasyWebSocket.CLOSING=2;EasyWebSocket.CLOSED=3;EasyWebSocket.serverUrl="http://88.191.76.230:8667";
EasyWebSocket.logFunction=function(){};EasyWebSocket.prototype.parseUri=function a(b){var c=a.options;b=c.parser[c.strictMode?"strict":"loose"].exec(b);for(var e={},g=14;g--;)e[c.key[g]]=b[g]||"";e[c.q.name]={};e[c.key[12]].replace(c.q.parser,function(l,q,o){if(q)e[c.q.name][q]=o});return e};
EasyWebSocket.prototype.parseUri.options={strictMode:false,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};
View
2  easyWebSocket.min.js
@@ -102,7 +102,7 @@ function(c,e){return function(g){var l=new a;l.initEvent(e,true,true);l.target=l
"-100px"}var e=document.createElement("div");e.id="webSocketFlash";c.appendChild(e);document.body.appendChild(c);swfobject.embedSWF(WEB_SOCKET_SWF_LOCATION,"webSocketFlash","1","1","9.0.0",null,{bridgeName:"webSocket"},{hasPriority:true,allowScriptAccess:"always"},null,function(g){g.success||b.error("[WebSocket] swfobject.embedSWF failed")});FABridge.addInitializationCallback("webSocket",function(){try{WebSocket.__flash=FABridge.webSocket.root();WebSocket.__flash.setCallerUrl(location.href);WebSocket.__flash.setDebug(!!window.WEB_SOCKET_DEBUG);
for(var g=0;g<WebSocket.__tasks.length;++g)WebSocket.__tasks[g]();WebSocket.__tasks=[]}catch(l){b.error("[WebSocket] "+l.toString())}})}else b.error("[WebSocket] set WEB_SOCKET_SWF_LOCATION to location of WebSocketMain.swf")};WebSocket.__addTask=function(c){WebSocket.__flash?c():WebSocket.__tasks.push(c)};WebSocket.__isFlashLite=function(){if(!window.navigator||!window.navigator.mimeTypes)return false;var c=window.navigator.mimeTypes["application/x-shockwave-flash"];if(!c||!c.enabledPlugin||!c.enabledPlugin.filename)return false;
return c.enabledPlugin.filename.match(/flashlite/i)?true:false};window.webSocketLog=function(c){b.log(decodeURIComponent(c))};window.webSocketError=function(c){b.error(decodeURIComponent(c))};window.WEB_SOCKET_DISABLE_AUTO_INITIALIZATION||(window.addEventListener?window.addEventListener("load",WebSocket.__initialize,false):window.attachEvent("onload",WebSocket.__initialize))}else b.error("Flash Player is not installed.")}})();EasyWebSocket=function(a){var b=this;this.url=a;this.bufferedAmount=0;this.readyState=EasyWebSocket.CONNECTING;this._clientId="clientid-sio-"+this.url+"-"+Math.floor(Math.random()*999999).toString(36);this.log=EasyWebSocket.logFunction;this.onopen=function(){b.log("default onopen method")};this.onmessage=function(){b.log("default onmessage method")};this.onerror=function(){b.log("default onerror method")};this.onclose=function(){b.log("default onclose method")};this._sioCtor()};
-EasyWebSocket.prototype._sioCtor=function(){var a=this,b=this.parseUri(EasyWebSocket.serverUrl),c=b.host;b=parseInt(b.port);this._sockio=new io.Socket(c,{port:b,rememberTransport:false});this._sockio.connect();this._sockio.on("connect",function(){console.log("socket connected",a._sockio,a._clientId);a._sockio.send({type:"connect",data:{wsUrl:a.url,clientId:a._clientId}});a.readyState=EasyWebSocket.CONNECTED;a.onopen()});this._sockio.on("connect_failed",function(){a.onerror()});this._sockio.on("message",
+EasyWebSocket.prototype._sioCtor=function(){var a=this,b=this.parseUri(EasyWebSocket.serverUrl),c=b.host;b=parseInt(b.port);this._sockio=new io.Socket(c,{port:b,rememberTransport:false});this._sockio.connect();this._sockio.on("connect",function(){a.log("socket connected",a._sockio,a._clientId);a._sockio.send({type:"connect",data:{wsUrl:a.url,clientId:a._clientId}});a.readyState=EasyWebSocket.CONNECTED;a.onopen()});this._sockio.on("connect_failed",function(){a.onerror()});this._sockio.on("message",
function(e){a.log("received message",e);a.onmessage({data:e})});this._sockio.on("disconnect",function(){console.log("socket disconnected");a.onclose()})};EasyWebSocket.prototype.send=function(a){this._sockio.send({type:"message",data:{clientId:this._clientId,message:a}})};EasyWebSocket.prototype.close=function(){this._sockio.disconnect()};EasyWebSocket.CONNECTING=0;EasyWebSocket.OPEN=1;EasyWebSocket.CLOSING=2;EasyWebSocket.CLOSED=3;EasyWebSocket.serverUrl="http://88.191.76.230:8667";
EasyWebSocket.logFunction=function(){};EasyWebSocket.prototype.parseUri=function a(b){var c=a.options;b=c.parser[c.strictMode?"strict":"loose"].exec(b);for(var e={},g=14;g--;)e[c.key[g]]=b[g]||"";e[c.q.name]={};e[c.key[12]].replace(c.q.parser,function(l,q,o){if(q)e[c.q.name][q]=o});return e};
EasyWebSocket.prototype.parseUri.options={strictMode:false,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};
View
2  node/easyWebSocket-node.js
@@ -74,7 +74,7 @@ EasyWebSocket.prototype._sioCtor = function()
self.onmessage({data: message})
})
this._sockio.on('disconnect', function(){
- console.log("socket disconnected")
+ self.log("socket disconnected")
self.onclose() // TODO is there an event attached to that
})
}
Please sign in to comment.
Something went wrong with that request. Please try again.