litesoft
@ 922
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
"use strict"; function updateCookie( name ) { var zName = name; var zValue = name; if (name.indexOf('!') == 0) { zName = name.substring(1); zValue = ";expires=Thu, 01 Jan 1970 00:00:01 GMT"; } var zCookie = zName + "=" + zValue; document.cookie = zCookie; } function buttonUpdateCookie( name ) { updateCookie(name); location.reload(); } function addHtml( pHtml ) { var newdiv = document.createElement('div'); newdiv.innerHTML = pHtml; var zDiv = document.getElementById("insertHere"); zDiv.appendChild(newdiv); } function addCookieButton( name ) { addHtml('<button onclick=\'buttonUpdateCookie("' + name + '")\'>' + name + '</button>'); } function getArea() { var zWidth = window.innerWidth; var zHeight = window.innerHeight; var zArea = (zWidth | 0) * (zHeight | 0); // alert("("+zWidth+" x "+zHeight+") =>" + zArea); return zArea; } function isNotSmall() { return (((1024 - 40) * (600 - 40)) <= getArea()); } function isHuge() { return (5000000 <= getArea()); } updateCookie("!Restart"); updateCookie("!ShutDown"); |