Last active
December 25, 2015 21:19
-
-
Save agateau/7042234 to your computer and use it in GitHub Desktop.
Greasemonkey script to make it easier to copy'n'paste review id
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 ReviewBoard - easy-to-copy review id | |
// @namespace http://agateau.com/ | |
// @description Insert the review id in a readonly input field next to the star image, making it easier to copy | |
// @include https://*/r/* | |
// @grant none | |
// @version 1 | |
// ==/UserScript== | |
var elements = document.getElementsByClassName("star"); | |
var star = elements[0]; | |
var reviewId = star.getAttribute("data-object-id"); | |
var label = document.createElement("span"); | |
label.innerHTML = "Review <u>I</u>D:"; | |
label.style = "padding-left: 1em"; | |
var input = document.createElement("input"); | |
input.type = "text"; | |
input.value = reviewId; | |
input.readOnly = true; | |
input.accessKey = "i"; | |
input.onfocus = function() { this.select() }; | |
star.parentElement.appendChild(label); | |
star.parentElement.appendChild(input); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment