summaryrefslogtreecommitdiff
path: root/js/prefs.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2012-08-23 20:23:19 +0400
committerAndrew Dolgov <[email protected]>2012-08-23 20:23:19 +0400
commit27211afe92ab90a89d1879a31a8543cdf2b6aab6 (patch)
tree2dbacda3994058c031773b24d8ebbc68b69e7e28 /js/prefs.js
parent639ad600353120d60c455bcb476227214ecfd049 (diff)
implement experimental web-based updater
Diffstat (limited to 'js/prefs.js')
-rw-r--r--js/prefs.js47
1 files changed, 47 insertions, 0 deletions
diff --git a/js/prefs.js b/js/prefs.js
index f7a68bf6d..10e33f701 100644
--- a/js/prefs.js
+++ b/js/prefs.js
@@ -2130,3 +2130,50 @@ function batchSubscribe() {
}
}
+function updateSelf() {
+ try {
+ var query = "backend.php?op=pref-prefs&method=updateSelf";
+
+ if (dijit.byId("updateSelfDlg"))
+ dijit.byId("updateSelfDlg").destroyRecursive();
+
+ var dialog = new dijit.Dialog({
+ id: "updateSelfDlg",
+ title: __("Update Tiny Tiny RSS"),
+ style: "width: 600px",
+ closable: false,
+ performUpdate: function() {
+ dijit.byId("self_update_start_btn").attr("disabled", true);
+ notify_progress("Loading, please wait...", true);
+ new Ajax.Request("backend.php", {
+ parameters: "?op=pref-prefs&method=performUpdate",
+ onComplete: function(transport) {
+ try {
+ notify('');
+ $("self_update_log").innerHTML = transport.responseText;
+ dialog.attr("updated", true);
+ } catch (e) {
+ exception_error("updateSelf/inner", e);
+ }
+ } });
+ },
+ close: function() {
+ if (dialog.attr("updated")) {
+ window.location.reload();
+ } else {
+ dialog.hide();
+ }
+ },
+ start: function() {
+ if (prompt(__("Live updating is considered experimental. Backup your tt-rss directory before continuing. Please type 'yes' to continue.")) == 'yes') {
+ dialog.performUpdate();
+ }
+ },
+ href: query});
+
+ dialog.show();
+ } catch (e) {
+ exception_error("batchSubscribe", e);
+ }
+}
+