diff --git a/resources/compiled/sage.js b/resources/compiled/sage.js index 5c861f3..fe13d83 100644 --- a/resources/compiled/sage.js +++ b/resources/compiled/sage.js @@ -1 +1 @@ -if("undefined"==typeof _sageInitialized){const a={t:[],i:-(_sageInitialized=1),o:function(e){const t=window.getSelection(),n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)},u:function(e,t){Array.prototype.slice.call(document.querySelectorAll(e),0).forEach(t)},l:function(e,t){return!!e.classList&&e.classList.contains(t=void 0===t?"_sage-show":t)},g:function(e,t){e.classList.add(t=void 0===t?"_sage-show":t)},v:function(e,t){return e.classList.remove(t=void 0===t?"_sage-show":t),e},next:function(e){for(;(e=e.nextElementSibling)&&"DD"!==e.tagName;);return e},toggle:function(e,t){(t=void 0===t?a.l(e):t)?a.v(e):a.g(e);let n=a.next(e);n&&1===n.childNodes.length&&(n=n.childNodes[0].childNodes[0])&&a.l(n,"_sage-parent")&&a.toggle(n,t)},_:function(e,t){const n=a.next(e),i=n.getElementsByClassName("_sage-parent");let o=i.length;for(void 0===t&&(t=a.l(e));o--;)a.toggle(i[o],t);a.toggle(e,t)},h:function(e){var t=document.getElementsByClassName("_sage-parent");let n=t.length;for(var i=a.l(e.parentNode);n--;)a.toggle(t[n],i)},m:function(e){let t,n=e,i=0;for(a.v(e.parentNode.getElementsByClassName("_sage-active-tab")[0],"_sage-active-tab"),e.className="_sage-active-tab";n=n.previousSibling;)1===n.nodeType&&i++;t=e.parentNode.nextSibling.childNodes;for(let e=0;eli:not(._sage-active-tab)",function(e){0===e.offsetWidth&&0===e.offsetHeight||a.t.push(e)})},tag:function(e){return"<"+e+">"},A:function(e){let t;(t=window.open())&&(t.document.open(),t.document.write(a.tag("html")+a.tag("head")+"Sage ☯ ("+(new Date).toISOString()+")"+a.tag('meta charset="utf-8"')+document.getElementsByClassName("_sage-js")[0].outerHTML+document.getElementsByClassName("_sage-css")[0].outerHTML+a.tag("/head")+a.tag("body")+'
'+e.parentNode.outerHTML+"
"+a.tag("/body")),t.document.close())},I:function(e,n,t){const i=e.tBodies[0],o=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"}),a=void 0===t.k?1:t.k;t.k=-1*a,[].slice.call(e.tBodies[0].rows).sort(function(e,t){return a*o.compare(e.cells[n].textContent,t.cells[n].textContent)}).forEach(function(e){i.appendChild(e)})},C:{D:function(e){var t="_sage-focused",n=document.querySelector("."+t);if(n&&a.v(n,t),-1!==e){n=a.t[e];a.g(n,t);const i=function(e){return e.offsetTop+(e.offsetParent?i(e.offsetParent):0)};t=i(n)-window.innerHeight/2;window.scrollTo(0,t)}a.i=e},F:function(e,t){return e?--t<0&&(t=a.t.length-1):++t>=a.t.length&&(t=0),a.C.D(t),!1}}};window.addEventListener("click",function(e){let t=e.target,n=t.tagName;if(a.p(t)){if("DFN"===n)a.o(t),t=t.parentNode;else if("VAR"===n)t=t.parentNode,n=t.tagName;else if("TH"===n)return e.ctrlKey||a.I(t.parentNode.parentNode.parentNode,t.cellIndex,t),!1;if("LI"===n&&"_sage-tabs"===t.parentNode.className)return"_sage-active-tab"!==t.className&&(a.m(t),-1!==a.i&&a.T()),!1;if("NAV"===n)return"FOOTER"===t.parentNode.tagName?(t=t.parentNode,a.toggle(t)):setTimeout(function(){0e&&(n=e),ili:not(._sage-active-tab)",function(e){0===e.offsetWidth&&0===e.offsetHeight||s.t.push(e)})},tag:function(e){return"<"+e+">"},A:function(e){let t;(t=window.open())&&(t.document.open(),t.document.write(s.tag("html")+s.tag("head")+"Sage ☯ ("+(new Date).toISOString()+")"+s.tag('meta charset="utf-8"')+document.getElementsByClassName("_sage-js")[0].outerHTML+document.getElementsByClassName("_sage-css")[0].outerHTML+s.tag("/head")+s.tag("body")+'
'+e.parentNode.outerHTML+"
"+s.tag("/body")),t.document.close())},I:function(e,n,t){const i=e.tBodies[0],o=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"}),s=void 0===t.k?1:t.k;t.k=-1*s,[].slice.call(e.tBodies[0].rows).sort(function(e,t){return s*o.compare(e.cells[n].textContent,t.cells[n].textContent)}).forEach(function(e){i.appendChild(e)})},C:{D:function(e){var t="_sage-focused",n=document.querySelector("."+t);if(n&&s._(n,t),-1!==e){n=s.t[e];s.g(n,t);const i=function(e){return e.offsetTop+(e.offsetParent?i(e.offsetParent):0)};t=i(n)-window.innerHeight/2;window.scrollTo(0,t)}s.i=e},F:function(e,t){return e?--t<0&&(t=s.t.length-1):++t>=s.t.length&&(t=0),s.C.D(t),!1}}};window.addEventListener("click",function(e){let t=e.target,n=t.tagName;if(s.p(t)){if("DFN"===n)s.o(t),t=t.parentNode;else if("VAR"===n)t=t.parentNode,n=t.tagName;else if("TH"===n)return e.ctrlKey||s.I(t.parentNode.parentNode.parentNode,t.cellIndex,t),!1;if("LI"===n&&"_sage-tabs"===t.parentNode.className)return"_sage-active-tab"!==t.className&&(s.m(t),-1!==s.i&&s.T()),!1;if("NAV"===n)return"FOOTER"===t.parentNode.tagName?(t=t.parentNode,s.toggle(t)):setTimeout(function(){0e&&(n=e),i - if (_sage.currentPlus !== -1) _sage.fetchVisiblePluses(); + if (_sage.currentPlus !== -1) { + _sage.fetchVisiblePluses(); + } } }, 300); } @@ -268,7 +272,9 @@ if (typeof _sageInitialized === 'undefined') { return false; } else if (_sage.hasClass(target, '_sage-parent')) { _sage.toggle(target); - if (_sage.currentPlus !== -1) _sage.fetchVisiblePluses(); + if (_sage.currentPlus !== -1) { + _sage.fetchVisiblePluses(); + } return false; } else if (_sage.hasClass(target, '_sage-ide-link')) { fetch(target.href); @@ -289,29 +295,38 @@ if (typeof _sageInitialized === 'undefined') { } }, false); - window.addEventListener("dblclick", function (e) { + window.addEventListener('dblclick', function (e) { const target = e.target; - if (!_sage.isSibling(target)) return; + if (!_sage.isSibling(target)) { + return; + } if (target.tagName === 'NAV') { target._sageTimer = 2; - _sage.toggleAll(target); - if (_sage.currentPlus !== -1) _sage.fetchVisiblePluses(); + _sage.toggleAll(_sage.hasClass(target)); + if (_sage.currentPlus !== -1) { + _sage.fetchVisiblePluses(); + } e.stopPropagation(); } }, false); // keyboard navigation window.onkeydown = function (e) { // direct assignment is used to have priority over ex FAYT - - // do nothing if alt/ctrl key is pressed or if we're actually typing somewhere - if (["INPUT", "TEXTAREA"].includes(e.target.tagName) || e.altKey || e.ctrlKey) return; - // todo use e.key https://www.toptal.com/developers/keycode - const keyCode = e.keyCode - , shiftKey = e.shiftKey + const keyCode = e.keyCode; let i = _sage.currentPlus; + // user pressed ctrl+f + if (keyCode === 70 && e.ctrlKey) { + _sage.toggleAll(true); + return; + } + + // do nothing if alt/ctrl key is pressed or if we're actually typing somewhere + if (['INPUT', 'TEXTAREA'].includes(e.target.tagName) || e.altKey || e.ctrlKey) { + return; + } if (keyCode === 9) { // TAB jumps out of navigation _sage.keyCallBacks.cleanup(-1); @@ -327,7 +342,9 @@ if (typeof _sageInitialized === 'undefined') { return false; } } else { - if (i === -1) return; + if (i === -1) { + return; + } if (keyCode === 38) { // ARROW UP : moves up return _sage.keyCallBacks.moveCursor(true, i); @@ -398,7 +415,7 @@ if (typeof _sageInitialized === 'undefined') { } }; - window.addEventListener("load", function () { // colorize microtime results relative to others + window.addEventListener('load', function () { // colorize microtime results relative to others const elements = Array.prototype.slice.call(document.querySelectorAll('._sage-microtime'), 0); let min = Infinity , max = -Infinity; @@ -406,8 +423,12 @@ if (typeof _sageInitialized === 'undefined') { elements.forEach(function (el) { const val = parseFloat(el.innerHTML); - if (min > val) min = val; - if (max < val) max = val; + if (min > val) { + min = val; + } + if (max < val) { + max = val; + } }); elements.forEach(function (el) { @@ -421,7 +442,9 @@ if (typeof _sageInitialized === 'undefined') { // debug purposes only, removed in minified source function clg(i) { - if (!window.console) return; + if (!window.console) { + return; + } const l = arguments.length; let o = 0; while (o < l) console.log(arguments[o++]) diff --git a/sage.phar b/sage.phar index 21843c4..706cc0d 100644 Binary files a/sage.phar and b/sage.phar differ