summaryrefslogtreecommitdiff
path: root/prefs.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2011-04-20 14:11:15 +0400
committerAndrew Dolgov <[email protected]>2011-04-20 14:11:15 +0400
commit9104a3e65afdb884dd2a6289ac62161d8176c555 (patch)
treefa7f068fe93cd35bc2368f34c8011af3c7808aba /prefs.js
parent16270276cf27620d72974eb7e71f089ea8bc3bd5 (diff)
implement instance edit & save
Diffstat (limited to 'prefs.js')
-rw-r--r--prefs.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/prefs.js b/prefs.js
index c13f0e0d4..5c7131d2f 100644
--- 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,
});