diff options
author | Ehsan Akhgari <ehsan@mozilla.com> | 2010-11-01 21:28:12 -0400 |
---|---|---|
committer | Ehsan Akhgari <ehsan@mozilla.com> | 2010-11-01 21:28:12 -0400 |
commit | ba6ff009fbc11eff77a5f91b777e4f33196338b6 (patch) | |
tree | 6d723f2767a7a4bbff025bef1063df6a7049d2fe /lib/main.js | |
parent | e6d9394bea821413c38842db099940ccf880e405 (diff) | |
download | bugzilla-triage-ba6ff009fbc11eff77a5f91b777e4f33196338b6.tar.gz |
Put the quicksearch text in the search boxes so that they can be edited
Diffstat (limited to 'lib/main.js')
-rw-r--r-- | lib/main.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/main.js b/lib/main.js index c1d09bd..335edc8 100644 --- a/lib/main.js +++ b/lib/main.js @@ -87,6 +87,9 @@ function tweakBugzilla(d) { if (!/bugzilla(-[a-zA-Z]+)*\.mozilla\.org/.test(d.location.href)) return; + // Put the quicksearch text in the quicksearch boxes + quicksearchHandler(d); + if (!d.getElementById("comments")) // don't process the mid-air collision pages return; @@ -553,6 +556,20 @@ function attachmentDiffLinkify(doc) { } } +function quicksearchHandler(doc) { + var win = doc.defaultView; + var match = /quicksearch=([^&]+)/i.exec(win.location.search); + if (match) { + var quicksearch = unescape(match[1]); + var quicksearchBox = doc.querySelectorAll("input[name=quicksearch]"); + if (quicksearchBox) { + for (var i = 0; i < quicksearchBox.length; ++i) { + quicksearchBox[i].value = quicksearch; + } + } + } +} + function AttachmentFlagHandlerCtor() { this._db = {}; this._interestingFlags = {}; |