From 33c3293d056c34dcb0a9dfa25b8b950cc06bcb3e Mon Sep 17 00:00:00 2001
From: Morris Jobke <hey@morrisjobke.de>
Date: Thu, 20 Oct 2016 12:16:44 +0200
Subject: [PATCH] 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>
---
 core/js/js.js | 76 ---------------------------------------------------
 1 file changed, 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
  */
-- 
GitLab