summaryrefslogtreecommitdiff
path: root/js/prefs.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2012-12-23 23:36:07 +0400
committerAndrew Dolgov <[email protected]>2012-12-23 23:36:07 +0400
commit6cbe53c9f5e9c369977b737f897a621f00fba90b (patch)
tree604f3d1c38be8fe6e056b084da61a8df11080522 /js/prefs.js
parent8dcb2b47628346226b18940b5cde7849f7a24687 (diff)
add instances plugin
Diffstat (limited to 'js/prefs.js')
-rw-r--r--js/prefs.js165
1 files changed, 0 insertions, 165 deletions
diff --git a/js/prefs.js b/js/prefs.js
index 51d8412fc..4687c60bb 100644
--- a/js/prefs.js
+++ b/js/prefs.js
@@ -24,15 +24,6 @@ function updateFeedList(sort_key) {
} });
}
-function updateInstanceList(sort_key) {
- new Ajax.Request("backend.php", {
- parameters: "?op=pref-instances&sort=" + param_escape(sort_key),
- onComplete: function(transport) {
- dijit.byId('instanceConfigTab').attr('content', transport.responseText);
- selectTab("instanceConfig", true);
- notify("");
- } });
-}
function updateUsersList(sort_key) {
try {
@@ -1891,162 +1882,6 @@ function insertSSLserial(value) {
}
}
-function getSelectedInstances() {
- return getSelectedTableRowIds("prefInstanceList");
-}
-
-function addInstance() {
- try {
- var query = "backend.php?op=dlg&method=addInstance";
-
- if (dijit.byId("instanceAddDlg"))
- dijit.byId("instanceAddDlg").destroyRecursive();
-
- dialog = new dijit.Dialog({
- id: "instanceAddDlg",
- title: __("Link Instance"),
- style: "width: 600px",
- regenKey: function() {
- new Ajax.Request("backend.php", {
- parameters: "?op=rpc&method=genHash",
- onComplete: function(transport) {
- var reply = JSON.parse(transport.responseText);
- if (reply)
- dijit.byId('instance_add_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,
- });
-
- dialog.show();
-
- } catch (e) {
- exception_error("addInstance", e);
- }
-}
-
-function editInstance(id, event) {
- try {
- if (!event || !event.ctrlKey) {
-
- selectTableRows('prefInstanceList', 'none');
- selectTableRowById('LIRR-'+id, 'LICHK-'+id, true);
-
- var query = "backend.php?op=pref-instances&method=edit&id=" +
- param_escape(id);
-
- if (dijit.byId("instanceEditDlg"))
- dijit.byId("instanceEditDlg").destroyRecursive();
-
- dialog = new dijit.Dialog({
- id: "instanceEditDlg",
- title: __("Edit Instance"),
- style: "width: 600px",
- regenKey: function() {
- new Ajax.Request("backend.php", {
- parameters: "?op=rpc&method=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,
- });
-
- dialog.show();
-
- } else if (event.ctrlKey) {
- var cb = $('LICHK-' + id);
- cb.checked = !cb.checked;
- toggleSelectRow(cb);
- }
-
-
- } catch (e) {
- exception_error("editInstance", e);
- }
-}
-
-function removeSelectedInstances() {
- try {
- var sel_rows = getSelectedInstances();
-
- if (sel_rows.length > 0) {
-
- var ok = confirm(__("Remove selected instances?"));
-
- if (ok) {
- notify_progress("Removing selected instances...");
-
- var query = "?op=pref-instances&method=remove&ids="+
- param_escape(sel_rows.toString());
-
- new Ajax.Request("backend.php", {
- parameters: query,
- onComplete: function(transport) {
- notify('');
- updateInstanceList();
- } });
- }
-
- } else {
- alert(__("No instances are selected."));
- }
-
- } catch (e) {
- exception_error("removeInstance", e);
- }
-}
-
-function editSelectedInstance() {
- var rows = getSelectedInstances();
-
- if (rows.length == 0) {
- alert(__("No instances are selected."));
- return;
- }
-
- if (rows.length > 1) {
- alert(__("Please select only one instance."));
- return;
- }
-
- notify("");
-
- editInstance(rows[0]);
-}
-
function showHelp() {
try {
new Ajax.Request("backend.php", {