//>>built define("dojox/storage/BehaviorStorageProvider",["dijit","dojo","dojox","dojo/require!dojox/storage/Provider,dojox/storage/manager"],function(_1,_2,_3){ _2.provide("dojox.storage.BehaviorStorageProvider"); _2.require("dojox.storage.Provider"); _2.require("dojox.storage.manager"); _2.declare("dojox.storage.BehaviorStorageProvider",[_3.storage.Provider],{store:null,storeName:"__dojox_BehaviorStorage",keys:[],initialize:function(){ try{ this.store=this._createStore(); this.store.load(this.storeName); } catch(e){ throw new Error("Store is not available: "+e); } var _4=this.get("keys","dojoxSystemNS"); this.keys=_4||[]; this.initialized=true; _3.storage.manager.loaded(); },isAvailable:function(){ return _2.isIE&&_2.isIE>=5; },_createStore:function(){ var _5=_2.create("link",{id:this.storeName+"Node",style:{"display":"none"}},_2.query("head")[0]); _5.addBehavior("#default#userdata"); return _5; },put:function(_6,_7,_8,_9){ this._assertIsValidKey(_6); _9=_9||this.DEFAULT_NAMESPACE; this._assertIsValidNamespace(_9); var _a=this.getFullKey(_6,_9); _7=_2.toJson(_7); this.store.setAttribute(_a,_7); this.store.save(this.storeName); var _b=this.store.getAttribute(_a)===_7; if(_b){ this._addKey(_a); this.store.setAttribute("__dojoxSystemNS_keys",_2.toJson(this.keys)); this.store.save(this.storeName); } if(_8){ _8(_b?this.SUCCESS:this.FAILED,_6,null,_9); } },get:function(_c,_d){ this._assertIsValidKey(_c); _d=_d||this.DEFAULT_NAMESPACE; this._assertIsValidNamespace(_d); _c=this.getFullKey(_c,_d); return _2.fromJson(this.store.getAttribute(_c)); },getKeys:function(_e){ _e=_e||this.DEFAULT_NAMESPACE; this._assertIsValidNamespace(_e); _e="__"+_e+"_"; var _f=[]; for(var i=0;i_1d.length){ return false; } return _1d.substring(0,_1e.length)===_1e; },_assertIsValidNamespace:function(_1f){ if(this.isValidNamespace(_1f)===false){ throw new Error("Invalid namespace given: "+_1f); } },_assertIsValidKey:function(key){ if(this.isValidKey(key)===false){ throw new Error("Invalid key given: "+key); } },_addKey:function(key){ this._removeKey(key); this.keys.push(key); },_removeKey:function(key){ this.keys=_2.filter(this.keys,function(_20){ return _20!==key; },this); }}); _3.storage.manager.register("dojox.storage.BehaviorStorageProvider",new _3.storage.BehaviorStorageProvider()); });