+ } catch (e) {
+ exception_error("clearTwitterCredentials", e);
+ }
+}
+
+function customizeCSS() {
+ try {
+ var query = "backend.php?op=dlg&id=customizeCSS";
+
+ if (dijit.byId("cssEditDlg"))
+ dijit.byId("cssEditDlg").destroyRecursive();
+
+ dialog = new dijit.Dialog({
+ id: "cssEditDlg",
+ title: __("Customize stylesheet"),
+ style: "width: 600px",
+ execute: function() {
+ notify_progress('Saving data...', true);
+ new Ajax.Request("backend.php", {
+ parameters: dojo.objectToQuery(this.attr('value')),
+ onComplete: function(transport) {
+ notify('');
+ window.location.reload();
+ } });
+
+ },
+ href: query});
+
+ dialog.show();
+
+ } catch (e) {
+ exception_error("customizeCSS", e);
+ }
+}
+
+function insertSSLserial(value) {
+ try {
+ dijit.byId("SSL_CERT_SERIAL").attr('value', value);
+ } catch (e) {
+ exception_error("insertSSLcerial", e);
+ }
+}
+
+function getSelectedInstances() {
+ return getSelectedTableRowIds("prefInstanceList");
+}
+
+function addInstance() {
+ try {
+ var query = "backend.php?op=dlg&id=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&subop=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&subop=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&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,
+ });
+
+ dialog.show();
+
+ } else if (event.ctrlKey) {
+ var cb = $('LICHK-' + id);
+ cb.checked = !cb.checked;
+ toggleSelectRow(cb);
+ }