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.21 KB
/
Copy pathscript.min.js
File metadata and controls
1 lines (1 loc) · 1.21 KB
1
(function(){function e(){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 o(){var c,o,e,l,h;for(u=document.getElementsByTagName("mark")[0],i=document.getElementsByTagName("progress")[0],f=i.firstElementChild||i.firstChild,c=0,o=0;o<n.length;o++)e=n[o],l=localStorage.getItem(e.id)==="true",e.checked=l,e.onchange=r,e.parentNode.className!=="optional"&&c++;for(h=0;h<t.length;h++)t[h].onclick=s;i.max=c}function s(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 r(){for(var r=0,f=0,t,i=0;i<n.length;i++)t=n[i],localStorage.setItem(t.id,t.checked),t.parentNode.className!=="optional"?t.checked&&r++:t.checked&&f++;u.innerHTML=f.toString(),h(r)}function h(n){i.value=n;var t=parseInt(i.max,10);f.style.width=n*100/t+"%"}function c(){document.getElementById("clearall").onclick=function(){for(var t=0;t<n.length;t++)n[t].checked=!1;return localStorage.clear(),r(),!1}}var n=[],t=[],i,u,f;localStorage&&(e(),o(),r(),c())})();