Last active
August 29, 2015 14:24
-
-
Save jmodjeska/f4bff2bd32cfdea64463 to your computer and use it in GitHub Desktop.
TamperMonkey - Replace Jira Sprint Board Title
This file contains 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 Jira Sprint Board Namer | |
// @version 0.1 | |
// @description Rename Jira Sprint Boards so they show the project name | |
// @author [email protected] | |
// @match *://*/*RapidBoard* | |
// @grant none | |
// ==/UserScript== | |
function callback(){ | |
return function(){ | |
var boardType = document.getElementById("ghx-board-name").innerText; | |
if(boardType.indexOf('|') === -1) { | |
var boardTitle = document.getElementsByTagName("h1")[1].innerText; | |
document.getElementById("ghx-board-name").innerHTML = boardTitle + ' | ' + boardType; | |
} | |
} | |
} | |
// http://stackoverflow.com/questions/18989345/ | |
var fireOnHashChangesToo = false; | |
var pageURLCheckTimer = setInterval ( | |
function () { | |
if ( this.lastPathStr !== location.pathname | |
|| this.lastQueryStr !== location.search | |
|| (fireOnHashChangesToo && this.lastHashStr !== location.hash) | |
) { | |
this.lastPathStr = location.pathname; | |
this.lastQueryStr = location.search; | |
this.lastHashStr = location.hash; | |
setTimeout(callback(), 500); | |
} | |
} | |
, 111 | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment