]> git.wh0rd.org - tt-rss.git/blobdiff - prefs.js
implement instance edit & save
[tt-rss.git] / prefs.js
index c13f0e0d41339a9c4350ef83efe10200ca5d05d2..5c7131d2f41b8a518264b52a1c7e18c04b06fffe 100644 (file)
--- a/prefs.js
+++ b/prefs.js
@@ -1810,6 +1810,30 @@ function editInstance(id, event) {
                        id: "instanceEditDlg",
                        title: __("Edit Instance"),
                        style: "width: 600px",
+                       regenKey: function() {
+                               new Ajax.Request("backend.php", {
+                                       parameters: "?op=rpc&subop=genHash",
+                                       onComplete: function(transport) {
+                                               var reply = JSON.parse(transport.responseText);
+                                               if (reply)
+                                                       dijit.byId('instance_edit_key').attr('value', reply.hash);
+
+                                       } });
+                       },
+                       execute: function() {
+                               if (this.validate()) {
+//                                     console.warn(dojo.objectToQuery(this.attr('value')));
+
+                                       notify_progress('Saving data...', true);
+                                       new Ajax.Request("backend.php", {
+                                               parameters: dojo.objectToQuery(this.attr('value')),
+                                               onComplete: function(transport) {
+                                                       dialog.hide();
+                                                       notify('');
+                                                       updateInstanceList();
+                                       } });
+                               }
+                       },
                        href: query,
                });