knight / redmine designer

// ==UserScript==
// @name           redmine designer 
// @namespace      redmine
// @author 	       knight, soa_project@mail.ru
// @version 	   0.0.0.6
// @grant          GM_getResourceURL
// @description    redmine designer (оформление)
// @license 	   GNU General Public License
// @include        http://redmine.localhost.com/*
// @resource    	picDone   http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/128/Actions-dialog-ok-apply-icon.png
// @resource    	picClose  http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/128/Actions-dialog-cancel-icon.png
// @resource    	picAnswer http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/128/Actions-dialog-ok-icon.png
// @resource    	picNew     http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/128/Actions-rating-icon.png
// @require     	http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js
// ==/UserScript==





jQuery(document).ready(function()
{
    //Localization
	strDone = "Выполнен";
	strClosed = "Закрыт";
	strNew = "Новый";
	strTouched = "Назначен";
	strAnswer = "Обратная связь";

	strLocation = window.location;

	strLocation = window.location.pathname;

	var re  = new RegExp("^\/projects", "gi");
	var re2 = new RegExp("^\/issues$", "gi");
	
	
	if ( (re.exec(strLocation)) || (re2.exec(strLocation)) ){
	
    $('td[class=status]').each(function() 
        {
			if ($(this).text()==strDone)	{$(this).html( addImage("picDone", $(this).text()) );}
			if ($(this).text()==strClosed)	{$(this).html( addImage("picClose", $(this).text()) );}
			if ($(this).text()==strNew)	{$(this).html( addImage("picNew", $(this).text()) );}			
			if ($(this).text()==strTouched)	{$(this).html( addImage("picNew", $(this).text()) );}						
			if ($(this).text()==strAnswer)	{$(this).html( addImage("picAnswer", $(this).text()) );}			
        }
    );

	}
	else
	{
		$('h4').each(function() 
			{
				var h = $(this).html();
				$(this).html("<div style='background-color:yellow;' >" + h + "</div>");
			}
	);
	
	}

	
});



function addImage(imgName, Comment)
{
	return "<image alt='" + Comment + "' style='width:20px;height:20px;' src='" + GM_getResourceURL( imgName ) + "'>";
}