diff options
author | portix <portix@gmx.net> | 2013-02-28 22:35:04 +0100 |
---|---|---|
committer | portix <portix@gmx.net> | 2013-02-28 22:35:04 +0100 |
commit | f58dc10ad6e0bc87d7313427b3dd27970affeb98 (patch) | |
tree | 11eb997a7fe3fde9fe08fdda841a2c46241d308e | |
parent | fd0369d9b9f189dee93025dc3ff3fcacb2a724a8 (diff) | |
download | dwb-f58dc10ad6e0bc87d7313427b3dd27970affeb98.zip |
perdomainsettings: get default values from global.settings
-rw-r--r-- | extensions/perdomainsettings | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/extensions/perdomainsettings b/extensions/perdomainsettings index 4741ed7e..f814439a 100644 --- a/extensions/perdomainsettings +++ b/extensions/perdomainsettings @@ -100,7 +100,7 @@ var me = "perdomainsettings"; var domains = null; var hosts = null; var uris = null; -var defaults = null; +var defaults = {}; var webviews = []; var sigNavigation = -1; var sigCloseTab = -1; @@ -204,6 +204,19 @@ function onCloseTab(wv) { } } } +function getDefaultValue(object) +{ + var key, s, o; + for(key in object) + { + o = object[key]; + for (s in o) + { + if (!defaults[s]) + defaults[s] = global.settings[s]; + } + } +} return { init : function (config) @@ -214,9 +227,14 @@ return { return false; } domains = config.domains || defaultConfig.domains; + domains && getDefaultValue(domains); + hosts = config.hosts || defaultConfig.hosts; + hosts && getDefaultValue(hosts); + uris = config.uris || defaultConfig.uris; - defaults = config.defaults || defaultConfig.defaults; + uris && getDefaultValue(uris); + sigNavigation = signals.connect("navigation", onNavigation); sigCloseTab = signals.connect("closeTab", onCloseTab); return true; |