From a95d522f404ed88c0d237175883adf0ead47d69e Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Wed, 24 Nov 2010 23:33:30 +0100 Subject: 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 --- lib/rhbzpage.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/rhbzpage.js') 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, -- cgit