diff options
author | Andrew Dolgov <[email protected]> | 2007-08-20 12:27:19 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2007-08-20 12:27:19 +0100 |
commit | b652c1b7c4bebf85fbad6d892d8e7ea36e9b2905 (patch) | |
tree | a736b5202ee7495563fd267744aceb7244671c9c /prefs.js | |
parent | 3d0615b9efafbe48e7e40ff4e952f47cc288c581 (diff) |
ajaxify prefs save/reset; update translations
Diffstat (limited to 'prefs.js')
-rw-r--r-- | prefs.js | 53 |
1 files changed, 52 insertions, 1 deletions
@@ -186,6 +186,13 @@ function notify_callback() { } } +function prefs_reset_callback() { + if (xmlhttp.readyState == 4) { + notify_info(xmlhttp.responseText); + selectTab(); + } +} + function changepass_callback() { try { @@ -1413,7 +1420,27 @@ function categorizeSelectedFeeds() { } function validatePrefsReset() { - return confirm(__("Reset to defaults?")); + try { + var ok = confirm(__("Reset to defaults?")); + + if (ok) { + + var query = Form.serialize("pref_prefs_form"); + query = query + "&subop=reset-config"; + debug(query); + + xmlhttp.open("POST", "backend.php", true); + xmlhttp.onreadystatechange=prefs_reset_callback; + xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); + xmlhttp.send(query); + } + + } catch (e) { + exception_error("validatePrefsSave", e); + } + + return false; + } function browseFeeds(limit) { @@ -1724,3 +1751,27 @@ function pubRegenKey() { return false; } + +function validatePrefsSave() { + try { + + var ok = confirm(__("Save current configuration?")); + + if (ok) { + + var query = Form.serialize("pref_prefs_form"); + query = query + "&subop=save-config"; + debug(query); + + xmlhttp.open("POST", "backend.php", true); + xmlhttp.onreadystatechange=notify_callback; + xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); + xmlhttp.send(query); + } + + } catch (e) { + exception_error("validatePrefsSave", e); + } + + return false; +} |