⬆️ Chore(libs): update instant.page from 5.1.1 to 5.2.0

This commit is contained in:
Cell
2023-10-23 17:45:33 +08:00
parent 5c043e2c0f
commit b58fddda9c
3 changed files with 13 additions and 5 deletions
+2 -2
View File
@@ -40,8 +40,8 @@ libFiles:
# gitalk@1.7.2 https://github.com/gitalk/gitalk
gitalkCSS: gitalk@1.7.2/dist/gitalk.min.css
gitalkJS: gitalk@1.7.2/dist/gitalk.min.js
# instant.page@5.1.1 https://github.com/instantpage/instant.page
instantPage: instant.page@5.1.1/instantpage.min.js
# instant.page@5.2.0 https://github.com/instantpage/instant.page
instantPage: instant.page@5.2.0/instantpage.min.js
# katex@0.16.2 https://github.com/KaTeX/KaTeX
katexAutoRenderJS: katex@0.16.2/dist/contrib/auto-render.min.js
katexCopyTexJS: katex@0.16.2/dist/contrib/copy-tex.min.js
+2 -2
View File
@@ -40,8 +40,8 @@ libFiles:
# gitalk@1.7.2 https://github.com/gitalk/gitalk
gitalkCSS: gitalk@1.7.2/dist/gitalk.min.css
gitalkJS: gitalk@1.7.2/dist/gitalk.min.js
# instant.page@5.1.1 https://github.com/instantpage/instant.page
instantPage: instant.page@5.1.1/instantpage.js
# instant.page@5.2.0 https://github.com/instantpage/instant.page
instantPage: instant.page@5.2.0/instantpage.js
# katex@0.16.2 https://github.com/KaTeX/KaTeX
katexAutoRenderJS: katex@0.16.2/dist/contrib/auto-render.min.js
katexCopyTexJS: katex@0.16.2/dist/contrib/copy-tex.min.js
+9 -1
View File
@@ -1 +1,9 @@
(()=>{var o,u,f=new Set,b=document.createElement("link").relList.supports("prefetch"),y="instantAllowQueryString"in document.body.dataset,E="instantAllowExternalLinks"in document.body.dataset,L="instantWhitelist"in document.body.dataset,m="instantMousedownShortcut"in document.body.dataset,h=1111,p=65,w=!1,v=!1,c=!1,g=null;navigator.userAgentData&&navigator.userAgentData.brands.forEach(({brand:t,version:e})=>{t=="Chromium"&&(g=parseInt(e))});if("instantIntensity"in document.body.dataset){let t=document.body.dataset.instantIntensity;if(t.startsWith("mousedown"))w=!0,t=="mousedown-only"&&(v=!0);else if(t.startsWith("viewport"))navigator.connection&&(navigator.connection.saveData||navigator.connection.effectiveType&&navigator.connection.effectiveType.includes("2g"))||(t=="viewport"?document.documentElement.clientWidth*document.documentElement.clientHeight<45e4&&(c=!0):t=="viewport-all"&&(c=!0));else{let e=parseInt(t);isNaN(e)||(p=e)}}if(b){let t={capture:!0,passive:!0};if(v||document.addEventListener("touchstart",I,t),w?m||document.addEventListener("mousedown",O,t):document.addEventListener("mouseover",T,t),m&&document.addEventListener("mousedown",A,t),c){let e=window.requestIdleCallback;e||(e=n=>{n()}),e(function(){let i=new IntersectionObserver(s=>{s.forEach(l=>{if(l.isIntersecting){let d=l.target;i.unobserve(d),a(d.href)}})});document.querySelectorAll("a").forEach(s=>{r(s)&&i.observe(s)})},{timeout:1500})}}function I(t){u=performance.now();let e=t.target.closest("a");r(e)&&a(e.href,"high")}function T(t){if(performance.now()-u<h||!("closest"in t.target))return;let e=t.target.closest("a");r(e)&&(e.addEventListener("mouseout",k,{passive:!0}),o=setTimeout(()=>{a(e.href,"high"),o=void 0},p))}function O(t){let e=t.target.closest("a");r(e)&&a(e.href,"high")}function k(t){t.relatedTarget&&t.target.closest("a")==t.relatedTarget.closest("a")||o&&(clearTimeout(o),o=void 0)}function A(t){if(performance.now()-u<h)return;let e=t.target.closest("a");if(t.which>1||t.metaKey||t.ctrlKey||!e)return;e.addEventListener("click",function(i){i.detail!=1337&&i.preventDefault()},{capture:!0,passive:!1,once:!0});let n=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1,detail:1337});e.dispatchEvent(n)}function r(t){if(!(!t||!t.href)&&!(L&&!("instant"in t.dataset))&&!(t.origin!=location.origin&&(!(E||"instant"in t.dataset)||!g))&&["http:","https:"].includes(t.protocol)&&!(t.protocol=="http:"&&location.protocol=="https:")&&!(!y&&t.search&&!("instant"in t.dataset))&&!(t.hash&&t.pathname+t.search==location.pathname+location.search)&&!("noInstant"in t.dataset))return!0}function a(t,e="auto"){if(f.has(t))return;let n=document.createElement("link");n.rel="prefetch",n.href=t,n.fetchPriority=e,n.as="document",document.head.appendChild(n),f.add(t)}})();
/**
* Minified by jsDelivr using Terser v5.15.1.
* Original file: /npm/instant.page@5.2.0/instantpage.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
/*! instant.page v5.2.0 - (C) 2019-2023 Alexandre Dieulot - https://instant.page/license */
let _allowQueryString,_allowExternalLinks,_useWhitelist,_lastTouchTimestamp,_mouseoverTimer,_chromiumMajorVersionInUserAgent=null,_delayOnHover=65,_preloadedList=new Set;const DELAY_TO_NOT_BE_CONSIDERED_A_TOUCH_INITIATED_ACTION=1111;function init(){if(!document.createElement("link").relList.supports("prefetch"))return;const e="instantVaryAccept"in document.body.dataset||"Shopify"in window,t=navigator.userAgent.indexOf("Chrome/");if(t>-1&&(_chromiumMajorVersionInUserAgent=parseInt(navigator.userAgent.substring(t+"Chrome/".length))),e&&_chromiumMajorVersionInUserAgent&&_chromiumMajorVersionInUserAgent<110)return;const n="instantMousedownShortcut"in document.body.dataset;_allowQueryString="instantAllowQueryString"in document.body.dataset,_allowExternalLinks="instantAllowExternalLinks"in document.body.dataset,_useWhitelist="instantWhitelist"in document.body.dataset;const o={capture:!0,passive:!0};let i=!1,r=!1,s=!1;if("instantIntensity"in document.body.dataset){const e=document.body.dataset.instantIntensity;if(e.startsWith("mousedown"))i=!0,"mousedown-only"==e&&(r=!0);else if(e.startsWith("viewport")){const t=navigator.connection&&navigator.connection.saveData,n=navigator.connection&&navigator.connection.effectiveType&&navigator.connection.effectiveType.includes("2g");t||n||("viewport"==e?document.documentElement.clientWidth*document.documentElement.clientHeight<45e4&&(s=!0):"viewport-all"==e&&(s=!0))}else{const t=parseInt(e);isNaN(t)||(_delayOnHover=t)}}if(r||document.addEventListener("touchstart",touchstartListener,o),i?n||document.addEventListener("mousedown",mousedownListener,o):document.addEventListener("mouseover",mouseoverListener,o),n&&document.addEventListener("mousedown",mousedownShortcutListener,o),s){let e=window.requestIdleCallback;e||(e=e=>{e()}),e((function(){const e=new IntersectionObserver((t=>{t.forEach((t=>{if(t.isIntersecting){const n=t.target;e.unobserve(n),preload(n.href)}}))}));document.querySelectorAll("a").forEach((t=>{isPreloadable(t)&&e.observe(t)}))}),{timeout:1500})}}function touchstartListener(e){_lastTouchTimestamp=performance.now();const t=e.target.closest("a");isPreloadable(t)&&preload(t.href,"high")}function mouseoverListener(e){if(performance.now()-_lastTouchTimestamp<1111)return;if(!("closest"in e.target))return;const t=e.target.closest("a");isPreloadable(t)&&(t.addEventListener("mouseout",mouseoutListener,{passive:!0}),_mouseoverTimer=setTimeout((()=>{preload(t.href,"high"),_mouseoverTimer=void 0}),_delayOnHover))}function mousedownListener(e){const t=e.target.closest("a");isPreloadable(t)&&preload(t.href,"high")}function mouseoutListener(e){e.relatedTarget&&e.target.closest("a")==e.relatedTarget.closest("a")||_mouseoverTimer&&(clearTimeout(_mouseoverTimer),_mouseoverTimer=void 0)}function mousedownShortcutListener(e){if(performance.now()-_lastTouchTimestamp<1111)return;const t=e.target.closest("a");if(e.which>1||e.metaKey||e.ctrlKey)return;if(!t)return;t.addEventListener("click",(function(e){1337!=e.detail&&e.preventDefault()}),{capture:!0,passive:!1,once:!0});const n=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1,detail:1337});t.dispatchEvent(n)}function isPreloadable(e){if(e&&e.href&&(!_useWhitelist||"instant"in e.dataset)){if(e.origin!=location.origin){if(!(_allowExternalLinks||"instant"in e.dataset)||!_chromiumMajorVersionInUserAgent)return}if(["http:","https:"].includes(e.protocol)&&("http:"!=e.protocol||"https:"!=location.protocol)&&(_allowQueryString||!e.search||"instant"in e.dataset)&&!(e.hash&&e.pathname+e.search==location.pathname+location.search||"noInstant"in e.dataset))return!0}}function preload(e,t="auto"){if(_preloadedList.has(e))return;const n=document.createElement("link");n.rel="prefetch",n.href=e,n.fetchPriority=t,n.as="document",document.head.appendChild(n),_preloadedList.add(e)}init();
//# sourceMappingURL=/sm/60fb95dda2409979534f889b11a4279c9602c20254de5a856d5c95159338bab2.map