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

META-INF.resources.persist-js.persist-min.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){return}var F=null;if(typeof GearsFactory!="undefined"){F=new GearsFactory}else{try{F=new ActiveXObject("Gears.Factory");if(F.getBuildInfo().indexOf("ie_mobile")!=-1){F.privateSetGlobalObject(this)}}catch(e){if(typeof navigator.mimeTypes!="undefined"&&navigator.mimeTypes["application/x-googlegears"]){F=document.createElement("object");F.style.display="none";F.width=0;F.height=0;F.type="application/x-googlegears";document.documentElement.appendChild(F)}}}if(!F){return}if(!window.google){google={}}if(!google.gears){google.gears={factory:F}}})();Persist=function(){var VERSION="0.3.1",P,B,esc,init,empty,ec;ec=function(){var EPOCH="Thu, 01-Jan-1970 00:00:01 GMT",RATIO=1e3*60*60*24,KEYS=["expires","path","domain"],esc=escape,un=unescape,doc=document,me;var get_now=function(){var r=new Date;r.setTime(r.getTime());return r};var cookify=function(c_key,c_val){var i,key,val,r=[],opt=arguments.length>2?arguments[2]:{};r.push(esc(c_key)+"="+esc(c_val));for(var idx=0;idx2?arguments[2]:{},now=get_now(),expire_at,cfg={};if(opt.expires){if(opt.expires==-1){cfg.expires=-1}else{var expires=opt.expires*RATIO;cfg.expires=new Date(now.getTime()+expires);cfg.expires=cfg.expires.toGMTString()}}var keys=["path","domain","secure"];for(var i=0;i=9){return true}if(window.location.protocol=="file:"){return false}}else{return true}}else{return false}return window.localStorage?true:false}catch(e){return false}},methods:{key:function(key){return this.name+">"+key},init:function(){this.store=localStorage},get:function(key){key=this.key(key);return this.store.getItem(key)},set:function(key,val){key=this.key(key);this.store.setItem(key,val);return val},remove:function(key){var val;key=this.key(key);val=this.store.getItem(key);this.store.removeItem(key);return val},iterate:function(fn,scope){var l=this.store,key,keys;for(var i=0;i");if(keys.length==2&&keys[0]==this.name){fn.call(scope||this,keys[1],l.getItem(key))}}}}},ie:{prefix:"_persist_data-",size:64*1024,test:function(){return window.ActiveXObject?true:false},make_userdata:function(id){var el=document.createElement("div");el.id=id;el.style.display="none";el.addBehavior("#default#userdata");document.body.appendChild(el);return el},methods:{init:function(){var id=B.ie.prefix+esc(this.name);this.el=B.ie.make_userdata(id);if(this.o.defer){this.load()}},get:function(key){var val;key=esc(key);if(!this.o.defer){this.load()}val=this.el.getAttribute(key);return val},set:function(key,val){key=esc(key);this.el.setAttribute(key,val);if(!this.o.defer){this.save()}return val},remove:function(key){var val;key=esc(key);if(!this.o.defer){this.load()}val=this.el.getAttribute(key);this.el.removeAttribute(key);if(!this.o.defer){this.save()}return val},load:function(){this.el.load(esc(this.name))},save:function(){this.el.save(esc(this.name))}}},cookie:{delim:":",size:4e3,test:function(){return P.Cookie.enabled?true:false},methods:{key:function(key){return this.name+B.cookie.delim+key},get:function(key,fn){var val;key=this.key(key);val=ec.get(key);return val},set:function(key,val,fn){key=this.key(key);ec.set(key,val,this.o);return val},remove:function(key,val){var val;key=this.key(key);val=ec.remove(key);return val}}},flash:{test:function(){try{if(!swfobject){return false}}catch(e){return false}var major=swfobject.getFlashPlayerVersion().major;return major>=8?true:false},methods:{init:function(){if(!B.flash.el){var key,el,fel,cfg=C.flash;el=document.createElement("div");el.id=cfg.div_id;fel=document.createElement("div");fel.id=cfg.id;el.appendChild(fel);document.body.appendChild(el);B.flash.el=swfobject.createSWF({id:cfg.id,data:this.o.swf_path||cfg.path,width:cfg.size.w,height:cfg.size.h},cfg.params,cfg.id)}this.el=B.flash.el},get:function(key){var val;key=esc(key);val=this.el.get(this.name,key);return val},set:function(key,val){var old_val;key=esc(key);old_val=this.el.set(this.name,key,val);return old_val},remove:function(key){var val;key=esc(key);val=this.el.remove(this.name,key);return val}}}};init=function(){var i,l,b,key,fns=C.methods,keys=C.search_order;for(var idx=0,len=fns.length;idx




© 2015 - 2025 Weber Informatics LLC | Privacy Policy