From 8648f4d0d5ea0141660eb8f24d62f8e46b25d330 Mon Sep 17 00:00:00 2001 From: zombieFox Date: Sat, 20 Jul 2019 11:40:26 +0100 Subject: [PATCH] [refactor] improve state module --- src/js/state.js | 15 +++++++++++---- src/js/version.js | 2 +- src/manifest.json | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/js/state.js b/src/js/state.js index 935284b8..27323681 100644 --- a/src/js/state.js +++ b/src/js/state.js @@ -1,6 +1,8 @@ var state = (function() { - var current = { + var mod = {}; + + mod.current = { header: { area: { width: 100, @@ -218,11 +220,11 @@ var state = (function() { autoSuggest: false, }; - var get = function() { + mod.get = function() { return current; }; - var restore = function(data) { + mod.restore = function(data) { if ("state" in data) { current = data.state; }; @@ -230,12 +232,17 @@ var state = (function() { var init = function() { if (data.load()) { - restore(data.load()); + mod.restore(data.load()); }; }; + var get = function() { + return mod.get(); + }; + return { init: init, + mod: mod, get: get }; diff --git a/src/js/version.js b/src/js/version.js index 01cfcc5b..26666167 100644 --- a/src/js/version.js +++ b/src/js/version.js @@ -1,6 +1,6 @@ var version = (function() { - var current = "3.57.0"; + var current = "3.58.0"; var compare = function(a, b) { var pa = a.split("."); diff --git a/src/manifest.json b/src/manifest.json index ddce52b5..e75fe63c 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -2,7 +2,7 @@ "name": "nightTab", "short_name": "nightTab", "description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.", - "version": "3.57.0", + "version": "3.58.0", "manifest_version": 2, "chrome_url_overrides": { "newtab": "index.html"