aboutsummaryrefslogtreecommitdiffstats
path: root/data/lib/queries.js
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2011-04-28 00:39:52 +0200
committerMatěj Cepl <mcepl@redhat.com>2011-04-28 00:46:45 +0200
commit4964705f6918eda4cf4c310d261d95242bd2f0ad (patch)
tree335ea177b9e437ce5cf17449b56efec0d4f75487 /data/lib/queries.js
parentbc4c8cfcc7bb9814a0a4ce73d402e37fa7c0eedd (diff)
downloadbugzilla-triage-4964705f6918eda4cf4c310d261d95242bd2f0ad.tar.gz
Use self.on and self.postMessage instead of global on and postMessage.
The reason is https://bugzilla.mozilla.org/show_bug.cgi?id=635748 and effort to save the world from global variables in content scripts.
Diffstat (limited to 'data/lib/queries.js')
-rw-r--r--data/lib/queries.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/data/lib/queries.js b/data/lib/queries.js
index 7f935c8..4bf959a 100644
--- a/data/lib/queries.js
+++ b/data/lib/queries.js
@@ -51,7 +51,7 @@ function queryInNewTab(text, component, product, equivComps) {
+ "&field0-0-2=status_whiteboard&type0-0-2=substring&value0-0-2="
+ text;
urlStr += searchText;
- postMessage(new Message("OpenURLinTab", urlStr)); // utils.js is always avaiulable
+ self.postMessage(new Message("OpenURLinTab", urlStr)); // utils.js is always avaiulable
}
}
@@ -62,7 +62,7 @@ function queryInNewTab(text, component, product, equivComps) {
function queryForSelection() {
var text = getSelection();
if (!text) {
- postMessage(new Message("GetClipboard", "queryLocal"));
+ self.postMessage(new Message("GetClipboard", "queryLocal"));
} else {
if (equivalentComponents) {
queryInNewTab(text, getComponent(), getProduct(), equivalentComponents);
@@ -87,7 +87,7 @@ function queryUpstreamCallback(text, queryUpBug) {
text = text.replace("$$$", getComponent());
}
text = encodeURIComponent(text).replace("%20","+");
- postMessage(new Message("OpenURLinTab", urlBase + text));
+ self.postMessage(new Message("OpenURLinTab", urlBase + text));
}
/**
@@ -102,7 +102,7 @@ function queryUpstream(qUpBug) {
}
var text = getSelection();
if (!text) {
- postMessage(new Message("GetClipboard", "queryUpstream"));
+ self.postMessage(new Message("GetClipboard", "queryUpstream"));
}
else {
queryUpstreamCallback(text, qUpBug);