Fixed preference loading in Webkit
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1461 eee81c28-f429-11dd-99c0-75d572ba1dddmaster
parent
9a15e97c3a
commit
e52ef2aa74
|
@ -78,7 +78,7 @@
|
||||||
storage = false;
|
storage = false;
|
||||||
// Some FF versions throw security errors here
|
// Some FF versions throw security errors here
|
||||||
try {
|
try {
|
||||||
if(window.localStorage && onweb) {
|
if(window.localStorage) { // && onweb removed so Webkit works locally
|
||||||
storage = localStorage;
|
storage = localStorage;
|
||||||
}
|
}
|
||||||
} catch(e) {}
|
} catch(e) {}
|
||||||
|
@ -90,7 +90,7 @@
|
||||||
|
|
||||||
if(storage) {
|
if(storage) {
|
||||||
if(store) storage.setItem(key, val);
|
if(store) storage.setItem(key, val);
|
||||||
else if (storage.getItem(key)) return storage.getItem(key).value;
|
else if (storage.getItem(key)) return storage.getItem(key) + ''; // Convert to string for FF (.value fails in Webkit)
|
||||||
} else if(window.widget) {
|
} else if(window.widget) {
|
||||||
if(store) widget.setPreferenceForKey(val, key);
|
if(store) widget.setPreferenceForKey(val, key);
|
||||||
else return widget.preferenceForKey(key);
|
else return widget.preferenceForKey(key);
|
||||||
|
@ -1024,6 +1024,9 @@
|
||||||
|
|
||||||
if($.pref('bkgd_color')) {
|
if($.pref('bkgd_color')) {
|
||||||
setBackground($.pref('bkgd_color'), $.pref('bkgd_url'));
|
setBackground($.pref('bkgd_color'), $.pref('bkgd_url'));
|
||||||
|
} else if($.pref('bkgd_url')) {
|
||||||
|
// No color set, only URL
|
||||||
|
setBackground(defaultPrefs.bkgd_color, $.pref('bkgd_url'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if($.pref('img_save')) {
|
if($.pref('img_save')) {
|
||||||
|
|
Loading…
Reference in New Issue