summaryrefslogtreecommitdiffstats
path: root/extensions/BugmailFilter/web
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2014-07-08 10:40:14 +0200
committerByron Jones <glob@mozilla.com>2014-07-08 10:40:14 +0200
commit2f3b5dd7df3e131af6aef3cd5ccf7e8523c1780e (patch)
treee71ea56398621e038df3c27cc5b87accf7a04968 /extensions/BugmailFilter/web
parentd74129306d8d5a903af6fe3957046feb36affdd1 (diff)
downloadbugzilla-2f3b5dd7df3e131af6aef3cd5ccf7e8523c1780e.tar.gz
bugzilla-2f3b5dd7df3e131af6aef3cd5ccf7e8523c1780e.tar.xz
Bug 990980: create an extension for server-side filtering of bugmail
Diffstat (limited to 'extensions/BugmailFilter/web')
-rw-r--r--extensions/BugmailFilter/web/js/bugmail-filter.js37
-rw-r--r--extensions/BugmailFilter/web/style/bugmail-filter.css44
2 files changed, 81 insertions, 0 deletions
diff --git a/extensions/BugmailFilter/web/js/bugmail-filter.js b/extensions/BugmailFilter/web/js/bugmail-filter.js
new file mode 100644
index 000000000..e298a60f1
--- /dev/null
+++ b/extensions/BugmailFilter/web/js/bugmail-filter.js
@@ -0,0 +1,37 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This Source Code Form is "Incompatible With Secondary Licenses", as
+ * defined by the Mozilla Public License, v. 2.0. */
+
+var Dom = YAHOO.util.Dom;
+var Event = YAHOO.util.Event;
+
+function onFilterProductChange() {
+ selectProduct(Dom.get('product'), Dom.get('component'), null, null, '__Any__');
+ Dom.get('component').disabled = Dom.get('product').value == '';
+}
+
+function onFilterActionChange() {
+ var value = Dom.get('action').value;
+ Dom.get('add_filter').disabled = value == '';
+}
+
+function onRemoveChange() {
+ var cbs = Dom.get('filters_table').getElementsByTagName('input');
+ for (var i = 0, l = cbs.length; i < l; i++) {
+ if (cbs[i].checked) {
+ Dom.get('remove').disabled = false;
+ return;
+ }
+ }
+ Dom.get('remove').disabled = true;
+}
+
+Event.onDOMReady(function() {
+ Event.on('action', 'change', onFilterActionChange);
+ onFilterProductChange();
+ onFilterActionChange();
+ onRemoveChange();
+});
diff --git a/extensions/BugmailFilter/web/style/bugmail-filter.css b/extensions/BugmailFilter/web/style/bugmail-filter.css
new file mode 100644
index 000000000..193cf4469
--- /dev/null
+++ b/extensions/BugmailFilter/web/style/bugmail-filter.css
@@ -0,0 +1,44 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This Source Code Form is "Incompatible With Secondary Licenses", as
+ * defined by the Mozilla Public License, v. 2.0. */
+
+#add_filter_table th {
+ text-align: right;
+}
+
+.example_filter_table {
+ margin-left: 2em;
+}
+
+.example_filter_table th {
+ text-align: right;
+ font-weight: normal;
+}
+
+.example_filter_table td {
+ padding-left: 1em;
+}
+
+#add_filter_table .blurb {
+ font-style: italic;
+ padding-left: 2em;
+}
+
+#filters_table {
+ margin-bottom: 1em;
+ border-spacing: 0;
+}
+
+#filters_table th, #filters_table td {
+ text-align: left;
+ padding-right: 1em;
+ padding: 2px;
+}
+
+#filters_table .row_odd {
+ background-color: #eeeeee;
+ color: #000000;
+}