Add Bars To GFAQS Votals

adds bars to gamefaqs votals screen

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Add Bars To GFAQS Votals
// @namespace    http://foolmoron.io
// @version      0.2
// @description  adds bars to gamefaqs votals screen
// @author       @foolmoron
// @match        http://*.gamefaqs.com/features/bge20_vote
// @grant        none
// ==/UserScript==

$(function() {
	BAR_HEIGHT = '20px';
	BORDER_RADIUS = '10px';
	FIRST_COLOR = '#3951C6';
	SECOND_COLOR = '#28398A';
	
	// kill ugly bars
	$('.battle_results').css('background-image', '')

    // add nice bars
    var detailedResults = $('.detailed_results');
    for (var i = 0; i < detailedResults.length; i++) {
        var detailedResult = detailedResults.eq(i);
        var firstPerc = $('.battle_results', detailedResult.siblings('.battler_box')[0]).text();
        var secondPerc = $('.battle_results', detailedResult.siblings('.battler_box')[1]).text();
        detailedResult.before('\
        	<div style="height: ' + BAR_HEIGHT + '; padding: 0px 4px;">\
        		<div style="float: right; height: 100%; background-color: ' + SECOND_COLOR + '; width: ' + secondPerc + '; border-top-right-radius: ' + BORDER_RADIUS + '; border-bottom-right-radius: ' + BORDER_RADIUS + '; border-left: 1px solid #ADD8E6;"></div>\
        		<div style="float: right; height: 100%; background-color: ' + FIRST_COLOR + '; width: ' + firstPerc + '; border-top-left-radius: ' + BORDER_RADIUS + '; border-bottom-left-radius: ' + BORDER_RADIUS + '; border-right: 1px solid #ADD8E6;"></div>\
    		</div>\
		');
    }
});