diff --git a/build/nodegame-window.js b/build/nodegame-window.js index ee05111..3624410 100644 --- a/build/nodegame-window.js +++ b/build/nodegame-window.js @@ -2968,23 +2968,6 @@ "use strict"; - // var J = node.JSUS; - - // function getElement(idOrObj, prefix) { - // var el; - // if ('string' === typeof idOrObj) { - // el = W.getElementById(idOrObj); - // } - // else if (J.isElement(idOrObj)) { - // el = idOrObj; - // } - // else { - // throw new TypeError(prefix + ': idOrObj must be string ' + - // ' or HTML Element.'); - // } - // return el; - // } - var GameWindow = node.GameWindow; /** @@ -3009,37 +2992,6 @@ W.init(node.conf.window); }); -// node.on('HIDE', function(idOrObj) { -// var el; -// console.log('***GameWindow.on.HIDE is deprecated. Use ' + -// 'GameWindow.hide() instead.***'); -// el = getElement(idOrObj, 'GameWindow.on.HIDE'); -// if (el) el.style.display = 'none'; -// }); -// -// node.on('SHOW', function(idOrObj) { -// var el; -// console.log('***GameWindow.on.SHOW is deprecated. Use ' + -// 'GameWindow.show() instead.***'); -// el = getElement(idOrObj, 'GameWindow.on.SHOW'); -// if (el) el.style.display = ''; -// }); -// -// node.on('TOGGLE', function(idOrObj) { -// var el; -// console.log('***GameWindow.on.TOGGLE is deprecated. Use ' + -// 'GameWindow.toggle() instead.***'); -// el = getElement(idOrObj, 'GameWindow.on.TOGGLE'); -// if (el) { -// if (el.style.display === 'none') { -// el.style.display = ''; -// } -// else { -// el.style.display = 'none'; -// } -// } -// }); - // Disable all the input forms found within a given id element. node.on('INPUT_DISABLE', function(id) { W.toggleInputs(id, true); @@ -3179,7 +3131,9 @@ } function event_PAUSED(text) { - text = text || W.waitScreen.defaultTexts.paused; + // Ignores non-string parameters. + text = 'string' === typeof text ? + text : W.waitScreen.defaultTexts.paused; if (W.isScreenLocked()) { W.waitScreen.beforePauseInnerHTML = W.waitScreen.contentDiv.innerHTML; @@ -4541,7 +4495,6 @@ }; GameWindow.prototype.setInnerHTML = function(search, replace, mod) { - // console.log('***deprecated: use W.html instead of W.setInnerHTML'); this.html(search, replace, mod); }; diff --git a/build/nodegame-window.min.js b/build/nodegame-window.min.js index 00a554d..2f06753 100644 --- a/build/nodegame-window.min.js +++ b/build/nodegame-window.min.js @@ -15,4 +15,4 @@ * * Depends on JSUS and nodegame-client. */ -(function(e,t){"use strict";function a(e,t){function r(){e.removeEventListener("load",r,!1),n.removeEventListener("load",r,!1),t&&setTimeout(function(){t()},120)}var n;n=e.contentWindow,e.addEventListener("load",r,!1),n.addEventListener("load",r,!1)}function f(e,t){function r(i){var s;s=J.getIFrameDocument(e);if(i.type==="load"||s.readyState==="complete")e.detachEvent("onreadystatechange",r),n.detachEvent("onload",r),t&&setTimeout(function(){t()},120)}var n;n=e.contentWindow,e.attachEvent("onreadystatechange",r),n.attachEvent("onload",r)}function l(e,t){W.isIE?f(e,t):a(e,t)}function c(){this.setStateLevel("UNINITIALIZED");if("undefined"==typeof e)throw new Error("GameWindow: no window found. Are you in a browser?");if("undefined"==typeof t)throw new Error("GameWindow: nodeGame not found");t.silly("node-window: loading..."),this.frameName=null,this.frameElement=null,this.frameWindow=null,this.frameDocument=null,this.frameRoot=null,this.headerElement=null,this.headerName=null,this.headerRoot=null,this.headerPosition=null,this.defaultHeaderPosition="top",this.conf={},this.uriChannel=null,this.areLoading=0,this.cacheSupported=null,this.directFrameDocumentAccess=null,this.cache={},this.currentURIs={},this.unprocessedUri=null,this.globalLibs=[],this.frameLibs={},this.uriPrefix=null,this.stateLevel=null,this.waitScreen=null,this.listenersAdded=null,this.screenState=t.constants.screenLevels.ACTIVE,this.styleElement=null,this.isIE=!!document.createElement("span").attachEvent,this.headerOffset=0,this.willResizeFrame=!1,this.addDefaultSetups(),this.addDefaultListeners(),setTimeout(function(){(function(e){e.length>=1&&(e[0].style.display="none")})(document.getElementsByTagName("noscript"))},1e3),this.init(c.defaults),t.silly("node-window: created.")}function h(e,t,n,r,i,s,o){var u,a;n=W.getElementById(r),u=W.getIFrameDocument(n).documentElement,i&&(u.innerHTML=e.cache[t].contents),r===e.frameName&&(e.frameWindow=n.contentWindow,e.frameDocument=e.getIFrameDocument(n),e.conf.rightClickDisabled&&J.disableRightClick(e.frameDocument),e.conf.noEscape&&(e.frameDocument.onkeydown=document.onkeydown)),e.styleElement=null,p(n),a=function(){v(n,e.globalLibs.concat(e.frameLibs.hasOwnProperty(t)?e.frameLibs[t]:[])),s&&(e.cache[t].contents=u.innerHTML),o(),b()},i?d(n,a):a()}function p(e){var t,n,r,i;n=W.getIFrameDocument(e),r=W.getElementsByClassName(n,"injectedlib","script");for(t=0;t=n.length&&r&&r()})}(o,a),e.frames[f].location.replace(o)},c.prototype.clearCache=function(){this.cache={}},c.prototype.getElementById=c.prototype.gid=function(e){var t,n;return n=this.getFrameDocument(),t=null,n&&n.getElementById&&(t=n.getElementById(e)),t||(t=document.getElementById(e)),t},c.prototype.getElementsByTagName=function(e){var t;return t=this.getFrameDocument(),t?t.getElementsByTagName(e):document.getElementsByTagName(e)},c.prototype.getElementsByClassName=function(e,t){var n;return n=this.getFrameDocument()||document,J.getElementsByClassName(n,e,t)},c.prototype.loadFrame=function(e,n,r){var i,s,o,u,a,f,p,d,v,g,b,w,E,S,x;if("string"!=typeof e)throw new TypeError("GameWindow.loadFrame: uri must be string. Found: "+e);if(n&&"function"!=typeof n)throw new TypeError("GameWindow.loadFrame: func must be function or undefined. Found: "+n);if(r&&"object"!=typeof r)throw new TypeError("GameWindow.loadFrame: opts must be object or undefined. Found: "+r);r=r||{},v=this.getFrame(),g=this.frameName;if(!v)throw new Error("GameWindow.loadFrame: no frame found");if(!g)throw new Error("GameWindow.loadFrame: frame has no name");this.setStateLevel("LOADING"),i=this,w=v.contentWindow,b=W.getIFrameDocument(v),S=b.readyState,S=S==="complete",s=c.defaults.cacheDefaults.loadCache,o=c.defaults.cacheDefaults.storeCacheNow,u=c.defaults.cacheDefaults.storeCacheLater;if(r.cache){if(r.cache.loadMode)if(r.cache.loadMode==="reload")s=!1;else{if(r.cache.loadMode!=="cache")throw new Error("GameWindow.loadFrame: unkown cache load mode: "+r.cache.loadMode);s=!0}if(r.cache.storeMode)if(r.cache.storeMode==="off")o=!1,u=!1;else if(r.cache.storeMode==="onLoad")o=!0,u=!1;else{if(r.cache.storeMode!=="onClose")throw new Error("GameWindow.loadFrame: unkown cache store mode: "+r.cache.storeMode);o=!1,u=!0}}if("undefined"!=typeof r.autoParse){if("object"!=typeof r.autoParse)throw new TypeError("GameWindow.loadFrame: opts.autoParse must be object or undefined. Found: "+r.autoParse);if("undefined"!=typeof r.autoParsePrefix){if("string"!=typeof r.autoParsePrefix)throw new TypeError("GameWindow.loadFrame: opts.autoParsePrefix must be string or undefined. Found: "+r.autoParsePrefix);p=r.autoParsePrefix}if("undefined"!=typeof r.autoParseMod){if("string"!=typeof r.autoParseMod)throw new TypeError("GameWindow.loadFrame: opts.autoParseMod must be string or undefined. Found: "+r.autoParseMod);d=r.autoParseMod}f=r.autoParse}a="undefined"==typeof r.scrollUp?!0:r.scrollUp,this.unprocessedUri=e;if(this.cacheSupported===null){this.preCacheTest(function(){i.loadFrame(e,n,r)});return}e=this.processUri(e),this.cacheSupported===!1?(o=!1,u=!1,s=!1):(x=this.currentURIs[g],this.cache.hasOwnProperty(x)&&this.cache[x].cacheOnClose&&(E=b.documentElement,this.cache[x].contents=E.innerHTML),this.cache.hasOwnProperty(e)||(this.cache[e]={contents:null,cacheOnClose:!1}),this.cache[e].cacheOnClose=u,this.cache[e].contents===null&&(s=!1)),this.currentURIs[g]=e,m(this,1),v.style.visibility="hidden",(!s||!S)&&l(v,function(){i.directFrameDocumentAccess===null&&y(i),h(i,e,v,g,s,o,function(){i.updateLoadFrameState(n,f,d,p,a)})}),s?S&&h(this,e,v,g,s,o,function(){i.updateLoadFrameState(n,f,d,p,a)}):w.location.replace(e),w.node=t},c.prototype.processUri=function(e){return e.charAt(0)!=="/"&&e.substr(0,7)!=="http://"&&(this.uriPrefix&&(e=this.uriPrefix+e),this.uriChannel&&(e=this.uriChannel+e)),e},c.prototype.updateLoadFrameState=function(n,r,i,s,u){var a,f;a=m(this,-1),a&&this.setStateLevel("LOADED"),n&&n.call(t.game),r&&this.searchReplace(r,i,s),u&&e.scrollTo&&e.scrollTo(0,0),t.events.ee.game.emit("FRAME_LOADED"),t.events.ee.stage.emit("FRAME_LOADED"),t.events.ee.step.emit("FRAME_LOADED"),a?(f=t.game.getStageLevel(),f===o&&t.emit("LOADED")):t.silly("game-window: "+this.areLoading+" frames "+"still loading.")},c.prototype.clearPageBody=function(){this.reset(),document.body.innerHTML=""},c.prototype.clearPage=function(){this.reset();try{document.documentElement.innerHTML=""}catch(e){this.removeChildrenFromNode(document.documentElement)}},c.prototype.setUriPrefix=function(e){if(e!==null&&"string"!=typeof e)throw new TypeError("GameWindow.setUriPrefix: uriPrefix must be string or null. Found: "+e);this.conf.uriPrefix=this.uriPrefix=e},c.prototype.setUriChannel=function(e){if("string"==typeof e)e.charAt(0)!=="/"&&(e="/"+e),e.charAt(e.length-1)!=="/"&&(e+="/");else if(e!==null)throw new TypeError("GameWindow.uriChannel: uriChannel must be string or null. Found: "+e);this.uriChannel=e},c.prototype.adjustFrameHeight=function(){var t,n;return n=function(t){var n,r,i;W.adjustHeaderOffset(),n=W.getFrame();if(!n||!n.contentWindow)return;if(!n.contentWindow.document.body){W.adjustFrameHeight(t,120);return}W.conf.adjustFrameHeight===!1?r="100vh":(r=e.innerHeight||e.clientHeight,i=n.contentWindow.document.body.offsetHeight,i+=60,W.headerPosition==="top"&&(i+=W.headerOffset),rDo not refresh the page!
Maximum Waiting Time: ",countdownResuming:e.countdownResumingText||"Resuming soon...",formatCountdown:function(e){var t;return t="",e=J.parseMilliseconds(e),e[2]&&(t+=e[2]+" min "),e[3]&&(t+=e[3]+" sec"),t||0}},this.lockedInputs=[],this.enable()}e.WaitScreen=l,l.version="0.10.0",l.description="Shows a waiting screen";var n,r;n=["button","select","textarea","input"],r=n.length,l.prototype.enable=function(){if(this.enabled)return;node.events.ee.game.on("REALLY_DONE",s),node.events.ee.game.on("STEPPING",o),node.events.ee.game.on("PLAYING",u),node.events.ee.game.on("PAUSED",a),node.events.ee.game.on("RESUMED",f),this.enabled=!0},l.prototype.disable=function(){if(!this.enabled)return;node.events.ee.game.off("REALLY_DONE",s),node.events.ee.game.off("STEPPING",o),node.events.ee.game.off("PLAYING",u),node.events.ee.game.off("PAUSED",a),node.events.ee.game.off("RESUMED",f),this.enabled=!1},l.prototype.lock=function(e,t){var n,r;r=this.defaultTexts,"undefined"==typeof e&&(e=r.locked),"undefined"==typeof document.getElementsByTagName&&node.warn("WaitScreen.lock: cannot lock inputs"),i(document),n=W.getFrameDocument(),n&&i(n),this.waitingDiv||(this.root||(this.root=W.getFrameRoot()||document.body),this.waitingDiv=W.add("div",this.root,this.id),this.contentDiv=W.add("div",this.waitingDiv,"ng_waitscreen-content-div")),this.waitingDiv.style.display==="none"&&(this.waitingDiv.style.display=""),this.contentDiv.innerHTML=e,this.displayCountdown&&t?(this.countdownDiv||(this.countdownDiv=W.add("div",this.waitingDiv,"ng_waitscreen-countdown-div"),this.countdownDiv.innerHTML=r.countdown,this.countdownSpan=W.add("span",this.countdownDiv,"ng_waitscreen-countdown-span")),this.countdown=t,this.countdownSpan.innerHTML=r.formatCountdown(t),this.countdownDiv.style.display="",this.countdownInterval=setInterval(function(){var e;e=W.waitScreen;if(!W.isScreenLocked()){clearInterval(e.countdownInterval);return}e.countdown-=1e3,e.countdown<0?(clearInterval(e.countdownInterval),e.countdownDiv.style.display="none",e.contentDiv.innerHTML=r.countdownResuming):e.countdownSpan.innerHTML=r.formatCountdown(e.countdown)},1e3)):this.countdownDiv&&(this.countdownDiv.style.display="none")},l.prototype.unlock=function(){var e,t;this.waitingDiv&&this.waitingDiv.style.display===""&&(this.waitingDiv.style.display="none"),this.countdownInterval&&clearInterval(this.countdownInterval);try{t=this.lockedInputs.length;for(e=-1;++e2&&(t=arguments[1],n=arguments[2]);if("undefined"==typeof n)n="ng_replace_";else if(null===n)n="";else if("string"!=typeof n)throw new TypeError("GameWindow.searchReplace: prefix must be string, null or undefined. Found: "+n);e=arguments[0];if(J.isArray(e)){s=-1,i=e.length;for(;++sn.dt)return 1}else{if(e.dtn.dt)return-1}if(e.dt===n.dt){if("undefined"==typeof e.dd)return-1;if("undefined"==typeof n.dd)return 1;if(e.ddn.dd)return 1;if(e.nddbidn.nddbid)return-1}return 0},this.DL=e.list||document.createElement(this.FIRST_LEVEL),this.DL.id=e.id||this.id,e.className&&(this.DL.className=e.className),this.options.title&&this.DL.appendChild(document.createTextNode(e.title)),this.htmlRenderer=new r(e.render)},s.prototype._add=function(e){if(!e)return;this.insert(e),this.auto_update&&this.parse()},s.prototype.addDT=function(e,t){if("undefined"==typeof e)return;this.last_dt++,t="undefined"!=typeof t?t:this.last_dt,this.last_dd=0;var n=new o({dt:t,content:e});return this._add(n)},s.prototype.addDD=function(e,t,n){if("undefined"==typeof e)return;t="undefined"!=typeof t?t:this.last_dt,n="undefined"!=typeof n?n:this.last_dd++;var r=new o({dt:t,dd:n,content:e});return this._add(r)},s.prototype.parse=function(){this.sort();var e=null,t=null,n=function(){var n=document.createElement(this.SECOND_LEVEL);return this.DL.appendChild(n),t=null,e=n,n},r=function(){var e=document.createElement(this.THIRD_LEVEL);return this.DL.appendChild(e),e};if(this.DL){while(this.DL.hasChildNodes())this.DL.removeChild(this.DL.firstChild);this.options.title&&this.DL.appendChild(document.createTextNode(this.options.title))}for(var i=0;ithis.pointers[e])this.pointers[e]=t;return this.pointers[e]},u.prototype.addMultiple=function(e,t,n,r){var i,s,o,u;f("addMultiple",e,n,r);if(t&&"string"!=typeof t||t&&"undefined"==typeof this.pointers[t])throw new TypeError("Table.addMultiple: dim must be a valid dimension (x or y) or undefined.");t=t||"x",n=this.getCurrPointer("x",n),r=this.getNextPointer("y",r),n="undefined"!=typeof n?n:this.pointers.x===null?0:this.pointers.x,r="undefined"!=typeof r?r:this.pointers.y===null?0:this.pointers.y,J.isArray(e)||(e=[e]),i=-1,s=e.length;for(;++ih+1){d=this.db[u].y-(h+1);for(a=0;a=1&&(e[0].style.display="none")})(document.getElementsByTagName("noscript"))},1e3),this.init(c.defaults),t.silly("node-window: created.")}function h(e,t,n,r,i,s,o){var u,a;n=W.getElementById(r),u=W.getIFrameDocument(n).documentElement,i&&(u.innerHTML=e.cache[t].contents),r===e.frameName&&(e.frameWindow=n.contentWindow,e.frameDocument=e.getIFrameDocument(n),e.conf.rightClickDisabled&&J.disableRightClick(e.frameDocument),e.conf.noEscape&&(e.frameDocument.onkeydown=document.onkeydown)),e.styleElement=null,p(n),a=function(){v(n,e.globalLibs.concat(e.frameLibs.hasOwnProperty(t)?e.frameLibs[t]:[])),s&&(e.cache[t].contents=u.innerHTML),o(),b()},i?d(n,a):a()}function p(e){var t,n,r,i;n=W.getIFrameDocument(e),r=W.getElementsByClassName(n,"injectedlib","script");for(t=0;t=n.length&&r&&r()})}(o,a),e.frames[f].location.replace(o)},c.prototype.clearCache=function(){this.cache={}},c.prototype.getElementById=c.prototype.gid=function(e){var t,n;return n=this.getFrameDocument(),t=null,n&&n.getElementById&&(t=n.getElementById(e)),t||(t=document.getElementById(e)),t},c.prototype.getElementsByTagName=function(e){var t;return t=this.getFrameDocument(),t?t.getElementsByTagName(e):document.getElementsByTagName(e)},c.prototype.getElementsByClassName=function(e,t){var n;return n=this.getFrameDocument()||document,J.getElementsByClassName(n,e,t)},c.prototype.loadFrame=function(e,n,r){var i,s,o,u,a,f,p,d,v,g,b,w,E,S,x;if("string"!=typeof e)throw new TypeError("GameWindow.loadFrame: uri must be string. Found: "+e);if(n&&"function"!=typeof n)throw new TypeError("GameWindow.loadFrame: func must be function or undefined. Found: "+n);if(r&&"object"!=typeof r)throw new TypeError("GameWindow.loadFrame: opts must be object or undefined. Found: "+r);r=r||{},v=this.getFrame(),g=this.frameName;if(!v)throw new Error("GameWindow.loadFrame: no frame found");if(!g)throw new Error("GameWindow.loadFrame: frame has no name");this.setStateLevel("LOADING"),i=this,w=v.contentWindow,b=W.getIFrameDocument(v),S=b.readyState,S=S==="complete",s=c.defaults.cacheDefaults.loadCache,o=c.defaults.cacheDefaults.storeCacheNow,u=c.defaults.cacheDefaults.storeCacheLater;if(r.cache){if(r.cache.loadMode)if(r.cache.loadMode==="reload")s=!1;else{if(r.cache.loadMode!=="cache")throw new Error("GameWindow.loadFrame: unkown cache load mode: "+r.cache.loadMode);s=!0}if(r.cache.storeMode)if(r.cache.storeMode==="off")o=!1,u=!1;else if(r.cache.storeMode==="onLoad")o=!0,u=!1;else{if(r.cache.storeMode!=="onClose")throw new Error("GameWindow.loadFrame: unkown cache store mode: "+r.cache.storeMode);o=!1,u=!0}}if("undefined"!=typeof r.autoParse){if("object"!=typeof r.autoParse)throw new TypeError("GameWindow.loadFrame: opts.autoParse must be object or undefined. Found: "+r.autoParse);if("undefined"!=typeof r.autoParsePrefix){if("string"!=typeof r.autoParsePrefix)throw new TypeError("GameWindow.loadFrame: opts.autoParsePrefix must be string or undefined. Found: "+r.autoParsePrefix);p=r.autoParsePrefix}if("undefined"!=typeof r.autoParseMod){if("string"!=typeof r.autoParseMod)throw new TypeError("GameWindow.loadFrame: opts.autoParseMod must be string or undefined. Found: "+r.autoParseMod);d=r.autoParseMod}f=r.autoParse}a="undefined"==typeof r.scrollUp?!0:r.scrollUp,this.unprocessedUri=e;if(this.cacheSupported===null){this.preCacheTest(function(){i.loadFrame(e,n,r)});return}e=this.processUri(e),this.cacheSupported===!1?(o=!1,u=!1,s=!1):(x=this.currentURIs[g],this.cache.hasOwnProperty(x)&&this.cache[x].cacheOnClose&&(E=b.documentElement,this.cache[x].contents=E.innerHTML),this.cache.hasOwnProperty(e)||(this.cache[e]={contents:null,cacheOnClose:!1}),this.cache[e].cacheOnClose=u,this.cache[e].contents===null&&(s=!1)),this.currentURIs[g]=e,m(this,1),v.style.visibility="hidden",(!s||!S)&&l(v,function(){i.directFrameDocumentAccess===null&&y(i),h(i,e,v,g,s,o,function(){i.updateLoadFrameState(n,f,d,p,a)})}),s?S&&h(this,e,v,g,s,o,function(){i.updateLoadFrameState(n,f,d,p,a)}):w.location.replace(e),w.node=t},c.prototype.processUri=function(e){return e.charAt(0)!=="/"&&e.substr(0,7)!=="http://"&&(this.uriPrefix&&(e=this.uriPrefix+e),this.uriChannel&&(e=this.uriChannel+e)),e},c.prototype.updateLoadFrameState=function(n,r,i,s,u){var a,f;a=m(this,-1),a&&this.setStateLevel("LOADED"),n&&n.call(t.game),r&&this.searchReplace(r,i,s),u&&e.scrollTo&&e.scrollTo(0,0),t.events.ee.game.emit("FRAME_LOADED"),t.events.ee.stage.emit("FRAME_LOADED"),t.events.ee.step.emit("FRAME_LOADED"),a?(f=t.game.getStageLevel(),f===o&&t.emit("LOADED")):t.silly("game-window: "+this.areLoading+" frames "+"still loading.")},c.prototype.clearPageBody=function(){this.reset(),document.body.innerHTML=""},c.prototype.clearPage=function(){this.reset();try{document.documentElement.innerHTML=""}catch(e){this.removeChildrenFromNode(document.documentElement)}},c.prototype.setUriPrefix=function(e){if(e!==null&&"string"!=typeof e)throw new TypeError("GameWindow.setUriPrefix: uriPrefix must be string or null. Found: "+e);this.conf.uriPrefix=this.uriPrefix=e},c.prototype.setUriChannel=function(e){if("string"==typeof e)e.charAt(0)!=="/"&&(e="/"+e),e.charAt(e.length-1)!=="/"&&(e+="/");else if(e!==null)throw new TypeError("GameWindow.uriChannel: uriChannel must be string or null. Found: "+e);this.uriChannel=e},c.prototype.adjustFrameHeight=function(){var t,n;return n=function(t){var n,r,i;W.adjustHeaderOffset(),n=W.getFrame();if(!n||!n.contentWindow)return;if(!n.contentWindow.document.body){W.adjustFrameHeight(t,120);return}W.conf.adjustFrameHeight===!1?r="100vh":(r=e.innerHeight||e.clientHeight,i=n.contentWindow.document.body.offsetHeight,i+=60,W.headerPosition==="top"&&(i+=W.headerOffset),rDo not refresh the page!
Maximum Waiting Time: ",countdownResuming:e.countdownResumingText||"Resuming soon...",formatCountdown:function(e){var t;return t="",e=J.parseMilliseconds(e),e[2]&&(t+=e[2]+" min "),e[3]&&(t+=e[3]+" sec"),t||0}},this.lockedInputs=[],this.enable()}e.WaitScreen=l,l.version="0.10.0",l.description="Shows a waiting screen";var n,r;n=["button","select","textarea","input"],r=n.length,l.prototype.enable=function(){if(this.enabled)return;node.events.ee.game.on("REALLY_DONE",s),node.events.ee.game.on("STEPPING",o),node.events.ee.game.on("PLAYING",u),node.events.ee.game.on("PAUSED",a),node.events.ee.game.on("RESUMED",f),this.enabled=!0},l.prototype.disable=function(){if(!this.enabled)return;node.events.ee.game.off("REALLY_DONE",s),node.events.ee.game.off("STEPPING",o),node.events.ee.game.off("PLAYING",u),node.events.ee.game.off("PAUSED",a),node.events.ee.game.off("RESUMED",f),this.enabled=!1},l.prototype.lock=function(e,t){var n,r;r=this.defaultTexts,"undefined"==typeof e&&(e=r.locked),"undefined"==typeof document.getElementsByTagName&&node.warn("WaitScreen.lock: cannot lock inputs"),i(document),n=W.getFrameDocument(),n&&i(n),this.waitingDiv||(this.root||(this.root=W.getFrameRoot()||document.body),this.waitingDiv=W.add("div",this.root,this.id),this.contentDiv=W.add("div",this.waitingDiv,"ng_waitscreen-content-div")),this.waitingDiv.style.display==="none"&&(this.waitingDiv.style.display=""),this.contentDiv.innerHTML=e,this.displayCountdown&&t?(this.countdownDiv||(this.countdownDiv=W.add("div",this.waitingDiv,"ng_waitscreen-countdown-div"),this.countdownDiv.innerHTML=r.countdown,this.countdownSpan=W.add("span",this.countdownDiv,"ng_waitscreen-countdown-span")),this.countdown=t,this.countdownSpan.innerHTML=r.formatCountdown(t),this.countdownDiv.style.display="",this.countdownInterval=setInterval(function(){var e;e=W.waitScreen;if(!W.isScreenLocked()){clearInterval(e.countdownInterval);return}e.countdown-=1e3,e.countdown<0?(clearInterval(e.countdownInterval),e.countdownDiv.style.display="none",e.contentDiv.innerHTML=r.countdownResuming):e.countdownSpan.innerHTML=r.formatCountdown(e.countdown)},1e3)):this.countdownDiv&&(this.countdownDiv.style.display="none")},l.prototype.unlock=function(){var e,t;this.waitingDiv&&this.waitingDiv.style.display===""&&(this.waitingDiv.style.display="none"),this.countdownInterval&&clearInterval(this.countdownInterval);try{t=this.lockedInputs.length;for(e=-1;++e2&&(t=arguments[1],n=arguments[2]);if("undefined"==typeof n)n="ng_replace_";else if(null===n)n="";else if("string"!=typeof n)throw new TypeError("GameWindow.searchReplace: prefix must be string, null or undefined. Found: "+n);e=arguments[0];if(J.isArray(e)){s=-1,i=e.length;for(;++sn.dt)return 1}else{if(e.dtn.dt)return-1}if(e.dt===n.dt){if("undefined"==typeof e.dd)return-1;if("undefined"==typeof n.dd)return 1;if(e.ddn.dd)return 1;if(e.nddbidn.nddbid)return-1}return 0},this.DL=e.list||document.createElement(this.FIRST_LEVEL),this.DL.id=e.id||this.id,e.className&&(this.DL.className=e.className),this.options.title&&this.DL.appendChild(document.createTextNode(e.title)),this.htmlRenderer=new r(e.render)},s.prototype._add=function(e){if(!e)return;this.insert(e),this.auto_update&&this.parse()},s.prototype.addDT=function(e,t){if("undefined"==typeof e)return;this.last_dt++,t="undefined"!=typeof t?t:this.last_dt,this.last_dd=0;var n=new o({dt:t,content:e});return this._add(n)},s.prototype.addDD=function(e,t,n){if("undefined"==typeof e)return;t="undefined"!=typeof t?t:this.last_dt,n="undefined"!=typeof n?n:this.last_dd++;var r=new o({dt:t,dd:n,content:e});return this._add(r)},s.prototype.parse=function(){this.sort();var e=null,t=null,n=function(){var n=document.createElement(this.SECOND_LEVEL);return this.DL.appendChild(n),t=null,e=n,n},r=function(){var e=document.createElement(this.THIRD_LEVEL);return this.DL.appendChild(e),e};if(this.DL){while(this.DL.hasChildNodes())this.DL.removeChild(this.DL.firstChild);this.options.title&&this.DL.appendChild(document.createTextNode(this.options.title))}for(var i=0;ithis.pointers[e])this.pointers[e]=t;return this.pointers[e]},u.prototype.addMultiple=function(e,t,n,r){var i,s,o,u;f("addMultiple",e,n,r);if(t&&"string"!=typeof t||t&&"undefined"==typeof this.pointers[t])throw new TypeError("Table.addMultiple: dim must be a valid dimension (x or y) or undefined.");t=t||"x",n=this.getCurrPointer("x",n),r=this.getNextPointer("y",r),n="undefined"!=typeof n?n:this.pointers.x===null?0:this.pointers.x,r="undefined"!=typeof r?r:this.pointers.y===null?0:this.pointers.y,J.isArray(e)||(e=[e]),i=-1,s=e.length;for(;++ih+1){d=this.db[u].y-(h+1);for(a=0;a