// ==UserScript== // @name 禅道自动解决 // @namespace http://tampermonkey.net/ // @version 0.3 // @description try to take over the world! // @author Alex // @match http*://*/* // @grant none // @run-at document-start // ==/UserScript== (function(){ var Length = $("#historyItem li").length -1; var LastOne = $($("#historyItem li")[Length]); var status = $(LastOne).find(".item")["0"].firstChild.parentNode.childNodes[2].data; //如果有解决按钮,直接点解决 if( $(".btn.iframe.showinonlybody")[1].innerText == " 解决"){ $(".btn.iframe.showinonlybody")[1].click(); $("#modalIframe").load(function(){ $(window.frames["modalIframe"].document).find("#resolution").val("fixed"); $(window.frames["modalIframe"].document).find("#resolvedBuildBox span")[0].innerText = "Trunk"; $(window.frames["modalIframe"].document).find("#resolvedBuild").val("trunk"); $(window.frames["modalIframe"].document).find("#submit").click(); }); } //如果状态为解决,直接指派 else if(status == " 解决,方案为 "){ $(".btn.iframe")[3].click(); $("#modalIframe").load(function(){ $(window.frames["modalIframe"].document).find("#submit").click(); }); } }());
配合Chrome 浏览器插件 TamperMonkey使用