diff options
author | Dave Lawrence <dlawrence@mozilla.com> | 2013-03-21 22:25:53 +0100 |
---|---|---|
committer | Dave Lawrence <dlawrence@mozilla.com> | 2013-03-21 22:25:53 +0100 |
commit | 2b88ae92c4970f0ff5cccb5b607902f8752590c2 (patch) | |
tree | 5f2586b20f4ca9311877e93c227b23cb6b525a34 /extensions | |
parent | 897f58ced15e63ca63e870a40991eaf97de84f2f (diff) | |
download | bugzilla-2b88ae92c4970f0ff5cccb5b607902f8752590c2.tar.gz bugzilla-2b88ae92c4970f0ff5cccb5b607902f8752590c2.tar.xz |
Bug 849905 - bug filing links in my dashboard should be able to be opened in new tabs/windows
r=glob
Diffstat (limited to 'extensions')
7 files changed, 42 insertions, 21 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 d6d493827..f7ff82a6e 100644 --- a/extensions/BMO/template/en/default/global/choose-product.html.tmpl +++ b/extensions/BMO/template/en/default/global/choose-product.html.tmpl @@ -58,19 +58,12 @@ <h2>[% h2 FILTER html %]</h2> -<script> - [% IF format %] - ProdCompSearch.format = '[% format FILTER js %]'; - [% END %] - [% IF cloned_bug_id %] - ProdCompSearch.cloned_bug_id = '[% cloned_bug_id FILTER js %]'; - [% END %] - ProdCompSearch.script_name = '[% target FILTER js %]'; -</script> <div id="prod_comp_search_main"> [% PROCESS prodcompsearch/form.html.tmpl - input_label = "Find product:" - %] + input_label = "Find product:" + format = format + cloned_bug_id = cloned_bug_id + script_name = target %] </div> <h2>or choose from the following selections</h2> diff --git a/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl b/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl index c9bed9f41..271055e0c 100644 --- a/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl +++ b/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl @@ -116,14 +116,11 @@ dupes.setLabels( Or search for a Product: </h3> -<script> - ProdCompSearch.format = 'guided'; - ProdCompSearch.script_name = 'enter_bug.cgi'; -</script> <div id="prod_comp_search_main"> [% PROCESS prodcompsearch/form.html.tmpl - input_label = "Find product:" - %] + input_label = "Find product:" + format = "guided" + script_name = "enter_bug.cgi" %] </div> </div> diff --git a/extensions/MyDashboard/template/en/default/pages/mydashboard.html.tmpl b/extensions/MyDashboard/template/en/default/pages/mydashboard.html.tmpl index e96ee8cde..1549b0dc2 100644 --- a/extensions/MyDashboard/template/en/default/pages/mydashboard.html.tmpl +++ b/extensions/MyDashboard/template/en/default/pages/mydashboard.html.tmpl @@ -104,7 +104,9 @@ <div id="right"> <div id="prod_comp_search_main"> [% PROCESS prodcompsearch/form.html.tmpl - input_label = "File a $terms.Bug:" + input_label = "File a $terms.Bug:" + script_name = "enter_bug.cgi" + new_tab = 1 %] </div> diff --git a/extensions/MyDashboard/web/js/query.js b/extensions/MyDashboard/web/js/query.js index 62d373e65..4590bb603 100644 --- a/extensions/MyDashboard/web/js/query.js +++ b/extensions/MyDashboard/web/js/query.js @@ -54,7 +54,7 @@ YUI({ Y.one("#query_container .query_heading").setHTML(e.response.meta.heading); Y.one("#query_bugs_found").setHTML( '<a href="buglist.cgi?' + e.response.meta.buffer + - '">' + e.response.results.length + ' bugs found</a>'); + '" target="_blank">' + e.response.results.length + ' bugs found</a>'); dataTable.set('data', e.response.results); } }, diff --git a/extensions/ProdCompSearch/template/en/default/pages/prodcompsearch.html.tmpl b/extensions/ProdCompSearch/template/en/default/pages/prodcompsearch.html.tmpl index 533ade888..649a205db 100644 --- a/extensions/ProdCompSearch/template/en/default/pages/prodcompsearch.html.tmpl +++ b/extensions/ProdCompSearch/template/en/default/pages/prodcompsearch.html.tmpl @@ -17,6 +17,7 @@ <div id="prod_comp_search_main"> [% PROCESS prodcompsearch/form.html.tmpl query_header = "File a $terms.Bug:" + script_name = "enter_bug.cgi" %] </div> diff --git a/extensions/ProdCompSearch/template/en/default/prodcompsearch/form.html.tmpl b/extensions/ProdCompSearch/template/en/default/prodcompsearch/form.html.tmpl index 9d75f66f1..8d4f46e07 100644 --- a/extensions/ProdCompSearch/template/en/default/prodcompsearch/form.html.tmpl +++ b/extensions/ProdCompSearch/template/en/default/prodcompsearch/form.html.tmpl @@ -6,6 +6,21 @@ # defined by the Mozilla Public License, v. 2.0. #%] +<script type="text/javascript"> + [% IF script_name %] + ProdCompSearch.script_name = '[% script_name FILTER js %]'; + [% END %] + [% IF format %] + ProdCompSearch.format = '[% format FILTER js %]'; + [% END %] + [% IF cloned_bug_id %] + ProdCompSearch.cloned_bug_id = '[% cloned_bug_id FILTER js %]'; + [% END %] + [% IF new_tab %] + ProdCompSearch.new_tab = true; + [% END %] +</script> + <div id="prod_comp_search_form" class="yui3-skin-sam"> <div id="prod_comp_search_header"> [% input_label FILTER none %] diff --git a/extensions/ProdCompSearch/web/js/prod_comp_search.js b/extensions/ProdCompSearch/web/js/prod_comp_search.js index bc0f41a2b..7cb1ec73b 100644 --- a/extensions/ProdCompSearch/web/js/prod_comp_search.js +++ b/extensions/ProdCompSearch/web/js/prod_comp_search.js @@ -11,7 +11,8 @@ var ProdCompSearch = { script_name: 'enter_bug.cgi', script_choices: ['enter_bug.cgi', 'describecomponents.cgi'], format: null, - cloned_bug_id: null + cloned_bug_id: null, + new_tab: null }; YUI({ @@ -100,7 +101,19 @@ YUI({ if (ProdCompSearch.script_name == 'describecomponents.cgi') { url += "#" + encodeURIComponent(data.component); } - window.location.href = url; + if (ProdCompSearch.new_tab) { + window.open(url, '_blank'); + } + else { + window.location.href = url; + } + } + }, + after: { + select: function(e) { + if (ProdCompSearch.new_tab) { + input.set('value',''); + } } } }); |