diff --git a/js/krumo.js b/js/krumo.js index 2e9a594..5c59993 100644 --- a/js/krumo.js +++ b/js/krumo.js @@ -1,5 +1,5 @@ // Command to generate minified JS: -// curl -X POST -s --data-urlencode 'input@js/krumo.js' https://www.toptal.com/developers/javascript-minifier/raw > js/krumo.min.js +// curl -X POST -s --data-urlencode 'input@js/krumo.js' https://www.toptal.com/developers/javascript-minifier/api/raw > js/krumo.min.js /** * JavaScript routines for Krumo diff --git a/js/krumo.min.js b/js/krumo.min.js index dab4a7a..95cc1ad 100644 --- a/js/krumo.min.js +++ b/js/krumo.min.js @@ -1 +1 @@ -function krumo(){}function qsa(e){return document.querySelectorAll(e)}function init_click(){qsa(".krumo-expand").forEach(function(e){e.parentNode.addEventListener("click",krumo.toggle)})}krumo.reclass=function(e,n){e.className.indexOf(n)<0&&(e.className+=" "+n)},krumo.unclass=function(e,n){e.className.indexOf(n)>-1&&(e.className=e.className.replace(n,""))},krumo.toggle=function(e){var n=e.target.closest(".krumo-expand"),o=e.ctrlKey;if(null!==n){var r=!n.classList.contains("krumo-opened");o?r?krumo.expand_all(n):krumo.collapse_all(n):r?krumo.expand(n):krumo.collapse(n),e.stopPropagation()}else e.stopPropagation()},krumo.expand=function(e){paren=e.parentNode,nest=paren.querySelector(".krumo-nest"),exp=paren.querySelector(".krumo-expand"),nest.style.display="block",krumo.reclass(exp,"krumo-opened")},krumo.collapse=function(e){paren=e.parentNode,nest=paren.querySelector(".krumo-nest"),exp=paren.querySelector(".krumo-expand"),nest.style.display="none",krumo.unclass(exp,"krumo-opened")},krumo.expand_all=function(e){paren=e.parentNode,nest=paren.querySelectorAll(".krumo-nest"),exp=paren.querySelectorAll(".krumo-expand"),nest.forEach(function(e,n){e.style.display="block"}),exp.forEach(function(e,n){krumo.reclass(e,"krumo-opened")})},krumo.collapse_all=function(e){paren=e.parentNode,nest=paren.querySelectorAll(".krumo-nest"),exp=paren.querySelectorAll(".krumo-expand"),nest.forEach(function(e,n){e.style.display="none"}),exp.forEach(function(e,n){krumo.unclass(e,"krumo-opened")})},krumo.over=function(e){krumo.reclass(e,"krumo-hover")},krumo.out=function(e){krumo.unclass(e,"krumo-hover")},document.addEventListener("DOMContentLoaded",function(){init_click()}); \ No newline at end of file +function krumo(){}function qsa(a){return document.querySelectorAll(a)}function init_click(){qsa(".krumo-expand").forEach(function(a){a.parentNode.addEventListener("click",krumo.toggle)})}krumo.reclass=function(a,b){0>a.className.indexOf(b)&&(a.className+=" "+b)},krumo.unclass=function(a,b){a.className.indexOf(b)> -1&&(a.className=a.className.replace(b,""))},krumo.toggle=function(b){var a=b.target.closest(".krumo-expand"),d=b.ctrlKey;if(null===a){b.stopPropagation();return}var c=!a.classList.contains("krumo-opened");d?c?krumo.expand_all(a):krumo.collapse_all(a):c?krumo.expand(a):krumo.collapse(a),b.stopPropagation()},krumo.expand=function(a){nest=(paren=a.parentNode).querySelector(".krumo-nest"),exp=paren.querySelector(".krumo-expand"),nest.style.display="block",krumo.reclass(exp,"krumo-opened")},krumo.collapse=function(a){nest=(paren=a.parentNode).querySelector(".krumo-nest"),exp=paren.querySelector(".krumo-expand"),nest.style.display="none",krumo.unclass(exp,"krumo-opened")},krumo.expand_all=function(a){nest=(paren=a.parentNode).querySelectorAll(".krumo-nest"),exp=paren.querySelectorAll(".krumo-expand"),nest.forEach(function(a,b){a.style.display="block"}),exp.forEach(function(a,b){krumo.reclass(a,"krumo-opened")})},krumo.collapse_all=function(a){nest=(paren=a.parentNode).querySelectorAll(".krumo-nest"),exp=paren.querySelectorAll(".krumo-expand"),nest.forEach(function(a,b){a.style.display="none"}),exp.forEach(function(a,b){krumo.unclass(a,"krumo-opened")})},krumo.over=function(a){krumo.reclass(a,"krumo-hover")},krumo.out=function(a){krumo.unclass(a,"krumo-hover")},document.addEventListener("DOMContentLoaded",function(){init_click()}) \ No newline at end of file