summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorportix <portix@gmx.net>2013-02-28 22:35:04 +0100
committerportix <portix@gmx.net>2013-02-28 22:35:04 +0100
commitf58dc10ad6e0bc87d7313427b3dd27970affeb98 (patch)
tree11eb997a7fe3fde9fe08fdda841a2c46241d308e
parentfd0369d9b9f189dee93025dc3ff3fcacb2a724a8 (diff)
downloaddwb-f58dc10ad6e0bc87d7313427b3dd27970affeb98.zip
perdomainsettings: get default values from global.settings
-rw-r--r--extensions/perdomainsettings22
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;