diff options
author | Morris Jobke <hey@morrisjobke.de> | 2016-10-20 12:16:44 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2016-10-20 12:16:44 +0200 |
commit | 33c3293d056c34dcb0a9dfa25b8b950cc06bcb3e (patch) | |
tree | 65a02fee2a27b09f488925aebe373bb0b1eac892 /core/js/js.js | |
parent | 19b69cbf1b617d6a0b66c2d2f24af4ef81376143 (diff) | |
download | nextcloud-server-33c3293d056c34dcb0a9dfa25b8b950cc06bcb3e.tar.gz nextcloud-server-33c3293d056c34dcb0a9dfa25b8b950cc06bcb3e.zip |
Remove OC.localStorage and object method
* use the localstorage APIs of the browser instead
* use new Object() instead
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'core/js/js.js')
-rw-r--r-- | core/js/js.js | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/core/js/js.js b/core/js/js.js index 4b09cc49038..c12eb1d87e4 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -1305,82 +1305,6 @@ OC.Breadcrumb={ } }; -if(typeof localStorage !=='undefined' && localStorage !== null){ - /** - * User and instance aware localstorage - * @namespace - */ - OC.localStorage={ - namespace:'oc_'+OC.currentUser+'_'+OC.webroot+'_', - - /** - * Whether the storage contains items - * @param {string} name - * @return {boolean} - */ - hasItem:function(name){ - return OC.localStorage.getItem(name)!==null; - }, - - /** - * Add an item to the storage - * @param {string} name - * @param {string} item - */ - setItem:function(name,item){ - return localStorage.setItem(OC.localStorage.namespace+name,JSON.stringify(item)); - }, - - /** - * Removes an item from the storage - * @param {string} name - * @param {string} item - */ - removeItem:function(name,item){ - return localStorage.removeItem(OC.localStorage.namespace+name); - }, - - /** - * Get an item from the storage - * @param {string} name - * @return {null|string} - */ - getItem:function(name){ - var item = localStorage.getItem(OC.localStorage.namespace+name); - if(item === null) { - return null; - } else { - return JSON.parse(item); - } - } - }; -}else{ - //dummy localstorage - OC.localStorage={ - hasItem:function(){ - return false; - }, - setItem:function(){ - return false; - }, - getItem:function(){ - return null; - } - }; -} - -/** - * prototypical inheritance functions - * @todo Write documentation - * usage: - * MySubObject=object(MyObject) - */ -function object(o) { - function F() {} - F.prototype = o; - return new F(); -} - /** * Initializes core */ |