[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/js/dist/script-modules/interactivity-router/ -> full-page.js (source)

   1  /******/ var __webpack_modules__ = ({
   2  
   3  /***/ 438:
   4  /***/ ((module) => {
   5  
   6  module.exports = import("@wordpress/interactivity-router");;
   7  
   8  /***/ })
   9  
  10  /******/ });
  11  /************************************************************************/
  12  /******/ // The module cache
  13  /******/ var __webpack_module_cache__ = {};
  14  /******/ 
  15  /******/ // The require function
  16  /******/ function __webpack_require__(moduleId) {
  17  /******/     // Check if module is in cache
  18  /******/     var cachedModule = __webpack_module_cache__[moduleId];
  19  /******/     if (cachedModule !== undefined) {
  20  /******/         return cachedModule.exports;
  21  /******/     }
  22  /******/     // Create a new module (and put it into the cache)
  23  /******/     var module = __webpack_module_cache__[moduleId] = {
  24  /******/         // no module.id needed
  25  /******/         // no module.loaded needed
  26  /******/         exports: {}
  27  /******/     };
  28  /******/ 
  29  /******/     // Execute the module function
  30  /******/     __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
  31  /******/ 
  32  /******/     // Return the exports of the module
  33  /******/     return module.exports;
  34  /******/ }
  35  /******/ 
  36  /************************************************************************/
  37  var __webpack_exports__ = {};
  38  const isValidLink = (ref) => ref && ref instanceof window.HTMLAnchorElement && ref.href && (!ref.target || ref.target === "_self") && ref.origin === window.location.origin && !ref.pathname.startsWith("/wp-admin") && !ref.pathname.startsWith("/wp-login.php") && !ref.getAttribute("href").startsWith("#") && !new URL(ref.href).searchParams.has("_wpnonce");
  39  const isValidEvent = (event) => event && event.button === 0 && // Left clicks only.
  40  !event.metaKey && // Open in new tab (Mac).
  41  !event.ctrlKey && // Open in new tab (Windows).
  42  !event.altKey && // Download.
  43  !event.shiftKey && !event.defaultPrevented;
  44  document.addEventListener("click", async (event) => {
  45    const ref = event.target.closest("a");
  46    if (isValidLink(ref) && isValidEvent(event)) {
  47      event.preventDefault();
  48      const { actions } = await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 438));
  49      actions.navigate(ref.href);
  50    }
  51  });
  52  document.addEventListener(
  53    "mouseenter",
  54    async (event) => {
  55      if (event.target?.nodeName === "A") {
  56        const ref = event.target.closest("a");
  57        if (isValidLink(ref) && isValidEvent(event)) {
  58          const { actions } = await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 438));
  59          actions.prefetch(ref.href);
  60        }
  61      }
  62    },
  63    true
  64  );
  65  


Generated : Thu Oct 23 08:20:05 2025 Cross-referenced by PHPXref