summaryrefslogtreecommitdiffstats
path: root/extensions/BMO
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/BMO')
-rw-r--r--extensions/BMO/template/en/default/hook/bug/edit-after_importance.html.tmpl54
-rw-r--r--extensions/BMO/web/styles/edit_bug.css11
2 files changed, 65 insertions, 0 deletions
diff --git a/extensions/BMO/template/en/default/hook/bug/edit-after_importance.html.tmpl b/extensions/BMO/template/en/default/hook/bug/edit-after_importance.html.tmpl
new file mode 100644
index 000000000..c177015f1
--- /dev/null
+++ b/extensions/BMO/template/en/default/hook/bug/edit-after_importance.html.tmpl
@@ -0,0 +1,54 @@
+[%# 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.
+ #%]
+
+[%# Display product and component descriptions after their respective fields %]
+<script type="text/javascript">
+ YUI({
+ base: 'js/yui3/',
+ combine: false
+ }).use('node', 'event', function(Y) {
+ // Display product description if user requests it
+ Y.on('contentready', function() {
+ var field_container = Y.one('#field_container_product');
+ field_container.appendChild('<span id="toggle_prod_desc">' +
+ '&nbsp;(<a href="javascript:void(0);" id="toggle_prod_desc_link">show info</a>)' +
+ '</span>');
+ field_container.appendChild('<div class="bz_default_hidden" id="prod_desc_container">' +
+ '[% bug.product_obj.description FILTER html_light FILTER js %]</div>');
+ Y.on('click', function() {
+ if (Y.one('#prod_desc_container').hasClass('bz_default_hidden')) {
+ Y.one('#toggle_prod_desc_link').set('innerHTML', 'hide info');
+ Y.one('#prod_desc_container').removeClass('bz_default_hidden');
+ }
+ else {
+ Y.one('#toggle_prod_desc_link').set('innerHTML', 'show info');
+ Y.one('#prod_desc_container').addClass('bz_default_hidden');
+ }
+ }, '#toggle_prod_desc_link');
+ }, '#field_container_product');
+ // Display component description if user requests it
+ Y.on('contentready', function() {
+ var field_container = Y.one('#field_container_component');
+ field_container.appendChild('<span id="toggle_comp_desc">' +
+ '&nbsp;(<a href="javascript:void(0);" id="toggle_comp_desc_link">show info</a>)' +
+ '</span>');
+ field_container.appendChild('<div class="bz_default_hidden" id="comp_desc_container">' +
+ '[% bug.component_obj.description FILTER html_light FILTER js %]</div>');
+ Y.on('click', function() {
+ if (Y.one('#comp_desc_container').hasClass('bz_default_hidden')) {
+ Y.one('#toggle_comp_desc_link').set('innerHTML', 'hide info');
+ Y.one('#comp_desc_container').removeClass('bz_default_hidden');
+ }
+ else {
+ Y.one('#toggle_comp_desc_link').set('innerHTML', 'show info');
+ Y.one('#comp_desc_container').addClass('bz_default_hidden');
+ }
+ }, '#toggle_comp_desc_link');
+ }, '#field_container_component');
+ });
+</script>
diff --git a/extensions/BMO/web/styles/edit_bug.css b/extensions/BMO/web/styles/edit_bug.css
index 089a92fbb..24212270d 100644
--- a/extensions/BMO/web/styles/edit_bug.css
+++ b/extensions/BMO/web/styles/edit_bug.css
@@ -36,3 +36,14 @@
font-family: monospace;
}
+#prod_desc_container,
+#comp_desc_container {
+ overflow: auto;
+ color: green;
+ padding: 2px;
+}
+
+#toggle_prod_desc,
+#toggle_comp_desc {
+ white-space: nowrap;
+}