summaryrefslogtreecommitdiff
path: root/prefs.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2010-11-20 14:10:26 +0300
committerAndrew Dolgov <[email protected]>2010-11-20 14:10:26 +0300
commitd90868d719a4a620ff5c1f74457626c429196590 (patch)
tree71e92f7f7b88a0454e9c4eee490343befa50fa21 /prefs.js
parent48b05a29860da1b2181689bc93622ca6f89d87ab (diff)
rework filter dialogs to use dijit.Form
Diffstat (limited to 'prefs.js')
-rw-r--r--prefs.js40
1 files changed, 23 insertions, 17 deletions
diff --git a/prefs.js b/prefs.js
index 2309e29ce..fa4804ff4 100644
--- a/prefs.js
+++ b/prefs.js
@@ -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");