Fixed preference loading in Webkit

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1461 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Alexis Deveria 2010-03-15 14:12:45 +00:00
parent 9a15e97c3a
commit e52ef2aa74
1 changed files with 5 additions and 2 deletions

View File

@ -78,7 +78,7 @@
storage = false;
// Some FF versions throw security errors here
try {
if(window.localStorage && onweb) {
if(window.localStorage) { // && onweb removed so Webkit works locally
storage = localStorage;
}
} catch(e) {}
@ -90,7 +90,7 @@
if(storage) {
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) {
if(store) widget.setPreferenceForKey(val, key);
else return widget.preferenceForKey(key);
@ -1024,6 +1024,9 @@
if($.pref('bkgd_color')) {
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')) {