diff --git a/public_html/js/lib/min/page-manager.js b/public_html/js/lib/min/page-manager.js index 1282bf1..b09ad5c 100755 --- a/public_html/js/lib/min/page-manager.js +++ b/public_html/js/lib/min/page-manager.js @@ -1,19 +1 @@ -/***************************************/ -function pageManagerClass(){}var ptrPageManagerClass -pageManagerClass.prototype={loaded:null,depJS:null,depCSS:null,xhr:[],activeXHR:null,page:null,vars:[],root:"",path:"",jsPath:"js",cssPath:"css",pagelist:null,container:null,refresher:function(){},ajax:function(t,e,s,i){var h -h=this.xhr.push(window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHttpRequest"))-1,this.activeXHR=this.xhr[h],this.xhr[h].addEventListener("readystatechange",function(t){if(void 0!=this.xhr[t]&&4===this.xhr[t].readyState){[0,200].indexOf(this.xhr[t].status)>-1?e(this.xhr[t].responseText):e(),this.xhr[t]=null -for(var s=!0,t=0;t=1?t:document.URL,null!=this.pagelist&&/^(?:(?:https?:\/\/)?[^\/]+)\/([a-z0-9_]+)(?:\/|((?:\/\w+)+)\/?)?(#.*)?$/i.test(t)){var e=RegExp.$2.split("/").slice(1) -return this.pagelist.indexOf(RegExp.$1)>-1?{page:RegExp.$1,var:e}:null}return null},loadDependencies:function(){"object"==typeof this.depCSS&&this.depCSS instanceof Element&&this.depCSS.parentNode==document.head&&document.head.removeChild(this.depCSS),"object"==typeof this.depJS&&this.depJS instanceof Element&&this.depJS.parentNode==document.head&&document.head.removeChild(this.depJS),this.ajax(this.root+this.path+"/"+this.cssPath+"/"+this.page+".css",function(t){null!=t?(this.depCSS=document.createElement("link"),this.depCSS.rel="stylesheet",this.depCSS.type="text/css",this.depCSS.href=this.root+this.path+"/"+this.cssPath+"/"+this.page+".css",document.head.appendChild(this.depCSS)):console.warn("[loadDependencies_Error] - ("+this.root+this.path+"/"+this.cssPath+"/"+this.page+".css)")}.bind(this)),this.ajax(this.root+this.path+"/"+this.jsPath+"/"+this.page+".js",function(t){null!=t?(this.depJS=document.createElement("script"),this.depJS.type="text/javascript",this.depJS.src=this.root+this.path+"/"+this.jsPath+"/"+this.page+".js",document.head.appendChild(this.depJS)):console.warn("[loadDependencies_Error] - ("+this.root+this.path+"/"+this.jsPath+"/"+this.page+".js)")}.bind(this))},updateURL:function(){this.vars.length>0?window.history.pushState(this.page,this.page,this.root+"/"+this.page+"/"+this.vars.join("/")+"/"):window.history.pushState(this.page,this.page,this.root+"/"+this.page+"/")},setPage:function(t,e,s,i,h){var n="object"==typeof i&&i instanceof Array?i:null -if(null!=n)for(var a=0;a-1){this.page=t -for(var r=new FormData,a=0;a-1?e(this.xhr[t].responseText):e(),this.xhr[t]=null;for(var s=!0,t=0;t=1?t:document.URL,null!=this.pagelist&&/^(?:(?:https?:\/\/)?[^\/]+)\/([a-z0-9_]+)(?:\/|((?:\/\w+)+)\/?)?(#.*)?$/i.test(t)){var e=RegExp.$2.split("/").slice(1);return this.pagelist.indexOf(RegExp.$1)>-1?{page:RegExp.$1,var:e}:null}return null},loadDependencies:function(){"object"==typeof this.depCSS&&this.depCSS instanceof Element&&this.depCSS.parentNode==document.head&&document.head.removeChild(this.depCSS),"object"==typeof this.depJS&&this.depJS instanceof Element&&this.depJS.parentNode==document.head&&document.head.removeChild(this.depJS),this.ajax(this.root+this.path+"/"+this.cssPath+"/"+this.page+".css",function(t){return null==t?void console.warn("[loadDependencies_Error] - ("+this.root+this.path+"/"+this.cssPath+"/"+this.page+".css)"):(this.depCSS=document.createElement("link"),this.depCSS.rel="stylesheet",this.depCSS.type="text/css",this.depCSS.innerHTML=t,void document.head.appendChild(this.depCSS))}.bind(this),"GET"),this.ajax(this.root+this.path+"/"+this.jsPath+"/"+this.page+".js",function(t){return null==t?void console.warn("[loadDependencies_Error] - ("+this.root+this.path+"/"+this.jsPath+"/"+this.page+".js)"):(this.depJS=document.createElement("script"),this.depJS.type="text/javascript",this.depJS.innerHTML=t,void document.head.appendChild(this.depJS))}.bind(this),"GET")},updateURL:function(){this.vars.length>0?window.history.pushState(this.page,this.page,this.root+"/"+this.page+"/"+this.vars.join("/")+"/"):window.history.pushState(this.page,this.page,this.root+"/"+this.page+"/")},setPage:function(t,e,s,i,h){var n="object"==typeof i&&i instanceof Array?i:null;if(null!=n)for(var a=0;a-1){this.page=t;for(var r=new FormData,a=0;a