diff options
author | Dave Lawrence <dlawrence@mozilla.com> | 2013-04-09 18:00:57 +0200 |
---|---|---|
committer | Dave Lawrence <dlawrence@mozilla.com> | 2013-04-09 18:00:57 +0200 |
commit | 080208aa7bf1c182429c2367c6d6744c246ecacb (patch) | |
tree | 9dd453f6ca1aa55222de0eba63d4c04995720863 | |
parent | 0ceb712501dc3146a4c8d06b7177e1e091362f00 (diff) | |
download | bugzilla-080208aa7bf1c182429c2367c6d6744c246ecacb.tar.gz bugzilla-080208aa7bf1c182429c2367c6d6744c246ecacb.tar.xz |
Bug 852279 - Bug pages no longer added to bfcache due to unload listener on Window
r=glob
8 files changed, 70 insertions, 41 deletions
diff --git a/extensions/BMO/template/en/default/global/choose-product.html.tmpl b/extensions/BMO/template/en/default/global/choose-product.html.tmpl index f7ff82a6e..38a43cd12 100644 --- a/extensions/BMO/template/en/default/global/choose-product.html.tmpl +++ b/extensions/BMO/template/en/default/global/choose-product.html.tmpl @@ -39,7 +39,9 @@ [% h2 = "Which product would you like to have described?" %] [% END %] -[% javascript_urls = [ "extensions/ProdCompSearch/web/js/prod_comp_search.js" ] %] +[% javascript_urls = [ "js/yui3/yui/yui-min.js", + "extensions/ProdCompSearch/web/js/prod_comp_search.js" ] +%] [% onload = "document.getElementById('prod_comp_search').focus();" %] [% style_urls.push("extensions/ProdCompSearch/web/styles/prod_comp_search.css") %] diff --git a/extensions/BMO/template/en/default/global/header.html.tmpl b/extensions/BMO/template/en/default/global/header.html.tmpl index 8112430a2..6aaac9411 100644 --- a/extensions/BMO/template/en/default/global/header.html.tmpl +++ b/extensions/BMO/template/en/default/global/header.html.tmpl @@ -78,7 +78,6 @@ [% SET starting_js_urls = [ "js/yui/yahoo-dom-event/yahoo-dom-event.js", "js/yui/cookie/cookie-min.js", - "js/yui3/yui/yui-min.js" ] %] 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 index c177015f1..f3eebafd3 100644 --- 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 @@ -8,47 +8,70 @@ [%# Display product and component descriptions after their respective fields %] <script type="text/javascript"> - YUI({ - base: 'js/yui3/', - combine: false - }).use('node', 'event', function(Y) { + var Event = YAHOO.util.Event; + var Dom = YAHOO.util.Dom; + Event.onDOMReady(function() { // 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">' + - ' (<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'); + var prod_desc = '[% bug.product_obj.description FILTER html_light FILTER js %]'; + if (prod_desc) { + var field_container = Dom.get('field_container_product'); + var toggle_container = document.createElement('span'); + Dom.setAttribute(toggle_container, 'id', 'toggle_prod_desc'); + toggle_container.appendChild(document.createTextNode(' (')); + var toggle_link = document.createElement('a'); + Dom.setAttribute(toggle_link, 'id', 'toggle_prod_desc_link'); + Dom.setAttribute(toggle_link, 'href', 'javascript:void(0);') + toggle_link.appendChild(document.createTextNode('show info')); + toggle_container.appendChild(toggle_link); + toggle_container.appendChild(document.createTextNode(')')); + field_container.appendChild(toggle_container); + var desc_container = document.createElement('div'); + Dom.setAttribute(desc_container, 'id', 'prod_desc_container'); + Dom.addClass(desc_container, 'bz_default_hidden'); + desc_container.innerHTML = prod_desc; + field_container.appendChild(desc_container); + Event.addListener(toggle_link, 'click', function () { + if (Dom.hasClass('prod_desc_container', 'bz_default_hidden')) { + Dom.get('toggle_prod_desc_link').innerHTML = 'hide info'; + Dom.removeClass('prod_desc_container', 'bz_default_hidden'); } else { - Y.one('#toggle_prod_desc_link').set('innerHTML', 'show info'); - Y.one('#prod_desc_container').addClass('bz_default_hidden'); + Dom.get('toggle_prod_desc_link').innerHTML = 'show info'; + Dom.addClass('prod_desc_container', '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">' + - ' (<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'); + var comp_desc = '[% bug.component_obj.description FILTER html_light FILTER js %]'; + if (comp_desc) { + var field_container = Dom.get('field_container_component'); + var toggle_container = document.createElement('span'); + Dom.setAttribute(toggle_container, 'id', 'toggle_comp_desc'); + toggle_container.appendChild(document.createTextNode(' (')); + var toggle_link = document.createElement('a'); + Dom.setAttribute(toggle_link, 'id', 'toggle_comp_desc_link'); + Dom.setAttribute(toggle_link, 'href', 'javascript:void(0);') + toggle_link.appendChild(document.createTextNode('show info')); + toggle_container.appendChild(toggle_link); + toggle_container.appendChild(document.createTextNode(')')); + field_container.appendChild(toggle_container); + var desc_container = document.createElement('div'); + Dom.setAttribute(desc_container, 'id', 'comp_desc_container'); + Dom.addClass(desc_container, 'bz_default_hidden'); + desc_container.innerHTML = comp_desc; + field_container.appendChild(desc_container); + Event.addListener(toggle_link, 'click', function () { + console.log('clicked'); + if (Dom.hasClass('comp_desc_container', 'bz_default_hidden')) { + Dom.get('toggle_comp_desc_link').innerHTML = 'hide info'; + Dom.removeClass('comp_desc_container', 'bz_default_hidden'); } else { - Y.one('#toggle_comp_desc_link').set('innerHTML', 'show info'); - Y.one('#comp_desc_container').addClass('bz_default_hidden'); + Dom.get('toggle_comp_desc_link').innerHTML = 'show info'; + Dom.addClass('comp_desc_container', 'bz_default_hidden'); } - }, '#toggle_comp_desc_link'); - }, '#field_container_component'); + }); + } }); </script> diff --git a/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl b/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl index 271055e0c..849df4c47 100644 --- a/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl +++ b/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl @@ -8,7 +8,8 @@ [% PROCESS global/variables.none.tmpl %] -[% js_urls = [ 'extensions/GuidedBugEntry/web/js/products.js', +[% js_urls = [ 'js/yui3/yui/yui-min.js', + 'extensions/GuidedBugEntry/web/js/products.js', 'extensions/GuidedBugEntry/web/js/guided.js', 'extensions/ProdCompSearch/web/js/prod_comp_search.js', 'js/field.js', 'js/TUI.js', 'js/bug.js' ] %] diff --git a/extensions/MyDashboard/template/en/default/pages/mydashboard.html.tmpl b/extensions/MyDashboard/template/en/default/pages/mydashboard.html.tmpl index 8b2dfd8bf..8222f6749 100644 --- a/extensions/MyDashboard/template/en/default/pages/mydashboard.html.tmpl +++ b/extensions/MyDashboard/template/en/default/pages/mydashboard.html.tmpl @@ -12,7 +12,8 @@ title = "My Dashboard" style_urls = [ "extensions/MyDashboard/web/styles/mydashboard.css", "extensions/ProdCompSearch/web/styles/prod_comp_search.css" ] - javascript_urls = [ "extensions/MyDashboard/web/js/query.js", + javascript_urls = [ "js/yui3/yui/yui-min.js", + "extensions/MyDashboard/web/js/query.js", "extensions/MyDashboard/web/js/flags.js", "extensions/ProdCompSearch/web/js/prod_comp_search.js" ] %] diff --git a/extensions/ProdCompSearch/template/en/default/pages/prodcompsearch.html.tmpl b/extensions/ProdCompSearch/template/en/default/pages/prodcompsearch.html.tmpl index 649a205db..5b39315b5 100644 --- a/extensions/ProdCompSearch/template/en/default/pages/prodcompsearch.html.tmpl +++ b/extensions/ProdCompSearch/template/en/default/pages/prodcompsearch.html.tmpl @@ -10,7 +10,8 @@ [% PROCESS global/header.html.tmpl title = "File a $terms.Bug" - javascript_urls = [ "extensions/ProdCompSearch/web/js/prod_comp_search.js" ] + javascript_urls = [ "js/yui3/yui/yui-min.js", + "extensions/ProdCompSearch/web/js/prod_comp_search.js" ] style_urls = [ "extensions/ProdCompSearch/web/styles/prod_comp_search.css" ] %] diff --git a/extensions/ProductDashboard/template/en/default/pages/productdashboard.html.tmpl b/extensions/ProductDashboard/template/en/default/pages/productdashboard.html.tmpl index f48d8f812..82de063aa 100644 --- a/extensions/ProductDashboard/template/en/default/pages/productdashboard.html.tmpl +++ b/extensions/ProductDashboard/template/en/default/pages/productdashboard.html.tmpl @@ -8,7 +8,10 @@ [% PROCESS global/variables.none.tmpl %] -[% javascript_urls = [ "js/util.js", "js/field.js" ] %] +[% javascript_urls = [ "js/yui3/yui/yui-min.js", + "js/util.js", + "js/field.js" ] +%] [% IF current_tab_name == 'summary' %] [% javascript_urls.push("extensions/ProductDashboard/web/js/summary.js") %] diff --git a/template/en/default/global/header.html.tmpl b/template/en/default/global/header.html.tmpl index b20070937..1abd7e8c7 100644 --- a/template/en/default/global/header.html.tmpl +++ b/template/en/default/global/header.html.tmpl @@ -78,7 +78,6 @@ [% SET starting_js_urls = [ "js/yui/yahoo-dom-event/yahoo-dom-event.js", "js/yui/cookie/cookie-min.js", - "js/yui3/yui/yui-min.js" ] %] |