From e4e1c83f2cac33341d9ad132dea8ca90c15487a4 Mon Sep 17 00:00:00 2001 From: hackademix Date: Sat, 15 Sep 2018 22:10:19 +0200 Subject: Fixed line endings. --- src/bg/Defaults.js | 38 ++++++++++++++++++++++++++++++++++++++ src/bg/defaults.js | 38 -------------------------------------- 2 files changed, 38 insertions(+), 38 deletions(-) create mode 100644 src/bg/Defaults.js delete mode 100644 src/bg/defaults.js (limited to 'src') diff --git a/src/bg/Defaults.js b/src/bg/Defaults.js new file mode 100644 index 0000000..ef2311f --- /dev/null +++ b/src/bg/Defaults.js @@ -0,0 +1,38 @@ +'use strict'; + +var Defaults = { + async init() { + let defaults = { + local: { + debug: false, + showCtxMenuItem: true, + showCountBadge: true, + showFullAddresses: false, + }, + sync: { + "global": false, + "xss": true, + "clearclick": true + } + }; + let defaultsClone = JSON.parse(JSON.stringify(defaults)); + + for (let [k, v] of Object.entries(defaults)) { + let store = await Storage.get(k, k); + if (k in store) { + Object.assign(v, store[k]); + } + v.storage = k; + } + + Object.assign(ns, defaults); + + // dynamic settings + if (!ns.local.uuid) { + ns.local.uuid = uuid(); + await ns.save(ns.local); + } + + return ns.defaults = defaultsClone; + } +}; diff --git a/src/bg/defaults.js b/src/bg/defaults.js deleted file mode 100644 index 7170743..0000000 --- a/src/bg/defaults.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict'; - -var Defaults = { - async init() { - let defaults = { - local: { - debug: false, - showCtxMenuItem: true, - showCountBadge: true, - showFullAddresses: false, - }, - sync: { - "global": false, - "xss": true, - "clearclick": true - } - }; - let defaultsClone = JSON.parse(JSON.stringify(defaults)); - - for (let [k, v] of Object.entries(defaults)) { - let store = await Storage.get(k, k); - if (k in store) { - Object.assign(v, store[k]); - } - v.storage = k; - } - - Object.assign(ns, defaults); - - // dynamic settings - if (!ns.local.uuid) { - ns.local.uuid = uuid(); - await ns.save(ns.local); - } - - return ns.defaults = defaultsClone; - } -}; -- cgit v1.2.3