some little script

Hack cursors

Verze ze dne 22. 03. 2017. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

//// ==UserScript==
// @name        some little script
// @namespace   lilsc
// @description Hack cursors
// @homepage	https://eu4.salesforce.com
// @match		https://eu4.salesforce.com
// @include		/^https://eu4.salesforce.com*
// @version 0.0.1.20170322172554
// ==/UserScript==

document.body.innerHTML = document.body.innerHTML.replace(/-/g, 'Kaputt');
document.body.innerHTML = document.body.innerHTML.replace(/Cold Caller/g, '');
Element.prototype.remove = function() {
	this.parentElement.removeChild(this);
}
NodeList.prototype.remove = HTMLCollection.prototype.remove = function() {
	for(var i = this.length - 1; i >= 0; i--) {
		if(this[i] && this[i].parentElement) {
			this[i].parentElement.removeChild(this[i]);
		}
	}
}


table = document.querySelector('.reportTable');
everything = document.body.childNodes;
document.body.style.background="white";
document.body.style.setProperty('display', 'flex', 'important');
document.body.style.setProperty('flex-direction', 'column', 'important');
document.body.style.setProperty('height', '100vh', 'important');
document.body.style.setProperty('align-items', 'center', 'important');
document.body.style.setProperty('justify-content', 'center', 'important');
while(everything.length)
	document.body.removeChild(everything[0]);
document.body.append(table);

function loadfonts() {
	var script = document.createElement("script");
	script.src = "https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js";
	script.type = "text/javascript";
	document.getElementsByTagName("head")[0].appendChild(script);
}
loadfonts();
setTimeout(function () {
	WebFont.load({
		google: {
			families: ['Press Start 2P']
		}
	})
}, 400)

newtable = document.querySelectorAll('tbody *');
for (var i = 0; i < newtable.length; i++) {
	newtable[i].style.setProperty('background-color', 'white', 'important');
	newtable[i].style.setProperty('font-size', 'large', 'important');
	newtable[i].style.setProperty('font-family', '"Press Start 2P"', 'important');
	newtable[i].style.setProperty('color', 'black', 'important');
	newtable[i].style.setProperty('padding', '15px', 'important');
}
z = document.querySelectorAll('tr.headerRow:nth-child(1)');
for (var i = 0; i < z.length; i++) {
	z[i].remove();
}
// z = document.querySelectorAll('tr.grandTotalRow');
// for (var i = 0; i < z.length; i++) {
// 	z[i].remove();
// }
z = document.querySelectorAll('td.drilldown');
for (var i = 0; i < z.length; i++) {
	z[i].remove();
}
z = document.querySelectorAll('tr td:nth-child(2)');
for (var i = 0; i < z.length; i++) {
	z[i].remove();
}
z = document.querySelectorAll('br');
for (var i = 0; i < z.length; i++) {
	z[i].remove();
}
q = document.createElement('th');
t = document.createTextNode('Dials')
q.appendChild(t)
q.style.setProperty('background-color', 'white', 'important');
q.style.setProperty('font-size', 'large', 'important');
q.style.setProperty('font-family', '"Press Start 2P"', 'important');
q.style.setProperty('color', 'black', 'important');
q.style.setProperty('padding', '15px', 'important');
x = document.querySelector('tr:nth-child(1)')
x.appendChild(q)

gifcontainer = document.createElement('img')
gifcontainer.src = 'run3.gif'
gifcontainer.style.height = '100px'
gifcontainer.style.width = 'auto'
document.body.insertBefore(gifcontainer, table);





values = ['Name','Kaputt', 'Appointment', 'Brutto', 'Netto', 'Grand Total']
players = document.querySelectorAll('tr').length;
playersdata = [];
appointments = [];
netto = [];
for (var i = 1; i < players; i++) {
	playersdata.push([]);
	appointments.push([]);
	netto.push([]);
	for (var j = 0; j < 6; j++){
		if (j==5){
			playersdata[i-1].push(document.querySelectorAll('tr')[i].querySelectorAll('td')[j].querySelector('b').innerHTML);
		}
		else{
			playersdata[i-1].push(document.querySelectorAll('tr')[i].querySelectorAll('td')[j].innerHTML);
		}
		if (j==2){
			appointments[i-1].push(document.querySelectorAll('tr')[i].querySelectorAll('td')[j].innerHTML);
		}
		if (j==4){
			netto[i-1].push(document.querySelectorAll('tr')[i].querySelectorAll('td')[j].innerHTML);
		}
	}
}

localStorage.appointments = appointments;
if (typeof localStorage.appointmentsold == 'undefined') {
	localStorage.appointmentsold = localStorage.appointments;
}
if(localStorage.appointments != localStorage.appointmentsold){
	var audio = new Audio('http://themushroomkingdom.net/sounds/wav/smb/smb_stage_clear.wav');
	audio.play();
	localStorage.appointmentsold = localStorage.appointments;
}
localStorage.netto = netto;
if (typeof localStorage.nettoold == 'undefined') {
	localStorage.nettoold = localStorage.netto;
}
if(localStorage.netto != localStorage.nettoold){
	var audio = new Audio('http://themushroomkingdom.net/sounds/wav/smb/smb_1-up.wav');
	audio.play();
	localStorage.nettoold = localStorage.netto;
}