nnnjjj123
2020-11-17 1b2c1edb61190eeb19f465ff031eaa3b2a1b8dbc
1
2
3
4
5
6
7
//>>built
define(["dojo","dijit","dojox","dojo/require!dojox/storage/Provider,dojox/storage/manager"],function(c,k,h){c.provide("dojox.storage.WhatWGStorageProvider");c.require("dojox.storage.Provider");c.require("dojox.storage.manager");c.declare("dojox.storage.WhatWGStorageProvider",[h.storage.Provider],{initialized:!1,_domain:null,_available:null,_statusHandler:null,_allNamespaces:null,_storageEventListener:null,initialize:function(){1!=c.config.disableWhatWGStorage&&(this._domain=location.hostname,this.initialized=
!0,h.storage.manager.loaded())},isAvailable:function(){return this._available=!0},put:function(a,b,e,d){if(0==this.isValidKey(a))throw Error("Invalid key given: "+a);d=d||this.DEFAULT_NAMESPACE;a=this.getFullKey(a,d);this._statusHandler=e;b=c.isString(b)?"string:"+b:c.toJson(b);var g=c.hitch(this,function(b){window.removeEventListener("storage",g,!1);e&&e.call(null,this.SUCCESS,a,null,d)});window.addEventListener("storage",g,!1);try{globalStorage[this._domain].setItem(a,b)}catch(f){this._statusHandler.call(null,
this.FAILED,a,f.toString(),d)}},get:function(a,b){if(0==this.isValidKey(a))throw Error("Invalid key given: "+a);b=b||this.DEFAULT_NAMESPACE;a=this.getFullKey(a,b);a=globalStorage[this._domain].getItem(a);if(null==a||""==a)return null;a=a.value;return a=c.isString(a)&&/^string:/.test(a)?a.substring(7):c.fromJson(a)},getNamespaces:function(){for(var a=[this.DEFAULT_NAMESPACE],b={},e=globalStorage[this._domain],d=/^__([^_]*)_/,c=0;c<e.length;c++){var f=e.key(c);1==d.test(f)&&(f=f.match(d)[1],"undefined"==
typeof b[f]&&(b[f]=!0,a.push(f)))}return a},getKeys:function(a){a=a||this.DEFAULT_NAMESPACE;if(0==this.isValidKey(a))throw Error("Invalid namespace given: "+a);a=a==this.DEFAULT_NAMESPACE?/^([^_]{2}.*)$/:new RegExp("^__"+a+"_(.*)$");for(var b=globalStorage[this._domain],c=[],d=0;d<b.length;d++){var g=b.key(d);1==a.test(g)&&(g=g.match(a)[1],c.push(g))}return c},clear:function(a){a=a||this.DEFAULT_NAMESPACE;if(0==this.isValidKey(a))throw Error("Invalid namespace given: "+a);a=a==this.DEFAULT_NAMESPACE?
/^[^_]{2}/:new RegExp("^__"+a+"_");for(var b=globalStorage[this._domain],e=[],d=0;d<b.length;d++)1==a.test(b.key(d))&&(e[e.length]=b.key(d));c.forEach(e,c.hitch(b,"removeItem"))},remove:function(a,b){a=this.getFullKey(a,b);globalStorage[this._domain].removeItem(a)},isPermanent:function(){return!0},getMaximumSize:function(){return this.SIZE_NO_LIMIT},hasSettingsUI:function(){return!1},showSettingsUI:function(){throw Error(this.declaredClass+" does not support a storage settings user-interface");},
hideSettingsUI:function(){throw Error(this.declaredClass+" does not support a storage settings user-interface");},getFullKey:function(a,b){b=b||this.DEFAULT_NAMESPACE;if(0==this.isValidKey(b))throw Error("Invalid namespace given: "+b);return b==this.DEFAULT_NAMESPACE?a:"__"+b+"_"+a}});h.storage.manager.register("dojox.storage.WhatWGStorageProvider",new h.storage.WhatWGStorageProvider)});