Gebruiker:Rots61/Gadget-TestGadget.js

Uit Wikikids
Naar navigatie springen Naar zoeken springen

Let op! Nadat je de veranderingen hebt opgeslagen, moet je de cache van je browser nog legen om ze daadwerkelijk te zien.

Mozilla (incl. Firefox) ctrl-shift-r
IE ctrl-f5
Opera f5
Safari cmd-r
Konqueror f5
/*
// Test voor het maken van tijd-statistieken
var titelnummerTS = 0;
var secondenTS = 0;
var timeoutTimer = 40;

function TS () {
	console.log(secondenTS, timeoutTimer);
	if (document.visibilityState !== 'hidden' && timeoutTimer !== 0) {
		secondenTS += 1;
		timeoutTimer -= 1;
		if ((secondenTS % 10) === 0) {
			titelnummerTS += 1;
			uploadTS();
		}
	} else if (document.visibilityState === 'hidden') {
		if (timeoutTimer < 25) {
			timeoutTimer = 25; 
		}
	}
}

function uploadTS () {
	document.title = titelnummerTS;
}

function resetTimeout() {
	timeoutTimer = 40; 
}

if (mw.config.get('wgTitle').toLowerCase().includes('testpagina')) {
	$('body').on("click mousedown mouseup focus blur change mousemove mouseover mousewheel keypress touchstart touchmove touchend touchcancel resize scroll select",function(e){
		console.log(e.type);
		resetTimeout();
	}); 
	setInterval(TS, 1000);
}
*/
Afkomstig van Wikikids , de interactieve Nederlandstalige Internet-encyclopedie voor en door kinderen. "https://wikikids.nl/index.php?title=Gebruiker:Rots61/Gadget-TestGadget.js&oldid=802149"