Gebruiker:Rots61/Gadget-TestGadget.js: verschil tussen versies
Naar navigatie springen
Naar zoeken springen
Regel 27: | Regel 27: | ||
if (mw.config.get('wgTitle').toLowerCase().includes('testpagina')) { |
if (mw.config.get('wgTitle').toLowerCase().includes('testpagina')) { |
||
− | $('body').on("click mousedown mouseup focus blur keydown change dblclick mousemove mouseover |
+ | $('body').on("click mousedown mouseup focus blur keydown change dblclick mousemove mouseover mousewheel keypress textInput touchstart touchmove touchend touchcancel resize scroll zoom select change submit reset",function(e){ |
− | console.log(e); |
+ | console.log(e.type); |
resetTimeout(); |
resetTimeout(); |
||
}); |
}); |
Versie van 16 jun 2023 16:10
// Test voor het maken van tijd-statistieken
var titelnummerTS = 0;
var secondenTS = 0;
var intervalX;
var timeoutTimer = 60;
var printedvalues = 'secondenTS';
function TS () {
console.log(eval(printedvalues));
if (document.visibilityState !== 'hidden' && timeoutTimer !== 0) {
secondenTS += 1;
timeoutTimer -= 1;
if ((secondenTS % 10) === 0) {
titelnummerTS += 1;
uploadTS();
}
}
}
function uploadTS () {
document.title = titelnummerTS;
}
function resetTimeout() {
timeoutTimer = 60;
}
if (mw.config.get('wgTitle').toLowerCase().includes('testpagina')) {
$('body').on("click mousedown mouseup focus blur keydown change dblclick mousemove mouseover mousewheel keypress textInput touchstart touchmove touchend touchcancel resize scroll zoom select change submit reset",function(e){
console.log(e.type);
resetTimeout();
});
setInterval(TS, 1000);
}