Replays On Box Score

dfsdfsdf

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           Replays On Box Score
// @namespace      robs
// @include        http://goallineblitz.com/game/game.pl?game_id=*
// @copyright      2009, pabst
// @license        (CC) Attribution Share Alike; http://creativecommons.org/licenses/by-sa/3.0/
// @version        09.02.21
// @description dfsdfsdf
// ==/UserScript==

window.setTimeout(
    function() {
        main();
    }
, 10);

function main() {
    var address = window.location.toString()+"&mode=pbp";
    getInetPage(address, run);
}

function run(address, page) {
    var div = document.createElement("div");
    div.innerHTML = page.responseText;
    //console.log(div.innerHTML);

    var plays = div.getElementsByClassName("pbp_play_row_scoring");
    var box = document.getElementsByClassName("pbp_play_row");

    var pidx = 0;
    for (var i=0; i<box.length; i++) {
        pidx = 0;
        var btime = box[i].getElementsByClassName("summary_time")[0];
        var btext = box[i].getElementsByClassName("summary_play")[0];
        for ( ; pidx<plays.length; pidx++) {
            var time = plays[pidx].getElementsByClassName("pbp_time_remaining")[0].innerHTML;
            var text = plays[pidx].getElementsByClassName("pbp_play")[0].innerHTML;
            if ((time == btime.innerHTML) && (text == btext.innerHTML)) {
                var replay = plays[pidx].getElementsByClassName("pbp_replay")[0];
                if (replay.firstChild.href != null) {
                    var a = document.createElement("a");
                    a.href = replay.firstChild.href;
                    a.innerHTML = "Replay";

                    btext.innerHTML += "&nbsp;(";
                    btext.appendChild(a);
                    btext.innerHTML += ")";
                }
                break;
            }
        }
    }
}

function getInetPage(address, func) {
    console.log("getInetPage : "+address);
    var req = new XMLHttpRequest();
	req.open( 'GET', address, true );
	req.onload = function() {
            if (this.status != 200) {
                alert("pbr gm script: Error "+this.status+" loading "+address);
            }
            else {
                console.log("loaded: "+address)
                func(address,this);
            }
	};

	req.send(null);
	return req;
}