All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.persist-js.persist-min.js Maven / Gradle / Ivy

Go to download

This plugin creates and transports variables containing local storage information. It also creates unique identifier in the local storage for device identification.

There is a newer version: 1.2.2.1-jre17
Show newest version
(function(){if(!window.google||!google.gears){var d=null;if("undefined"!=typeof GearsFactory)d=new GearsFactory;else try{d=new ActiveXObject("Gears.Factory"),-1!=d.getBuildInfo().indexOf("ie_mobile")&&d.privateSetGlobalObject(this)}catch(e){"undefined"!=typeof navigator.mimeTypes&&navigator.mimeTypes["application/x-googlegears"]&&(d=document.createElement("object"),d.style.display="none",d.width=0,d.height=0,d.type="application/x-googlegears",document.documentElement.appendChild(d))}d&&(window.google|| (google={}),google.gears||(google.gears={factory:d}))}})(); Persist=function(){var d,e,c,l,q,n;n=function(){var a=["expires","path","domain"],b=escape,f=unescape,d=document,c,e=function(s,f){var d,p,c=[],e=2c?!1:!0},get:function(a){a=b(a);var c=d.cookie,e=c.indexOf(a+"="),p=e+a.length+1,k=c.substring(0,a.length);if(!e&&a!=k||0>e)return null;a=c.indexOf(";",p);0>a&&(a=c.length);return f(c.substring(p,a))},remove:function(a){var b=c.get(a);d.cookie=e(a,"",{expires:"Thu, 01-Jan-1970 00:00:01 GMT"}); return b},keys:function(){for(var a=d.cookie.split("; "),b,c=[],e=0;e"+a},init:function(){this.store=localStorage},get:function(a){a=this.key(a);return this.store.getItem(a)},set:function(a,b){a=this.key(a);this.store.setItem(a,b);return b},remove:function(a){var b;a=this.key(a);b=this.store.getItem(a);this.store.removeItem(a);return b},iterate:function(a,b){for(var c=this.store, d,e,h=0;h"),2==e.length&&e[0]==this.name&&a.call(b||this,e[1],c.getItem(d))}}},ie:{prefix:"_persist_data-",size:65536,test:function(){return window.ActiveXObject?!0:!1},make_userdata:function(a){var b=document.createElement("div");b.id=a;b.style.display="none";b.addBehavior("#default#userdata");document.body.appendChild(b);return b},methods:{init:function(){var a=e.ie.prefix+c(this.name);this.el=e.ie.make_userdata(a);this.o.defer&&this.load()},get:function(a){a= c(a);this.o.defer||this.load();return this.el.getAttribute(a)},set:function(a,b){a=c(a);this.el.setAttribute(a,b);this.o.defer||this.save();return b},remove:function(a){var b;a=c(a);this.o.defer||this.load();b=this.el.getAttribute(a);this.el.removeAttribute(a);this.o.defer||this.save();return b},load:function(){this.el.load(c(this.name))},save:function(){this.el.save(c(this.name))}}},cookie:{delim:":",size:4E3,test:function(){return d.Cookie.enabled?!0:!1},methods:{key:function(a){return this.name+ e.cookie.delim+a},get:function(a,b){a=this.key(a);return n.get(a)},set:function(a,b,c){a=this.key(a);n.set(a,b,this.o);return b},remove:function(a,b){a=this.key(a);return b=n.remove(a)}}},flash:{test:function(){return swfobject?8<=swfobject.getFlashPlayerVersion().major?!0:!1:!1},methods:{init:function(){if(!e.flash.el){var a,b;a=document.createElement("div");a.id="_persist_flash_wrap";b=document.createElement("div");b.id="_persist_flash";a.appendChild(b);document.body.appendChild(a);e.flash.el=swfobject.createSWF({id:"_persist_flash", data:this.o.swf_path||"persist.swf",width:1,height:1},v,"_persist_flash")}this.el=e.flash.el},get:function(a){a=c(a);return this.el.get(this.name,a)},set:function(a,b){a=c(a);return this.el.set(this.name,a,b)},remove:function(a){a=c(a);return this.el.remove(this.name,a)}}}};l=function(){var a,b,c=h;a=0;for(var g=r.length;ab||(h.splice(b,1),delete e[a],l())},Cookie:n,Store:function(a,b){if(!u.exec(a))throw Error("Invalid name");if(!d.type)throw Error("No suitable storage found");b=b||{};this.name=a;b.domain=b.domain||location.hostname||"localhost";b.domain=b.domain.replace(/:\d+$/,"");b.domain="localhost"==b.domain?"":b.domain;this.o=b;b.expires=b.expires||730;b.path=b.path|| "/";this.o.search_order&&(h=this.o.search_order,l());this.init()}};l();return d}();




© 2015 - 2025 Weber Informatics LLC | Privacy Policy