aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2010-11-24 23:33:30 +0100
committerMatěj Cepl <mcepl@redhat.com>2010-11-24 23:33:30 +0100
commita95d522f404ed88c0d237175883adf0ead47d69e (patch)
tree73be52f2943cbd88398917ad159aeb9e73b1ae4d /lib
parent94204070249610258451f8ec9f2d6aa7db4ea7d5 (diff)
downloadbugzilla-triage-a95d522f404ed88c0d237175883adf0ead47d69e.tar.gz
Limit full-text queries of upstream bugzillas just to current component.
* changed queryUpstreamBug data to have additional fields for this. * changed queryUpstream method of RHBZPage to use them. Fixes #56
Diffstat (limited to 'lib')
-rw-r--r--lib/rhbzpage.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/rhbzpage.js b/lib/rhbzpage.js
index dc0b250..10090a7 100644
--- a/lib/rhbzpage.js
+++ b/lib/rhbzpage.js
@@ -577,9 +577,14 @@ RHBugzillaPage.prototype.setBranding = function() {
RHBugzillaPage.prototype.queryUpstream = function() {
var text = this.getSelectionOrClipboard();
if (text) {
- text = encodeURIComponent(text.trim());
var queryUpstreamBugsURLArray = this.constantData.queryUpstreamBug;
- var urlBase = util.filterByRegexp(queryUpstreamBugsURLArray, this.getComponent());
+ var searchData = util.filterByRegexp(queryUpstreamBugsURLArray, this.getComponent());
+ var urlBase = searchData.url;
+ text = searchData.searchBy+":"+searchData.fillIn+" "+text.trim();
+ if (searchData.fillIn == "$$$") {
+ text = text.replace("$$$", this.getComponent());
+ }
+ text = encodeURIComponent(text).replace("%20","+");
tabs.open({
url: urlBase + text,
inBackground: true,