salesforce script

Hack cursors

目前为 2017-03-19 提交的版本,查看 最新版本

//// ==UserScript==
// @name        salesforce script
// @namespace   lilsc
// @description Hack cursors
// @homepage	https://eu4.salesforce.com
// @match	https://eu4.salesforce.com
// @version 0.0.1.20170319164635
// ==/UserScript==
table = document.querySelector('.reportTable');
everything = document.body.childNodes;
document.body.style.background="black";
document.body.style.setProperty('display', 'flex', '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();

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', 'xx-large', 'important');
	newtable[i].style.setProperty('font-family', 'Baloo', 'important');
	newtable[i].style.setProperty('color', 'black', 'important');
	newtable[i].style.setProperty('padding', '0 15px', 'important');
}
z = document.querySelectorAll('tbody td:nth-child(3)');
for (var i = 0; i < z.length; i++) {
	z[i].style.display = 'none';
}
z = document.querySelectorAll('tbody th:nth-child(3)')
for (var i = 0; i < z.length; i++) {
	z[i].style.display = 'none';
}
z = document.querySelectorAll('tbody td:first-child')
for (var i = 0; i < z.length; i++) {
	z[i].style.display = 'none';
}
z = document.querySelectorAll('tbody td.subTotal, tbody th.subTotalTitle')
for (var i = 0; i < z.length; i++) {
	z[i].style.display = 'none';
}
z = document.querySelectorAll('.grandTotal:last-child:not(.grandTotalTitle)')
for (var i = 0; i < z.length; i++) {
	z[i].insertAdjacentHTML('beforebegin',
		'<td class="nowrapCell grandTotal" align="right" style="background-color: white !important; font-size: xx-large !important; color: black !important;"></td>');
}
document.querySelector('tbody tr:nth-child(2) th:nth-child(4)').innerHTML = 'Kaputt';
document.querySelector('tbody tr:nth-child(1) th:nth-child(5)').innerHTML = 'Dials';
document.querySelector('table').insertAdjacentHTML('beforebegin', "<style>.bubble:before {content: '';    position: absolute;    bottom: -140px;    right: 0;    border-width: 0 0 140px 140px;    border-style: solid;    border-color: transparent #C91F2C;}.bubble {    position: absolute;    text-align: center; top:160px; left: 60px;   font: 48px Baloo, sans-serif;    color: #fff;    background: #C91F2C;}.bubble:after {    content: '';    position: absolute;    bottom: -140px;    right: 85px;    border-width: 0 0 140px 55px;    border-style: solid;    border-color: transparent #000;}</style><div><div class='bubble'>I'm on <span id='appointments'><span></div><img style='width:150px;height:150px;border-radius:50%;overflow:hidden;' src='https://media.licdn.com/mpr/mpr/shrinknp_400_400/AAEAAQAAAAAAAAIWAAAAJDBmMTU4MmJmLWY3MTQtNDE0Yi1hZWVjLTZiZjA2ZWIwZWEzOQ.jpg'></div>");
if (document.querySelector('tbody tr:nth-child(3) td:nth-child(5)').innerHTML[0]<2) {
	document.querySelector('#appointments').innerHTML = document.querySelector('tbody tr:nth-child(3) td:nth-child(5)').innerHTML[0] + ' appointment!!!';
}
else {
	document.querySelector('#appointments').innerHTML = document.querySelector('tbody tr:nth-child(3) td:nth-child(5)').innerHTML[0] + ' appointments!!!';

}
document.querySelector('tbody tr:last-child').style.display = 'none';
document.querySelector('.headerDark:nth-child(2)').innerHTML = '';

setTimeout(function () {
	WebFont.load({
		google: {
			families: ['Baloo']
		}
	})
}, 400)
localStorage.appointments = document.querySelector('tbody tr:nth-child(3) td:nth-child(5)').innerHTML[0];
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 = document.querySelector('tbody tr:nth-child(3) td:nth-child(7)').innerHTML[0];
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;
}