Changeset 2903907
- Timestamp:
- 04/25/2023 12:49:44 PM (3 years ago)
- Location:
- quicklink
- Files:
-
- 8 edited
- 1 copied
-
tags/0.10.0 (copied) (copied from quicklink/trunk)
-
tags/0.10.0/quicklink.bundle.js (modified) (2 diffs)
-
tags/0.10.0/quicklink.min.js (modified) (1 diff)
-
tags/0.10.0/quicklink.php (modified) (4 diffs)
-
tags/0.10.0/readme.txt (modified) (2 diffs)
-
trunk/quicklink.bundle.js (modified) (2 diffs)
-
trunk/quicklink.min.js (modified) (1 diff)
-
trunk/quicklink.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
quicklink/tags/0.10.0/quicklink.bundle.js
r2583709 r2903907 1 1 /******/ (function() { // webpackBootstrap 2 2 /******/ "use strict"; 3 /******/ var __webpack_modules__ = ([ 4 /* 0 */, 5 /* 1 */ 6 /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 7 8 __webpack_require__.r(__webpack_exports__); 9 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 10 /* harmony export */ "default": function() { return /* binding */ _typeof; } 11 /* harmony export */ }); 12 function _typeof(obj) { 13 "@babel/helpers - typeof"; 14 15 if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { 16 _typeof = function _typeof(obj) { 17 return typeof obj; 18 }; 19 } else { 20 _typeof = function _typeof(obj) { 21 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 22 }; 23 } 24 25 return _typeof(obj); 26 } 27 28 /***/ }), 29 /* 2 */ 30 /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 31 32 __webpack_require__.r(__webpack_exports__); 33 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 34 /* harmony export */ "listen": function() { return /* binding */ i; }, 35 /* harmony export */ "prefetch": function() { return /* binding */ c; } 36 /* harmony export */ }); 37 function e(e){return new Promise(function(n,t,r){(r=new XMLHttpRequest).open("GET",e,r.withCredentials=!0),r.onload=function(){200===r.status?n():t()},r.send()})}var n,t=(n=document.createElement("link")).relList&&n.relList.supports&&n.relList.supports("prefetch")?function(e){return new Promise(function(n,t,r){(r=document.createElement("link")).rel="prefetch",r.href=e,r.onload=n,r.onerror=t,document.head.appendChild(r)})}:e,r=window.requestIdleCallback||function(e){var n=Date.now();return setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-n))}})},1)},o=new Set;function i(e){if(e||(e={}),window.IntersectionObserver){var n=function(e){e=e||1;var n=[],t=0;function r(){t<e&&n.length>0&&(n.shift()(),t++)}return[function(e){n.push(e)>1||r()},function(){t--,r()}]}(e.throttle||1/0),t=n[0],i=n[1],u=e.limit||1/0,f=e.origins||[location.hostname],a=e.ignores||[],s=e.delay||0,l=[],h=e.timeoutFn||r,d="function"==typeof e.hrefFn&&e.hrefFn,m=new IntersectionObserver(function(n){n.forEach(function(n){if(n.isIntersecting)l.push((n=n.target).href),function(e,n){n?setTimeout(e,n):e()}(function(){-1!==l.indexOf(n.href)&&(m.unobserve(n),o.size<u&&t(function(){c(d?d(n):n.href,e.priority).then(i).catch(function(n){i(),e.onError&&e.onError(n)})}))},s);else{var r=l.indexOf((n=n.target).href);r>-1&&l.splice(r)}})},{threshold:e.threshold||0});return h(function(){(e.el||document).querySelectorAll("a").forEach(function(e){f.length&&!f.includes(e.hostname)||function e(n,t){return Array.isArray(t)?t.some(function(t){return e(n,t)}):(t.test||t).call(t,n.href,n)}(e,a)||m.observe(e)})},{timeout:e.timeout||2e3}),function(){o.clear(),m.disconnect()}}}function c(n,r,i){if(i=navigator.connection){if(i.saveData)return Promise.reject(new Error("Cannot prefetch, Save-Data is enabled"));if(/2g/.test(i.effectiveType))return Promise.reject(new Error("Cannot prefetch, network conditions are poor"))}return Promise.all([].concat(n).map(function(n){if(!o.has(n))return o.add(n),(r?function(n){return window.fetch?fetch(n,{credentials:"include"}):e(n)}:t)(new URL(n,location.href).toString())}))} 38 39 40 /***/ }) 41 /******/ ]); 42 /************************************************************************/ 43 /******/ // The module cache 44 /******/ var __webpack_module_cache__ = {}; 45 /******/ 46 /******/ // The require function 47 /******/ function __webpack_require__(moduleId) { 48 /******/ // Check if module is in cache 49 /******/ var cachedModule = __webpack_module_cache__[moduleId]; 50 /******/ if (cachedModule !== undefined) { 51 /******/ return cachedModule.exports; 52 /******/ } 53 /******/ // Create a new module (and put it into the cache) 54 /******/ var module = __webpack_module_cache__[moduleId] = { 55 /******/ // no module.id needed 56 /******/ // no module.loaded needed 57 /******/ exports: {} 58 /******/ }; 59 /******/ 60 /******/ // Execute the module function 61 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 62 /******/ 63 /******/ // Return the exports of the module 64 /******/ return module.exports; 65 /******/ } 3 /******/ // The require scope 4 /******/ var __webpack_require__ = {}; 66 5 /******/ 67 6 /************************************************************************/ … … 108 47 /************************************************************************/ 109 48 var __webpack_exports__ = {}; 110 // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.111 !function() {112 __webpack_require__.r(__webpack_exports__);113 /* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);114 /* harmony import */ var quicklink__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);115 49 116 // Move quicklink to the global scope 50 // NAMESPACE OBJECT: ./node_modules/quicklink/dist/quicklink.mjs 51 var quicklink_namespaceObject = {}; 52 __webpack_require__.r(quicklink_namespaceObject); 53 __webpack_require__.d(quicklink_namespaceObject, { 54 "listen": function() { return u; }, 55 "prefetch": function() { return s; }, 56 "prerender": function() { return f; } 57 }); 117 58 118 window.quicklink = quicklink__WEBPACK_IMPORTED_MODULE_1__; 119 __webpack_require__.g.addEventListener('load', function () { 120 var exportedOptions = window.quicklinkOptions || {}; 121 var listenerOptions = {}; // el: Convert selector into element reference. 59 ;// CONCATENATED MODULE: ./node_modules/quicklink/dist/quicklink.mjs 60 function e(e){return new Promise(function(n,r,t){(t=new XMLHttpRequest).open("GET",e,t.withCredentials=!0),t.onload=function(){200===t.status?n():r()},t.send()})}var n,r=(n=document.createElement("link")).relList&&n.relList.supports&&n.relList.supports("prefetch")?function(e){return new Promise(function(n,r,t){(t=document.createElement("link")).rel="prefetch",t.href=e,t.onload=n,t.onerror=r,document.head.appendChild(t)})}:e,t=window.requestIdleCallback||function(e){var n=Date.now();return setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-n))}})},1)},o=new Set,i=new Set,c=!1;function a(e){if(e){if(e.saveData)return new Error("Save-Data is enabled");if(/2g/.test(e.effectiveType))return new Error("network conditions are poor")}return!0}function u(e){if(e||(e={}),window.IntersectionObserver){var n=function(e){e=e||1;var n=[],r=0;function t(){r<e&&n.length>0&&(n.shift()(),r++)}return[function(e){n.push(e)>1||t()},function(){r--,t()}]}(e.throttle||1/0),r=n[0],a=n[1],u=e.limit||1/0,l=e.origins||[location.hostname],d=e.ignores||[],h=e.delay||0,p=[],m=e.timeoutFn||t,w="function"==typeof e.hrefFn&&e.hrefFn,g=e.prerender||!1;c=e.prerenderAndPrefetch||!1;var v=new IntersectionObserver(function(n){n.forEach(function(n){if(n.isIntersecting)p.push((n=n.target).href),function(e,n){n?setTimeout(e,n):e()}(function(){-1!==p.indexOf(n.href)&&(v.unobserve(n),(c||g)&&i.size<1?f(w?w(n):n.href).catch(function(n){if(!e.onError)throw n;e.onError(n)}):o.size<u&&!g&&r(function(){s(w?w(n):n.href,e.priority).then(a).catch(function(n){a(),e.onError&&e.onError(n)})}))},h);else{var t=p.indexOf((n=n.target).href);t>-1&&p.splice(t)}})},{threshold:e.threshold||0});return m(function(){(e.el||document).querySelectorAll("a").forEach(function(e){l.length&&!l.includes(e.hostname)||function e(n,r){return Array.isArray(r)?r.some(function(r){return e(n,r)}):(r.test||r).call(r,n.href,n)}(e,d)||v.observe(e)})},{timeout:e.timeout||2e3}),function(){o.clear(),v.disconnect()}}}function s(n,t,u){var s=a(navigator.connection);return s instanceof Error?Promise.reject(new Error("Cannot prefetch, "+s.message)):(i.size>0&&!c&&console.warn("[Warning] You are using both prefetching and prerendering on the same document"),Promise.all([].concat(n).map(function(n){if(!o.has(n))return o.add(n),(t?function(n){return window.fetch?fetch(n,{credentials:"include"}):e(n)}:r)(new URL(n,location.href).toString())})))}function f(e,n){var r=a(navigator.connection);if(r instanceof Error)return Promise.reject(new Error("Cannot prerender, "+r.message));if(!HTMLScriptElement.supports("speculationrules"))return s(e),Promise.reject(new Error("This browser does not support the speculation rules API. Falling back to prefetch."));if(document.querySelector('script[type="speculationrules"]'))return Promise.reject(new Error("Speculation Rules is already defined and cannot be altered."));for(var t=0,u=[].concat(e);t<u.length;t+=1){var f=u[t];if(window.location.origin!==new URL(f,window.location.href).origin)return Promise.reject(new Error("Only same origin URLs are allowed: "+f));i.add(f)}o.size>0&&!c&&console.warn("[Warning] You are using both prefetching and prerendering on the same document");var l=function(e){var n=document.createElement("script");n.type="speculationrules",n.text='{"prerender":[{"source": "list","urls": ["'+Array.from(e).join('","')+'"]}]}';try{document.head.appendChild(n)}catch(e){return e}return!0}(i);return!0===l?Promise.resolve():Promise.reject(l)} 122 61 62 ;// CONCATENATED MODULE: ./build/js/quicklink.js 63 64 65 // Move quicklink to the global scope 66 window.quicklink = quicklink_namespaceObject; 67 __webpack_require__.g.addEventListener('load', () => { 68 const exportedOptions = window.quicklinkOptions || {}; 69 const listenerOptions = {}; 70 71 // el: Convert selector into element reference. 123 72 if ('string' === typeof exportedOptions.el && exportedOptions.el) { 124 73 listenerOptions.el = document.querySelector(exportedOptions.el); 125 } // timeout: Verify we actually get an int for milliseconds.74 } 126 75 127 76 // timeout: Verify we actually get an int for milliseconds. 128 77 if ('number' === typeof exportedOptions.timeout) { 129 78 listenerOptions.timeout = exportedOptions.timeout; 130 } // limit: Verify we actually get an int.79 } 131 80 132 81 // limit: Verify we actually get an int. 133 82 if ('number' === typeof exportedOptions.limit && exportedOptions.limit > 0) { 134 83 listenerOptions.limit = exportedOptions.limit; 135 } // throttle: Verify we actually get an int.84 } 136 85 137 86 // throttle: Verify we actually get an int. 138 87 if ('number' === typeof exportedOptions.throttle && exportedOptions.throttle > 0) { 139 88 listenerOptions.throttle = exportedOptions.throttle; 140 } // timeoutFn: Obtain function reference as opposed to function string, if it is not the default.89 } 141 90 142 143 if ('string' === typeof exportedOptions.timeoutFn && 'requestIdleCallback' !== exportedOptions.timeoutFn && (0,_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__.default)('function') === window[exportedOptions.timeoutFn]) { 144 var timeoutFn = window[exportedOptions.timeoutFn]; 145 91 // timeoutFn: Obtain function reference as opposed to function string, if it is not the default. 92 if ('string' === typeof exportedOptions.timeoutFn && 'requestIdleCallback' !== exportedOptions.timeoutFn && typeof 'function' === window[exportedOptions.timeoutFn]) { 93 const timeoutFn = window[exportedOptions.timeoutFn]; 146 94 listenerOptions.timeoutFn = function () { 147 95 return timeoutFn.apply(window, arguments); 148 96 }; 149 } // onError: Obtain function reference as opposed to function string, if it is not the default.97 } 150 98 151 152 if ('string' === typeof exportedOptions.onError && (0,_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__.default)('function') === window[exportedOptions.onError]) { 153 var onError = window[exportedOptions.onError]; 154 99 // onError: Obtain function reference as opposed to function string, if it is not the default. 100 if ('string' === typeof exportedOptions.onError && typeof 'function' === window[exportedOptions.onError]) { 101 const onError = window[exportedOptions.onError]; 155 102 listenerOptions.onError = function () { 156 103 return onError.apply(window, arguments); 157 104 }; 158 } // priority: Obtain priority.105 } 159 106 160 107 // priority: Obtain priority. 161 108 if ('boolean' === typeof exportedOptions.priority) { 162 109 listenerOptions.priority = exportedOptions.priority; 163 } // origins: Verify we don't get an empty array, as that would turn off quicklink.110 } 164 111 165 112 // origins: Verify we don't get an empty array, as that would turn off quicklink. 166 113 if (Array.isArray(exportedOptions.origins) && 0 < exportedOptions.origins.length) { 167 114 listenerOptions.origins = exportedOptions.origins; 168 } // ignores: Convert strings to regular expressions.115 } 169 116 170 117 // ignores: Convert strings to regular expressions. 171 118 if (Array.isArray(exportedOptions.ignores) && 0 < exportedOptions.ignores.length) { 172 listenerOptions.ignores = exportedOptions.ignores.map( function (ignore){119 listenerOptions.ignores = exportedOptions.ignores.map(ignore => { 173 120 return new RegExp(ignore); 174 121 }); 175 122 } 123 u(listenerOptions); 176 124 177 quicklink__WEBPACK_IMPORTED_MODULE_1__.listen(listenerOptions);178 125 /** 179 126 * The option to prefetch urls from the options is deprecated as of version 0.8.0. 180 127 */ 181 182 128 if (Array.isArray(exportedOptions.urls) && 0 < exportedOptions.urls.length) { 183 quicklink__WEBPACK_IMPORTED_MODULE_1__.prefetch(exportedOptions.urls);129 s(exportedOptions.urls); 184 130 } 185 131 }); 186 }();187 132 /******/ })() 188 133 ; -
quicklink/tags/0.10.0/quicklink.min.js
r2583709 r2903907 1 !function(){"use strict";var r=[,function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}n.r(e),n.d(e,{default:function(){return r}})},function(t,e,n){function r(r){return new Promise(function(t,e,n){(n=new XMLHttpRequest).open("GET",r,n.withCredentials=!0),n.onload=function(){200===n.status?t():e()},n.send()})}n.r(e),n.d(e,{listen:function(){return u},prefetch:function(){return m}});var o,i=(o=document.createElement("link")).relList&&o.relList.supports&&o.relList.supports("prefetch")?function(r){return new Promise(function(t,e,n){(n=document.createElement("link")).rel="prefetch",n.href=r,n.onload=t,n.onerror=e,document.head.appendChild(n)})}:r,d=window.requestIdleCallback||function(t){var e=Date.now();return setTimeout(function(){t({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-e))}})},1)},p=new Set;function u(r){if(r=r||{},window.IntersectionObserver){var t=function(t){t=t||1;var e=[],n=0;function r(){n<t&&0<e.length&&(e.shift()(),n++)}return[function(t){1<e.push(t)||r()},function(){n--,r()}]}(r.throttle||1/0),o=t[0],i=t[1],u=r.limit||1/0,e=r.origins||[location.hostname],n=r.ignores||[],c=r.delay||0,f=[],l=r.timeoutFn||d,a="function"==typeof r.hrefFn&&r.hrefFn,s=new IntersectionObserver(function(t){t.forEach(function(t){if(t.isIntersecting)f.push((t=t.target).href),n=function(){-1!==f.indexOf(t.href)&&(s.unobserve(t),p.size<u&&o(function(){m(a?a(t):t.href,r.priority).then(i).catch(function(t){i(),r.onError&&r.onError(t)})}))},c?setTimeout(n,c):n();else{var e=f.indexOf((t=t.target).href);-1<e&&f.splice(e)}var n})},{threshold:r.threshold||0});return l(function(){(r.el||document).querySelectorAll("a").forEach(function(t){e.length&&!e.includes(t.hostname)||function e(n,t){return Array.isArray(t)?t.some(function(t){return e(n,t)}):(t.test||t).call(t,n.href,n)}(t,n)||s.observe(t)})},{timeout:r.timeout||2e3}),function(){p.clear(),s.disconnect()}}}function m(t,e,n){if(n=navigator.connection){if(n.saveData)return Promise.reject(new Error("Cannot prefetch, Save-Data is enabled"));if(/2g/.test(n.effectiveType))return Promise.reject(new Error("Cannot prefetch, network conditions are poor"))}return Promise.all([].concat(t).map(function(t){if(!p.has(t))return p.add(t),(e?function(t){return window.fetch?fetch(t,{credentials:"include"}):r(t)}:i)(new URL(t,location.href).toString())}))}}],o={};function u(t){var e=o[t];if(void 0!==e)return e.exports;var n=o[t]={exports:{}};return r[t](n,n.exports,u),n.exports}u.d=function(t,e){for(var n in e)u.o(e,n)&&!u.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},u.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),u.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},u.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var t={};!function(){u.r(t);var o=u(1),i=u(2);window.quicklink=i,u.g.addEventListener("load",function(){var t=window.quicklinkOptions||{},e={};if("string"==typeof t.el&&t.el&&(e.el=document.querySelector(t.el)),"number"==typeof t.timeout&&(e.timeout=t.timeout),"number"==typeof t.limit&&0<t.limit&&(e.limit=t.limit),"number"==typeof t.throttle&&0<t.throttle&&(e.throttle=t.throttle),"string"==typeof t.timeoutFn&&"requestIdleCallback"!==t.timeoutFn&&(0,o.default)("function")===window[t.timeoutFn]){var n=window[t.timeoutFn];e.timeoutFn=function(){return n.apply(window,arguments)}}if("string"==typeof t.onError&&(0,o.default)("function")===window[t.onError]){var r=window[t.onError];e.onError=function(){return r.apply(window,arguments)}}"boolean"==typeof t.priority&&(e.priority=t.priority),Array.isArray(t.origins)&&0<t.origins.length&&(e.origins=t.origins),Array.isArray(t.ignores)&&0<t.ignores.length&&(e.ignores=t.ignores.map(function(t){return new RegExp(t)})),i.listen(e),Array.isArray(t.urls)&&0<t.urls.length&&i.prefetch(t.urls)})}()}();1 !function(){"use strict";var e={d:function(r,n){for(var t in n)e.o(n,t)&&!e.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:n[t]})}};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),e.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},e.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};function n(e){return new Promise((function(r,n,t){(t=new XMLHttpRequest).open("GET",e,t.withCredentials=!0),t.onload=function(){200===t.status?r():n()},t.send()}))}e.r(r),e.d(r,{listen:function(){return l},prefetch:function(){return f},prerender:function(){return d}});var t,o=(t=document.createElement("link")).relList&&t.relList.supports&&t.relList.supports("prefetch")?function(e){return new Promise((function(r,n,t){(t=document.createElement("link")).rel="prefetch",t.href=e,t.onload=r,t.onerror=n,document.head.appendChild(t)}))}:n,i=window.requestIdleCallback||function(e){var r=Date.now();return setTimeout((function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-r))}})}),1)},u=new Set,c=new Set,s=!1;function a(e){if(e){if(e.saveData)return new Error("Save-Data is enabled");if(/2g/.test(e.effectiveType))return new Error("network conditions are poor")}return!0}function l(e){if(e||(e={}),window.IntersectionObserver){var r=function(e){e=e||1;var r=[],n=0;function t(){n<e&&r.length>0&&(r.shift()(),n++)}return[function(e){r.push(e)>1||t()},function(){n--,t()}]}(e.throttle||1/0),n=r[0],t=r[1],o=e.limit||1/0,a=e.origins||[location.hostname],l=e.ignores||[],p=e.delay||0,h=[],m=e.timeoutFn||i,w="function"==typeof e.hrefFn&&e.hrefFn,g=e.prerender||!1;s=e.prerenderAndPrefetch||!1;var y=new IntersectionObserver((function(r){r.forEach((function(r){if(r.isIntersecting)h.push((r=r.target).href),function(e,r){r?setTimeout(e,r):e()}((function(){-1!==h.indexOf(r.href)&&(y.unobserve(r),(s||g)&&c.size<1?d(w?w(r):r.href).catch((function(r){if(!e.onError)throw r;e.onError(r)})):u.size<o&&!g&&n((function(){f(w?w(r):r.href,e.priority).then(t).catch((function(r){t(),e.onError&&e.onError(r)}))})))}),p);else{var i=h.indexOf((r=r.target).href);i>-1&&h.splice(i)}}))}),{threshold:e.threshold||0});return m((function(){(e.el||document).querySelectorAll("a").forEach((function(e){a.length&&!a.includes(e.hostname)||function e(r,n){return Array.isArray(n)?n.some((function(n){return e(r,n)})):(n.test||n).call(n,r.href,r)}(e,l)||y.observe(e)}))}),{timeout:e.timeout||2e3}),function(){u.clear(),y.disconnect()}}}function f(e,r,t){var i=a(navigator.connection);return i instanceof Error?Promise.reject(new Error("Cannot prefetch, "+i.message)):(c.size>0&&!s&&console.warn("[Warning] You are using both prefetching and prerendering on the same document"),Promise.all([].concat(e).map((function(e){if(!u.has(e))return u.add(e),(r?function(e){return window.fetch?fetch(e,{credentials:"include"}):n(e)}:o)(new URL(e,location.href).toString())}))))}function d(e,r){var n=a(navigator.connection);if(n instanceof Error)return Promise.reject(new Error("Cannot prerender, "+n.message));if(!HTMLScriptElement.supports("speculationrules"))return f(e),Promise.reject(new Error("This browser does not support the speculation rules API. Falling back to prefetch."));if(document.querySelector('script[type="speculationrules"]'))return Promise.reject(new Error("Speculation Rules is already defined and cannot be altered."));for(var t=0,o=[].concat(e);t<o.length;t+=1){var i=o[t];if(window.location.origin!==new URL(i,window.location.href).origin)return Promise.reject(new Error("Only same origin URLs are allowed: "+i));c.add(i)}u.size>0&&!s&&console.warn("[Warning] You are using both prefetching and prerendering on the same document");var l=function(e){var r=document.createElement("script");r.type="speculationrules",r.text='{"prerender":[{"source": "list","urls": ["'+Array.from(e).join('","')+'"]}]}';try{document.head.appendChild(r)}catch(e){return e}return!0}(c);return!0===l?Promise.resolve():Promise.reject(l)}window.quicklink=r,e.g.addEventListener("load",(()=>{const e=window.quicklinkOptions||{},r={};if("string"==typeof e.el&&e.el&&(r.el=document.querySelector(e.el)),"number"==typeof e.timeout&&(r.timeout=e.timeout),"number"==typeof e.limit&&e.limit>0&&(r.limit=e.limit),"number"==typeof e.throttle&&e.throttle>0&&(r.throttle=e.throttle),"string"==typeof e.timeoutFn&&"requestIdleCallback"!==e.timeoutFn&&"string"===window[e.timeoutFn]){const n=window[e.timeoutFn];r.timeoutFn=function(){return n.apply(window,arguments)}}if("string"==typeof e.onError&&"string"===window[e.onError]){const n=window[e.onError];r.onError=function(){return n.apply(window,arguments)}}"boolean"==typeof e.priority&&(r.priority=e.priority),Array.isArray(e.origins)&&0<e.origins.length&&(r.origins=e.origins),Array.isArray(e.ignores)&&0<e.ignores.length&&(r.ignores=e.ignores.map((e=>new RegExp(e)))),l(r),Array.isArray(e.urls)&&0<e.urls.length&&f(e.urls)}))}(); -
quicklink/tags/0.10.0/quicklink.php
r2583709 r2903907 4 4 * 5 5 * @package quicklink 6 * @version 0. 9.16 * @version 0.10.0 7 7 * 8 8 * Plugin Name: Quicklink for WordPress … … 11 11 * Author: WP Munich 12 12 * Author URI: https://www.wp-munich.com/?utm_source=wporg&utm_medium=plugin_repo&utm_campaign=description&utm_content=quicklink 13 * Version: 0. 9.113 * Version: 0.10.0 14 14 * Text Domain: quicklink 15 15 */ … … 32 32 } 33 33 34 wp_enqueue_script( 'quicklink', '', array(), '0. 9.1', true );34 wp_enqueue_script( 'quicklink', '', array(), '0.10.0', true ); 35 35 36 36 $options = array( … … 159 159 */ 160 160 function quicklink_to_default_scripts( $scripts ) { 161 $scripts->add( 'quicklink', QUICKLINK_URL . 'quicklink.min.js', array(), '0. 9.1' );161 $scripts->add( 'quicklink', QUICKLINK_URL . 'quicklink.min.js', array(), '0.10.0' ); 162 162 } 163 163 add_action( 'wp_default_scripts', 'quicklink_to_default_scripts' ); -
quicklink/tags/0.10.0/readme.txt
r2583709 r2903907 4 4 Tags: performance, speed, fast, prefetch, seo, http2, preconnect, optimization 5 5 Requires at least: 4.9 6 Tested up to: 5.86 Tested up to: 6.2 7 7 Requires PHP: 5.6 8 Stable tag: 0. 9.18 Stable tag: 0.10.0 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 55 55 == Changelog == 56 56 57 = 0.10.0 = 58 * General maintenance for the repository 59 * Updated Quicklink dependency to version 2.3 60 * Tested for WordPress 6.2 61 57 62 = 0.9.0 = 58 63 * General maintenance for the repository -
quicklink/trunk/quicklink.bundle.js
r2583709 r2903907 1 1 /******/ (function() { // webpackBootstrap 2 2 /******/ "use strict"; 3 /******/ var __webpack_modules__ = ([ 4 /* 0 */, 5 /* 1 */ 6 /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 7 8 __webpack_require__.r(__webpack_exports__); 9 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 10 /* harmony export */ "default": function() { return /* binding */ _typeof; } 11 /* harmony export */ }); 12 function _typeof(obj) { 13 "@babel/helpers - typeof"; 14 15 if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { 16 _typeof = function _typeof(obj) { 17 return typeof obj; 18 }; 19 } else { 20 _typeof = function _typeof(obj) { 21 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 22 }; 23 } 24 25 return _typeof(obj); 26 } 27 28 /***/ }), 29 /* 2 */ 30 /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 31 32 __webpack_require__.r(__webpack_exports__); 33 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 34 /* harmony export */ "listen": function() { return /* binding */ i; }, 35 /* harmony export */ "prefetch": function() { return /* binding */ c; } 36 /* harmony export */ }); 37 function e(e){return new Promise(function(n,t,r){(r=new XMLHttpRequest).open("GET",e,r.withCredentials=!0),r.onload=function(){200===r.status?n():t()},r.send()})}var n,t=(n=document.createElement("link")).relList&&n.relList.supports&&n.relList.supports("prefetch")?function(e){return new Promise(function(n,t,r){(r=document.createElement("link")).rel="prefetch",r.href=e,r.onload=n,r.onerror=t,document.head.appendChild(r)})}:e,r=window.requestIdleCallback||function(e){var n=Date.now();return setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-n))}})},1)},o=new Set;function i(e){if(e||(e={}),window.IntersectionObserver){var n=function(e){e=e||1;var n=[],t=0;function r(){t<e&&n.length>0&&(n.shift()(),t++)}return[function(e){n.push(e)>1||r()},function(){t--,r()}]}(e.throttle||1/0),t=n[0],i=n[1],u=e.limit||1/0,f=e.origins||[location.hostname],a=e.ignores||[],s=e.delay||0,l=[],h=e.timeoutFn||r,d="function"==typeof e.hrefFn&&e.hrefFn,m=new IntersectionObserver(function(n){n.forEach(function(n){if(n.isIntersecting)l.push((n=n.target).href),function(e,n){n?setTimeout(e,n):e()}(function(){-1!==l.indexOf(n.href)&&(m.unobserve(n),o.size<u&&t(function(){c(d?d(n):n.href,e.priority).then(i).catch(function(n){i(),e.onError&&e.onError(n)})}))},s);else{var r=l.indexOf((n=n.target).href);r>-1&&l.splice(r)}})},{threshold:e.threshold||0});return h(function(){(e.el||document).querySelectorAll("a").forEach(function(e){f.length&&!f.includes(e.hostname)||function e(n,t){return Array.isArray(t)?t.some(function(t){return e(n,t)}):(t.test||t).call(t,n.href,n)}(e,a)||m.observe(e)})},{timeout:e.timeout||2e3}),function(){o.clear(),m.disconnect()}}}function c(n,r,i){if(i=navigator.connection){if(i.saveData)return Promise.reject(new Error("Cannot prefetch, Save-Data is enabled"));if(/2g/.test(i.effectiveType))return Promise.reject(new Error("Cannot prefetch, network conditions are poor"))}return Promise.all([].concat(n).map(function(n){if(!o.has(n))return o.add(n),(r?function(n){return window.fetch?fetch(n,{credentials:"include"}):e(n)}:t)(new URL(n,location.href).toString())}))} 38 39 40 /***/ }) 41 /******/ ]); 42 /************************************************************************/ 43 /******/ // The module cache 44 /******/ var __webpack_module_cache__ = {}; 45 /******/ 46 /******/ // The require function 47 /******/ function __webpack_require__(moduleId) { 48 /******/ // Check if module is in cache 49 /******/ var cachedModule = __webpack_module_cache__[moduleId]; 50 /******/ if (cachedModule !== undefined) { 51 /******/ return cachedModule.exports; 52 /******/ } 53 /******/ // Create a new module (and put it into the cache) 54 /******/ var module = __webpack_module_cache__[moduleId] = { 55 /******/ // no module.id needed 56 /******/ // no module.loaded needed 57 /******/ exports: {} 58 /******/ }; 59 /******/ 60 /******/ // Execute the module function 61 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 62 /******/ 63 /******/ // Return the exports of the module 64 /******/ return module.exports; 65 /******/ } 3 /******/ // The require scope 4 /******/ var __webpack_require__ = {}; 66 5 /******/ 67 6 /************************************************************************/ … … 108 47 /************************************************************************/ 109 48 var __webpack_exports__ = {}; 110 // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.111 !function() {112 __webpack_require__.r(__webpack_exports__);113 /* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);114 /* harmony import */ var quicklink__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);115 49 116 // Move quicklink to the global scope 50 // NAMESPACE OBJECT: ./node_modules/quicklink/dist/quicklink.mjs 51 var quicklink_namespaceObject = {}; 52 __webpack_require__.r(quicklink_namespaceObject); 53 __webpack_require__.d(quicklink_namespaceObject, { 54 "listen": function() { return u; }, 55 "prefetch": function() { return s; }, 56 "prerender": function() { return f; } 57 }); 117 58 118 window.quicklink = quicklink__WEBPACK_IMPORTED_MODULE_1__; 119 __webpack_require__.g.addEventListener('load', function () { 120 var exportedOptions = window.quicklinkOptions || {}; 121 var listenerOptions = {}; // el: Convert selector into element reference. 59 ;// CONCATENATED MODULE: ./node_modules/quicklink/dist/quicklink.mjs 60 function e(e){return new Promise(function(n,r,t){(t=new XMLHttpRequest).open("GET",e,t.withCredentials=!0),t.onload=function(){200===t.status?n():r()},t.send()})}var n,r=(n=document.createElement("link")).relList&&n.relList.supports&&n.relList.supports("prefetch")?function(e){return new Promise(function(n,r,t){(t=document.createElement("link")).rel="prefetch",t.href=e,t.onload=n,t.onerror=r,document.head.appendChild(t)})}:e,t=window.requestIdleCallback||function(e){var n=Date.now();return setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-n))}})},1)},o=new Set,i=new Set,c=!1;function a(e){if(e){if(e.saveData)return new Error("Save-Data is enabled");if(/2g/.test(e.effectiveType))return new Error("network conditions are poor")}return!0}function u(e){if(e||(e={}),window.IntersectionObserver){var n=function(e){e=e||1;var n=[],r=0;function t(){r<e&&n.length>0&&(n.shift()(),r++)}return[function(e){n.push(e)>1||t()},function(){r--,t()}]}(e.throttle||1/0),r=n[0],a=n[1],u=e.limit||1/0,l=e.origins||[location.hostname],d=e.ignores||[],h=e.delay||0,p=[],m=e.timeoutFn||t,w="function"==typeof e.hrefFn&&e.hrefFn,g=e.prerender||!1;c=e.prerenderAndPrefetch||!1;var v=new IntersectionObserver(function(n){n.forEach(function(n){if(n.isIntersecting)p.push((n=n.target).href),function(e,n){n?setTimeout(e,n):e()}(function(){-1!==p.indexOf(n.href)&&(v.unobserve(n),(c||g)&&i.size<1?f(w?w(n):n.href).catch(function(n){if(!e.onError)throw n;e.onError(n)}):o.size<u&&!g&&r(function(){s(w?w(n):n.href,e.priority).then(a).catch(function(n){a(),e.onError&&e.onError(n)})}))},h);else{var t=p.indexOf((n=n.target).href);t>-1&&p.splice(t)}})},{threshold:e.threshold||0});return m(function(){(e.el||document).querySelectorAll("a").forEach(function(e){l.length&&!l.includes(e.hostname)||function e(n,r){return Array.isArray(r)?r.some(function(r){return e(n,r)}):(r.test||r).call(r,n.href,n)}(e,d)||v.observe(e)})},{timeout:e.timeout||2e3}),function(){o.clear(),v.disconnect()}}}function s(n,t,u){var s=a(navigator.connection);return s instanceof Error?Promise.reject(new Error("Cannot prefetch, "+s.message)):(i.size>0&&!c&&console.warn("[Warning] You are using both prefetching and prerendering on the same document"),Promise.all([].concat(n).map(function(n){if(!o.has(n))return o.add(n),(t?function(n){return window.fetch?fetch(n,{credentials:"include"}):e(n)}:r)(new URL(n,location.href).toString())})))}function f(e,n){var r=a(navigator.connection);if(r instanceof Error)return Promise.reject(new Error("Cannot prerender, "+r.message));if(!HTMLScriptElement.supports("speculationrules"))return s(e),Promise.reject(new Error("This browser does not support the speculation rules API. Falling back to prefetch."));if(document.querySelector('script[type="speculationrules"]'))return Promise.reject(new Error("Speculation Rules is already defined and cannot be altered."));for(var t=0,u=[].concat(e);t<u.length;t+=1){var f=u[t];if(window.location.origin!==new URL(f,window.location.href).origin)return Promise.reject(new Error("Only same origin URLs are allowed: "+f));i.add(f)}o.size>0&&!c&&console.warn("[Warning] You are using both prefetching and prerendering on the same document");var l=function(e){var n=document.createElement("script");n.type="speculationrules",n.text='{"prerender":[{"source": "list","urls": ["'+Array.from(e).join('","')+'"]}]}';try{document.head.appendChild(n)}catch(e){return e}return!0}(i);return!0===l?Promise.resolve():Promise.reject(l)} 122 61 62 ;// CONCATENATED MODULE: ./build/js/quicklink.js 63 64 65 // Move quicklink to the global scope 66 window.quicklink = quicklink_namespaceObject; 67 __webpack_require__.g.addEventListener('load', () => { 68 const exportedOptions = window.quicklinkOptions || {}; 69 const listenerOptions = {}; 70 71 // el: Convert selector into element reference. 123 72 if ('string' === typeof exportedOptions.el && exportedOptions.el) { 124 73 listenerOptions.el = document.querySelector(exportedOptions.el); 125 } // timeout: Verify we actually get an int for milliseconds.74 } 126 75 127 76 // timeout: Verify we actually get an int for milliseconds. 128 77 if ('number' === typeof exportedOptions.timeout) { 129 78 listenerOptions.timeout = exportedOptions.timeout; 130 } // limit: Verify we actually get an int.79 } 131 80 132 81 // limit: Verify we actually get an int. 133 82 if ('number' === typeof exportedOptions.limit && exportedOptions.limit > 0) { 134 83 listenerOptions.limit = exportedOptions.limit; 135 } // throttle: Verify we actually get an int.84 } 136 85 137 86 // throttle: Verify we actually get an int. 138 87 if ('number' === typeof exportedOptions.throttle && exportedOptions.throttle > 0) { 139 88 listenerOptions.throttle = exportedOptions.throttle; 140 } // timeoutFn: Obtain function reference as opposed to function string, if it is not the default.89 } 141 90 142 143 if ('string' === typeof exportedOptions.timeoutFn && 'requestIdleCallback' !== exportedOptions.timeoutFn && (0,_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__.default)('function') === window[exportedOptions.timeoutFn]) { 144 var timeoutFn = window[exportedOptions.timeoutFn]; 145 91 // timeoutFn: Obtain function reference as opposed to function string, if it is not the default. 92 if ('string' === typeof exportedOptions.timeoutFn && 'requestIdleCallback' !== exportedOptions.timeoutFn && typeof 'function' === window[exportedOptions.timeoutFn]) { 93 const timeoutFn = window[exportedOptions.timeoutFn]; 146 94 listenerOptions.timeoutFn = function () { 147 95 return timeoutFn.apply(window, arguments); 148 96 }; 149 } // onError: Obtain function reference as opposed to function string, if it is not the default.97 } 150 98 151 152 if ('string' === typeof exportedOptions.onError && (0,_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__.default)('function') === window[exportedOptions.onError]) { 153 var onError = window[exportedOptions.onError]; 154 99 // onError: Obtain function reference as opposed to function string, if it is not the default. 100 if ('string' === typeof exportedOptions.onError && typeof 'function' === window[exportedOptions.onError]) { 101 const onError = window[exportedOptions.onError]; 155 102 listenerOptions.onError = function () { 156 103 return onError.apply(window, arguments); 157 104 }; 158 } // priority: Obtain priority.105 } 159 106 160 107 // priority: Obtain priority. 161 108 if ('boolean' === typeof exportedOptions.priority) { 162 109 listenerOptions.priority = exportedOptions.priority; 163 } // origins: Verify we don't get an empty array, as that would turn off quicklink.110 } 164 111 165 112 // origins: Verify we don't get an empty array, as that would turn off quicklink. 166 113 if (Array.isArray(exportedOptions.origins) && 0 < exportedOptions.origins.length) { 167 114 listenerOptions.origins = exportedOptions.origins; 168 } // ignores: Convert strings to regular expressions.115 } 169 116 170 117 // ignores: Convert strings to regular expressions. 171 118 if (Array.isArray(exportedOptions.ignores) && 0 < exportedOptions.ignores.length) { 172 listenerOptions.ignores = exportedOptions.ignores.map( function (ignore){119 listenerOptions.ignores = exportedOptions.ignores.map(ignore => { 173 120 return new RegExp(ignore); 174 121 }); 175 122 } 123 u(listenerOptions); 176 124 177 quicklink__WEBPACK_IMPORTED_MODULE_1__.listen(listenerOptions);178 125 /** 179 126 * The option to prefetch urls from the options is deprecated as of version 0.8.0. 180 127 */ 181 182 128 if (Array.isArray(exportedOptions.urls) && 0 < exportedOptions.urls.length) { 183 quicklink__WEBPACK_IMPORTED_MODULE_1__.prefetch(exportedOptions.urls);129 s(exportedOptions.urls); 184 130 } 185 131 }); 186 }();187 132 /******/ })() 188 133 ; -
quicklink/trunk/quicklink.min.js
r2583709 r2903907 1 !function(){"use strict";var r=[,function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}n.r(e),n.d(e,{default:function(){return r}})},function(t,e,n){function r(r){return new Promise(function(t,e,n){(n=new XMLHttpRequest).open("GET",r,n.withCredentials=!0),n.onload=function(){200===n.status?t():e()},n.send()})}n.r(e),n.d(e,{listen:function(){return u},prefetch:function(){return m}});var o,i=(o=document.createElement("link")).relList&&o.relList.supports&&o.relList.supports("prefetch")?function(r){return new Promise(function(t,e,n){(n=document.createElement("link")).rel="prefetch",n.href=r,n.onload=t,n.onerror=e,document.head.appendChild(n)})}:r,d=window.requestIdleCallback||function(t){var e=Date.now();return setTimeout(function(){t({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-e))}})},1)},p=new Set;function u(r){if(r=r||{},window.IntersectionObserver){var t=function(t){t=t||1;var e=[],n=0;function r(){n<t&&0<e.length&&(e.shift()(),n++)}return[function(t){1<e.push(t)||r()},function(){n--,r()}]}(r.throttle||1/0),o=t[0],i=t[1],u=r.limit||1/0,e=r.origins||[location.hostname],n=r.ignores||[],c=r.delay||0,f=[],l=r.timeoutFn||d,a="function"==typeof r.hrefFn&&r.hrefFn,s=new IntersectionObserver(function(t){t.forEach(function(t){if(t.isIntersecting)f.push((t=t.target).href),n=function(){-1!==f.indexOf(t.href)&&(s.unobserve(t),p.size<u&&o(function(){m(a?a(t):t.href,r.priority).then(i).catch(function(t){i(),r.onError&&r.onError(t)})}))},c?setTimeout(n,c):n();else{var e=f.indexOf((t=t.target).href);-1<e&&f.splice(e)}var n})},{threshold:r.threshold||0});return l(function(){(r.el||document).querySelectorAll("a").forEach(function(t){e.length&&!e.includes(t.hostname)||function e(n,t){return Array.isArray(t)?t.some(function(t){return e(n,t)}):(t.test||t).call(t,n.href,n)}(t,n)||s.observe(t)})},{timeout:r.timeout||2e3}),function(){p.clear(),s.disconnect()}}}function m(t,e,n){if(n=navigator.connection){if(n.saveData)return Promise.reject(new Error("Cannot prefetch, Save-Data is enabled"));if(/2g/.test(n.effectiveType))return Promise.reject(new Error("Cannot prefetch, network conditions are poor"))}return Promise.all([].concat(t).map(function(t){if(!p.has(t))return p.add(t),(e?function(t){return window.fetch?fetch(t,{credentials:"include"}):r(t)}:i)(new URL(t,location.href).toString())}))}}],o={};function u(t){var e=o[t];if(void 0!==e)return e.exports;var n=o[t]={exports:{}};return r[t](n,n.exports,u),n.exports}u.d=function(t,e){for(var n in e)u.o(e,n)&&!u.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},u.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),u.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},u.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var t={};!function(){u.r(t);var o=u(1),i=u(2);window.quicklink=i,u.g.addEventListener("load",function(){var t=window.quicklinkOptions||{},e={};if("string"==typeof t.el&&t.el&&(e.el=document.querySelector(t.el)),"number"==typeof t.timeout&&(e.timeout=t.timeout),"number"==typeof t.limit&&0<t.limit&&(e.limit=t.limit),"number"==typeof t.throttle&&0<t.throttle&&(e.throttle=t.throttle),"string"==typeof t.timeoutFn&&"requestIdleCallback"!==t.timeoutFn&&(0,o.default)("function")===window[t.timeoutFn]){var n=window[t.timeoutFn];e.timeoutFn=function(){return n.apply(window,arguments)}}if("string"==typeof t.onError&&(0,o.default)("function")===window[t.onError]){var r=window[t.onError];e.onError=function(){return r.apply(window,arguments)}}"boolean"==typeof t.priority&&(e.priority=t.priority),Array.isArray(t.origins)&&0<t.origins.length&&(e.origins=t.origins),Array.isArray(t.ignores)&&0<t.ignores.length&&(e.ignores=t.ignores.map(function(t){return new RegExp(t)})),i.listen(e),Array.isArray(t.urls)&&0<t.urls.length&&i.prefetch(t.urls)})}()}();1 !function(){"use strict";var e={d:function(r,n){for(var t in n)e.o(n,t)&&!e.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:n[t]})}};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),e.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},e.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};function n(e){return new Promise((function(r,n,t){(t=new XMLHttpRequest).open("GET",e,t.withCredentials=!0),t.onload=function(){200===t.status?r():n()},t.send()}))}e.r(r),e.d(r,{listen:function(){return l},prefetch:function(){return f},prerender:function(){return d}});var t,o=(t=document.createElement("link")).relList&&t.relList.supports&&t.relList.supports("prefetch")?function(e){return new Promise((function(r,n,t){(t=document.createElement("link")).rel="prefetch",t.href=e,t.onload=r,t.onerror=n,document.head.appendChild(t)}))}:n,i=window.requestIdleCallback||function(e){var r=Date.now();return setTimeout((function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-r))}})}),1)},u=new Set,c=new Set,s=!1;function a(e){if(e){if(e.saveData)return new Error("Save-Data is enabled");if(/2g/.test(e.effectiveType))return new Error("network conditions are poor")}return!0}function l(e){if(e||(e={}),window.IntersectionObserver){var r=function(e){e=e||1;var r=[],n=0;function t(){n<e&&r.length>0&&(r.shift()(),n++)}return[function(e){r.push(e)>1||t()},function(){n--,t()}]}(e.throttle||1/0),n=r[0],t=r[1],o=e.limit||1/0,a=e.origins||[location.hostname],l=e.ignores||[],p=e.delay||0,h=[],m=e.timeoutFn||i,w="function"==typeof e.hrefFn&&e.hrefFn,g=e.prerender||!1;s=e.prerenderAndPrefetch||!1;var y=new IntersectionObserver((function(r){r.forEach((function(r){if(r.isIntersecting)h.push((r=r.target).href),function(e,r){r?setTimeout(e,r):e()}((function(){-1!==h.indexOf(r.href)&&(y.unobserve(r),(s||g)&&c.size<1?d(w?w(r):r.href).catch((function(r){if(!e.onError)throw r;e.onError(r)})):u.size<o&&!g&&n((function(){f(w?w(r):r.href,e.priority).then(t).catch((function(r){t(),e.onError&&e.onError(r)}))})))}),p);else{var i=h.indexOf((r=r.target).href);i>-1&&h.splice(i)}}))}),{threshold:e.threshold||0});return m((function(){(e.el||document).querySelectorAll("a").forEach((function(e){a.length&&!a.includes(e.hostname)||function e(r,n){return Array.isArray(n)?n.some((function(n){return e(r,n)})):(n.test||n).call(n,r.href,r)}(e,l)||y.observe(e)}))}),{timeout:e.timeout||2e3}),function(){u.clear(),y.disconnect()}}}function f(e,r,t){var i=a(navigator.connection);return i instanceof Error?Promise.reject(new Error("Cannot prefetch, "+i.message)):(c.size>0&&!s&&console.warn("[Warning] You are using both prefetching and prerendering on the same document"),Promise.all([].concat(e).map((function(e){if(!u.has(e))return u.add(e),(r?function(e){return window.fetch?fetch(e,{credentials:"include"}):n(e)}:o)(new URL(e,location.href).toString())}))))}function d(e,r){var n=a(navigator.connection);if(n instanceof Error)return Promise.reject(new Error("Cannot prerender, "+n.message));if(!HTMLScriptElement.supports("speculationrules"))return f(e),Promise.reject(new Error("This browser does not support the speculation rules API. Falling back to prefetch."));if(document.querySelector('script[type="speculationrules"]'))return Promise.reject(new Error("Speculation Rules is already defined and cannot be altered."));for(var t=0,o=[].concat(e);t<o.length;t+=1){var i=o[t];if(window.location.origin!==new URL(i,window.location.href).origin)return Promise.reject(new Error("Only same origin URLs are allowed: "+i));c.add(i)}u.size>0&&!s&&console.warn("[Warning] You are using both prefetching and prerendering on the same document");var l=function(e){var r=document.createElement("script");r.type="speculationrules",r.text='{"prerender":[{"source": "list","urls": ["'+Array.from(e).join('","')+'"]}]}';try{document.head.appendChild(r)}catch(e){return e}return!0}(c);return!0===l?Promise.resolve():Promise.reject(l)}window.quicklink=r,e.g.addEventListener("load",(()=>{const e=window.quicklinkOptions||{},r={};if("string"==typeof e.el&&e.el&&(r.el=document.querySelector(e.el)),"number"==typeof e.timeout&&(r.timeout=e.timeout),"number"==typeof e.limit&&e.limit>0&&(r.limit=e.limit),"number"==typeof e.throttle&&e.throttle>0&&(r.throttle=e.throttle),"string"==typeof e.timeoutFn&&"requestIdleCallback"!==e.timeoutFn&&"string"===window[e.timeoutFn]){const n=window[e.timeoutFn];r.timeoutFn=function(){return n.apply(window,arguments)}}if("string"==typeof e.onError&&"string"===window[e.onError]){const n=window[e.onError];r.onError=function(){return n.apply(window,arguments)}}"boolean"==typeof e.priority&&(r.priority=e.priority),Array.isArray(e.origins)&&0<e.origins.length&&(r.origins=e.origins),Array.isArray(e.ignores)&&0<e.ignores.length&&(r.ignores=e.ignores.map((e=>new RegExp(e)))),l(r),Array.isArray(e.urls)&&0<e.urls.length&&f(e.urls)}))}(); -
quicklink/trunk/quicklink.php
r2583709 r2903907 4 4 * 5 5 * @package quicklink 6 * @version 0. 9.16 * @version 0.10.0 7 7 * 8 8 * Plugin Name: Quicklink for WordPress … … 11 11 * Author: WP Munich 12 12 * Author URI: https://www.wp-munich.com/?utm_source=wporg&utm_medium=plugin_repo&utm_campaign=description&utm_content=quicklink 13 * Version: 0. 9.113 * Version: 0.10.0 14 14 * Text Domain: quicklink 15 15 */ … … 32 32 } 33 33 34 wp_enqueue_script( 'quicklink', '', array(), '0. 9.1', true );34 wp_enqueue_script( 'quicklink', '', array(), '0.10.0', true ); 35 35 36 36 $options = array( … … 159 159 */ 160 160 function quicklink_to_default_scripts( $scripts ) { 161 $scripts->add( 'quicklink', QUICKLINK_URL . 'quicklink.min.js', array(), '0. 9.1' );161 $scripts->add( 'quicklink', QUICKLINK_URL . 'quicklink.min.js', array(), '0.10.0' ); 162 162 } 163 163 add_action( 'wp_default_scripts', 'quicklink_to_default_scripts' ); -
quicklink/trunk/readme.txt
r2583709 r2903907 4 4 Tags: performance, speed, fast, prefetch, seo, http2, preconnect, optimization 5 5 Requires at least: 4.9 6 Tested up to: 5.86 Tested up to: 6.2 7 7 Requires PHP: 5.6 8 Stable tag: 0. 9.18 Stable tag: 0.10.0 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 55 55 == Changelog == 56 56 57 = 0.10.0 = 58 * General maintenance for the repository 59 * Updated Quicklink dependency to version 2.3 60 * Tested for WordPress 6.2 61 57 62 = 0.9.0 = 58 63 * General maintenance for the repository
Note: See TracChangeset
for help on using the changeset viewer.