summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2011-11-22 00:02:59 +0100
committerDave Lawrence <dlawrence@mozilla.com>2011-11-22 00:02:59 +0100
commit8c7652a2a8beceb65a5189d0393a8111186de32c (patch)
tree4fce452f2fca19d8cde67f4d66b656fb156cb0e7
parent5f1ae49c9a96fca5be3297c4d6b322df4c7ac77f (diff)
downloadbugzilla-8c7652a2a8beceb65a5189d0393a8111186de32c.tar.gz
bugzilla-8c7652a2a8beceb65a5189d0393a8111186de32c.tar.xz
Added some missing files from bmo/4.0
-rw-r--r--js/create_bug.js116
-rw-r--r--skins/custom/bug_groups.css24
-rw-r--r--skins/custom/create_bug.css18
3 files changed, 158 insertions, 0 deletions
diff --git a/js/create_bug.js b/js/create_bug.js
new file mode 100644
index 000000000..62d24a642
--- /dev/null
+++ b/js/create_bug.js
@@ -0,0 +1,116 @@
+function toggleAdvancedFields() {
+ TUI_toggle_class('expert_fields');
+ var elements = YAHOO.util.Dom.getElementsByClassName('expert_fields');
+ if (YAHOO.util.Dom.hasClass(elements[0], TUI_HIDDEN_CLASS)) {
+ handleWantsBugFlags(false);
+ }
+}
+
+function handleWantsBugFlags(wants) {
+ if (wants) {
+ hideElementById('bug_flags_false');
+ showElementById('bug_flags_true');
+ }
+ else {
+ showElementById('bug_flags_false');
+ hideElementById('bug_flags_true');
+ clearBugFlagFields();
+ }
+}
+
+function clearBugFlagFields() {
+ var flags_table;
+ flags_table = document.getElementById('bug_flags');
+ if (flags_table) {
+ var selects = flags_table.getElementsByTagName('select');
+ for (var i = 0, il = selects.length; i < il; i++) {
+ if (selects[i].value != 'X') {
+ selects[i].value = 'X';
+ toggleRequesteeField(selects[i]);
+ }
+ }
+ }
+ flags_table = document.getElementById('bug_tracking_flags');
+ if (flags_table) {
+ var selects = flags_table.getElementsByTagName('select');
+ for (var i = 0, il = selects.length; i < il; i++) {
+ selects[i].value = '---';
+ }
+ }
+}
+
+YAHOO.util.Event.onDOMReady(function() {
+ function set_width(id, width) {
+ var el = document.getElementById(id);
+ if (!el) return;
+ el.style.width = width + 'px';
+ }
+
+ // force field widths
+
+ var width = document.getElementById('short_desc').clientWidth + 'px';
+ var el;
+
+ el = document.getElementById('comment');
+ el.style.width = width;
+
+ el = document.getElementById('cf_crash_signature');
+ if (el) el.style.width = width;
+
+ // show the bug flags if a flag is set
+
+ var flag_set = false;
+ var flags_table;
+ flags_table = document.getElementById('bug_flags');
+ if (flags_table) {
+ var selects = flags_table.getElementsByTagName('select');
+ for (var i = 0, il = selects.length; i < il; i++) {
+ if (selects[i].value != 'X') {
+ flag_set = true;
+ break;
+ }
+ }
+ }
+ if (!flag_set) {
+ flags_table = document.getElementById('bug_tracking_flags');
+ if (flags_table) {
+ var selects = flags_table.getElementsByTagName('select');
+ for (var i = 0, il = selects.length; i < il; i++) {
+ if (selects[i].value != '---') {
+ flag_set = true;
+ break;
+ }
+ }
+ }
+ }
+
+ if (flag_set) {
+ hideElementById('bug_flags_false');
+ showElementById('bug_flags_true');
+ } else {
+ hideElementById('bug_flags_true');
+ showElementById('bug_flags_false');
+ }
+ showElementById('btn_no_bug_flags')
+});
+
+function take_bug(user) {
+ var el = Dom.get('assigned_to');
+ el.value = user;
+ el.focus();
+ el.select();
+ assignee_change(user);
+ return false;
+}
+
+function assignee_change(user) {
+ var el = Dom.get('take_bug');
+ if (!el) return;
+ el.style.display = Dom.get('assigned_to').value == user ? 'none' : '';
+}
+
+function init_take_handler(user) {
+ YAHOO.util.Event.addListener(
+ 'assigned_to', 'change', function() { assignee_change(user); });
+ assignee_change(user);
+}
diff --git a/skins/custom/bug_groups.css b/skins/custom/bug_groups.css
new file mode 100644
index 000000000..b8486c968
--- /dev/null
+++ b/skins/custom/bug_groups.css
@@ -0,0 +1,24 @@
+/* colorize bugs in various groups */
+body[class*=bz_group_] {
+ background-color: #e0e0ff;
+ border-left: solid red 2px;
+ padding-left: 13px;
+}
+
+body[class*=bz_group_] #bugzilla-body {
+ background-color: inherit;
+}
+
+body.bz_group_webtools-security,
+body.bz_group_websites-security,
+body.bz_group_bugzilla-security {
+ background-color: #ffeeee;
+}
+
+body.bz_group_client-services-security {
+ background-color: #ffff80;
+}
+
+body.bz_group_core-security {
+ background-color: #ffe0b0;
+}
diff --git a/skins/custom/create_bug.css b/skins/custom/create_bug.css
new file mode 100644
index 000000000..044896d68
--- /dev/null
+++ b/skins/custom/create_bug.css
@@ -0,0 +1,18 @@
+
+#bug_tracking_flags .field_label {
+ font-weight: normal !important;
+}
+
+#guided {
+ margin-top: 30px;
+}
+
+#component {
+ width: 25em;
+}
+
+.hidden_text {
+ opacity: 0;
+ filter: alpha(opacity=0);
+}
+