User:Mscalora/monobook.js

/*js!hint esversion: 6 */ (function { function detectMob {    var toMatch = [        /Android/i,        /webOS/i,        /iPhone/i,        /iPad/i,        /iPod/i,        /BlackBerry/i,        /Windows Phone/i    ];    return toMatch.some(function(toMatchItem) { return navigator.userAgent.match(toMatchItem); }); }

function setup { var isIPad = (!navigator.userAgent.includes('iPhone') && (typeof window.ontouchstart !== 'undefined')); iPadiPad = (!navigator.userAgent.includes('iPhone') && (typeof window.ontouchstart !== 'undefined')); iPadiPad = (!navigator.userAgent.includes('iPhone') && (typeof window.ontouchstart !== 'undefined')); iPadiPad = (!navigator.userAgent.includes('iPhone') && (typeof window.ontouchstart !== 'undefined')); iPadiPad = (!navigator.userAgent.includes('iPhone') && (typeof window.ontouchstart !== 'undefined')); iPadiPad = (!navigator.userAgent.includes('iPhone') && (typeof window.ontouchstart !== 'undefined')); iPadiPad = (!navigator.userAgent.includes('iPhone') && (typeof window.ontouchstart !== 'undefined')); iPadiPad = (!navigator.userAgent.includes('iPhone') && (typeof window.ontouchstart !== 'undefined')); if (document.body) { if (isIPad) { document.body.classList.add('scalora-mobile'); }   showMark(isIPad); return true; } return !!document.body; }

setup; var limit = 5000, start = Date.now, timer = setInterval(function{     if (setup || (Date.now-start>limit)) {      	clearInterval(timer);      	console.log("SCALORA: took " + (Date.now-start) + "ms");      }    }, 250); function showMark(isIPad) { console.log('SALORA: showMark ' + (isIPad ? 'iPad' : 'not iPad')); document.body.insertAdjacentHTML('afterbegin', 		' '+		'  .scalora-notice {'+		'     background: ' + (isIPad ? 'limegreen;' : 'purple;')+		'    color: white;'+		'     position: fixed;'+		'     top: 16px;'+		'     right: 20px;'+		'     font-size: 12px;'+		'     z-index: 1000000000;'+        '     padding: 2px 6px 3px;'+        '     border-radius: 8px;'+		'   }'+		' '+		' installed '		); } });