diff options
Diffstat (limited to 'bugzillaBugTriage.js')
-rw-r--r-- | bugzillaBugTriage.js | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/bugzillaBugTriage.js b/bugzillaBugTriage.js index d262d33..5fe6bc2 100644 --- a/bugzillaBugTriage.js +++ b/bugzillaBugTriage.js @@ -1078,17 +1078,24 @@ BzPage.prototype.sendBugUpstream = function() { var url = filterByRegexp(upstreamBugzillasArray, this.getOptionValue("component")); - var text = this.dok.getElementById("short_desc_nonedit_display"). - textContent.trim() + "\n\n"; - text += this.collectComments(); - jetpack.clipboard.set(text); var ret = jetpack.tabs.open(url); - // TODO ret is yet another jetpack.tabs member, so - // ret.contentDocument should work. We can directly - // prepopulate b.m.o form instead of messing with - // the clipboard. - console.log("opening new tab returned"); - console.log(ret); + var that = this; + console.log("Setting up load listener"); + jetpack.tabs.onReady(function() { + var otherDoc = ret.contentDocument; + console.log("otherDoc"); + console.log(otherDoc); + var otherElems = otherDoc.forms.namedItem("Create").elements; + otherElems.namedItem("short_desc").value = + that.dok.getElementById("short_desc_nonedit_display"). + textContent.trim(); + otherElems.namedItem("comment").value = that.collectComments(); + ret.focused(); + + console.log("opening new tab returned"); + console.log(ret); + + }); }; /** @@ -1639,7 +1646,6 @@ function BzPage(doc) { var that = this; this.originalButton = this.dok.getElementById("commit"); - console.log(this.dok.querySelector("#header ul.links li:last-of-type")); var loginArr = this.dok. querySelector("#header ul.links li:last-of-type"). textContent.split("\n"); |