Skip to content

Instantly share code, notes, and snippets.

@jmodjeska
Last active August 29, 2015 14:24
Show Gist options
  • Save jmodjeska/f4bff2bd32cfdea64463 to your computer and use it in GitHub Desktop.
Save jmodjeska/f4bff2bd32cfdea64463 to your computer and use it in GitHub Desktop.
TamperMonkey - Replace Jira Sprint Board Title
// ==UserScript==
// @name Jira Sprint Board Namer
// @version 0.1
// @description Rename Jira Sprint Boards so they show the project name
// @author jeremy@moz.com
// @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