Project

General

Profile

Bug #1363 ยป Wt.1363.patch

Kevin Robertson, 07/28/2012 04:23 AM

View differences:

src/web/skeleton/Wt.js
} else {
var query = sessionUrl.substr(sessionUrl.indexOf('?'));
wsurl = "ws" + location.protocol.substr(4)
+ "//" + location.hostname + ":"
+ location.port + deployUrl + query;
+ "//" + location.host + deployUrl + query;
}
wsurl += "&request=ws";
src/web/skeleton/Wt.min.js
true;setTimeout(function(){oa=false;C._p_.autoJavaScript()},1)}}function ba(c){if(c){c="(function() {"+c+"})();";window.execScript?window.execScript(c):window.eval(c)}C==window._$_APP_CLASS_$_&&ia()}function L(c,d,f){if(!R){if(c==0){p.resolveRelativeAnchors();_$_$if_CATCH_ERROR_$_();try{_$_$endif_$_();ba(d);_$_$if_CATCH_ERROR_$_()}catch(h){d=null;_$_$if_SHOW_STACK_$_();d=h.stack||h.stacktrace;_$_$endif_$_();alert("Wt internal error: "+h+", code: "+h.code+", description: "+h.description+(d?", stack:\n"+
d:""))}_$_$endif_$_();f&&X(f)}else E=I.concat(E);I=[];if(W){clearTimeout(W);W=null}O=null;if(c>0)++ka;else ka=0;if(!R)if(ua||E.length>0)if(c==1){c=Math.min(12E4,Math.exp(ka)*500);ca=setTimeout(function(){k()},c)}else k()}}function ea(c){J=c.indexOf("://")!=-1||c[0]=="/"?c:V+c;na&&na.setUrl(c)}function S(){O.abort();W=O=null;R||k()}function a(c,d,f,h){if(!pa){pa=true;p.checkReleaseCapture(c,f);_$_$if_STRICTLY_SERIALIZED_EVENTS_$_();if(!O){_$_$endif_$_();var n={},j=E.length;n.object=c;n.signal=d;n.event=
window.fakeEvent||f;n.feedback=h;E[j]=ga(n,j);b();ba();_$_$if_STRICTLY_SERIALIZED_EVENTS_$_()}_$_$endif_$_();pa=false}}function b(){if(!R){_$_$if_WEB_SOCKETS_$_();if(z.state!=2)if(typeof window.WebSocket==="undefined"&&typeof window.MozWebSocket==="undefined")z.state=2;else{var c=z.socket;if(c==null||c.readyState>1)if(c!=null&&z.state==0)z.state=2;else{function d(){++z.reconnectTries;var h=Math.min(12E4,Math.exp(z.reconnectTries)*500);setTimeout(function(){b()},h)}var f;if(J.indexOf("://")!=-1)f=
"ws"+J.substr(4);else{f=J.substr(J.indexOf("?"));f="ws"+location.protocol.substr(4)+"//"+location.hostname+":"+location.port+V+f}f+="&request=ws";z.socket=typeof window.WebSocket!=="undefined"?(c=new WebSocket(f)):(c=new MozWebSocket(f));z.keepAlive&&clearInterval(z.keepAlive);z.keepAlive=null;c.onmessage=function(h){z.reconnectTries=0;z.state=1;L(0,h.data,null)};c.onerror=function(){if(reconnectTries==3&&z.state==0)z.state=2;d()};c.onclose=function(){if(z.reconnectTries==3&&z.state==0)z.state=2;
"ws"+J.substr(4);else{f=J.substr(J.indexOf("?"));f="ws"+location.protocol.substr(4)+"//"+location.host+V+f}f+="&request=ws";z.socket=typeof window.WebSocket!=="undefined"?(c=new WebSocket(f)):(c=new MozWebSocket(f));z.keepAlive&&clearInterval(z.keepAlive);z.keepAlive=null;c.onmessage=function(h){z.reconnectTries=0;z.state=1;L(0,h.data,null)};c.onerror=function(){if(reconnectTries==3&&z.state==0)z.state=2;d()};c.onclose=function(){if(z.reconnectTries==3&&z.state==0)z.state=2;
d()};c.onopen=function(){z.keepAlive=setInterval(function(){if(c.readyState==1)c.send("&signal=ping");else{clearInterval(z.keepAlive);z.keepAlive=null}},_$_SERVER_PUSH_TIMEOUT_$_)}}if(c.readyState==1){k();return}}_$_$endif_$_();if(O!=null&&W!=null){clearTimeout(W);O.abort();O=null}if(O==null)if(ca==null){ca=setTimeout(function(){k()},p.updateDelay);va=(new Date).getTime()}else if(ka){clearTimeout(ca);k()}else if((new Date).getTime()-va>p.updateDelay){clearTimeout(ca);k()}}}function e(c,d){qa=d;ra=
c;na.responseReceived(c)}function i(c){wa=c}function k(){if(C!=window._$_APP_CLASS_$_)T();else if(!O){ca=null;if(R){if(!xa){if(confirm("The application was quited, do you want to restart?"))document.location=document.location;xa=true}}else{var c,d,f;if(E.length>0){c=g();d=c.feedback?setTimeout(U,_$_INDICATOR_TIMEOUT_$_):null;f=false}else{c={result:"&signal=poll"};d=null;f=true}c.result+="&ackId="+ra+"&pageId="+wa;if(qa){var h="",n=$("#"+qa).get(0);if(n)for(n=n.parentNode;!p.hasTag(n,"BODY");n=n.parentNode)if(n.id){if(h!=
"")h+=",";h+=n.id}c.result+="&ackPuzzle="+encodeURIComponent(h)}c.result+="&_$_PARAMS_$_";if(z.socket!=null&&z.socket.readyState==1){O=null;d!=null&&clearTimeout(d);f||z.socket.send(c.result)}else{O=na.sendUpdate("request=jsupdate"+c.result,d,ra,-1);W=f?setTimeout(S,_$_SERVER_PUSH_TIMEOUT_$_):null}}}}function l(c,d,f){if(typeof c.wtWidth==="undefined"||c.wtWidth!=d||typeof c.wtHeight==="undefined"||c.wtHeight!=f){c.wtWidth=d;c.wtHeight=f;o(c,"resized",d,f)}}function o(c,d){var f={},h=E.length;f.signal=
    (1-1/1)