From d13f30b39f93f694241239c86c08c306c7b94fd4 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Wed, 18 Sep 2013 14:40:39 +1000 Subject: js/settings.js: Simple config stuff for javascript extensions --- templates/main.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'templates') diff --git a/templates/main.js b/templates/main.js index 235b52db..5a4c68fc 100644 --- a/templates/main.js +++ b/templates/main.js @@ -249,6 +249,17 @@ function rememberStuff() { } } +var script_settings = function(script_name) { + this.script_name = script_name; + this.get = function(var_name, default_val) { + if (typeof tb_settings == 'undefined' || + typeof tb_settings[this.script_name] == 'undefined' || + typeof tb_settings[this.script_name][var_name] == 'undefined') + return default_val; + return tb_settings[this.script_name][var_name]; + } +}; + function init() { init_stylechooser(); -- cgit v1.3