Last active
January 16, 2017 09:06
-
-
Save mephisto41/bc5cc50ccb21fafc8fc353a88375b1cc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Get Wiki format | |
// @namespace bugzilla | |
// @include https://bugzilla.mozilla.org/show_bug.cgi?id=* | |
// @version 1 | |
// @grant GM_setClipboard | |
// ==/UserScript== | |
var title = document.getElementById("mode-container"); | |
var button = document.createElement("button"); | |
button.type = "button"; | |
button.innerHTML = "Copy for Wiki" | |
button.className = "major"; | |
title.insertBefore(button, title.firstChild); | |
button.onclick = function(e) { | |
var bugid = document.getElementById("this-bug").innerText; | |
var bugdesc = document.getElementById("field-value-short_desc").innerText; | |
bugid = bugid.replace(/\s/g, '|') | |
var res = "* {{" + bugid + "}} - " + bugdesc; | |
// console.log(res) | |
GM_setClipboard (res); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment