aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libbugzilla.js
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2011-05-28 13:18:44 +0200
committerMatěj Cepl <mcepl@redhat.com>2011-06-05 14:53:47 +0200
commit70800020bb6731136f1df1fd42f7de1607cd2767 (patch)
tree0f8391ba03e9edd9d6b57a00135ff45d32cc890c /lib/libbugzilla.js
parent9954df923e6b54a4cf6bf66c5eaa1306197c21bc (diff)
downloadbugzilla-triage-70800020bb6731136f1df1fd42f7de1607cd2767.tar.gz
Use new tab.attach() internal page-mod method of creating new upstream bug.
Fixes #100
Diffstat (limited to 'lib/libbugzilla.js')
-rw-r--r--lib/libbugzilla.js22
1 files changed, 14 insertions, 8 deletions
diff --git a/lib/libbugzilla.js b/lib/libbugzilla.js
index c2ee51d..b49e776 100644
--- a/lib/libbugzilla.js
+++ b/lib/libbugzilla.js
@@ -274,17 +274,23 @@ var openURLInNewTab = exports.openURLInNewTab = function openURLInNewTab(url) {
});
};
-exports.createUpstreamBug = function createUpstreamBug(urlStr, subject, comment) {
+exports.createUpstreamBug = function createUpstreamBug(urlStr, subjectStr, commentStr) {
+ var payload = JSON.stringify({
+ subject: subjectStr,
+ comment: commentStr
+ });
tabs.open({
url: urlStr,
inBackground: true,
- onReady: function (t) {
- var otherElems = t.contentDocument.forms.namedItem("Create").elements;
- // Summary
- otherElems.namedItem("short_desc").value = subject;
- // Comment
- otherElems.namedItem("comment").value = collectComments();
- t.activate();
+ onReady: function (tab) {
+ tab.attach({
+ contentScriptFile: selfMod.data.url("internalMods/createBugElsewhere.js"),
+ contentScript: "fillTheForm(" + payload + ");",
+ onMessage: function(str) {
+ tab.activate();
+ }
+ });
+
}
});
};