js/settings.js: Simple config stuff for javascript extensions

This commit is contained in:
Michael Foster 2013-09-18 14:40:39 +10:00
parent cff15bd765
commit d13f30b39f
4 changed files with 362 additions and 338 deletions

View file

@ -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();