From 9104a3e65afdb884dd2a6289ac62161d8176c555 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 20 Apr 2011 14:11:15 +0400 Subject: implement instance edit & save --- prefs.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'prefs.js') 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, }); -- cgit v1.2.3