diff options
author | Andrew Dolgov <[email protected]> | 2010-11-20 14:10:26 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2010-11-20 14:10:26 +0300 |
commit | d90868d719a4a620ff5c1f74457626c429196590 (patch) | |
tree | 71e92f7f7b88a0454e9c4eee490343befa50fa21 /prefs.js | |
parent | 48b05a29860da1b2181689bc93622ca6f89d87ab (diff) |
rework filter dialogs to use dijit.Form
Diffstat (limited to 'prefs.js')
-rw-r--r-- | prefs.js | 40 |
1 files changed, 23 insertions, 17 deletions
@@ -288,27 +288,31 @@ function editUser(id, event) { } function editFilter(id, event) { - try { - if (!event || !event.ctrlKey) { + var query = "backend.php?op=pref-filters&subop=edit&id=" + param_escape(id); - notify_progress("Loading, please wait...", true); + if (dijit.byId("filterEditDlg")) + dijit.byId("filterEditDlg").destroyRecursive(); + + dialog = new dijit.Dialog({ + id: "filterEditDlg", + title: __("Edit Filter"), + style: "width: 600px", + execute: function() { + if (this.validate()) { + this.hide(); + new Ajax.Request("backend.php", { + parameters: dojo.objectToQuery(this.attr('value')), + onComplete: function(transport) { + updateFilterList(); + }}); + } + }, + href: query}); + + dialog.show(); - var query = "?op=pref-filters&subop=edit&id=" + - param_escape(id); - - new Ajax.Request("backend.php", { - parameters: query, - onComplete: function(transport) { - infobox_callback2(transport); - document.forms['filter_edit_form'].reg_exp.focus(); - } }); - } else if (event.ctrlKey) { - var cb = $('FICHK-' + id); - cb.checked = !cb.checked; - toggleSelectRow(cb); - } } catch (e) { exception_error("editFilter", e); @@ -1099,6 +1103,8 @@ function init() { dojo.require("dijit.layout.ContentPane"); dojo.require("dijit.Dialog"); dojo.require("dijit.form.Button"); + dojo.require("dijit.form.Select"); + dojo.require("dijit.form.FilteringSelect"); dojo.require("dijit.form.TextBox"); dojo.require("dijit.form.ValidationTextBox"); dojo.require("dijit.form.RadioButton"); |