Greasy Fork is available in English.

# in Replays Script

shows number of placed blocks in replays

Stan na 18-09-2020. Zobacz najnowsza wersja.

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         # in Replays Script
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  shows number of placed blocks in replays
// @author       Oki
// @match        https://*.jstris.jezevec10.com/*
// @grant        none
// ==/UserScript==

/**************************
   # in Replays Script
**************************/

(function() {
    window.addEventListener('load', function(){

if(typeof Game == "undefined" && typeof Replayer != "undefined") {

	var website = "jstris.jezevec10.com"
	var url = window.location.href
	var parts = url.split("/")
	
	Replayer["addStat2"] = function(id,into) {
	    var apmStat = document.createElement("tr");
	    apmStat.innerHTML = '<td class="ter">#</td><td class="sval"><span id="'+id+'">0</span></td>'
	    into.appendChild(apmStat);
	}

	if(typeof getParams != "function"){var getParams=a=>{var params=a.slice(a.indexOf("(")+1);params=params.substr(0,params.indexOf(")")).split(",");return params}}
	var trim=a=>{a=a.slice(0,-1);a=a.substr(a.indexOf("{")+1);return a}
	
	if(parts[3]=="replay" && parts[2].endsWith(website) && parts.length>4){
	
	    if(parts[4]=="1v1"){
	        Replayer["addStat2"]("countElement1",document.getElementsByTagName("tbody")[0])
	        Replayer["addStat2"]("countElement2",document.getElementsByTagName("tbody")[2])
	    } else {
	        Replayer["addStat2"]("countElementP",document.getElementsByClassName("moreStats")[0])
	    }
	
	   var oldTextBar = View.prototype.updateTextBar.toString();
	   oldTextBar = trim(oldTextBar) + ';var cat2 = this.kppElement.id.slice(-1);console.log(this);eval("countElement"+cat2+"&&(countElement"+cat2+".innerHTML = this.g.placedBlocks)");'
	   View.prototype.updateTextBar = new Function(oldTextBar);

	}
}

    });
})();