Файловый менеджер - Редактировать - /home/newsgini/news74.in/MrDino/jsonmanager.js
Назад
var gdjs;(function(l){const c=new l.Logger("JSON Manager"),i=["json","tilemap","tileset"];class d{constructor(o){this._loadedJsons=new l.ResourceCache;this._callbacks=new l.ResourceCache;this._getJsonResource=o=>{const e=this._resourceLoader.getResource(o);return e&&this.getResourceKinds().includes(e.kind)?e:null};this._resourceLoader=o}getResourceKinds(){return i}async loadResource(o){const e=this._resourceLoader.getResource(o);if(!e){c.warn('Unable to find json for resource "'+o+'".');return}if(!e.disablePreload)try{await this.loadJsonAsync(e.name)}catch(s){c.error(`Error while preloading json resource ${e.name}:`,s)}}loadJsonAsync(o){const e=this;return new Promise((s,t)=>{e.loadJson(o,(r,n)=>{r&&t(r.message),s(n)})})}async processResource(o){}loadJson(o,e){const s=this._getJsonResource(o);if(!s){e(new Error(`Can't find resource with name: "`+o+'" (or is not a json resource).'),null);return}if(this._loadedJsons.get(s)){e(null,this._loadedJsons.get(s));return}{const n=this._callbacks.get(s);if(n){n.push(e);return}else this._callbacks.set(s,[e])}const t=this,r=new XMLHttpRequest;r.responseType="json",r.withCredentials=this._resourceLoader.checkIfCredentialsRequired(s.file),r.open("GET",this._resourceLoader.getFullUrl(s.file)),r.onload=function(){const n=t._callbacks.get(s);if(!!n){if(r.status!==200){for(const a of n)a(new Error("HTTP error: "+r.status+"("+r.statusText+")"),null);t._callbacks.delete(s);return}t._loadedJsons.set(s,r.response);for(const a of n)a(null,r.response);t._callbacks.delete(s)}},r.onerror=function(){const n=t._callbacks.get(s);if(!!n){for(const a of n)a(new Error("Network error"),null);t._callbacks.delete(s)}},r.onabort=function(){const n=t._callbacks.get(s);if(!!n){for(const a of n)a(new Error("Request aborted"),null);t._callbacks.delete(s)}},r.send()}isJsonLoaded(o){return!!this._loadedJsons.getFromName(o)}getLoadedJson(o){return this._loadedJsons.getFromName(o)||null}dispose(){this._loadedJsons.clear(),this._callbacks.clear()}unloadResourcesList(o){o.forEach(e=>{this._loadedJsons.get(e)&&this._loadedJsons.delete(e),this._callbacks.get(e)&&this._callbacks.delete(e)})}}l.JsonManager=d})(gdjs||(gdjs={})); //# sourceMappingURL=jsonmanager.js.map
| ver. 1.6 |
Github
|
.
| PHP 8.1.31 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка