diff options
author | Matěj Cepl <mcepl@redhat.com> | 2010-01-13 01:55:10 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2010-01-13 01:55:10 +0100 |
commit | 8c3b4cc06a0b1a73ef58b87ed04f1edfe9d2cf9d (patch) | |
tree | da2f7625ad2a7c55603207c899d1170be314542c | |
parent | c1e40d3c536da9c5a5ff24fe822fa083920ece63 (diff) | |
download | bugzilla-triage-8c3b4cc06a0b1a73ef58b87ed04f1edfe9d2cf9d.tar.gz |
Don't play with clipboard but fill in the fields in the open entry form on
the upstream bugzilla directly.
-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"); |