League of Legends Community
12345 ... 10

League of Legends Community (http://forums.na.leagueoflegends.com/board/index.php)
-   Tribunal Ban Inquiries (http://forums.na.leagueoflegends.com/board/forumdisplay.php?f=41)
-   -   Bookmarklet: Change enemy names to black (Colorblind Option) (http://forums.na.leagueoflegends.com/board/showthread.php?t=804001)

Velkorious 06-01-2011 02:06 PM

Bookmarklet: Change enemy names to black (Colorblind Option)
 
1 Attachment(s)
I read a few threads about how colorblind users have difficulty distinguishing enemy and friendly players in the tribunal chat log, so I made a quick bookmarklet that changes enemy names to black. Not the most convenient solution, but there's nothing else yet.


To Install the Bookmarklet

1. In your browser, make a new bookmark, name it anything
2. Copy this text into the address box:
Quote:

javascript:(function(){var colorName = "black"; var styleText = ".enemy {color:" + colorName + " !important;}";styleElement = document.createElement("style");styleElement.type = "text/css";if (styleElement.styleSheet) {styleElement.styleSheet.cssText = styleText;} else {styleElement.appendChild(document.createTextNode( styleText)); } document.getElementsByTagName("head")[0].appendChild(styleElement);})();
3. Save the bookmark
4. When you're viewing a tribunal case, click the bookmark. It scans the page for enemy names and changes their color to black.


Greasemonkey Version

Thanks to FrankWest for the original GreaseMonkey script, which I've updated. If you install the GreaseMonkey addon for your web browser and add this User Script, it will change the names automatically.

Quote:

// ==UserScript==
// @name enemy names in black
// @namespace http://
// @include http://na.leagueoflegends.com/tribunal/*
// @include http://euw.leagueoflegends.com/tribunal/*
// @include http://eune.leagueoflegends.com/tribunal/*
// @version 1
// ==/UserScript==
var colorName = "black";
var styleText = ".enemy {color:" + colorName + " !important;}";
styleElement = document.createElement("style");
styleElement.type = "text/css";
if (styleElement.styleSheet)
{
styleElement.styleSheet.cssText = styleText;
}
else
{
styleElement.appendChild(document.createTextNode( styleText));
}
document.getElementsByTagName("head")[0].appendChild(styleElement);


Tested in Firefox, Chrome, Safari, and Internet Explorer


EDIT: Fixed so that you don't have to reclick when viewing a different game.
EDIT2: If you want to change it to something other than black, just edit the bold part of either code. Most common colors should work fine (blue, orange, purple, etc). Just make sure you don't accidentally delete the quotation marks.
EDIT3: Updated for May 2012 tribunal changes

FrankWest 06-01-2011 02:25 PM

That's really clever!

I copied your code and made it into a GreaseMonkey script, so it can run automatically (in Firefox, with Greasemonkey installed.)
Code:

// ==UserScript==
// @name          EnemyNamesInBlack
// @namespace      http://
// @include        http://www.leagueoflegends.com/tribunal/case/*
// ==/UserScript==
var arr=document.getElementsByTagName("span");
for(var i=0;i< arr.length;i++)
    if(arr[i].className==="chat_user enemy")
        arr[i].style.color = "black";


Velkorious 06-02-2011 06:48 AM

Page 3 bump.

Llwynn 06-02-2011 06:56 AM

XD I could use this just to keep things ordered without being colorblind. Thanks for this.

Wonderbolts 06-06-2011 09:00 PM

cool, this thread became a sticky

tomtomkenobi 06-07-2011 02:43 AM

*tear* I love this community

Velkorious 06-07-2011 07:55 AM

Oh wow a sticky! Thanks!

sciyth 06-07-2011 12:00 PM

nice job velkor. you are the customizing master

Rebel Cardinal 06-07-2011 01:14 PM

+1 Thoughtful OP.

mpank 06-07-2011 01:15 PM

Good to see that people care about comunity! +1


All times are GMT -8. The time now is 10:11 AM.
12345 ... 10


(c) 2008 Riot Games Inc