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
1 lines (1 loc) · 1.31 KB
/
Copy pathscript.min.js
File metadata and controls
1 lines (1 loc) · 1.31 KB
1
(function(){function o(){for(var r=document.getElementsByTagName("input"),i=0;i<r.length;i++)r[i].type==="checkbox"&&n.push(r[i]);t=document.getElementsByTagName("em")}function s(){var l,s,o,a,c;for(f=document.getElementsByTagName("mark")[0],i=document.getElementsByTagName("progress")[0],e=i.firstElementChild||i.firstChild,r=location.pathname.substr(1),l=0,s=0;s<n.length;s++)o=n[s],o.onchange=u,Modernizr.localstorage&&(a=localStorage.getItem(r+o.id)==="true",o.checked=a),o.parentNode.className!=="optional"&&l++;for(c=0;c<t.length;c++)t[c].onclick=h;i.max=l}function h(n){var r,u,i,f;for(n||(n=window.event),r=n.target||n.srcElement,u=r.nextElementSibling||r.nextSibling,u.style.maxHeight=u.style.maxHeight!=="100px"?"100px":"0",i=0;i<t.length;i++)t[i]!==r&&(f=t[i].nextElementSibling||t[i].nextSibling,f.style.maxHeight="0")}function u(){for(var u=0,e=0,t,i=0;i<n.length;i++)t=n[i],localStorage&&localStorage.setItem(r+t.id,t.checked),t.parentNode.className!=="optional"?t.checked&&u++:t.checked&&e++;f.innerHTML=e.toString(),c(u)}function c(n){i.value=n;var t=parseInt(i.max,10);e.style.width=n*100/t+"%"}function l(){document.getElementById("clearall").onclick=function(){for(var t=0;t<n.length;t++)n[t].checked=!1;return localStorage&&localStorage.clear(),u(),!1}}var n=[],t=[],i,f,e,r;window.onload=function(){o(),s(),u(),l()}})();