We have a Lore FAQ page. If you have Story/Lore related questions - make sure to check it out!
Difference between revisions of "MediaWiki:Common.js"
From The Ark: NieR Automata Lore
Line 1: | Line 1: | ||
jQuery(document).ready( function( $ ) { | jQuery(document).ready( function( $ ) { | ||
+ | |||
+ | $(#rss-reddit-username).each(function() { | ||
+ | var r = $(this).html().replace(/https:.* - /,"") | ||
+ | $(this).html(r) | ||
+ | }); | ||
+ | |||
$('td[data-sort-value]').each(function() { | $('td[data-sort-value]').each(function() { | ||
var value = $(this).attr('data-sort-value') | var value = $(this).attr('data-sort-value') | ||
Line 11: | Line 17: | ||
}); | }); | ||
− | + | function getRandomColor() { | |
− | + | var letters = 'BCDEF'.split(''); | |
− | + | var color = '#'; | |
− | + | for (var i = 0; i < 6; i++ ) { | |
− | + | color += letters[Math.floor(Math.random() * letters.length)]; | |
− | + | } | |
− | + | return color; | |
− | + | } |
Revision as of 22:07, 3 October 2017
jQuery(document).ready( function( $ ) { $(#rss-reddit-username).each(function() { var r = $(this).html().replace(/https:.* - /,"") $(this).html(r) }); $('td[data-sort-value]').each(function() { var value = $(this).attr('data-sort-value') color = getRandomColor() $('td[data-sort-value]').each(function() { if (value == $(this).attr('data-sort-value')) { $(this).css("background-color", color) } }); }); }); function getRandomColor() { var letters = 'BCDEF'.split(''); var color = '#'; for (var i = 0; i < 6; i++ ) { color += letters[Math.floor(Math.random() * letters.length)]; } return color; }