Created
April 26, 2015 19:51
-
-
Save gforcada/31555f15d7b04a3ede04 to your computer and use it in GitHub Desktop.
Easily close dev.plone.org tickets as invalid with greasemonkey
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 dev.plone.org close bug as invalid | |
// @namespace plone | |
// @include https://dev.plone.org/ticket/* | |
// @version 1 | |
// @grant none | |
// @run-at document-end | |
// ==/UserScript== | |
$(document).ready(function () { | |
var status, status_text, button; | |
status = document.getElementsByClassName("status")[0]; | |
status_text = status.childNodes[0].nodeValue; | |
if (status_text.search("invalid") === -1) { | |
// open the 'modify ticket form' | |
document.getElementById("no2").click(); | |
// mark as resolved | |
document.getElementById("action_resolve").checked = true; | |
document.getElementById("action_resolve").click(); | |
// mark as invalid | |
document.getElementById("action_resolve_resolve_resolution").selectedIndex = "2"; | |
// ask for confirmation | |
if (confirm('Close as invalid?')) { | |
button = document.getElementsByName("submit")[0]; | |
button.click(); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment