From ba6ff009fbc11eff77a5f91b777e4f33196338b6 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Mon, 1 Nov 2010 21:28:12 -0400 Subject: Put the quicksearch text in the search boxes so that they can be edited --- lib/main.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lib') 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 = {}; -- cgit