X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=static%2Fstatic%2Fexpert.js;fp=static%2Fstatic%2Fexpert.js;h=a4d14acac95b41e0fbaabbfb335749e7399b6362;hp=0000000000000000000000000000000000000000;hb=3c851b6824c0f54c9082640c4f83e453bbecbb6a;hpb=ce8b9c388ddaf73c6b35b7ece7fcdbf8618aee9f diff --git a/static/static/expert.js b/static/static/expert.js new file mode 100644 index 00000000..a4d14aca --- /dev/null +++ b/static/static/expert.js @@ -0,0 +1,32 @@ +(function() { + function showExpert(isExpert) + { + var elements = document.getElementsByClassName("expert"); + for(var i = 0; elements.length > i; i++) + { + if(!isExpert) { + elements[i].setAttribute("class","expert experthidden"); + } else { + elements[i].setAttribute("class","expert"); + } + } + } + function init(){ + showExpert(false); + var expert = document.getElementById("expertbox"); + if(expert !== null) { + expert.onchange = (function(expert){return function(){showExpert(expert.checked)}})(expert); + } + } + (function(oldLoad) { + if (oldLoad == undefined) { + window.onload = init; + } else { + window.onload = function() { + init(); + oldLoad(); + } + } + })(window.onload); + +})();