Created
January 10, 2012 23:52
-
-
Save potch/1591990 to your computer and use it in GitHub Desktop.
Revisions
-
potch revised this gist
Jan 11, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ Bugzilla Color Friend! ====================== A `dotjs <https://addons.mozilla.org/en-US/firefox/addon/dotjs/>`_ script to add some color to Bugzilla. It's The Worst!™ -
potch revised this gist
Jan 11, 2012 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ Bugzilla Color Friend! ====================== A `dotjs <https://addons.mozilla.org/en-US/firefox/addon/dotjs/>` script to add some color to Bugzilla. It's The Worst!™ -
potch revised this gist
Jan 11, 2012 . 1 changed file with 8 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,6 +6,11 @@ function textColor(bg) { return yiq >= 128 ? "black" : "white"; } function bgColor(el, i) { var bn = $("a", el).eq(i).text().match(/\d+/)[0]; return ("000000" + bn).substr(-6); } var tds = $('.bz_id_column'), head = $('.bz_alias_short_desc_container'), start = 0, @@ -15,7 +20,7 @@ function doChunk() { for (i=start; i<start+20; i++) { el = tds[i]; if (!el) break; var c = bgColor(el, 0); $(el).css('background-color', "#" + c); $("a", $(el)).css('color', textColor(c)); } @@ -28,6 +33,6 @@ if (tds.length) { } if (head.length) { var c = bgColor(head, 1); $("body").css('background-color', "#" + c); } -
potch revised this gist
Jan 11, 2012 . 1 changed file with 14 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,12 @@ function textColor(bg) { var yiq = (r * 299 + g * 587 + b * 114) / 1000; return yiq >= 128 ? "black" : "white"; } var tds = $('.bz_id_column'), head = $('.bz_alias_short_desc_container'), start = 0, i; function doChunk() { for (i=start; i<start+20; i++) { el = tds[i]; @@ -18,4 +23,11 @@ function doChunk() { if (i<tds.length) setTimeout(doChunk, 0); } if (tds.length) { doChunk(); } if (head.length) { var c = ("000000" + $.trim($("a", head).eq(1).text())).substr(-6); $("body").css('background-color', "#" + c); } -
potch revised this gist
Jan 11, 2012 . 1 changed file with 14 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,8 +5,17 @@ function textColor(bg) { var yiq = (r * 299 + g * 587 + b * 114) / 1000; return yiq >= 128 ? "black" : "white"; } var tds = $('.bz_id_column'), start=0, i; function doChunk() { for (i=start; i<start+20; i++) { el = tds[i]; if (!el) break; var c = ("000000" + $.trim($("a", el).text())).substr(-6); $(el).css('background-color', "#" + c); $("a", $(el)).css('color', textColor(c)); } start = i; if (i<tds.length) setTimeout(doChunk, 0); } doChunk(); -
potch revised this gist
Jan 10, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ function textColor(bg) { return yiq >= 128 ? "black" : "white"; } $('.bz_id_column').each(function() { var c = ("000000" + $.trim($("a", this).text())).substr(-6); $(this).css('background-color', "#" + c); $("a", $(this)).css('color', textColor(c)); }); -
potch created this gist
Jan 10, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ function textColor(bg) { var r = parseInt(bg.substr(0,2),16), g = parseInt(bg.substr(2,2),16), b = parseInt(bg.substr(4,2),16); var yiq = (r * 299 + g * 587 + b * 114) / 1000; return yiq >= 128 ? "black" : "white"; } $('.bz_id_column').each(function() { var c = $.trim($(this).text()); $(this).css('background-color', "#" + c); $("a", $(this)).css('color', textColor(c)); });