Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
<script>

// https://www.w3schools.com/cssref/css_colors.asp

AJS.$(document).ready(function(){

var elements = document.getElementsByClassName("trigger-label")

  for (var i = 0; i < elements.length; i++) {
  
    //alert (elements[i])
	
	switch(elements[i].innerHTML.toLowerCase()) {
  
  		case "close":
		case "close issue":
    		elements[i].parentNode.style.backgroundColor="CornflowerBlue";
			elements[i].parentNode.style.color="White";
    		break;
			
		case "cancel":
    		elements[i].parentNode.style.backgroundColor="CornflowerBlue";
			elements[i].parentNode.style.color="White";
    		break;
			
		case "resolve":
		case "resolve issue":
    		elements[i].parentNode.style.backgroundColor="LightGreen";
			//elements[i].parentNode.style.color="White";
    		break;
			
		case "submit for review":
    		elements[i].parentNode.style.backgroundColor="LightGreen";
			//elements[i].parentNode.style.color="White";
    		break;
			
		case "submit for authorization":
    		elements[i].parentNode.style.backgroundColor="LightGreen";
			elements[i].parentNode.style.color="White";
    		break;
  
  		case "set in progress":
    		elements[i].parentNode.style.backgroundColor="Green";
			elements[i].parentNode.style.color="White";
    		break;
			
		case "change priority":
    		elements[i].parentNode.style.backgroundColor="CadetBlue";
			elements[i].parentNode.style.color="White";
    		break;
			
		//case "bounce to customer":
    	//	elements[i].parentNode.style.backgroundColor="LightSalmon";
			//elements[i].parentNode.style.color="White";
    	//	break;
			
		//case "assess issue":
    	//	elements[i].parentNode.style.backgroundColor="PaleGoldenRod";
			//elements[i].parentNode.style.color="White";
    	//	break;
		
		case "bounce to customer":
    		elements[i].parentNode.style.backgroundColor="PapayaWhip";
			//elements[i].parentNode.style.color="White";
    		break;
		
		
	}
	
	  }   
 });
</script>