From e235e34e0fadf6721b2bc699a38c2b8be5dbed6c Mon Sep 17 00:00:00 2001 From: Vince Date: Sun, 16 Sep 2012 15:36:45 +0200 Subject: [PATCH] Removing dead code --- js/service/LocalStorageService.js | 92 ------------------------------- 1 file changed, 92 deletions(-) diff --git a/js/service/LocalStorageService.js b/js/service/LocalStorageService.js index ba746993..753b4fb5 100644 --- a/js/service/LocalStorageService.js +++ b/js/service/LocalStorageService.js @@ -86,96 +86,4 @@ }]); } }; - - - // var frameSheet_; - - /** - * @private - */ - // var localStorageThrottler_ = null; - - /** - * @private - */ - /*var persistToLocalStorageRequest_ = function() { - // Persist to localStorage when drawing. We throttle localStorage accesses - // for high frequency drawing (eg mousemove). - if(localStorageThrottler_ !== null) { - window.clearTimeout(localStorageThrottler_); - } - localStorageThrottler_ = window.setTimeout(function() { - persistToLocalStorage_(); - localStorageThrottler_ = null; - }, 1000); - }; - */ - /** - * @private - */ - /* - var persistToLocalStorage_ = function() { - console.log('[LocalStorage service]: Snapshot stored'); - window.localStorage.snapShot = frameSheet_.serialize(); - }; - */ - - /** - * @private - * TODO(vince): Move that away from LocalStorageService - */ - /* - - var restoreFromLocalStorage_ = function() { - - frameSheet_.deserialize(window.localStorage.snapShot); - frameSheet_.setCurrentFrameIndex(0); - }; -*/ - /** - * @private - */ - /* - var cleanLocalStorage_ = function() { - console.log('[LocalStorage service]: Snapshot removed'); - delete window.localStorage.snapShot; - }; - *//* - return { - init: function(frameSheet) { - - if(frameSheet === undefined) { - throw "Bad LocalStorageService initialization: "; - } - frameSheet_ = frameSheet; - - $.subscribe(Events.LOCALSTORAGE_REQUEST, persistToLocalStorageRequest_); - }, - - // TODO(vincz): Find a good place to put this UI rendering, a service should not render UI. - displayRestoreNotification: function() { - if(window.localStorage && window.localStorage.snapShot) { - var reloadLink = "reload"; - var discardLink = "discard"; - var content = "Non saved version found. " + reloadLink + " or " + discardLink; - - $.publish(Events.SHOW_NOTIFICATION, [{ - "content": content, - "behavior": function(rootNode) { - rootNode = $(rootNode); - rootNode.click(function(evt) { - var target = $(evt.target); - if(target.hasClass("localstorage-restore")) { - restoreFromLocalStorage_(); - } - else if (target.hasClass("localstorage-discard")) { - cleanLocalStorage_(); - } - $.publish(Events.HIDE_NOTIFICATION); - }); - } - }]); - } - } - };*/ })(); \ No newline at end of file