forked from vaishaksuresh/webdevchecklist.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.min.js
More file actions
2 lines (2 loc) · 2.59 KB
/
Copy pathscript.min.js
File metadata and controls
2 lines (2 loc) · 2.59 KB
1
2
(function(){function w(){for(var i=document.getElementsByTagName("input"),t=0;t<i.length;t++)i[t].type==="checkbox"&&r.push(i[t]);n=document.getElementsByTagName("em"),e=r.slice(0),v(e),o=Array.prototype.slice.call(n),v(o)}function b(){var v,e,i,p,o,h,y;for(l=document.getElementsByTagName("mark")[0],f=document.getElementsByTagName("progress")[0],u=document.getElementsByTagName("nav")[0],a=f.firstElementChild||f.firstChild,t=location.pathname.substr(1),u&&((u.firstElementChild||u.firstChild).onclick=nt),v=0,e=0;e<r.length;e++)i=r[e],i.onchange=s,Modernizr.localstorage&&(p=localStorage.getItem(t+i.id)==="true",i.checked=p),i.parentNode.className!=="optional"&&v++;for(o=0;o<n.length;o++)n[o].onclick=k;for(h=0;h<n.length;h++)y=n[h],Modernizr.localstorage&&localStorage.getItem(t+y.id)&&c(y);f.max=v,t&&t.endsWith("demo")&&tt()}function k(r){var u;for(r||(r=window.event),u=r.target||r.srcElement,c(u),i=0;i<n.length;i++)u=n[i],u.className==="open"?localStorage&&localStorage.setItem(t+u.id,!0):localStorage&&localStorage.removeItem(t+u.id)}function c(t){for(var r=t.nextElementSibling||t.nextSibling,u,i=0;i<n.length;i++)n[i]!==t&&(u=n[i].nextElementSibling||n[i].nextSibling,u.style.maxHeight="0"),n[i].className="";r.style.maxHeight!=="100px"?(r.style.maxHeight="100px",t.className="open"):r.style.maxHeight="0"}function s(){for(var u=0,f=0,n,i=0;i<r.length;i++)n=r[i],n.checked?localStorage&&localStorage.setItem(t+n.id,n.checked):localStorage&&localStorage.removeItem(t+n.id),n.parentNode.className!=="optional"?n.checked&&u++:n.checked&&f++;l.innerHTML=f.toString(),d(u)}function d(n){f.value=n;var t=parseInt(f.max,10);a.style.width=n*100/t+"%"}function g(){document.getElementById("reset").onclick=function(){return h(),!1}}function h(){for(var u,i=0;i<r.length;i++)r[i].checked=!1,Modernizr.localstorage&&localStorage.removeItem(t+r[i].id);for(u=0;u<n.length;u++)Modernizr.localstorage&&localStorage.removeItem(t+n[u].id);s()}function nt(n){n||(n=window.event);var t=n.target||n.srcElement;u.className=u.className!=="open"?"open":""}function v(n){var t=n.length,i,r,u;if(t==0)return!1;while(--t)i=Math.floor(Math.random()*(t+1)),r=n[t],u=n[i],n[t]=u,n[i]=r}function tt(){y(0,e),p(0,o)}function y(n,t){n==0&&h(),n>t.length+5&&(n=0,h(),t=e),t[n]&&(t[n].checked=!0,s()),setTimeout(function(){y(++n,t)},200)}function p(n,t){n>o.length-1&&(n=0,h()),c(t[n]),setTimeout(function(){p(++n,t)},2e3)}var r=[],e=[],n=[],o=[],f,l,a,t,u;window.onload=function(){w(),b(),s(),g(),localStorage.length===0&&n[0].click()},String.prototype.endsWith=function(n){return this.indexOf(n,this.length-n.length)!==-1}})();
//@ sourceMappingURL=script.min.js.map