Changeset 2233
- Timestamp:
- 09/21/11 13:24:50 (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3-dev/model/sources/academic/gen/_web/widg/tpl/tplMgr.doss/tplMgr.js
r2213 r2233 261 261 } 262 262 263 / / Local Storage API (localStorage/userData/cookie)263 /** Local Storage API (localStorage/userData/cookie) */ 264 264 function LocalStore(pId){ 265 265 if (pId && !/^[a-z][a-z0-9]+$/.exec(pId)) throw new Error("Invalid store name"); … … 267 267 this.fRootKey = document.location.pathname.substring(0,document.location.pathname.lastIndexOf("/")) +"/"; 268 268 if ("localStorage" in window) { 269 this.get = function(pKey) { return unescape(localStorage.getItem(this.fRootKey+this.xKey(pKey)))};269 this.get = function(pKey) {var vRet = localStorage.getItem(this.fRootKey+this.xKey(pKey));return (typeof vRet == "string" ? unescape(vRet) : null)}; 270 270 this.set = function(pKey, pVal) {localStorage.setItem(this.fRootKey+this.xKey(pKey), escape(pVal))}; 271 271 } else if (window.ActiveXObject){ … … 279 279 document.body.appendChild(this.fIE); 280 280 } else { 281 this.get = function(pKey){var vReg=new RegExp(this.xKey(pKey)+"=([^;]*)");var vArr=vReg.exec(document.cookie);if(vArr && vArr.length==2) return(unescape(vArr[1]));else return ""};281 this.get = function(pKey){var vReg=new RegExp(this.xKey(pKey)+"=([^;]*)");var vArr=vReg.exec(document.cookie);if(vArr && vArr.length==2) return(unescape(vArr[1]));else return null}; 282 282 this.set = function(pKey,pVal){document.cookie = this.xKey(pKey)+"="+escape(pVal)}; 283 283 }
Note: See TracChangeset
for help on using the changeset viewer.