Make JIRA Ticket Links Open Detailed View

Clicking a ticket id on a board opens the detailed ticket view in a new tab

目前为 2016-01-24 提交的版本。查看 最新版本

// ==UserScript==
// @name        Make JIRA Ticket Links Open Detailed View
// @namespace   chriskim06
// @description Clicking a ticket id on a board opens the detailed ticket view in a new tab
// @include     https://*jira*com/secure/*Board*
// @require     http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js
// @require     https://greasyfork.org/scripts/5392-waitforkeyelements/code/WaitForKeyElements.js?version=19641
// @version     1.1.2
// @grant       none
// @locale      en
// ==/UserScript==

this.$ = this.jQuery = jQuery.noConflict(true);

waitForKeyElements(".js-key-link", addOnClick);

function addOnClick(jNode) {
  console.log("JNODE: " + jNode.tagName);
  jNode.setAttribute("onclick", "window.open('" + jNode.getAttribute("href") + "'); return false;");
  jNode.setAttribute("target", "_blank");
//  var tickets = document.getElementsByClassName("js-key-link");
//  for (var i = 0; i < tickets.length; i++) {
//    tickets[i].setAttribute("onclick", "window.open('" + tickets[i].getAttribute("href") + "'); return false;");
//    tickets[i].setAttribute("target", "_blank");
//  }
}