Difference between revisions of "HD Button Remove"

From James Dooley's Wiki
Jump to: navigation, search
(Created page with "==Overview== Cleans up HD keyword button clutter. ==Script== <code>[javascript,n] // ==UserScript== // @name Button Remover // @namespace http://jamesdooley.us ...")
 
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
[[Category:GreaseMonkey]]
 
==Overview==
 
==Overview==
  
Line 5: Line 6:
 
==Script==
 
==Script==
  
<code>[javascript,n]
+
<source lang='javascript'>
 
// ==UserScript==
 
// ==UserScript==
 
// @name          Button Remover
 
// @name          Button Remover
Line 11: Line 12:
 
// @description    Get rid of button clutter
 
// @description    Get rid of button clutter
 
// @include        https://adminhd.liquidweb.com*/msgs/*
 
// @include        https://adminhd.liquidweb.com*/msgs/*
 +
// @include        https://hd.int.liquidweb.com*/msgs/*
 
// ==/UserScript==
 
// ==/UserScript==
  
Line 29: Line 31:
 
}
 
}
 
return false;
 
return false;
}</code>
+
}
 +
</source>
  
 
==What to change==
 
==What to change==
  
 
btnlist contains a list of buttons you wish to remove. The value is the text that is displayed on the button.
 
btnlist contains a list of buttons you wish to remove. The value is the text that is displayed on the button.

Latest revision as of 14:33, 25 March 2014

Overview

Cleans up HD keyword button clutter.

Script

// ==UserScript==
// @name           Button Remover
// @namespace      http://jamesdooley.us
// @description    Get rid of button clutter
// @include        https://adminhd.liquidweb.com*/msgs/*
// @include        https://hd.int.liquidweb.com*/msgs/*
// ==/UserScript==

//List of buttons by value to remove
var btnlist = new Array("besteffort","document_this","escalations","resolver-changed","storm","support_handoff","terminations");

var hdbutton = document.getElementsByTagName('button');
for (var i=0; i < hdbutton.length; i++) {
	btnremove(hdbutton[i].getAttribute('value'))
}

function btnremove (btnvalue){
	for (var b=0; b < btnlist.length; b++) {
		if (btnvalue==btnlist[b]) {
			var style = hdbutton[i].style;
			style.display = 'none';
		}
	}
	return false;
}

What to change

btnlist contains a list of buttons you wish to remove. The value is the text that is displayed on the button.