nexusframework 0.3.0-beta.73 → 0.3.0-beta.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +55 -55
- package/README.md +12 -12
- package/about/index.json +5 -5
- package/about/index.nhp +4 -4
- package/icon.png +0 -0
- package/index.d.ts +0 -2
- package/index.js +0 -0
- package/index.js.map +1 -1
- package/index.ts +101 -101
- package/indexOfSkeleton.nhp +133 -133
- package/legacySkeleton.nhp +22 -22
- package/loader/overlay.css +1 -1
- package/loader/overlay.html +25 -25
- package/loader/overlay.scss +152 -152
- package/package.json +102 -90
- package/scripts/es5/compat.js +100 -100
- package/scripts/es5/compat.min.js +1 -1
- package/scripts/es5/loader.js +0 -0
- package/scripts/es5/loader.js.map +0 -0
- package/scripts/es5/loader.min.js +1 -1
- package/scripts/es5/loader.min.js.map +0 -0
- package/scripts/es5/nexusframeworkclient.js +1224 -1224
- package/scripts/es5/nexusframeworkclient.js.map +0 -0
- package/scripts/es5/nexusframeworkclient.min.js +1 -1
- package/scripts/es5/nexusframeworkclient.min.js.map +0 -0
- package/scripts/es6/compat.js +64 -64
- package/scripts/es6/compat.min.js +1 -1
- package/scripts/es6/loader.js +0 -0
- package/scripts/es6/loader.js.map +0 -0
- package/scripts/es6/loader.min.js +1 -1
- package/scripts/es6/loader.min.js.map +0 -0
- package/scripts/es6/nexusframeworkclient.js +1146 -1146
- package/scripts/es6/nexusframeworkclient.js.map +0 -0
- package/scripts/es6/nexusframeworkclient.min.js +1 -1
- package/scripts/es6/nexusframeworkclient.min.js.map +0 -0
- package/scripts/index.d.ts +259 -259
- package/scripts/src/compat.ts +62 -62
- package/scripts/src/loader.ts +385 -385
- package/scripts/src/nexusframeworkclient.ts +1163 -1163
- package/scripts/tsconfig.json +11 -11
- package/src/cli.d.ts +1 -0
- package/src/cli.js +102 -102
- package/src/cli.js.map +1 -1
- package/src/cli.ts +101 -101
- package/src/compileScripts.d.ts +0 -0
- package/src/compileScripts.js +0 -0
- package/src/compileScripts.js.map +1 -1
- package/src/compileScripts.ts +153 -153
- package/src/nexusframework.d.ts +5 -5
- package/src/nexusframework.js +44 -37
- package/src/nexusframework.js.map +1 -1
- package/src/nexusframework.ts +3631 -3622
- package/templates/basic/package.json +3 -3
- package/templates/basic/www/skeleton.nhp +1 -1
- package/templates/bootstrap/package.json +2 -2
- package/templates/bootstrap/www/skeleton.nhp +1 -1
- package/templates/bootstrap-material-design/package.json +2 -2
- package/templates/bootstrap-material-design/www/skeleton.nhp +1 -1
- package/tsconfig.json +25 -22
- package/types.d.ts +612 -612
|
File without changes
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var __extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}}();!function(k){var g=new k.bson;Object.defineProperties(k,{NexusFrameworkTransport:{configurable:!0,set:function(e){Object.defineProperty(k,"NexusFrameworkTransport",{value:e})},get:function(){var e;if(!("XMLHttpRequest"in k))throw new Error("No transport implementations");var f=function(){function e(e,t,r,n){this._url=t,this.request=e,this.hadData=r,this.abResponse=n}return Object.defineProperty(e.prototype,"url",{get:function(){return this.request.responseURL||this._url},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"code",{get:function(){return this.request.status},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentLength",{get:function(){return parseInt(this.request.getResponseHeader("content-length"))||this.request.responseText.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentFromJSON",{get:function(){return this.parsedJson||(this.parsedJson=JSON.parse(this.request.responseText)),this.parsedJson},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentFromBSON",{get:function(){if(!this.parsedBson){var e=this.request.response;e="string"==typeof e?Buffer.from(e,"utf8"):new Buffer(e),this.parsedBson=g.deserialize(e,{promoteValues:!0})}return this.parsedBson},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentAsString",{get:function(){return this.request.responseText},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentAsArrayBuffer",{get:function(){return this.request.response},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"headers",{get:function(){if(!this.processedHeaders){var a=this.processedHeaders={};this.request.getAllResponseHeaders().split(/\r?\n/g).forEach(function(e){var t,r,n=e.indexOf(":");0<n?(t=e.substring(0,n).trim().toLowerCase(),r=e.substring(n+1).trim()):t=e.trim().toLowerCase();var o=a[t];o||(o=a[t]=[]),r&&o.push(r)})}return this.processedHeaders},enumerable:!0,configurable:!0}),e}(),i=function(e,t,r,n,o,a,i){var s,c=new XMLHttpRequest;try{if(!i)throw!1;if((c.responseType="arraybuffer")!==c.responseType)throw console.error("Could not request arraybuffer"),!1;s=!0}catch(e){s=!1}c.open(e,t,!0),o&&Object.keys(o).forEach(function(e){c.setRequestHeader(e,o[e])}),a&&(c.onprogress=function(e){e.lengthComputable&&e.total&&a(e.loaded,e.total)}),c.onreadystatechange=function(e){c.readyState===XMLHttpRequest.DONE&&n(new f(c,t,!!r,s))};var u=r&&r.type;if(u)switch(u){case"":case"text/urlencoded":for(var l="",d=0,p=r.data;d<p.length;d++){var h=p[d];l&&(l+="&"),l+=encodeURIComponent(h[0]),l+="=",l+=encodeURIComponent(h[1])}c.setRequestHeader("Content-Type","text/urlencoded"),c.send(l);break;case"text/json":c.setRequestHeader("Content-Type","text/json"),c.send(JSON.stringify(r.data));break;case"application/bson":c.setRequestHeader("Content-Type","application/bson"),c.send(g.serialize(r.data));break;case"multipart/form-data":c.send(r.data);break;default:c.send(r)}else c.send(r)};return e={get:function(e,t,r,n,o){i("GET",e,void 0,t,r,n,o)},head:function(e,t,r,n,o){i("HEAD",e,void 0,t,r,n,o)},post:function(e,t,r,n,o,a){i("POST",e,t,r,n,o,a)},put:function(e,t,r,n,o,a){i("PUT",e,t,r,n,o,a)},execute:i,del:function(e,t,r,n,o){i("DELETE",e,void 0,t,r,n,o)}},Object.defineProperty(k,"NexusFrameworkTransport",{value:e}),e}},NexusFrameworkImpl:{configurable:!0,set:function(e){Object.defineProperty(k,"NexusFrameworkImpl",{value:e})},get:function(){var e,x=k.NexusFrameworkLoader,p=x.showError,A=console.log.bind(console),r={reportError:function(e,t){if(k.ga)try{k.ga("send","exception",{exDescription:(e.stack||""+e).replace(/\n/g,"\n\t"),exFatal:t})}catch(e){console.warn(e)}},reportEvent:function(e,t,r,n){if(k.ga)try{k.ga("send","event",e,t,r,n)}catch(e){console.warn(e)}},reportPage:function(e){if(k.ga)try{e||(e=location.pathname),k.ga("set","page",e),k.ga("send","pageview")}catch(e){console.warn(e)}}},n=document.createElement("a"),o=location.href.match(/^\w+:/)[0],O=function(e){n.setAttribute("href",e);var t=n.href;return/^\/\//.test(t)&&(t=o+t),t},g=/(^|\s)loader\-(progress|error)\-container(\s|$)/,t=function(){function e(e,t){void 0===e&&(e="/"),this.activerid=0,this.components={},this.currentUserID=void 0,this.progressVisible=!1,this.animationTiming=500,this.requestPage=this.defaultRequestPage,this._listeners={},e=O(e),/\/$/.test(e)||(e+="/"),Object.defineProperties(this,{io:{value:t},url:{value:e}}),this._analytics=r}return e.prototype.resolveUrl=function(e){return/^\w+\:/.test(e)?e:O(this.url+e)},e.prototype.disableAll=function(e){void 0===e&&(e=document.body);for(var t=e.querySelectorAll("a, input, select, textarea, iframe, button, *[focusable], *[tabindex]"),r=0;r<t.length;r++){var n=t[r],o=n.getAttribute("tabindex");if("-1"==o)return;n.setAttribute("data-tabindex",o||""),n.setAttribute("data-tabindex","-1")}},e.prototype.enableAll=function(e){void 0===e&&(e=document.body);for(var t=e.querySelectorAll("*[data-tabindex]"),r=0;r<t.length;r++){var n=t[r];n.setAttribute("tabindex",n.getAttribute("data-tabindex")),n.removeAttribute("data-tabindex")}},Object.defineProperty(e.prototype,"analytics",{get:function(){return this._analytics},set:function(e){this._analytics=e||r},enumerable:!0,configurable:!0}),e.prototype.reportError=function(e,t){console[t?"error":"warn"](e.stack),this.errorreporter&&this.errorreporter(e,t)},e.prototype.installErrorReporter=function(e){this.errorreporter=e},e.prototype.registerComponent=function(i,e){var s=this;if(e)this.components[i]=e,this.createComponents(document.head),this.createComponents(document.body);else{delete this.components[i];var t=function(e){var t=e.querySelectorAll(i);if(t.length)for(var r=0;r<t.length;r++){var n=t[r],o=n.__nf_cmapping__;o||(o=n.__nf_cmapping__={});var a=o[i];if(a)try{a.destroy()}catch(e){s.reportError(e)}}};t(document.head),t(document.body)}},e.prototype.unregisterComponent=function(e,t){},e.prototype.createComponents=function(i){var s=this;Object.keys(this.components).forEach(function(e){var t=i.querySelectorAll(e);if(t.length)for(var r=0;r<t.length;r++){var n=t[r],o=n.__nf_cmapping__;if(o||(o=n.__nf_cmapping__={}),!o[e]){var a=s.components[e];try{(o[e]=new a).create(n)}catch(e){s.reportError(e)}}}})},e.prototype.destroyComponents=function(i){var s=this;Object.keys(this.components).forEach(function(e){var t=i.querySelectorAll(e);if(t.length)for(var r=0;r<t.length;r++){var n=t[r],o=n.__nf_cmapping__;o||(o=n.__nf_cmapping__={});var a=o[e];if(a)try{a.destroy()}catch(e){s.reportError(e)}}})},e.prototype.restoreComponents=function(u,l){var d=this;Object.keys(this.components).forEach(function(e){var t=l[e];if(t){var r=u.querySelectorAll(e);if(r.length)for(var n=0;n<r.length;n++){var o=r[n];if(!t.length)break;var a=t.shift();if(a){var i=o.__nf_cmapping__;i||(i=o.__nf_cmapping__={});var s=i[e];if(!s){var c=d.components[e];try{(s=i[e]=new c).create(o)}catch(e){d.reportError(e),console.warn(e);continue}}try{s.restore(a)}catch(e){d.reportError(e),console.warn(e)}}}}})},e.prototype.saveComponents=function(c){var u=this,l={};return Object.keys(this.components).forEach(function(e){var t=l[e]=[],r=c.querySelectorAll(e);if(r.length)for(var n=0;n<r.length;n++){var o=r[n],a=o.__nf_cmapping__;a||(a=o.__nf_cmapping__={});var i=a[e];if(!i){var s=u.components[e];try{(i=a[e]=new s).create(o)}catch(e){t.push(void 0),u.reportError(e),console.warn(e);continue}}try{t.push(i.save())}catch(e){t.push(void 0),u.reportError(e),console.warn(e)}}}),l},e.prototype.initPageSystem=function(u){var m=this;if(!x)return console.error("The NexusFramework Loader is required for the dynamic Page System to work correctly.");if(!history.pushState||!history.replaceState)return console.warn("This browser is missing an essential feature required for the dynamic Page System.");if(this.pagesyshandler)return console.warn("Page System already initialized, ignoring additional requests to initialize.");u=u||{};var y=this,v=0,b=[];this.animationTiming=u.animationTiming||500;var w=u.pageHistoryCacheSize||25e6,l=function(r){return function(e){var t=e.headers["x-logged-user"];y.currentUserID=t?t[0]:void 0,A("Current UID",y.currentUserID),r(e),200===e.code&&setTimeout(function(){y._analytics.reportPage()})}};x.showError=function(e){var t=location.href.match(q),r=t&&t[1]||location.href,n=e.stack.length,o=w<=n;try{for(var a=b.length,i=0;i<a;i++){var s=b[i];if(s.url===r)throw o?(b.splice(i,1),v-=s.size):(s.data={error:e},s.updated=+new Date,v+=n-s.size),!0}if(o)throw!0;b.push({url:r,data:{error:e},updated:+new Date,size:n}),v+=n}catch(e){if(!0!==e)throw e}return p(e)};var n={requestPage:function(e,t,r,n){if(!y.pagesysprerequest||y.pagesysprerequest(e)){u.noprogress||(y.disableAll(),x.showProgress());var o=y.resolveUrl(":pagesys/"+e),a=u.noprogress?t:function(e){u.noprogress?t(e):x.showProgress(function(){t(e),y.enableAll()})};r?k.NexusFrameworkTransport.post(o,r,l(a),void 0,void 0,!0):k.NexusFrameworkTransport.get(o,l(a),void 0,void 0,!0)}else y.defaultRequestPage(e,r)}};if(!u.noio&&this.io){var o=this.io;this.pagesysimpl={requestPage:function(i,s,e,c){if(o.connected){if(y.pagesysprerequest&&!y.pagesysprerequest(i))return void y.defaultRequestPage(i,e);u.noprogress||(y.disableAll(),x.showProgress());var t={referrer:location.href},r=document.cookie;r&&(t.cookie=r),o.emit("page",e?"POST":"GET",i,e,t,function(e){if(c==y.activerid){var t=e.headers["set-cookie"];t&&t.forEach(function(e){document.cookie=e});var r,n,o,a=u.noprogress?s:function(e){u.noprogress?x.showProgress(function(){s(e),y.enableAll()}):s(e)};l(a)((r=e,void 0===(n=y.resolveUrl(i))&&(n=location.href),"string"==typeof r.data?{url:n,code:r.code,contentAsString:r.data,get contentLength(){return parseInt(r.headers["content-length"]&&r.headers["content-length"][0])||r.data.length},get contentAsArrayBuffer(){throw new Error("Not implemented")},get contentFromBSON(){return o||(o=JSON.parse(r.data)),o},get contentFromJSON(){return o||(o=JSON.parse(r.data)),o},headers:r.headers}:{url:n,code:r.code,get contentAsString(){return o||(o=JSON.stringify(r.data)),o},get contentAsArrayBuffer(){throw new Error("Not implemented")},contentFromJSON:r.data,contentFromBSON:r.data,headers:r.headers,get contentLength(){var e=parseInt(r.headers["content-length"]&&r.headers["content-length"][0]);return e||(o||(o=JSON.stringify(r.data)),o.length)}}))}})}else n.requestPage(i,s,e,c)}}}else this.pagesysimpl=n;var _,P=document.getElementsByTagName("base");P=P&&P[0],this.pagesysprerequest=u.prerequest,this.pagesyshandler=u.handler||function(e,t){try{var r=e.headers["content-type"][0];if(!/\/html(;.+)?$/.test(r.toLowerCase()))throw new Error("Content type is not html")}catch(e){}var n=e.contentAsString,o=n.indexOf("<body");if(-1==o)throw new Error("Could not find start of body tag");var a=n.indexOf("</body>")||n.indexOf("</ body>");if(-1==a)throw new Error("Could not find end of body tag");var i=n.match(/<title>([^<]+)<\/\s*title>/);document.title=i&&i[1]||"Title Not Set";var s,c=document.createElement("html");c.innerHTML=n.substring(o,a)+"</body>";for(var u=c.children,l=[],d=0;d<u.length;d++){switch((h=u[d]).nodeName.toUpperCase()){case"HEAD":break;case"BODY":d=-1,u=h.children;break;case"SCRIPT":var p=h.innerHTML.match(/^NexusFrameworkLoader\.load\((.+)\);?$/);p&&(s=JSON.parse(p[1]));break;default:if(g.test(h.className))break;l.push(h)}}if(!l.length)throw new Error("Nothing found in response to add to page");if(!s)throw new Error("NexusFrameworkLoader script not found...");for(d=(u=document.body.children).length-1;0<=d;d--){var h;switch((h=u[d]).nodeName.toUpperCase()){case"LINK":case"SCRIPT":break;default:if(g.test(h.className))break;document.body.removeChild(h)}}var f=document.createDocumentFragment();return l.forEach(function(e){f.appendChild(e),m.createComponents(e)}),document.body.appendChild(f),x.load(s,function(){y.progressVisible=!0,x.resetProgress(),t()}),!0};var q=/^([^#]+)(#.*)?$/,E=location.href.match(q)[1],S=new RegExp("^"+this.url.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")+"(.*)$","i"),e=function(){function e(){var a=this;this.handler=function(e){if(!a.element.hasAttribute("data-nopagesys")&&!a.element.hasAttribute("data-nodynamic")){var t=a.element.getAttribute("href");if(t&&t.length){var r=a.element.href,n=r.match(q);if(!n[2]||E!==n[1])if(S.test(r))try{var o=r.match(/^(.+)#.*$/);o&&(r=o[1]),y.requestPage(r.substring(y.url.length));try{e.stopPropagation()}catch(e){}try{e.preventDefault()}catch(e){}}catch(e){console.warn(e)}else A("Navigating",r)}}}}return e.prototype.create=function(e){e.addEventListener("click",this.handler),this.element=e},e.prototype.destroy=function(){this.element.removeEventListener("click",this.handler)},e.prototype.restore=function(e){},e.prototype.save=function(){},e}(),t=function(){function e(){var p=this;this.handler=function(e){if(!p.element.hasAttribute("data-nopagesys")&&!p.element.hasAttribute("data-nodynamic")){var t=p.element.getAttribute("method")||"get",r=p.element.getAttribute("enctype")||"text/urlencoded",n=p.element.getAttribute("action")||"",o=O(n);if(S.test(o))try{var a=o.match(/^(.+)#.*$/);a&&(o=a[1]);var i=new FormData(p.element);if(x.showProgress(void 0,"Submitting Form","Your form data is being processed"),"post"===t.trim().toLowerCase())y.requestPage(o.substring(y.url.length),{type:r,data:i});else{for(var s=!0,c=o.substring(y.url.length)+"?",u=0,l=i;u<l.length;u++){var d=l[u];s?s=!1:c+="&",c+=encodeURIComponent(d[0]),c+="=",c+=encodeURIComponent(d[1])}y.requestPage(c)}try{e.stopPropagation()}catch(e){}try{e.preventDefault()}catch(e){}return Array.prototype.forEach.call(p.element.querySelectorAll("a, input, select, textarea, iframe, button, *[name]"),function(e){e.setAttribute("disabled","disabled"),e.className+=" disabled"}),Array.prototype.forEach.call(p.element.querySelectorAll("button:not([type]), button[type=submit]"),function(e){e.innerHTML="Processing Request"}),void Array.prototype.forEach.call(p.element.querySelectorAll("input[type=submit]"),function(e){e.value="Processing Request"})}catch(e){A(e)}A("Submitting",o)}}}return e.prototype.create=function(e){e.addEventListener("submit",this.handler),this.element=e},e.prototype.destroy=function(){this.element.removeEventListener("submit",this.handler)},e.prototype.restore=function(e){},e.prototype.save=function(){},e}(),a=this.requestPage=function(l,d,p){void 0===p&&(p=!1);var e=l.match(/\.([^\/]+)([\?#].*)?$/);if(e&&"htm"!==e[0]&&"html"!==e[0])m.defaultRequestPage(l,d),A("Ignoring navigation",l,e);else{A("requestPage",l);var h=++y.activerid,f=m.resolveUrl(l),g=f+(e&&e[2]||"");p?history.replaceState(!!d,"Loading...",g):(history.pushState(!!d,"Loading...",g),E=g.match(q)[1],k.scrollTo(0,0)),x.resetError(),x.resetProgress(),m.pagesysimpl.requestPage(l,function(u){try{if(h!==y.activerid)return;if(!u.code)return x.showProgress(void 0,"Connection Issue","Check your network and try again"),document.title="Connection Issue",history.replaceState(u.hadData,"Connection Issue",g),void setTimeout(function(){h===y.activerid&&a(l,d,!0)},9e5);if(502===u.code||503===u.code)return x.showProgress(void 0,"Scheduled Maintenance","Sorry but this website is undergoing scheduled maintenance"),document.title="Scheduled Maintenance",history.replaceState(u.hadData,"Scheduled Maintenance",g),void setTimeout(function(){h===y.activerid&&a(l,d,!0)},9e5);var e=u.headers["x-location"]||u.headers.location;if(e){var t=O(e[0]);return S.test(t)?void m.requestPage(t.substring(m.url.length),void 0,!0):(console.warn("Requested redirect to external url:",t),void(k.location.href=t))}var r=u.headers["content-disposition"];if(r&&"attachment"==r[0].toLowerCase())throw new Error("Attachment disposition");m.pagesyshandler(u,function(){if(h===y.activerid)try{var t,e=document.title,r=u.contentLength,n=w<=r,o=n?void 0:{title:e,user:y.currentUserID,scroll:[k.scrollX,k.scrollY],body:y.saveComponents(document.body),basehref:P?P.href:void 0,response:u},a=b.length;try{for(t=0;t<a;t++){var i=b[t];if(i.url===f)throw n?(b.splice(t,1),v-=i.size):(i.data=o,i.updated=+new Date,v+=r-i.size),!0}if(!n)throw b.push({url:f,data:o,updated:+new Date,size:r}),v+=r,!0;A("Response too big to store",f,r)}catch(e){if(!0!==e)throw e;var s=v-w;if(0<s){b.sort(function(e,t){return e.updated-t.updated});var c=0;for(t=0;t<a&&!(s<=(c+=b[t].size));t++);t++,b.splice(0,t),A("Trimmed",t,"items...")}}history.replaceState(u.hadData,document.title,g),y.emit("page",f,l)}catch(e){if(A(e),p)k.location.reload(!0);else try{E=void 0,_=[l,d],A("Going backwards"),history.go(-1)}catch(e){}}})}catch(e){if(A(e),p)k.location.reload(!0);else try{E=void 0,_=[l,d],A("Going backwards"),history.go(-1)}catch(e){}}},d,h)}};return this.registerComponent("a",e),this.registerComponent("form",t),k.addEventListener("popstate",function(t){try{for(var r,e=location.href.match(q),n=b.length,o=e[1],a=0;a<n;a++){var i=b[a];if(i.url===o){r=i;break}}var s=!!r,c=++y.activerid,u=s&&r.data.error;if(u)return void p(u);if(_){A("forwardPopState",_);var l=_;return setTimeout(function(){c===y.activerid&&y.defaultRequestPage(l[0],l[1])}),void(_=void 0)}if(E===o)return void A("Only hash has changed...",o);if(E=e[1],t.state&&alert("You submitted data to this page, which cannot be re-sent. Because of this, what you're viewing may not be the same now."),!s)throw new Error("No state for: "+o+", reloading...");if(r.data.user!=y.currentUserID)throw new Error("User has changed since state was created, reloading...");document.title=r.data.title,x.resetProgress(),x.resetError(),y.pagesyshandler(r.data.response,function(e){if(c===y.activerid)try{if(e)throw e;r.data.body&&y.restoreComponents(document.body,r.data.body),r.data.scroll&&k.scrollTo.apply(k,r.data.scroll),A("Used stored page state!",r)}catch(e){A(e);var t=location.href;if(S.test(t))try{if(/reloading\.\.\.$/.test(e.message))return void y.requestPage(t.substring(y.url.length),void 0,!0);console.error("Unknown error occured, actually navigating to page...")}catch(e){console.error(e)}location.reload(!0)}})}catch(e){A(e);var d=location.href;if(S.test(d))try{if(/reloading\.\.\.$/.test(e.message))return void y.requestPage(d.substring(y.url.length),void 0,!0);console.error("Unknown error occured, actually navigating to page...")}catch(t){console.error(t)}location.reload(!0)}}),!0},Object.defineProperty(e.prototype,"currentUser",{get:function(){return this.currentUserID},enumerable:!0,configurable:!0}),e.prototype.defaultRequestPage=function(e,t){if(t)throw new Error("Posting is not supported without an initialized page system, yet");location.href=this.resolveUrl(e)},e.prototype.on=function(e,t){var r=this._listeners[e];r?r.push(t):this._listeners[e]=r=[t]},e.prototype.off=function(e,t){var r,n=this._listeners[e];n&&-1<(r=n.indexOf(t))&&n.splice(r,1)},e.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=this,o=this._listeners[e];o&&o.forEach(function(e){e.apply(n,t)})},e}();return e=k.io?function(n){function e(e){var t=n.call(this,e,k.io({path:"/:io"}))||this,r=t.io;return r.on("connect",function(){r.emit("init",x.requestedResources())}),t}return __extends(e,n),e}(t):function(t){function e(e){return t.call(this,e)||this}return __extends(e,t),e}(t),Object.defineProperty(k,"NexusFrameworkImpl",{value:e}),e}},NexusFrameworkClient:{configurable:!0,set:function(e){Object.defineProperty(k,"NexusFrameworkClient",{value:e})},get:function(){var e=new k.NexusFrameworkImpl;return Object.defineProperty(k,"NexusFrameworkClient",{value:e}),e}}})}(window);
|
|
1
|
+
var __extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}}();!function(k){var g=new k.bson;Object.defineProperties(k,{NexusFrameworkTransport:{configurable:!0,set:function(e){Object.defineProperty(k,"NexusFrameworkTransport",{value:e})},get:function(){var e;if(!("XMLHttpRequest"in k))throw new Error("No transport implementations");var f=function(){function e(e,t,r,n){this._url=t,this.request=e,this.hadData=r,this.abResponse=n}return Object.defineProperty(e.prototype,"url",{get:function(){return this.request.responseURL||this._url},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"code",{get:function(){return this.request.status},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentLength",{get:function(){return parseInt(this.request.getResponseHeader("content-length"))||this.request.responseText.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentFromJSON",{get:function(){return this.parsedJson||(this.parsedJson=JSON.parse(this.request.responseText)),this.parsedJson},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentFromBSON",{get:function(){if(!this.parsedBson){var e=this.request.response;e="string"==typeof e?Buffer.from(e,"utf8"):new Buffer(e),this.parsedBson=g.deserialize(e,{promoteValues:!0})}return this.parsedBson},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentAsString",{get:function(){return this.request.responseText},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentAsArrayBuffer",{get:function(){return this.request.response},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"headers",{get:function(){if(!this.processedHeaders){var a=this.processedHeaders={};this.request.getAllResponseHeaders().split(/\r?\n/g).forEach(function(e){var t,r,n=e.indexOf(":");0<n?(t=e.substring(0,n).trim().toLowerCase(),r=e.substring(n+1).trim()):t=e.trim().toLowerCase();var o=a[t];o||(o=a[t]=[]),r&&o.push(r)})}return this.processedHeaders},enumerable:!0,configurable:!0}),e}(),i=function(e,t,r,n,o,a,i){var s,c=new XMLHttpRequest;try{if(!i)throw!1;if((c.responseType="arraybuffer")!==c.responseType)throw console.error("Could not request arraybuffer"),!1;s=!0}catch(e){s=!1}c.open(e,t,!0),o&&Object.keys(o).forEach(function(e){c.setRequestHeader(e,o[e])}),a&&(c.onprogress=function(e){e.lengthComputable&&e.total&&a(e.loaded,e.total)}),c.onreadystatechange=function(e){c.readyState===XMLHttpRequest.DONE&&n(new f(c,t,!!r,s))};var u=r&&r.type;if(u)switch(u){case"":case"text/urlencoded":for(var l="",d=0,p=r.data;d<p.length;d++){var h=p[d];l&&(l+="&"),l+=encodeURIComponent(h[0]),l+="=",l+=encodeURIComponent(h[1])}c.setRequestHeader("Content-Type","text/urlencoded"),c.send(l);break;case"text/json":c.setRequestHeader("Content-Type","text/json"),c.send(JSON.stringify(r.data));break;case"application/bson":c.setRequestHeader("Content-Type","application/bson"),c.send(g.serialize(r.data));break;case"multipart/form-data":c.send(r.data);break;default:c.send(r)}else c.send(r)};return e={get:function(e,t,r,n,o){i("GET",e,void 0,t,r,n,o)},head:function(e,t,r,n,o){i("HEAD",e,void 0,t,r,n,o)},post:function(e,t,r,n,o,a){i("POST",e,t,r,n,o,a)},put:function(e,t,r,n,o,a){i("PUT",e,t,r,n,o,a)},execute:i,del:function(e,t,r,n,o){i("DELETE",e,void 0,t,r,n,o)}},Object.defineProperty(k,"NexusFrameworkTransport",{value:e}),e}},NexusFrameworkImpl:{configurable:!0,set:function(e){Object.defineProperty(k,"NexusFrameworkImpl",{value:e})},get:function(){var e,x=k.NexusFrameworkLoader,p=x.showError,A=console.log.bind(console),r={reportError:function(e,t){if(k.ga)try{k.ga("send","exception",{exDescription:(e.stack||""+e).replace(/\n/g,"\n\t"),exFatal:t})}catch(e){console.warn(e)}},reportEvent:function(e,t,r,n){if(k.ga)try{k.ga("send","event",e,t,r,n)}catch(e){console.warn(e)}},reportPage:function(e){if(k.ga)try{e||(e=location.pathname),k.ga("set","page",e),k.ga("send","pageview")}catch(e){console.warn(e)}}},n=document.createElement("a"),o=location.href.match(/^\w+:/)[0],O=function(e){n.setAttribute("href",e);var t=n.href;return/^\/\//.test(t)&&(t=o+t),t},g=/(^|\s)loader\-(progress|error)\-container(\s|$)/,t=function(){function e(e,t){void 0===e&&(e="/"),this.activerid=0,this.components={},this.currentUserID=void 0,this.progressVisible=!1,this.animationTiming=500,this.requestPage=this.defaultRequestPage,this._listeners={},e=O(e),/\/$/.test(e)||(e+="/"),Object.defineProperties(this,{io:{value:t},url:{value:e}}),this._analytics=r}return e.prototype.resolveUrl=function(e){return/^\w+\:/.test(e)?e:O(this.url+e)},e.prototype.disableAll=function(e){void 0===e&&(e=document.body);for(var t=e.querySelectorAll("a, input, select, textarea, iframe, button, *[focusable], *[tabindex]"),r=0;r<t.length;r++){var n=t[r],o=n.getAttribute("tabindex");if("-1"==o)return;n.setAttribute("data-tabindex",o||""),n.setAttribute("data-tabindex","-1")}},e.prototype.enableAll=function(e){void 0===e&&(e=document.body);for(var t=e.querySelectorAll("*[data-tabindex]"),r=0;r<t.length;r++){var n=t[r];n.setAttribute("tabindex",n.getAttribute("data-tabindex")),n.removeAttribute("data-tabindex")}},Object.defineProperty(e.prototype,"analytics",{get:function(){return this._analytics},set:function(e){this._analytics=e||r},enumerable:!0,configurable:!0}),e.prototype.reportError=function(e,t){console[t?"error":"warn"](e.stack),this.errorreporter&&this.errorreporter(e,t)},e.prototype.installErrorReporter=function(e){this.errorreporter=e},e.prototype.registerComponent=function(i,e){var s=this;if(e)this.components[i]=e,this.createComponents(document.head),this.createComponents(document.body);else{delete this.components[i];var t=function(e){var t=e.querySelectorAll(i);if(t.length)for(var r=0;r<t.length;r++){var n=t[r],o=n.__nf_cmapping__;o||(o=n.__nf_cmapping__={});var a=o[i];if(a)try{a.destroy()}catch(e){s.reportError(e)}}};t(document.head),t(document.body)}},e.prototype.unregisterComponent=function(e,t){},e.prototype.createComponents=function(i){var s=this;Object.keys(this.components).forEach(function(e){var t=i.querySelectorAll(e);if(t.length)for(var r=0;r<t.length;r++){var n=t[r],o=n.__nf_cmapping__;if(o||(o=n.__nf_cmapping__={}),!o[e]){var a=s.components[e];try{(o[e]=new a).create(n)}catch(e){s.reportError(e)}}}})},e.prototype.destroyComponents=function(i){var s=this;Object.keys(this.components).forEach(function(e){var t=i.querySelectorAll(e);if(t.length)for(var r=0;r<t.length;r++){var n=t[r],o=n.__nf_cmapping__;o||(o=n.__nf_cmapping__={});var a=o[e];if(a)try{a.destroy()}catch(e){s.reportError(e)}}})},e.prototype.restoreComponents=function(u,l){var d=this;Object.keys(this.components).forEach(function(e){var t=l[e];if(t){var r=u.querySelectorAll(e);if(r.length)for(var n=0;n<r.length;n++){var o=r[n];if(!t.length)break;var a=t.shift();if(a){var i=o.__nf_cmapping__;i||(i=o.__nf_cmapping__={});var s=i[e];if(!s){var c=d.components[e];try{(s=i[e]=new c).create(o)}catch(e){d.reportError(e),console.warn(e);continue}}try{s.restore(a)}catch(e){d.reportError(e),console.warn(e)}}}}})},e.prototype.saveComponents=function(c){var u=this,l={};return Object.keys(this.components).forEach(function(e){var t=l[e]=[],r=c.querySelectorAll(e);if(r.length)for(var n=0;n<r.length;n++){var o=r[n],a=o.__nf_cmapping__;a||(a=o.__nf_cmapping__={});var i=a[e];if(!i){var s=u.components[e];try{(i=a[e]=new s).create(o)}catch(e){t.push(void 0),u.reportError(e),console.warn(e);continue}}try{t.push(i.save())}catch(e){t.push(void 0),u.reportError(e),console.warn(e)}}}),l},e.prototype.initPageSystem=function(u){var m=this;if(!x)return console.error("The NexusFramework Loader is required for the dynamic Page System to work correctly.");if(!history.pushState||!history.replaceState)return console.warn("This browser is missing an essential feature required for the dynamic Page System.");if(this.pagesyshandler)return console.warn("Page System already initialized, ignoring additional requests to initialize.");u=u||{};var y=this,v=0,b=[];this.animationTiming=u.animationTiming||500;var w=u.pageHistoryCacheSize||25e6,l=function(r){return function(e){var t=e.headers["x-logged-user"];y.currentUserID=t?t[0]:void 0,A("Current UID",y.currentUserID),r(e),200===e.code&&setTimeout(function(){y._analytics.reportPage()})}};x.showError=function(e){var t=location.href.match(q),r=t&&t[1]||location.href,n=e.stack.length,o=w<=n;try{for(var a=b.length,i=0;i<a;i++){var s=b[i];if(s.url===r)throw o?(b.splice(i,1),v-=s.size):(s.data={error:e},s.updated=+new Date,v+=n-s.size),!0}if(o)throw!0;b.push({url:r,data:{error:e},updated:+new Date,size:n}),v+=n}catch(e){if(!0!==e)throw e}return p(e)};var n={requestPage:function(e,t,r,n){if(!y.pagesysprerequest||y.pagesysprerequest(e)){u.noprogress||(y.disableAll(),x.showProgress());var o=y.resolveUrl(":pagesys/"+e),a=u.noprogress?t:function(e){u.noprogress?t(e):x.showProgress(function(){t(e),y.enableAll()})};r?k.NexusFrameworkTransport.post(o,r,l(a),void 0,void 0,!0):k.NexusFrameworkTransport.get(o,l(a),void 0,void 0,!0)}else y.defaultRequestPage(e,r)}};if(!u.noio&&this.io){var o=this.io;this.pagesysimpl={requestPage:function(i,s,e,c){if(o.connected){if(y.pagesysprerequest&&!y.pagesysprerequest(i))return void y.defaultRequestPage(i,e);u.noprogress||(y.disableAll(),x.showProgress());var t={referrer:location.href},r=document.cookie;r&&(t.cookie=r),o.emit("page",e?"POST":"GET",i,e,t,function(e){if(c==y.activerid){var t=e.headers["set-cookie"];t&&t.forEach(function(e){document.cookie=e});var r,n,o,a=u.noprogress?s:function(e){u.noprogress?x.showProgress(function(){s(e),y.enableAll()}):s(e)};l(a)((r=e,void 0===(n=y.resolveUrl(i))&&(n=location.href),"string"==typeof r.data?{url:n,code:r.code,contentAsString:r.data,get contentLength(){return parseInt(r.headers["content-length"]&&r.headers["content-length"][0])||r.data.length},get contentAsArrayBuffer(){throw new Error("Not implemented")},get contentFromBSON(){return o||(o=JSON.parse(r.data)),o},get contentFromJSON(){return o||(o=JSON.parse(r.data)),o},headers:r.headers}:{url:n,code:r.code,get contentAsString(){return o||(o=JSON.stringify(r.data)),o},get contentAsArrayBuffer(){throw new Error("Not implemented")},contentFromJSON:r.data,contentFromBSON:r.data,headers:r.headers,get contentLength(){var e=parseInt(r.headers["content-length"]&&r.headers["content-length"][0]);return e||(o||(o=JSON.stringify(r.data)),o.length)}}))}})}else n.requestPage(i,s,e,c)}}}else this.pagesysimpl=n;var _,P=document.getElementsByTagName("base");P=P&&P[0],this.pagesysprerequest=u.prerequest,this.pagesyshandler=u.handler||function(e,t){try{var r=e.headers["content-type"][0];if(!/\/html(;.+)?$/.test(r.toLowerCase()))throw new Error("Content type is not html")}catch(e){}var n=e.contentAsString,o=n.indexOf("<body");if(-1==o)throw new Error("Could not find start of body tag");var a=n.indexOf("</body>")||n.indexOf("</ body>");if(-1==a)throw new Error("Could not find end of body tag");var i=n.match(/<title>([^<]+)<\/\s*title>/);document.title=i&&i[1]||"Title Not Set";var s,c=document.createElement("html");c.innerHTML=n.substring(o,a)+"</body>";for(var u=c.children,l=[],d=0;d<u.length;d++){switch((h=u[d]).nodeName.toUpperCase()){case"HEAD":break;case"BODY":d=-1,u=h.children;break;case"SCRIPT":var p=h.innerHTML.match(/^NexusFrameworkLoader\.load\((.+)\);?$/);p&&(s=JSON.parse(p[1]));break;default:if(g.test(h.className))break;l.push(h)}}if(!l.length)throw new Error("Nothing found in response to add to page");if(!s)throw new Error("NexusFrameworkLoader script not found...");for(d=(u=document.body.children).length-1;0<=d;d--){var h;switch((h=u[d]).nodeName.toUpperCase()){case"LINK":case"SCRIPT":break;default:if(g.test(h.className))break;document.body.removeChild(h)}}var f=document.createDocumentFragment();return l.forEach(function(e){f.appendChild(e),m.createComponents(e)}),document.body.appendChild(f),x.load(s,function(){y.progressVisible=!0,x.resetProgress(),t()}),!0};var q=/^([^#]+)(#.*)?$/,E=location.href.match(q)[1],S=new RegExp("^"+this.url.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")+"(.*)$","i"),e=function(){function e(){var a=this;this.handler=function(e){if(!a.element.hasAttribute("data-nopagesys")&&!a.element.hasAttribute("data-nodynamic")){var t=a.element.getAttribute("href");if(t&&t.length){var r=a.element.href,n=r.match(q);if(!n[2]||E!==n[1])if(S.test(r))try{var o=r.match(/^(.+)#.*$/);o&&(r=o[1]),y.requestPage(r.substring(y.url.length));try{e.stopPropagation()}catch(e){}try{e.preventDefault()}catch(e){}}catch(e){console.warn(e)}else A("Navigating",r)}}}}return e.prototype.create=function(e){e.addEventListener("click",this.handler),this.element=e},e.prototype.destroy=function(){this.element.removeEventListener("click",this.handler)},e.prototype.restore=function(e){},e.prototype.save=function(){},e}(),t=function(){function e(){var p=this;this.handler=function(e){if(!p.element.hasAttribute("data-nopagesys")&&!p.element.hasAttribute("data-nodynamic")){var t=p.element.getAttribute("method")||"get",r=p.element.getAttribute("enctype")||"text/urlencoded",n=p.element.getAttribute("action")||"",o=O(n);if(S.test(o))try{var a=o.match(/^(.+)#.*$/);a&&(o=a[1]);var i=new FormData(p.element);if(x.showProgress(void 0,"Submitting Form","Your form data is being processed"),"post"===t.trim().toLowerCase())y.requestPage(o.substring(y.url.length),{type:r,data:i});else{for(var s=!0,c=o.substring(y.url.length)+"?",u=0,l=i;u<l.length;u++){var d=l[u];s?s=!1:c+="&",c+=encodeURIComponent(d[0]),c+="=",c+=encodeURIComponent(d[1])}y.requestPage(c)}try{e.stopPropagation()}catch(e){}try{e.preventDefault()}catch(e){}return Array.prototype.forEach.call(p.element.querySelectorAll("a, input, select, textarea, iframe, button, *[name]"),function(e){e.setAttribute("disabled","disabled"),e.className+=" disabled"}),Array.prototype.forEach.call(p.element.querySelectorAll("button:not([type]), button[type=submit]"),function(e){e.innerHTML="Processing Request"}),void Array.prototype.forEach.call(p.element.querySelectorAll("input[type=submit]"),function(e){e.value="Processing Request"})}catch(e){A(e)}A("Submitting",o)}}}return e.prototype.create=function(e){e.addEventListener("submit",this.handler),this.element=e},e.prototype.destroy=function(){this.element.removeEventListener("submit",this.handler)},e.prototype.restore=function(e){},e.prototype.save=function(){},e}(),a=this.requestPage=function(l,d,p){void 0===p&&(p=!1);var e=l.match(/\.([^\/]+)([\?#].*)?$/);if(e&&"htm"!==e[0]&&"html"!==e[0])m.defaultRequestPage(l,d),A("Ignoring navigation",l,e);else{A("requestPage",l);var h=++y.activerid,f=m.resolveUrl(l),g=f+(e&&e[2]||"");p?history.replaceState(!!d,"Loading...",g):(history.pushState(!!d,"Loading...",g),E=g.match(q)[1],k.scrollTo(0,0)),x.resetError(),x.resetProgress(),m.pagesysimpl.requestPage(l,function(u){try{if(h!==y.activerid)return;if(!u.code)return x.showProgress(void 0,"Connection Issue","Check your network and try again"),document.title="Connection Issue",history.replaceState(u.hadData,"Connection Issue",g),void setTimeout(function(){h===y.activerid&&a(l,d,!0)},9e5);if(502===u.code||503===u.code)return x.showProgress(void 0,"Scheduled Maintenance","Sorry but this website is undergoing scheduled maintenance"),document.title="Scheduled Maintenance",history.replaceState(u.hadData,"Scheduled Maintenance",g),void setTimeout(function(){h===y.activerid&&a(l,d,!0)},9e5);var e=u.headers["x-location"]||u.headers.location;if(e){var t=O(e[0]);return S.test(t)?void m.requestPage(t.substring(m.url.length),void 0,!0):(console.warn("Requested redirect to external url:",t),void(k.location.href=t))}var r=u.headers["content-disposition"];if(r&&"attachment"==r[0].toLowerCase())throw new Error("Attachment disposition");m.pagesyshandler(u,function(){if(h===y.activerid)try{var t,e=document.title,r=u.contentLength,n=w<=r,o=n?void 0:{title:e,user:y.currentUserID,scroll:[k.scrollX,k.scrollY],body:y.saveComponents(document.body),basehref:P?P.href:void 0,response:u},a=b.length;try{for(t=0;t<a;t++){var i=b[t];if(i.url===f)throw n?(b.splice(t,1),v-=i.size):(i.data=o,i.updated=+new Date,v+=r-i.size),!0}if(!n)throw b.push({url:f,data:o,updated:+new Date,size:r}),v+=r,!0;A("Response too big to store",f,r)}catch(e){if(!0!==e)throw e;var s=v-w;if(0<s){b.sort(function(e,t){return e.updated-t.updated});var c=0;for(t=0;t<a&&!(s<=(c+=b[t].size));t++);t++,b.splice(0,t),A("Trimmed",t,"items...")}}history.replaceState(u.hadData,document.title,g),y.emit("page",f,l)}catch(e){if(A(e),p)k.location.reload(!0);else try{E=void 0,_=[l,d],A("Going backwards"),history.go(-1)}catch(e){}}})}catch(e){if(A(e),p)k.location.reload(!0);else try{E=void 0,_=[l,d],A("Going backwards"),history.go(-1)}catch(e){}}},d,h)}};return this.registerComponent("a",e),this.registerComponent("form",t),k.addEventListener("popstate",function(t){try{for(var r,e=location.href.match(q),n=b.length,o=e[1],a=0;a<n;a++){var i=b[a];if(i.url===o){r=i;break}}var s=!!r,c=++y.activerid,u=s&&r.data.error;if(u)return void p(u);if(_){A("forwardPopState",_);var l=_;return setTimeout(function(){c===y.activerid&&y.defaultRequestPage(l[0],l[1])}),void(_=void 0)}if(E===o)return void A("Only hash has changed...",o);if(E=e[1],t.state&&alert("You submitted data to this page, which cannot be re-sent. Because of this, what you're viewing may not be the same now."),!s)throw new Error("No state for: "+o+", reloading...");if(r.data.user!=y.currentUserID)throw new Error("User has changed since state was created, reloading...");document.title=r.data.title,x.resetProgress(),x.resetError(),y.pagesyshandler(r.data.response,function(e){if(c===y.activerid)try{if(e)throw e;r.data.body&&y.restoreComponents(document.body,r.data.body),r.data.scroll&&k.scrollTo.apply(k,r.data.scroll),A("Used stored page state!",r)}catch(e){A(e);var t=location.href;if(S.test(t))try{if(/reloading\.\.\.$/.test(e.message))return void y.requestPage(t.substring(y.url.length),void 0,!0);console.error("Unknown error occured, actually navigating to page...")}catch(e){console.error(e)}location.reload(!0)}})}catch(e){A(e);var d=location.href;if(S.test(d))try{if(/reloading\.\.\.$/.test(e.message))return void y.requestPage(d.substring(y.url.length),void 0,!0);console.error("Unknown error occured, actually navigating to page...")}catch(t){console.error(t)}location.reload(!0)}}),!0},Object.defineProperty(e.prototype,"currentUser",{get:function(){return this.currentUserID},enumerable:!0,configurable:!0}),e.prototype.defaultRequestPage=function(e,t){if(t)throw new Error("Posting is not supported without an initialized page system, yet");location.href=this.resolveUrl(e)},e.prototype.on=function(e,t){var r=this._listeners[e];r?r.push(t):this._listeners[e]=r=[t]},e.prototype.off=function(e,t){var r,n=this._listeners[e];n&&-1<(r=n.indexOf(t))&&n.splice(r,1)},e.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=this,o=this._listeners[e];o&&o.forEach(function(e){e.apply(n,t)})},e}();return e=k.io?function(n){function e(e){var t=n.call(this,e,k.io({path:"/:io"}))||this,r=t.io;return r.on("connect",function(){r.emit("init",x.requestedResources())}),t}return __extends(e,n),e}(t):function(t){function e(e){return t.call(this,e)||this}return __extends(e,t),e}(t),Object.defineProperty(k,"NexusFrameworkImpl",{value:e}),e}},NexusFrameworkClient:{configurable:!0,set:function(e){Object.defineProperty(k,"NexusFrameworkClient",{value:e})},get:function(){var e=new k.NexusFrameworkImpl;return Object.defineProperty(k,"NexusFrameworkClient",{value:e}),e}}})}(window);
|
|
2
2
|
//# sourceMappingURL=nexusframeworkclient.min.js.map
|
|
File without changes
|
package/scripts/es6/compat.js
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
/// <reference path="../index.d.ts" />
|
|
2
|
-
(function (window) {
|
|
3
|
-
var Buffer;
|
|
4
|
-
const TextDecoder = window['TextDecoder'];
|
|
5
|
-
const TextEncoder = window['TextEncoder'];
|
|
6
|
-
class BufferBase extends Uint8Array {
|
|
7
|
-
static isBuffer(object) {
|
|
8
|
-
return object instanceof Buffer;
|
|
9
|
-
}
|
|
10
|
-
slice(start = 0, end = this.length) {
|
|
11
|
-
return new Buffer(this.buffer.slice(start, end));
|
|
12
|
-
}
|
|
13
|
-
write(index, val) {
|
|
14
|
-
this[index] = val;
|
|
15
|
-
}
|
|
16
|
-
copy(from, offset = 0, start = 0, end = from.length) {
|
|
17
|
-
const copylen = end - start + offset;
|
|
18
|
-
for (var i = offset; i < copylen; i++)
|
|
19
|
-
this[offset] = from[start + i];
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
if (TextDecoder && TextEncoder) {
|
|
23
|
-
class BufferImpl extends BufferBase {
|
|
24
|
-
toString(encoding, start = 0, end = this.length) {
|
|
25
|
-
const decoder = new TextDecoder(encoding);
|
|
26
|
-
if (start > 0 || end < this.length)
|
|
27
|
-
return decoder.decode(this.slice(start, end));
|
|
28
|
-
return decoder.decode(this);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
(Buffer = BufferImpl)['from'] = function (data, encoding = "utf8") {
|
|
32
|
-
const encoder = new TextEncoder(encoding);
|
|
33
|
-
const encoded = encoder.encode(data);
|
|
34
|
-
const buffer = new Buffer(encoded.length);
|
|
35
|
-
buffer.copy(encoded);
|
|
36
|
-
return buffer;
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
class BufferImpl extends BufferBase {
|
|
41
|
-
toString(encoding, start = 0, end = this.length) {
|
|
42
|
-
var str = "";
|
|
43
|
-
for (var i = start; i < end; i++)
|
|
44
|
-
str += String.fromCharCode(this[i]);
|
|
45
|
-
return str;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
(Buffer = BufferImpl)['from'] = function (data, encoding = "utf8") {
|
|
49
|
-
if (encoding === "utf8") {
|
|
50
|
-
data = "" + data;
|
|
51
|
-
const len = data.length;
|
|
52
|
-
const buff = new Buffer(len);
|
|
53
|
-
for (var i = 0; i < len; i++)
|
|
54
|
-
buff[i] = data.charCodeAt(i) & 0xFF;
|
|
55
|
-
console.log(buff);
|
|
56
|
-
return buff;
|
|
57
|
-
}
|
|
58
|
-
else
|
|
59
|
-
return new Buffer(data);
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
window['Buffer'] = Buffer;
|
|
63
|
-
window['global'] = window;
|
|
64
|
-
})(window);
|
|
1
|
+
/// <reference path="../index.d.ts" />
|
|
2
|
+
(function (window) {
|
|
3
|
+
var Buffer;
|
|
4
|
+
const TextDecoder = window['TextDecoder'];
|
|
5
|
+
const TextEncoder = window['TextEncoder'];
|
|
6
|
+
class BufferBase extends Uint8Array {
|
|
7
|
+
static isBuffer(object) {
|
|
8
|
+
return object instanceof Buffer;
|
|
9
|
+
}
|
|
10
|
+
slice(start = 0, end = this.length) {
|
|
11
|
+
return new Buffer(this.buffer.slice(start, end));
|
|
12
|
+
}
|
|
13
|
+
write(index, val) {
|
|
14
|
+
this[index] = val;
|
|
15
|
+
}
|
|
16
|
+
copy(from, offset = 0, start = 0, end = from.length) {
|
|
17
|
+
const copylen = end - start + offset;
|
|
18
|
+
for (var i = offset; i < copylen; i++)
|
|
19
|
+
this[offset] = from[start + i];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
if (TextDecoder && TextEncoder) {
|
|
23
|
+
class BufferImpl extends BufferBase {
|
|
24
|
+
toString(encoding, start = 0, end = this.length) {
|
|
25
|
+
const decoder = new TextDecoder(encoding);
|
|
26
|
+
if (start > 0 || end < this.length)
|
|
27
|
+
return decoder.decode(this.slice(start, end));
|
|
28
|
+
return decoder.decode(this);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
(Buffer = BufferImpl)['from'] = function (data, encoding = "utf8") {
|
|
32
|
+
const encoder = new TextEncoder(encoding);
|
|
33
|
+
const encoded = encoder.encode(data);
|
|
34
|
+
const buffer = new Buffer(encoded.length);
|
|
35
|
+
buffer.copy(encoded);
|
|
36
|
+
return buffer;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
class BufferImpl extends BufferBase {
|
|
41
|
+
toString(encoding, start = 0, end = this.length) {
|
|
42
|
+
var str = "";
|
|
43
|
+
for (var i = start; i < end; i++)
|
|
44
|
+
str += String.fromCharCode(this[i]);
|
|
45
|
+
return str;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
(Buffer = BufferImpl)['from'] = function (data, encoding = "utf8") {
|
|
49
|
+
if (encoding === "utf8") {
|
|
50
|
+
data = "" + data;
|
|
51
|
+
const len = data.length;
|
|
52
|
+
const buff = new Buffer(len);
|
|
53
|
+
for (var i = 0; i < len; i++)
|
|
54
|
+
buff[i] = data.charCodeAt(i) & 0xFF;
|
|
55
|
+
console.log(buff);
|
|
56
|
+
return buff;
|
|
57
|
+
}
|
|
58
|
+
else
|
|
59
|
+
return new Buffer(data);
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
window['Buffer'] = Buffer;
|
|
63
|
+
window['global'] = window;
|
|
64
|
+
})(window);
|
|
65
65
|
//# sourceMappingURL=compat.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t){var e;const n=t.TextDecoder,r=t.TextEncoder;class s extends Uint8Array{static isBuffer(t){return t instanceof e}slice(t=0,n=this.length){return new e(this.buffer.slice(t,n))}write(t,e){this[t]=e}copy(t,e=0,n=0,r=t.length){const s=r-n+e;for(var o=e;o<s;o++)this[e]=t[n+o]}}if(n&&r){class t extends s{toString(t,e=0,r=this.length){const s=new n(t);return e>0||r<this.length?s.decode(this.slice(e,r)):s.decode(this)}}(e=t).from=function(t,n="utf8"){const s=new r(n).encode(t),o=new e(s.length);return o.copy(s),o}}else{class t extends s{toString(t,e=0,n=this.length){for(var r="",s=e;s<n;s++)r+=String.fromCharCode(this[s]);return r}}(e=t).from=function(t,n="utf8"){if("utf8"===n){const n=(t=""+t).length,s=new e(n);for(var r=0;r<n;r++)s[r]=255&t.charCodeAt(r);return console.log(s),s}return new e(t)}}t.Buffer=e,t.global=t}(window);
|
|
1
|
+
!function(t){var e;const n=t.TextDecoder,r=t.TextEncoder;class s extends Uint8Array{static isBuffer(t){return t instanceof e}slice(t=0,n=this.length){return new e(this.buffer.slice(t,n))}write(t,e){this[t]=e}copy(t,e=0,n=0,r=t.length){const s=r-n+e;for(var o=e;o<s;o++)this[e]=t[n+o]}}if(n&&r){class t extends s{toString(t,e=0,r=this.length){const s=new n(t);return e>0||r<this.length?s.decode(this.slice(e,r)):s.decode(this)}}(e=t).from=function(t,n="utf8"){const s=new r(n).encode(t),o=new e(s.length);return o.copy(s),o}}else{class t extends s{toString(t,e=0,n=this.length){for(var r="",s=e;s<n;s++)r+=String.fromCharCode(this[s]);return r}}(e=t).from=function(t,n="utf8"){if("utf8"===n){const n=(t=""+t).length,s=new e(n);for(var r=0;r<n;r++)s[r]=255&t.charCodeAt(r);return console.log(s),s}return new e(t)}}t.Buffer=e,t.global=t}(window);
|
|
2
2
|
//# sourceMappingURL=compat.min.js.map
|
package/scripts/es6/loader.js
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e){const r=window.document,t=r.createElement("a"),n=location.href.match(/^\w+:/)[0],o=function(e,r){var t;const n=new RegExp("(^|\\s+)"+r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")+"(\\s+|$)","g");for(var o=0;o<e.length;o++)(t=e[o]).className=t.className.replace(n,function(e,r){return/^\s.+\s$/.test(e)?" ":""})},s=function(e,r){var t;const n=new RegExp("(^|\\s+)"+r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")+"(\\s+|$)","g");for(var o=0;o<e.length;o++)t=e[o],n.test(t.className)||(t.className=(t.className?t.className+" ":"")+r)};var a=!1;const c="loader-error-visible",i=r.getElementsByClassName("loader-error-container"),l=r.getElementsByClassName("loader-error-message"),u=function(r){const t=""+(r.stack||r);if(console.warn(t),a)return i;if(a=!0,l.length){const r={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","/":"/","=":"="," ":" ","\n":"<br />"},o=t.replace(/([&<>"'`=\/\n]| )/g,function(e){return r[e]});for(var n=0;n<l.length;n++)l[n].innerHTML=o;if(e.ga)try{e.ga("send","exception",{exDescription:t,exFatal:!0})}catch(e){console.warn(e)}i.length&&s(i,c)}return i};try{var f,d,g=r.getElementsByClassName("loader-progress-bar"),h=r.getElementsByClassName("loader-progress-container");if(g.length){let e=0,r=0;d=function(t){var n;++r>=e?(t?t():h&&o(h,"loader-progress-visible"),document.body.style.overflow="auto",n=1):n=1-Math.pow(5,1-r/e)/5,n=100*n+"%";for(var s=0;s<g.length;s++)g[s].style&&(g[s].style.width=n)},f=function(t=1){e=t,r=0}}else if(h.length){let e=0,r=0;d=function(t){++r>=e&&(t?t():o(h,"loader-progress-visible"))},f=function(t=1){e=t,r=0}}else{let e=0,r=0;d=function(t){++r>=e&&t&&t()},f=function(t=1){e=t,r=0}}h&&s(h,"loader-progress-visible"),document.body.style.overflow="hidden";const l=function(e){try{return btoa(e)}catch(a){for(var r=e.split(""),t=0,n=r.length;t<n;t++){var o=r[t];try{btoa(o)}catch(e){for(var s=o.charCodeAt(0).toString(16);s.length<4;)s="0"+s;r[t]="\\u"+s}}return btoa(r.join(""))}},m=function(e,r=8,t="0"){for(;e.length<r;)e=t+e;return e},b=function(e){if(0===e.length)return"00000000";for(var r=0,t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t)|0;return m(r.toString(16))};var p;const w={},E={},x={load(e,r){if(p){const r=e[0],n=r.length;if(n!==p.length)return location.reload(!0);for(var t=0;t<n;t++)if(r[t]!==p[t])return location.reload(!0)}else p=e[0];const n=e[1];n.length?(f(n.length),n.forEach(function(e){x.loadResource(e.type,e.source,function(e){e?(console.log(e),x.showError(e)):d(r)},e.dependencies,e.inline||e.integrity,e.name)})):r?r():(f(),d(r))},requestedResources:()=>Object.keys(E),resourceSource:e=>E[e],loadResource(e,o,s,a=[],c,i){try{var u,f,d;if("script"==e)d="text/javascript",u=function(e){const t=r.createElement("script");t.type="text/javascript",c&&!0!==c&&(t.integrity=c),t.async=!0,t.onload=function(){f()},t.onerror=function(){f(new Error("Failed to load resource: "+o))},t.src=e,r.body.appendChild(t)};else{if("style"!=e)throw new Error("Unknown type: "+e);d="text/css",u=function(e){const t=r.createElement("link");t.type="text/css",t.rel="stylesheet",c&&!0!==c&&(t.integrity=c),t.onload=function(){f()},t.onerror=function(){f(new Error("Failed to load resource: "+o))},t.href=e,r.body.appendChild(t)}}var g=!1;const m=function(e){g||(e?(g=!0,s(e)):s())};if(!0!==c&&(o=function(e){t.setAttribute("href",e);var r=t.href;return/^\/\//.test(r)&&(r=n+r),r}(o)),!i)if(!0===c)i="inline-"+b(o);else{var h=(i=o).lastIndexOf("/");h>-1&&(i=i.substring(h+1));var p=i.match(/^(([a-z][a-z0-9]*[\-_\.]?)+)\.(css|js)(\?.*)?$/i);i=p?p[1]:i.replace(/\.(css|js)(\?.*)?$/i,""),/\.min$/.test(i)&&(i=i.substring(0,i.length-4)),/\.slim$/.test(i)&&(i=i.substring(0,i.length-5)),/\.umd$/.test(i)&&(i=i.substring(0,i.length-4)),(p=i.match(/^(.+)\-\d+([\.\-]\d)*$/))&&(i=p[1])}const $=e+":"+i;var v=w[$];if(v)return v.push(m);if(f=function(r){v.forEach(function(e){e(r)}),!0===c&&"script"===e?delete w[$]:w[$]={push:function(e){e(r)}}},v=w[$]=[m],!0!==c&&-1==o.indexOf("/"))return f(new Error(e[0].toUpperCase()+e.substring(1)+" `"+i+"` is required, but not included."));if(a.length){var y=a.length;a.forEach(function(r){x.loadResource(e,r,function(e){e?f(e):--y||(E[$]=o,u(!0===c?"data:"+d+";base64,"+l(o):o))})})}else u(!0===c?"data:"+d+";base64,"+l(o):o)}catch(e){console.warn(e),s(e)}}};var v,y;x.resetError=function(){i.length&&o(i,c),a=!1},x.showError=function(e){return a=!1,u(e)},x.showProgress=function(e,r,t){if(h){if(s(h,"loader-progress-visible"),t?(Array.prototype.forEach.call(h,function(e){const n=e.querySelector(".loader-progress-message-container");n.querySelector("h5").innerHTML=r,n.querySelector("p").innerHTML=t}),s(h,"loader-progress-message-visible"),v=!0):v&&(o(h,"loader-progress-message-visible"),v=void 0),e){try{clearTimeout(y)}catch(e){}y=setTimeout(e,200)}}else e&&e();return document.body.style.overflow="hidden",h},x.resetProgress=function(){if(h){try{clearTimeout(y)}catch(e){}o(h,"loader-progress-visible"),v&&(o(h,"loader-progress-message-visible"),v=void 0)}document.body.style.overflow="auto"},Object.defineProperty(e,"NexusFrameworkLoader",{value:x})}catch(e){u(e)}}(window);
|
|
1
|
+
!function(e){const r=window.document,t=r.createElement("a"),n=location.href.match(/^\w+:/)[0],o=function(e,r){var t;const n=new RegExp("(^|\\s+)"+r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")+"(\\s+|$)","g");for(var o=0;o<e.length;o++)(t=e[o]).className=t.className.replace(n,function(e,r){return/^\s.+\s$/.test(e)?" ":""})},s=function(e,r){var t;const n=new RegExp("(^|\\s+)"+r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")+"(\\s+|$)","g");for(var o=0;o<e.length;o++)t=e[o],n.test(t.className)||(t.className=(t.className?t.className+" ":"")+r)};var a=!1;const c="loader-error-visible",i=r.getElementsByClassName("loader-error-container"),l=r.getElementsByClassName("loader-error-message"),u=function(r){const t=""+(r.stack||r);if(console.warn(t),a)return i;if(a=!0,l.length){const r={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","/":"/","=":"="," ":" ","\n":"<br />"},o=t.replace(/([&<>"'`=\/\n]| )/g,function(e){return r[e]});for(var n=0;n<l.length;n++)l[n].innerHTML=o;if(e.ga)try{e.ga("send","exception",{exDescription:t,exFatal:!0})}catch(e){console.warn(e)}i.length&&s(i,c)}return i};try{var f,d,g=r.getElementsByClassName("loader-progress-bar"),h=r.getElementsByClassName("loader-progress-container");if(g.length){let e=0,r=0;d=function(t){var n;++r>=e?(t?t():h&&o(h,"loader-progress-visible"),document.body.style.overflow="auto",n=1):n=1-Math.pow(5,1-r/e)/5,n=100*n+"%";for(var s=0;s<g.length;s++)g[s].style&&(g[s].style.width=n)},f=function(t=1){e=t,r=0}}else if(h.length){let e=0,r=0;d=function(t){++r>=e&&(t?t():o(h,"loader-progress-visible"))},f=function(t=1){e=t,r=0}}else{let e=0,r=0;d=function(t){++r>=e&&t&&t()},f=function(t=1){e=t,r=0}}h&&s(h,"loader-progress-visible"),document.body.style.overflow="hidden";const l=function(e){try{return btoa(e)}catch(a){for(var r=e.split(""),t=0,n=r.length;t<n;t++){var o=r[t];try{btoa(o)}catch(e){for(var s=o.charCodeAt(0).toString(16);s.length<4;)s="0"+s;r[t]="\\u"+s}}return btoa(r.join(""))}},m=function(e,r=8,t="0"){for(;e.length<r;)e=t+e;return e},b=function(e){if(0===e.length)return"00000000";for(var r=0,t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t)|0;return m(r.toString(16))};var p;const w={},E={},x={load(e,r){if(p){const r=e[0],n=r.length;if(n!==p.length)return location.reload(!0);for(var t=0;t<n;t++)if(r[t]!==p[t])return location.reload(!0)}else p=e[0];const n=e[1];n.length?(f(n.length),n.forEach(function(e){x.loadResource(e.type,e.source,function(e){e?(console.log(e),x.showError(e)):d(r)},e.dependencies,e.inline||e.integrity,e.name)})):r?r():(f(),d(r))},requestedResources:()=>Object.keys(E),resourceSource:e=>E[e],loadResource(e,o,s,a=[],c,i){try{var u,f,d;if("script"==e)d="text/javascript",u=function(e){const t=r.createElement("script");t.type="text/javascript",c&&!0!==c&&(t.integrity=c),t.async=!0,t.onload=function(){f()},t.onerror=function(){f(new Error("Failed to load resource: "+o))},t.src=e,r.body.appendChild(t)};else{if("style"!=e)throw new Error("Unknown type: "+e);d="text/css",u=function(e){const t=r.createElement("link");t.type="text/css",t.rel="stylesheet",c&&!0!==c&&(t.integrity=c),t.onload=function(){f()},t.onerror=function(){f(new Error("Failed to load resource: "+o))},t.href=e,r.body.appendChild(t)}}var g=!1;const m=function(e){g||(e?(g=!0,s(e)):s())};if(!0!==c&&(o=function(e){t.setAttribute("href",e);var r=t.href;return/^\/\//.test(r)&&(r=n+r),r}(o)),!i)if(!0===c)i="inline-"+b(o);else{var h=(i=o).lastIndexOf("/");h>-1&&(i=i.substring(h+1));var p=i.match(/^(([a-z][a-z0-9]*[\-_\.]?)+)\.(css|js)(\?.*)?$/i);i=p?p[1]:i.replace(/\.(css|js)(\?.*)?$/i,""),/\.min$/.test(i)&&(i=i.substring(0,i.length-4)),/\.slim$/.test(i)&&(i=i.substring(0,i.length-5)),/\.umd$/.test(i)&&(i=i.substring(0,i.length-4)),(p=i.match(/^(.+)\-\d+([\.\-]\d)*$/))&&(i=p[1])}const $=e+":"+i;var v=w[$];if(v)return v.push(m);if(f=function(r){v.forEach(function(e){e(r)}),!0===c&&"script"===e?delete w[$]:w[$]={push:function(e){e(r)}}},v=w[$]=[m],!0!==c&&-1==o.indexOf("/"))return f(new Error(e[0].toUpperCase()+e.substring(1)+" `"+i+"` is required, but not included."));if(a.length){var y=a.length;a.forEach(function(r){x.loadResource(e,r,function(e){e?f(e):--y||(E[$]=o,u(!0===c?"data:"+d+";base64,"+l(o):o))})})}else u(!0===c?"data:"+d+";base64,"+l(o):o)}catch(e){console.warn(e),s(e)}}};var v,y;x.resetError=function(){i.length&&o(i,c),a=!1},x.showError=function(e){return a=!1,u(e)},x.showProgress=function(e,r,t){if(h){if(s(h,"loader-progress-visible"),t?(Array.prototype.forEach.call(h,function(e){const n=e.querySelector(".loader-progress-message-container");n.querySelector("h5").innerHTML=r,n.querySelector("p").innerHTML=t}),s(h,"loader-progress-message-visible"),v=!0):v&&(o(h,"loader-progress-message-visible"),v=void 0),e){try{clearTimeout(y)}catch(e){}y=setTimeout(e,200)}}else e&&e();return document.body.style.overflow="hidden",h},x.resetProgress=function(){if(h){try{clearTimeout(y)}catch(e){}o(h,"loader-progress-visible"),v&&(o(h,"loader-progress-message-visible"),v=void 0)}document.body.style.overflow="auto"},Object.defineProperty(e,"NexusFrameworkLoader",{value:x})}catch(e){u(e)}}(window);
|
|
2
2
|
//# sourceMappingURL=loader.min.js.map
|
|
File without changes
|