Skip to content

Instantly share code, notes, and snippets.

@say2joe
Last active November 21, 2018 17:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save say2joe/1155242 to your computer and use it in GitHub Desktop.
Save say2joe/1155242 to your computer and use it in GitHub Desktop.
Rally Scrum Tool: Task Creator Bookmarklet
javascript:if(!Custom)var Custom={};if(!Custom.UI)Custom.UI={};Custom.UI.TaskSelection=(function(){var userOptions={id:"rctsDD",css:"position: absolute;",options:["Implement Java code for task","Implement JS changes for task","Implement CSS changes for task","Implement XSL changes for task","Code Review (if needed) for task","JUnit Testing for task","Test Case Update for task","Test Case Review for task","Test Case Creation for task","Test Case Execution for task"]},targetId="name0";return{DropDown:(function(opts,s){s.addEventListener("keypress",function(e){if(e.keyCode==13)this.hide();},false);s.addEventListener("change",this.hide,false);for(var i=0,l=opts.options.length;i<l;i++){s.add(new Option(opts.options[i]),null);} with(s){id=opts.id;style.cssText=opts.css;style.display="none";size=1;} return document.body.appendChild(s);})(userOptions,document.createElement("select")),getTarget:function(){var el=(document.getElementById(targetId)||this.lkTarget);el.style.position="relative";return el;},getID:function(){var el=this.getTarget().parentNode.parentNode,nl=function(r){return(r.nl||r.attributes.getNamedItem("nl").nodeValue);};do{el=el.previousSibling;}while("TR"!=el.tagName||0!=nl(el));return(el.querySelector("td[class~='cn_workproduct.idstring0'] a").innerHTML||"task");},hide:function(){if(this.DropDown.style.display=="none")return false;this.getTarget().value=this.DropDown.value.replace("task",this.getID());this.DropDown.style.display="none";},show:function(){var dd=this.DropDown,fld=this.getTarget();dd.style.top=(fld.offsetTop+20)+"px";dd.style.left=fld.offsetLeft+"px";dd.style.display="block";this.lkTarget=fld;}};})();window.addEventListener("keyup",function(e){if(!e)e=window.event;if(!e.target)e.target=e.srcElement;if(e.keyCode==27)Custom.UI.TaskSelection.hide();else if((e.target==Custom.UI.TaskSelection.getTarget())&&(e.ctrlKey&&e.keyCode==32))Custom.UI.TaskSelection.show();},false);
/*** The following is the same code as above, only presented here unminified and unobfuscated ...
//|* Users should only have to edit the userOptions object (in the beginning of the code).
// I've created this helper script to assist with Sony's scrum grooming process (a few hours a every other week).
// A lot of the sub-tasks were repetitive and the Rally Scrum Tool isn't very customizable and I spoke up at a meeting
// ... and stupidly said "Hey! I can make this meeting go faster and fix this tool for our group!" (so I did ...)
if (!Custom) var Custom = {};
if (!Custom.UI) Custom.UI = {};
Custom.UI.TaskSelection = (function() {
var userOptions = {
id: "rctsDD",
css: "position: absolute;",
options: [
"Investigate (and fix) task",
"Implement Java code for task",
"Implement JS changes for task",
"Implement CSS changes for task",
"Implement XSL changes for task",
"JUnit Testing for task",
"Validate Fixes for task",
"Test Case Update for task",
"Test Case Review for task",
"Test Case Creation for task",
"Test Case Execution for task",
"Code Review (if needed) for task",
"Post Code Review changes (if needed) for task"
]
}, targetId = "name0";
return {
DropDown: (function(opts,s){
s.addEventListener("keypress", function(e){ if (e.keyCode == 13) Custom.UI.TaskSelection.hide(); }, false);
s.addEventListener("change", function(){ Custom.UI.TaskSelection.hide(); }, false);
for (var i=0, l=opts.options.length; i<l; i++) { s.add(new Option(opts.options[i]),null); }
with (s) { id = opts.id; style.cssText = opts.css; style.display = "none"; size = 1; }
return document.body.appendChild(s);
})(userOptions, document.createElement("select")
),
getTarget: function() {
var el = (document.getElementById(targetId) || this.lkTarget);
el.style.position = "relative"; return el;
},
getID: function() {
var el = this.getTarget().parentNode.parentNode,
nl = function(r){ return (r.nl || r.attributes.getNamedItem("nl").nodeValue); };
do { el = el.previousSibling; } while ("TR" != el.tagName || 0 != nl(el));
return (el.querySelector("td[class~='cn_workproduct.idstring0'] a").innerHTML || "task");
},
hide: function() {
if (!this.DropDown.length) return;
this.DropDown.style.display = "none";
this.getTarget().value = this.DropDown.value.replace("task",this.getID());
},
show: function() {
var dd = this.DropDown, fld = this.getTarget();
dd.style.top = (fld.offsetTop + 20) + "px";
dd.style.left = fld.offsetLeft + "px";
dd.style.display = "block";
this.lkTarget = fld;
}
};
})();
window.addEventListener("keyup", function(e){
if (!e) e = window.event;
if (!e.target) e.target = e.srcElement;
if (e.keyCode == 27) Custom.UI.TaskSelection.hide();
else if ((e.target == Custom.UI.TaskSelection.getTarget()) && (e.ctrlKey && e.keyCode == 32)) Custom.UI.TaskSelection.show();
}, false);
***/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment