]> BookStack Code Mirror - bookstack/blobdiff - resources/js/markdown/settings.js
Readme: Swapped codeclimate reference for custom phpmetrics
[bookstack] / resources / js / markdown / settings.js
diff --git a/resources/js/markdown/settings.js b/resources/js/markdown/settings.js
deleted file mode 100644 (file)
index 6dd1422..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-import {kebabToCamel} from "../services/text";
-
-
-export class Settings {
-
-    constructor(initialSettings) {
-        this.settingMap = {};
-        this.changeListeners = {};
-        this.merge(initialSettings);
-    }
-
-    set(key, value) {
-        key = this.normaliseKey(key);
-        this.settingMap[key] = value;
-        for (const listener of (this.changeListeners[key] || [])) {
-            listener(value);
-        }
-    }
-
-    get(key) {
-        return this.settingMap[this.normaliseKey(key)] || null;
-    }
-
-    merge(settings) {
-        for (const [key, value] of Object.entries(settings)) {
-            this.set(key, value);
-        }
-    }
-
-    onChange(key, callback) {
-        key = this.normaliseKey(key);
-        const listeners = this.changeListeners[this.normaliseKey(key)] || [];
-        listeners.push(callback);
-        this.changeListeners[this.normaliseKey(key)] = listeners;
-    }
-
-    normaliseKey(key) {
-        return kebabToCamel(key.replace('md-', ''));
-    }
-}
\ No newline at end of file