- if (e) {
- if (fg) e.style.color = fg;
- if (bg) e.style.backgroundColor = bg;
- }
-
- new Ajax.Request("backend.php", { parameters: query });
-
- updateFilterList();
- },
- execute: function() {
- if (this.validate()) {
- var caption = this.attr('value').caption;
- var fg_color = this.attr('value').fg_color;
- var bg_color = this.attr('value').bg_color;
- var query = dojo.objectToQuery(this.attr('value'));
-
- dijit.byId('labelTree').setNameById(id, caption);
- this.setLabelColor(id, fg_color, bg_color);
- this.hide();
-
- new Ajax.Request("backend.php", {
- parameters: query,
- onComplete: function(transport) {
- updateFilterList();
- } });
- }
- },
- href: query});
-
- dialog.show();
-
- } catch (e) {
- exception_error("editLabel", e);
- }
-}
-
-function clearTwitterCredentials() {
- try {
- var ok = confirm(__("This will clear your stored authentication information for Twitter. Continue?"));
-
- if (ok) {
- notify_progress("Clearing credentials...");
-
- var query = "?op=pref-feeds&method=remtwitterinfo";
-
- new Ajax.Request("backend.php", {
- parameters: query,
- onComplete: function(transport) {
- notify_info("Twitter credentials have been cleared.");
- updateFeedList();
- } });
- }
-
- } catch (e) {
- exception_error("clearTwitterCredentials", e);
- }
-}
-
-function customizeCSS() {
- try {
- var query = "backend.php?op=dlg&method=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&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);
- }