User:M28k/monobook.js

class BodyTagger { constructor { this.tagged = false; }	tag { if (!this.tagged) { this.tagged = true; document.body.classList.add('onShiftPressed'); }	}	untag { if (this.tagged) { document.body.classList.remove('onShiftPressed'); this.tagged = false; }	} }

function runBodyTagger { const SHIFT_LEFT = "ShiftLeft"; const bodyTagger = new BodyTagger;

document.body.addEventListener('keydown', event => {		if (event.code === SHIFT_LEFT) {			bodyTagger.tag;		}		}); document.body.addEventListener('keyup', event => {		if (event.code === SHIFT_LEFT) {			bodyTagger.untag;		}		}); }

$(document).ready(runBodyTagger);