1/* ----------------------------------------------------------------------------------------------- 2 Namespace 3--------------------------------------------------------------------------------------------------- */ 4// ! function(a) { "function" == typeof define && define.amd ? define(["jquery"], a) : "object" == typeof exports ? module.exports = a : a(jQuery) }(function(a) { 5// function b(b) { 6// var g = b || window.event, 7// h = i.call(arguments, 1), 8// j = 0, 9// l = 0, 10// m = 0, 11// n = 0, 12// o = 0, 13// p = 0; 14// if (b = a.event.fix(g), b.type = "mousewheel", "detail" in g && (m = -1 * g.detail), "wheelDelta" in g && (m = g.wheelDelta), "wheelDeltaY" in g && (m = g.wheelDeltaY), "wheelDeltaX" in g && (l = -1 * g.wheelDeltaX), "axis" in g && g.axis === g.HORIZONTAL_AXIS && (l = -1 * m, m = 0), j = 0 === m ? l : m, "deltaY" in g && (m = -1 * g.deltaY, j = m), "deltaX" in g && (l = g.deltaX, 0 === m && (j = -1 * l)), 0 !== m || 0 !== l) { 15// if (1 === g.deltaMode) { 16// var q = a.data(this, "mousewheel-line-height"); 17// j *= q, m *= q, l *= q 18// } else if (2 === g.deltaMode) { 19// var r = a.data(this, "mousewheel-page-height"); 20// j *= r, m *= r, l *= r 21// } 22// if (n = Math.max(Math.abs(m), Math.abs(l)), (!f || f > n) && (f = n, d(g, n) && (f /= 40)), d(g, n) && (j /= 40, l /= 40, m /= 40), j = Math[j >= 1 ? "floor" : "ceil"](j / f), l = Math[l >= 1 ? "floor" : "ceil"](l / f), m = Math[m >= 1 ? "floor" : "ceil"](m / f), k.settings.normalizeOffset && this.getBoundingClientRect) { 23// var s = this.getBoundingClientRect(); 24// o = b.clientX - s.left, p = b.clientY - s.top 25// } 26// return b.deltaX = l, b.deltaY = m, b.deltaFactor = f, b.offsetX = o, b.offsetY = p, b.deltaMode = 0, h.unshift(b, j, l, m), e && clearTimeout(e), e = setTimeout(c, 200), (a.event.dispatch || a.event.handle).apply(this, h) 27// } 28// } 29 30// function c() { f = null } 31 32// function d(a, b) { return k.settings.adjustOldDeltas && "mousewheel" === a.type && b % 120 === 0 } 33// var e, f, g = ["wheel", "mousewheel", "DOMMouseScroll", "MozMousePixelScroll"], 34// h = "onwheel" in document || document.documentMode >= 9 ? ["wheel"] : ["mousewheel", "DomMouseScroll", "MozMousePixelScroll"], 35// i = Array.prototype.slice; 36// if (a.event.fixHooks) 37// for (var j = g.length; j;) a.event.fixHooks[g[--j]] = a.event.mouseHooks; 38// var k = a.event.special.mousewheel = { 39// version: "3.1.12", 40// setup: function() { 41// if (this.addEventListener) 42// for (var c = h.length; c;) this.addEventListener(h[--c], b, !1); 43// else this.onmousewheel = b; 44// a.data(this, "mousewheel-line-height", k.getLineHeight(this)), a.data(this, "mousewheel-page-height", k.getPageHeight(this)) 45// }, 46// teardown: function() { 47// if (this.removeEventListener) 48// for (var c = h.length; c;) this.removeEventListener(h[--c], b, !1); 49// else this.onmousewheel = null; 50// a.removeData(this, "mousewheel-line-height"), a.removeData(this, "mousewheel-page-height") 51// }, 52// getLineHeight: function(b) { 53// var c = a(b), 54// d = c["offsetParent" in a.fn ? "offsetParent" : "parent"](); 55// return d.length || (d = a("body")), parseInt(d.css("fontSize"), 10) || parseInt(c.css("fontSize"), 10) || 16 56// }, 57// getPageHeight: function(b) { return a(b).height() }, 58// settings: { adjustOldDeltas: !0, normalizeOffset: !0 } 59// }; 60// a.fn.extend({ mousewheel: function(a) { return a ? this.bind("mousewheel", a) : this.trigger("mousewheel") }, unmousewheel: function(a) { return this.unbind("mousewheel", a) } }) 61// }); 62try { 63 var twentytwenty = twentytwenty || {}; 64 // Set a default value for scrolled. 65 twentytwenty.scrolled = 0; 66 67 // polyfill closest 68 // https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#Polyfill 69 if (!Element.prototype.closest) { 70 Element.prototype.closest = function (s) { 71 var el = this; 72 73 do { 74 if (el.matches(s)) { 75 return el; 76 } 77 78 el = el.parentElement || el.parentNode; 79 } while (el !== null && el.nodeType === 1); 80 81 return null; 82 }; 83 } 84
85 // polyfill forEach 86 // https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach#Polyfill 87 if (window.NodeList && !NodeList.prototype.forEach) { 88 NodeList.prototype.forEach = function (callback, thisArg) { 89 var i; 90 var len = this.length; 91 92 thisArg = thisArg || window; 93 94 for (i = 0; i < len; i++) { 95 callback.call(thisArg, this[i], i, this); 96 } 97 }; 98 } 99 100 // event "polyfill" 101 twentytwenty.createEvent = function (eventName) { 102 var event; 103 if (typeof window.Event === "function") { 104 event = new Event(eventName); 105 } else { 106 event = document.createEvent("Event"); 107 event.initEvent(eventName, true, false); 108 } 109 return event; 110 }; 111 112 // matches "polyfill" 113 // https://developer.mozilla.org/es/docs/Web/API/Element/matches 114 if (!Element.prototype.matches) { 115 Element.prototype.matches = 116 Element.prototype.matchesSelector || 117 Element.prototype.mozMatchesSelector || 118 Element.prototype.msMatchesSelector || 119 Element.prototype.oMatchesSelector || 120 Element.prototype.webkitMatchesSelector || 121 function (s) { 122 var matches = (this.document || this.ownerDocument).querySelectorAll(s), 123 i = matches.length; 124 while (--i >= 0 && matches.item(i) !== this) {} 125 return i > -1; 126 }; 127 } 128 129 // Add a class to the body for when touch is enabled for browsers that don't support media queries 130 // for interaction media features. Adapted from <https://codepen.io/Ferie/pen/vQOMmO>. 131 twentytwenty.touchEnabled = { 132 init: function () { 133 var matchMedia = function () { 134 // Include the 'heartz' as a way to have a non-matching MQ to help terminate the join. See <https://git.io/vznFH>. 135 var prefixes = ["-webkit-", "-moz-", "-o-", "-ms-"]; 136 var query = [ 137 "(", 138 prefixes.join("touch-enabled),("), 139 "heartz", 140 ")", 141 ].join(""); 142 return window.matchMedia && window.matchMedia(query).matches; 143 }; 144 145 if ( 146 "ontouchstart" in window || 147 (window.DocumentTouch && document instanceof window.DocumentTouch) || 148 matchMedia() 149 ) { 150 document.body.classList.add("touch-enabled"); 151 } 152 }, 153 }; // twentytwenty.touchEnabled 154 155 /* ----------------------------------------------------------------------------------------------- 156 Cover Modals 157 --------------------------------------------------------------------------------------------------- */ 158 159 twentytwenty.coverModals = { 160 init: function () { 161 if (document.querySelector(".cover-modal")) { 162 // Handle cover modals when they're toggled. 163 this.onToggle(); 164 165 // When toggled, untoggle if visitor clicks on the wrapping element of the modal. 166 this.outsideUntoggle(); 167 168 // Close on escape key press. 169 this.closeOnEscape(); 170 171 // Hide and show modals before and after their animations have played out. 172 this.hideAndShowModals(); 173 } 174 }, 175 176 // Handle cover modals when they're toggled. 177 onToggle: function () { 178 document.querySelectorAll(".cover-modal").forEach(function (element) { 179 element.addEventListener("toggled", function (event) { 180 var modal = event.target, 181 body = document.body; 182 183 if (modal.classList.contains("active")) { 184 body.classList.add("showing-modal"); 185 } else { 186 body.classList.remove("showing-modal"); 187 body.classList.add("hiding-modal"); 188 189 // Remove the hiding class after a delay, when animations have been run. 190 setTimeout(function () { 191 body.classList.remove("hiding-modal"); 192 }, 500); 193 } 194 }); 195 }); 196 }, 197 198 // Close modal on outside click. 199 outsideUntoggle: function () { 200 document.addEventListener( 201 "click", 202 function (event) { 203 var target = event.target; 204 var modal = document.querySelector(".cover-modal.active"); 205 206 // if target onclick is <a> with # within the href attribute 207 if ( 208 event.target.tagName.toLowerCase() === "a" && 209 event.target.hash.includes("#") && 210 modal !== null 211 ) { 212 // untoggle the modal 213 this.untoggleModal(modal);
214 // wait 550 and scroll to the anchor 215 setTimeout(function () { 216 var anchor = document.getElementById(event.target.hash.slice(1)); 217 anchor.scrollIntoView(); 218 }, 550); 219 } 220 221 if (target === modal) { 222 this.untoggleModal(target); 223 } 224 }.bind(this) 225 ); 226 }, 227 228 // Close modal on escape key press. 229 closeOnEscape: function () { 230 document.addEventListener( 231 "keydown", 232 function (event) { 233 if (event.keyCode === 27) { 234 event.preventDefault(); 235 document.querySelectorAll(".cover-modal.active").forEach( 236 function (element) { 237 this.untoggleModal(element); 238 }.bind(this) 239 ); 240 } 241 }.bind(this) 242 ); 243 }, 244 245 // Hide and show modals before and after their animations have played out. 246 hideAndShowModals: function () { 247 var _doc = document, 248 _win = window, 249 modals = _doc.querySelectorAll(".cover-modal"), 250 htmlStyle = _doc.documentElement.style, 251 adminBar = _doc.querySelector("#wpadminbar"); 252 253 function getAdminBarHeight(negativeValue) { 254 var height, 255 currentScroll = _win.pageYOffset; 256 257 if (adminBar) { 258 height = currentScroll + adminBar.getBoundingClientRect().height; 259 260 return negativeValue ? -height : height; 261 } 262 263 return currentScroll === 0 ? 0 : -currentScroll; 264 } 265 266 function htmlStyles() { 267 var overflow = 268 _win.innerHeight > 269 _doc.documentElement.getBoundingClientRect().height; 270 271 return { 272 "overflow-y": overflow ? "hidden" : "scroll", 273 position: "fixed", 274 width: "100%", 275 top: getAdminBarHeight(true) + "px", 276 left: 0, 277 }; 278 } 279 280 // Show the modal. 281 modals.forEach(function (modal) { 282 modal.addEventListener( 283 "toggle-target-before-inactive", 284 function (event) { 285 var styles = htmlStyles(), 286 offsetY = _win.pageYOffset, 287 paddingTop = Math.abs(getAdminBarHeight()) - offsetY + "px", 288 mQuery = _win.matchMedia("(max-width: 600px)"); 289 290 if (event.target !== modal) { 291 return; 292 } 293 294 Object.keys(styles).forEach(function (styleKey) { 295 htmlStyle.setProperty(styleKey, styles[styleKey]); 296 }); 297 298 _win.twentytwenty.scrolled = parseInt(styles.top, 10); 299 300 if (adminBar) { 301 _doc.body.style.setProperty("padding-top", paddingTop); 302 303 if (mQuery.matches) { 304 if (offsetY >= getAdminBarHeight()) { 305 modal.style.setProperty("top", 0); 306 } else { 307 modal.style.setProperty( 308 "top", 309 getAdminBarHeight() - offsetY + "px" 310 ); 311 } 312 } 313 } 314 315 modal.classList.add("show-modal"); 316 } 317 ); 318 319 // Hide the modal after a delay, so animations have time to play out. 320 modal.addEventListener( 321 "toggle-target-after-inactive", 322 function (event) { 323 if (event.target !== modal) { 324 return; 325 } 326 327 setTimeout(function () { 328 var clickedEl = twentytwenty.toggles.clickedEl; 329 330 modal.classList.remove("show-modal"); 331 Object.keys(htmlStyles()).forEach(function (styleKey) { 332 htmlStyle.removeProperty(styleKey); 333 }); 334 335 if (adminBar) { 336 _doc.body.style.removeProperty("padding-top"); 337 modal.style.removeProperty("top"); 338 } 339 340 if (clickedEl !== false) { 341 clickedEl.focus(); 342 clickedEl = false; 343 } 344 345 _win.scrollTo( 346 0, 347 Math.abs(_win.twentytwenty.scrolled + getAdminBarHeight()) 348 ); 349 _win.twentytwenty.scrolled = 0; 350 }, 500); 351 } 352 ); 353 }); 354 }, 355 356 // Untoggle a modal. 357 untoggleModal: function (modal) { 358 var modalTargetClass, 359 modalToggle = false; 360 361 // If the modal has specified the string (ID or class) used by toggles to target it, untoggle the toggles with that target string. 362 // The modal-target-string must match the string toggles use to target the modal. 363 if (modal.dataset.modalTargetString) { 364 modalTargetClass = modal.dataset.modalTargetString; 365 366 modalToggle = document.querySelector( 367 '*[data-toggle-target="' + modalTargetClass + '"]' 368 ); 369 } 370 371 // If a modal toggle exists, trigger it so all of the toggle options are included. 372 if (modalToggle) { 373 modalToggle.click(); 374 375 // If one doesn't exist, just hide the modal. 376 } else { 377 modal.classList.remove("active"); 378 } 379 }, 380 }; // twentytwenty.coverModals 381 382 /* ----------------------------------------------------------------------------------------------- 383 Intrinsic Ratio Embeds 384 --------------------------------------------------------------------------------------------------- */ 385 386 twentytwenty.intrinsicRatioVideos = { 387 init: function () { 388 this.makeFit(); 389 390 window.addEventListener( 391 "resize", 392 function () { 393 this.makeFit(); 394 }.bind(this) 395 ); 396 }, 397 398 makeFit: function () { 399 document 400 .querySelectorAll("iframe, object, video") 401 .forEach(function (video) { 402 var ratio, 403 iTargetWidth, 404 container = video.parentNode; 405 406 // Skip videos we want to ignore. 407 if ( 408 video.classList.contains("intrinsic-ignore") || 409 video.parentNode.classList.contains("intrinsic-ignore") 410 ) { 411 return true; 412 } 413 414 if (!video.dataset.origwidth) { 415 // Get the video element proportions. 416 video.setAttribute("data-origwidth", video.width); 417 video.setAttribute("data-origheight", video.height); 418 } 419 420 iTargetWidth = container.offsetWidth; 421 422 // Get ratio from proportions. 423 ratio = iTargetWidth / video.dataset.origwidth; 424 425 // Scale based on ratio, thus retaining proportions. 426 video.style.width = iTargetWidth + "px"; 427 video.style.height = video.dataset.origheight * ratio + "px"; 428 }); 429 }, 430 }; // twentytwenty.instrinsicRatioVideos 431 432 /* ----------------------------------------------------------------------------------------------- 433 Modal Menu 434 --------------------------------------------------------------------------------------------------- */ 435 twentytwenty.modalMenu = { 436 init: function () { 437 // If the current menu item is in a sub level, expand all the levels higher up on load. 438 this.expandLevel(); 439 this.keepFocusInModal(); 440 }, 441 442 expandLevel: function () { 443 var modalMenus = document.querySelectorAll(".modal-menu"); 444
445 modalMenus.forEach(function (modalMenu) { 446 var activeMenuItem = modalMenu.querySelector(".current-menu-item"); 447 448 if (activeMenuItem) { 449 twentytwentyFindParents(activeMenuItem, "li").forEach(function ( 450 element 451 ) { 452 var subMenuToggle = element.querySelector(".sub-menu-toggle"); 453 if (subMenuToggle) { 454 twentytwenty.toggles.performToggle(subMenuToggle, true); 455 } 456 }); 457 } 458 }); 459 }, 460 461 keepFocusInModal: function () { 462 var _doc = document; 463 464 _doc.addEventListener("keydown", function (event) { 465 var toggleTarget, 466 modal, 467 selectors, 468 elements, 469 menuType, 470 bottomMenu, 471 activeEl, 472 lastEl, 473 firstEl, 474 tabKey, 475 shiftKey, 476 clickedEl = twentytwenty.toggles.clickedEl; 477 478 if (clickedEl && _doc.body.classList.contains("showing-modal")) { 479 toggleTarget = clickedEl.dataset.toggleTarget; 480 selectors = "input, a, button"; 481 modal = _doc.querySelector(toggleTarget); 482 483 elements = modal.querySelectorAll(selectors); 484 elements = Array.prototype.slice.call(elements); 485 486 if (".menu-modal" === toggleTarget) { 487 menuType = window.matchMedia("(min-width: 1000px)").matches; 488 menuType = menuType ? ".expanded-menu" : ".mobile-menu"; 489 490 elements = elements.filter(function (element) { 491 return ( 492 null !== element.closest(menuType) && 493 null !== element.offsetParent 494 ); 495 }); 496 497 elements.unshift(_doc.querySelector(".close-nav-toggle")); 498 499 bottomMenu = _doc.querySelector(".menu-bottom > nav"); 500 501 if (bottomMenu) { 502 bottomMenu 503 .querySelectorAll(selectors) 504 .forEach(function (element) { 505 elements.push(element); 506 }); 507 } 508 } 509 510 lastEl = elements[elements.length - 1]; 511 firstEl = elements[0]; 512 activeEl = _doc.activeElement; 513 tabKey = event.keyCode === 9; 514 shiftKey = event.shiftKey; 515 516 if (!shiftKey && tabKey && lastEl === activeEl) { 517 event.preventDefault(); 518 firstEl.focus(); 519 } 520 521 if (shiftKey && tabKey && firstEl === activeEl) { 522 event.preventDefault(); 523 lastEl.focus(); 524 } 525 } 526 }); 527 }, 528 }; // twentytwenty.modalMenu 529 530 /* ----------------------------------------------------------------------------------------------- 531 Primary Menu 532 --------------------------------------------------------------------------------------------------- */ 533 534 twentytwenty.primaryMenu = { 535 init: function () { 536 this.focusMenuWithChildren(); 537 }, 538 539 // The focusMenuWithChildren() function implements Keyboard Navigation in the Primary Menu 540 // by adding the '.focus' class to all 'li.menu-item-has-children' when the focus is on the 'a' element. 541 focusMenuWithChildren: function () { 542 // Get all the link elements within the primary menu. 543 var links, 544 i, 545 len, 546 menu = document.querySelector(".primary-menu-wrapper"); 547 548 if (!menu) { 549 return false; 550 } 551 552 links = menu.getElementsByTagName("a"); 553 554 // Each time a menu link is focused or blurred, toggle focus. 555 for (i = 0, len = links.length; i < len; i++) { 556 links[i].addEventListener("focus", toggleFocus, true); 557 links[i].addEventListener("blur", toggleFocus, true); 558 } 559 560 //Sets or removes the .focus class on an element. 561 function toggleFocus() { 562 var self = this; 563 564 // Move up through the ancestors of the current link until we hit .primary-menu. 565 while (-1 === self.className.indexOf("primary-menu")) { 566 // On li elements toggle the class .focus. 567 if ("li" === self.tagName.toLowerCase()) { 568 if (-1 !== self.className.indexOf("focus")) { 569 self.className = self.className.replace(" focus", ""); 570 } else { 571 self.className += " focus"; 572 } 573 } 574 self = self.parentElement; 575 } 576 } 577 }, 578 }; // twentytwenty.primaryMenu 579 580 /* ----------------------------------------------------------------------------------------------- 581 Toggles 582 --------------------------------------------------------------------------------------------------- */ 583 584 twentytwenty.toggles = { 585 clickedEl: false, 586 587 init: function () { 588 // Do the toggle. 589 this.toggle(); 590 591 // Check for toggle/untoggle on resize. 592 this.resizeCheck(); 593 594 // Check for untoggle on escape key press. 595 this.untoggleOnEscapeKeyPress(); 596 }, 597 598 performToggle: function (element, instantly) { 599 var target, 600 timeOutTime, 601 classToToggle, 602 self = this, 603 _doc = document, 604 // Get our targets. 605 toggle = element, 606 targetString = toggle.dataset.toggleTarget, 607 activeClass = "active"; 608 609 // Elements to focus after modals are closed. 610 if (!_doc.querySelectorAll(".show-modal").length) { 611 self.clickedEl = _doc.activeElement; 612 } 613
614 if (targetString === "next") { 615 target = toggle.nextSibling; 616 } else { 617 target = _doc.querySelector(targetString); 618 } 619 620 // Trigger events on the toggle targets before they are toggled. 621 if (target.classList.contains(activeClass)) { 622 target.dispatchEvent( 623 twentytwenty.createEvent("toggle-target-before-active") 624 ); 625 } else { 626 target.dispatchEvent( 627 twentytwenty.createEvent("toggle-target-before-inactive") 628 ); 629 } 630 631 // Get the class to toggle, if specified. 632 classToToggle = toggle.dataset.classToToggle 633 ? toggle.dataset.classToToggle 634 : activeClass; 635 636 // For cover modals, set a short timeout duration so the class animations have time to play out. 637 timeOutTime = 0; 638 639 if (target.classList.contains("cover-modal")) { 640 timeOutTime = 10; 641 } 642 643 setTimeout(function () { 644 var focusElement, 645 subMenued = target.classList.contains("sub-menu"), 646 newTarget = subMenued 647 ? toggle.closest(".menu-item").querySelector(".sub-menu") 648 : target, 649 duration = toggle.dataset.toggleDuration; 650 651 // Toggle the target of the clicked toggle. 652 if ( 653 toggle.dataset.toggleType === "slidetoggle" && 654 !instantly && 655 duration !== "0" 656 ) { 657 twentytwentyMenuToggle(newTarget, duration); 658 } else { 659 newTarget.classList.toggle(classToToggle); 660 } 661 662 // If the toggle target is 'next', only give the clicked toggle the active class. 663 if (targetString === "next") { 664 toggle.classList.toggle(activeClass); 665 } else if (target.classList.contains("sub-menu")) { 666 toggle.classList.toggle(activeClass); 667 } else { 668 // If not, toggle all toggles with this toggle target. 669 _doc 670 .querySelector('*[data-toggle-target="' + targetString + '"]') 671 .classList.toggle(activeClass); 672 } 673 674 // Toggle aria-expanded on the toggle. 675 twentytwentyToggleAttribute(toggle, "aria-expanded", "true", "false"); 676 677 if ( 678 self.clickedEl && 679 -1 !== toggle.getAttribute("class").indexOf("close-") 680 ) { 681 twentytwentyToggleAttribute( 682 self.clickedEl, 683 "aria-expanded", 684 "true", 685 "false" 686 ); 687 } 688 689 // Toggle body class. 690 if (toggle.dataset.toggleBodyClass) { 691 _doc.body.classList.toggle(toggle.dataset.toggleBodyClass); 692 } 693 694 // Check whether to set focus. 695 if (toggle.dataset.setFocus) { 696 focusElement = _doc.querySelector(toggle.dataset.setFocus); 697 698 if (focusElement) { 699 if (target.classList.contains(activeClass)) { 700 focusElement.focus(); 701 } else { 702 focusElement.blur(); 703 } 704 } 705 } 706 707 // Trigger the toggled event on the toggle target. 708 target.dispatchEvent(twentytwenty.createEvent("toggled")); 709 710 // Trigger events on the toggle targets after they are toggled. 711 if (target.classList.contains(activeClass)) { 712 target.dispatchEvent( 713 twentytwenty.createEvent("toggle-target-after-active") 714 ); 715 } else { 716 target.dispatchEvent( 717 twentytwenty.createEvent("toggle-target-after-inactive") 718 ); 719 } 720 }, timeOutTime); 721 }, 722 723 // Do the toggle. 724 toggle: function () { 725 var self = this; 726 727 document 728 .querySelectorAll("*[data-toggle-target]") 729 .forEach(function (element) { 730 element.addEventListener("click", function (event) { 731 event.preventDefault(); 732 self.performToggle(element); 733 }); 734 }); 735 }, 736 737 // Check for toggle/untoggle on screen resize. 738 resizeCheck: function () { 739 if ( 740 document.querySelectorAll( 741 "*[data-untoggle-above], *[data-untoggle-below], *[data-toggle-above], *[data-toggle-below]" 742 ).length 743 ) { 744 window.addEventListener("resize", function () { 745 var winWidth = window.innerWidth, 746 toggles = document.querySelectorAll(".toggle"); 747
748 toggles.forEach(function (toggle) { 749 var unToggleAbove = toggle.dataset.untoggleAbove, 750 unToggleBelow = toggle.dataset.untoggleBelow, 751 toggleAbove = toggle.dataset.toggleAbove, 752 toggleBelow = toggle.dataset.toggleBelow; 753 754 // If no width comparison is set, continue. 755 if ( 756 !unToggleAbove && 757 !unToggleBelow && 758 !toggleAbove && 759 !toggleBelow 760 ) { 761 return; 762 } 763 764 // If the toggle width comparison is true, toggle the toggle. 765 if ( 766 (((unToggleAbove && winWidth > unToggleAbove) || 767 (unToggleBelow && winWidth < unToggleBelow)) && 768 toggle.classList.contains("active")) || 769 (((toggleAbove && winWidth > toggleAbove) || 770 (toggleBelow && winWidth < toggleBelow)) && 771 !toggle.classList.contains("active")) 772 ) { 773 toggle.click(); 774 } 775 }); 776 }); 777 } 778 }, 779 780 // Close toggle on escape key press. 781 untoggleOnEscapeKeyPress: function () { 782 document.addEventListener("keyup", function (event) { 783 if (event.key === "Escape") { 784 document 785 .querySelectorAll("*[data-untoggle-on-escape].active") 786 .forEach(function (element) { 787 if (element.classList.contains("active")) { 788 element.click(); 789 } 790 }); 791 } 792 }); 793 }, 794 }; // twentytwenty.toggles 795 796 /** 797 * Is the DOM ready? 798 * 799 * This implementation is coming from https://gomakethings.com/a-native-javascript-equivalent-of-jquerys-ready-method/ 800 * 801 * @since Twenty Twenty 1.0 802 * 803 * @param {Function} fn Callback function to run. 804 */ 805 function twentytwentyDomReady(fn) { 806 if (typeof fn !== "function") { 807 return; 808 } 809 810 if ( 811 document.readyState === "interactive" || 812 document.readyState === "complete" 813 ) { 814 return fn(); 815 } 816 817 document.addEventListener("DOMContentLoaded", fn, false); 818 } 819 820 twentytwentyDomReady(function () { 821 twentytwenty.toggles.init(); // Handle toggles. 822 twentytwenty.coverModals.init(); // Handle cover modals. 823 twentytwenty.intrinsicRatioVideos.init(); // Retain aspect ratio of videos on window resize. 824 twentytwenty.modalMenu.init(); // Modal Menu. 825 twentytwenty.primaryMenu.init(); // Primary Menu. 826 twentytwenty.touchEnabled.init(); // Add class to body if device is touch-enabled. 827 }); 828 829 /* ----------------------------------------------------------------------------------------------- 830 Helper functions 831 --------------------------------------------------------------------------------------------------- */ 832 833 /* Toggle an attribute ----------------------- */ 834 835 function twentytwentyToggleAttribute(element, attribute, trueVal, falseVal) { 836 if (element.classList.contains("close-search-toggle")) { 837 return; 838 } 839 if (trueVal === undefined) { 840 trueVal = true; 841 } 842 if (falseVal === undefined) { 843 falseVal = false; 844 } 845 if (element.getAttribute(attribute) !== trueVal) { 846 element.setAttribute(attribute, trueVal); 847 } else { 848 element.setAttribute(attribute, falseVal); 849 } 850 } 851 852 /** 853 * Toggle a menu item on or off. 854 * 855 * @since Twenty Twenty 1.0 856 * 857 * @param {HTMLElement} target 858 * @param {number} duration 859 */ 860 function twentytwentyMenuToggle(target, duration) { 861 var initialParentHeight, 862 finalParentHeight, 863 menu, 864 menuItems, 865 transitionListener, 866 initialPositions = [], 867 finalPositions = []; 868 869 if (!target) { 870 return; 871 } 872 873 menu = target.closest(".menu-wrapper"); 874 875 // Step 1: look at the initial positions of every menu item. 876 menuItems = menu.querySelectorAll(".menu-item"); 877 878 menuItems.forEach(function (menuItem, index) { 879 initialPositions[index] = { 880 x: menuItem.offsetLeft, 881 y: menuItem.offsetTop, 882 }; 883 });
884 initialParentHeight = target.parentElement.offsetHeight; 885 886 target.classList.add("toggling-target"); 887 888 // Step 2: toggle target menu item and look at the final positions of every menu item. 889 target.classList.toggle("active"); 890 891 menuItems.forEach(function (menuItem, index) { 892 finalPositions[index] = { x: menuItem.offsetLeft, y: menuItem.offsetTop }; 893 }); 894 finalParentHeight = target.parentElement.offsetHeight; 895 896 // Step 3: close target menu item again. 897 // The whole process happens without giving the browser a chance to render, so it's invisible. 898 target.classList.toggle("active"); 899 900 /* 901 * Step 4: prepare animation. 902 * Position all the items with absolute offsets, at the same starting position. 903 * Shouldn't result in any visual changes if done right. 904 */ 905 menu.classList.add("is-toggling"); 906 target.classList.toggle("active"); 907 menuItems.forEach(function (menuItem, index) { 908 var initialPosition = initialPositions[index]; 909 if (initialPosition.y === 0 && menuItem.parentElement === target) { 910 initialPosition.y = initialParentHeight; 911 } 912 menuItem.style.transform = 913 "translate(" + initialPosition.x + "px, " + initialPosition.y + "px)"; 914 }); 915 916 /* 917 * The double rAF is unfortunately needed, since we're toggling CSS classes, and 918 * the only way to ensure layout completion here across browsers is to wait twice. 919 * This just delays the start of the animation by 2 frames and is thus not an issue. 920 */ 921 requestAnimationFrame(function () { 922 requestAnimationFrame(function () { 923 /* 924 * Step 5: start animation by moving everything to final position. 925 * All the layout work has already happened, while we were preparing for the animation. 926 * The animation now runs entirely in CSS, using cheap CSS properties (opacity and transform) 927 * that don't trigger the layout or paint stages. 928 */ 929 menu.classList.add("is-animating"); 930 menuItems.forEach(function (menuItem, index) { 931 var finalPosition = finalPositions[index]; 932 if (finalPosition.y === 0 && menuItem.parentElement === target) { 933 finalPosition.y = finalParentHeight; 934 } 935 if (duration !== undefined) { 936 menuItem.style.transitionDuration = duration + "ms"; 937 } 938 menuItem.style.transform = 939 "translate(" + finalPosition.x + "px, " + finalPosition.y + "px)"; 940 }); 941 if (duration !== undefined) { 942 target.style.transitionDuration = duration + "ms"; 943 } 944 }); 945 946 // Step 6: finish toggling. 947 // Remove all transient classes when the animation ends. 948 transitionListener = function () { 949 menu.classList.remove("is-animating"); 950 menu.classList.remove("is-toggling"); 951 target.classList.remove("toggling-target"); 952 menuItems.forEach(function (menuItem) { 953 menuItem.style.transform = ""; 954 menuItem.style.transitionDuration = ""; 955 }); 956 target.style.transitionDuration = ""; 957 target.removeEventListener("transitionend", transitionListener); 958 }; 959 960 target.addEventListener("transitionend", transitionListener); 961 }); 962 } 963 964 /** 965 * Traverses the DOM up to find elements matching the query. 966 * 967 * @since Twenty Twenty 1.0 968 * 969 * @param {HTMLElement} target 970 * @param {string} query 971 * @return {NodeList} parents matching query 972 */ 973 function twentytwentyFindParents(target, query) { 974 var parents = []; 975 976 // Recursively go up the DOM adding matches to the parents array. 977 function traverse(item) { 978 var parent = item.parentNode; 979 if (parent instanceof HTMLElement) { 980 if (parent.matches(query)) { 981 parents.push(parent); 982 } 983 traverse(parent); 984 } 985 } 986 987 traverse(target); 988 989 return parents; 990 } 991 992 // --------------------------------- 993 994 // game 995 // function toggleSound(id){ 996 // var video = document.getElementById('movie'); 997 // if(video.paused){ //å¦âæžÅå·²æšâÃ¥ÂÅÃ¥Ëâ¢Ã¦âÂæâ¾ 998 // video.play(); //æâÂæâ¾æŽ§å˶ 999 // }else{ // å·²æâÂæâ¾çâ¹åâ¡Â»Ã¥Ëâ¢Ã¦Å¡âÃ¥ÂÅ 1000 // video.pause();
1000 //æšâÃ¥ÂÅ控å˶ 1001 // } 1002 // } 1003 // playMovie1() 1004 // function playMovie1(argument) { 1005 // try { 1006 // var video = document.getElementById('uno-video'); 1007 // video.play(); //æâÂæâ¾æŽ§å˶ 1008 // } catch (err) {} 1009 // } 1010} catch (err) { 1011 // æâ°â¹Ã¥Å ¨æŠâºÃ¥â¡ÂºÃ¥Â¼â常 1012 Sentry.captureException(err); 1013} 1014 1015jQuery(document).ready(function ($) { 1016 try { 1017 // $("html,body").animate({ scrollTop: 0 }, "fast"); 1018 $("#resume input").change(function () { 1019 var resumeInput = document.querySelector("input[name='ResumeCV']"); 1020 if ( 1021 resumeInput.files && 1022 resumeInput.files[0] && 1023 resumeInput.files[0].size * 1 > 10 * 1024 * 1024 1024 ) { 1025 $("#resume input").val(""); 1026 window.alert("A single Resume/CV file cannot exceed 10MB."); 1027 return; 1028 } else if (resumeInput.files && resumeInput.files[0]) { 1029 var val = $("#resume input").val(); 1030 var pos = val.lastIndexOf("\\"); 1031 $("#resume-button").html(val.substring(pos + 1)); 1032 } else { 1033 $("#resume-button").html("Upload"); 1034 } 1035 }); 1036 1037 $("#attach input").change(function () { 1038 var attachInput = document.querySelector("input[name='Attachment']"); 1039 if ( 1040 attachInput.files && 1041 attachInput.files[0] && 1042 attachInput.files[0].size * 1 > 20 * 1024 * 1024 1043 ) { 1044 $("#attach input").val(""); 1045 window.alert("A single Attachment file cannot exceed 20MB."); 1046 return; 1047 } else if (attachInput.files && attachInput.files[0]) { 1048 var val = $("#attach input").val(); 1049 var pos = val.lastIndexOf("\\"); 1050 $("#attachment-button").html(val.substring(pos + 1)); 1051 } else { 1052 $("#attachment-button").html("Upload"); 1053 } 1054 }); 1055 1056 // 表åÂâ¢Ã¦ÂÂ交åŽ触åÂâÃ¥âºÅ¾Ã¨Â°? 1057 document.addEventListener( 1058 "wpcf7mailsent", 1059 function (event) { 1060 resetForm(); 1061 }, 1062 false 1063 ); 1064 $(".wpcf7 form").submit(function (e) { 1065 $("input[type='submit']").attr("disabled", true); 1066 setTimeout(function () { 1067 $("input[type='submit']").attr("disabled", false); 1068 }, 1200); 1069 }); 1070 // $('.submit-btn').click(function(e){ 1071 // $(".wpcf7 form").submit(function(e){ 1072 // }); 1073 // }) 1074 1075 // ------------------------滚动翻页---------------------------------------------- 1076 // åˤæâÂæË¯ä¸ÂæË¯ç§»åŠ¨ç«¯ 1077 function isMobile() { 1078 let mobile = navigator.userAgent.match( 1079 /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i 1080 ); 1081 return mobile != null; 1082 } 1083 1084 if ($('#uno2Pop').length > 0 && !sessionStorage.noSpecialUNO2Flag) { 1085 sessionStorage.noSpecialUNO2Flag = true; 1086 $(".popClose-uno2").click(function() { 1087 $("#uno2Pop").hide(); 1088 }); 1089 1090 let url = `url('https://store-f2e.mattel163.com/gamecenter-core-uploads/prod/2025/09/11/15/04/40/UNO2_ONLINE_M.png?ran=${Math.random()} no-repeat')`; 1091 if (!isMobile()) { 1092 url = `url('https://store-f2e.mattel163.com/gamecenter-core-uploads/prod/2025/09/11/15/04/40/UNO2_ONLINE_PC.png?ran=${Math.random()} no-repeat')`; 1093 } 1094 $(`#uno2Pop`).addClass(isMobile() ? 'uno2Pop-m' : 'uno2Pop-pc') 1095 $(`#uno2Pop`).show(); 1096 setTimeout(() => { 1097 $(`#uno2Pop .popCon`).css("background-image", url); 1098 }, 100); 1099 1100 $(".popGo-uno2").click(async function() { 1101 $("#uno2Pop").hide(); 1102 var url = 'https://unowonder.onelink.me/djND/gacjw4rz'; 1103 window.open(url, '_blank'); 1104 }); 1105 } 1106 1107 // ----------------表åÂâ¢Ã¦ÂÂ交çâºÂ¸Ã¥â¦Â³-------------------- 1108 $(".reset-btn").click(resetForm); 1109 1110 $(".reset-btn").on("touchend", function (e) { 1111 e.preventDefault(); 1112 resetForm(); 1113 }); 1114 1115 function resetForm() { 1116 const game = $("input[name='Game']").val(); 1117 1118 $(".wpcf7-form-control-wrap input").val(""); 1119 // $("#wpcf7-f1141-o1").show() 1120 // $("#wpcf7-f1559-o2").hide() 1121 // $("#wpcf7-f1560-o3").hide() 1122 $("textarea").val(""); 1123 1124 setTimeout(function () { 1125 if ($('input[name="Job"]')) { 1126 $(".upload-button").text("Upload"); 1127 $('input[name="Job"]').val($(".career-name").text()); 1128 $('input[name="From"]').val( 1129 localStorage && localStorage.from ? localStorage.from : "" 1130 ); 1131 } 1132 if (game) { 1133 // $('.js-game-name').text('UNO!ââ?') 1134 $("input[name='Game']").val(game); 1135 1136 // const game = $("input[name='Game']").val() 1137 // alert(game) 1138 if (game.indexOf("UNO") > -1) { 1139 $(".form-box .wpcf7:eq(0)").show(); 1140 $(".form-box .wpcf7:eq(1)").hide(); 1141 $(".form-box .wpcf7:eq(2)").hide(); 1142 // $("#wpcf7-f1559-o2").hide() 1143 // $("#wpcf7-f1560-o3").hide() 1144 } else if (game.indexOf("Phase") > -1) { 1145 $(".form-box .wpcf7:eq(0)").hide(); 1146 $(".form-box .wpcf7:eq(1)").show(); 1147 $(".form-boxt .wpcf7:eq(2)").hide(); 1148 } else { 1149 $(".form-box .wpcf7:eq(0)").hide(); 1150 $(".form-boxt .wpcf7:eq(1)").hide(); 1151 $(".form-box .wpcf7:eq(2)").show(); 1152 } 1153 } else { 1154 $("input[name='Game']").val("UNO!â¢"); 1155 $(".form-box .wpcf7:eq(0)").show(); 1156 $(".form-box .wpcf7:eq(1)").hide(); 1157 $(".form-box .wpcf7:eq(2)").hide(); 1158 } 1159 }, 10); 1160 } 1161 1162 // ================= 1163 // 设置cookie 1164 var cookiesMap = { 1165 analyzing: "__uuid,_gid,_ga,_ga_*,_gat_gtag_UA_*", 1166 }; 1167 var __mt163__www_domain = "mattel163.com"; 1168 window.__mt163__www && 1169 window.__mt163__www.init({ 1170 className: "mattel163_font_size", 1171 // gtag_config: '', 1172 game_id: "", 1173 website: "", 1174 domain: __mt163__www_domain, 1175 // with_rem: true, 1176 // only_mobile: true, 1177 googletagmanager_id: "G-G414S3L9PW", 1178 confirmFn: function (accept_list) { 1179 if (accept_list) { 1180 var _cookiesMap = Object.assign({}, cookiesMap); 1181 var accept_lists = accept_list.split(","); 1182 // 没æÅâ°uuid 1183 // if(accept_lists.includes('analyzing')) { 1184 // var uuid = getUUid() 1185 // console.log(uuid); 1186 // }
1187 accept_lists.forEach(function (v, i) { 1188 if (_cookiesMap[v]) delete _cookiesMap[v]; 1189 }); 1190 try { 1191 Object.keys(_cookiesMap).forEach(function (v, i) { 1192 var list = (_cookiesMap[v] || "").split(","); 1193 list.forEach(function (name) { 1194 var cookiess = document.cookie.split(";"); 1195 cookiess.forEach(function (cookie) { 1196 var cookieName = cookie.split("=")[0]; 1197 console.log(cookieName); 1198 if (name.endsWith("*")) { 1199 var _name = name.slice(0, -1); 1200 if (cookieName.trim().startsWith(_name)) { 1201 document.cookie = 1202 cookieName + 1203 "=; expires=Thu, 01 Jan 1970 00:00:00 GMT; domain=" + 1204 __mt163__www_domain + 1205 "; path=/;"; 1206 } 1207 } else { 1208 if (cookieName.trim() === name) { 1209 document.cookie = 1210 cookieName + 1211 "=; expires=Thu, 01 Jan 1970 00:00:00 GMT; domain=" + 1212 __mt163__www_domain + 1213 "; path=/;"; 1214 } 1215 } 1216 }); 1217 }); 1218 }); 1219 } catch (e) { 1220 console.log(e); 1221 } 1222 } 1223 }, 1224 }); 1225 // var acceptStatus = getCookie("accept_status"); 1226 // $(".use-cookie").css("display", "none"); 1227 1228 // if (!acceptStatus) { 1229 // $(".use-cookie").css("display", "block"); 1230 // $("#accept").click(function () { 1231 // setCookie("accept_status", "accepted", { expires: 30 }); 1232 // $(".use-cookie").css("display", "none"); 1233 // // loadGtag() 1234 // }); 1235 1236 // $("#reject").click(function () { 1237 // $(".use-cookie").css("display", "none"); 1238 // }); 1239 // } 1240 1241 // function setCookie(name, value) { 1242 // var Days = 30; 1243 // var exp = new Date(); 1244 // exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000); 1245 // document.cookie = 1246 // name + "=" + escape(value) + ";expires=" + exp.toGMTString(); 1247 // } 1248 1249 // function getCookie(name) { 1250 // var arr, 1251 // reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)"); 1252 // if ((arr = document.cookie.match(reg))) return unescape(arr[2]); 1253 // else return null; 1254 // } 1255 // --------------------- 1256 // 获åÂâæÂ¥æº 1257 function GetRequest() { 1258 var url = location.href.split("?")[1]; //获åÂâurlä¸?"?"符åÂŽçšâÃ¥Ââä¸? 1259 var theRequest = new Object(); 1260 if (location.href.indexOf("?") != -1) { 1261 var strs = url.split("&"); 1262 for (var i = 0; i < strs.length; i++) { 1263 theRequest[strs[i].split("=")[0]] = strs[i].split("=")[1]; 1264 } 1265 localStorage.from = theRequest.from; 1266 return theRequest; 1267 } 1268 } 1269 GetRequest(); 1270 if (location.href.includes("ar_rt")) { 1271 $(".post_detail_content") 1272 .css("text-align", "right") 1273 .css("direction", "rtl"); 1274 $('.post_detail_content *:not(".concat-us"):not(".concat-us-btn")') 1275 .css("text-align", "right") 1276 .css("direction", "rtl"); 1277 $(".link-area").css("text-align", "left").css("direction", "rtl"); 1278 } 1279 1280 if ($(".From input") && localStorage && localStorage.from) { 1281 $(".From input").val( 1282 localStorage && localStorage.from ? localStorage.from : "" 1283 ); 1284 } 1285 // 获åÂâèÂÅä½ÂÃ¥ÂÂç§° 1286 if ($(".career-name") && $(".Job input")) { 1287 $(".Job input").val($(".career-name").text()); 1288 // alert(document.querySelector(".Job input").value) 1289 } 1290 $(".global-pop").hide(); 1291 // 去å¤âéâ? 1292 $(".js-link-logo").click(function () { 1293 var _href = $(this).attr("data-href"); 1294 if (_href.indexOf(".mattel163.com") > -1) { 1295 window.open(_href); 1296 return; 1297 } 1298 if (_href.indexOf("letsplayuno.com") > -1) { 1299 window.open(_href); 1300 return; 1301 } 1302 if (!_href) { 1303 $("body").css("overflow", "hidden"); 1304 $(".comming-pop").show(); 1305 return; 1306 } 1307 $(".global-pop").show(); 1308 $("body").css("overflow", "hidden"); 1309 $(".js-button-go").attr("href", _href); 1310 });
1311 1312 // è¿âÃ¥âºÅ¾ 1313 $(".js-button-back").click(function () { 1314 $(".global-pop").hide(); 1315 $("body").css("overflow", ""); 1316 }); 1317 $(".pop-close").click(function () { 1318 $(".global-pop").hide(); 1319 $("body").css("overflow", ""); 1320 }); 1321 $(".comming-pop-close").click(function () { 1322 $(".comming-pop").hide(); 1323 $("body").css("overflow", ""); 1324 }); 1325 1326 $(".comming-pop-close-btn").click(function () { 1327 $(".comming-pop").hide(); 1328 $("body").css("overflow", ""); 1329 }); 1330 // 1331 $(".js-button-go").click(function () { 1332 $(".global-pop").hide(); 1333 $("body").css("overflow", ""); 1334 }); 1335 1336 $("form").attr("autocomplete", "off"); 1337 1338 $('[id=mtsupport]').click(function () { 1339 $('.support-pop').show() 1340 }); 1341 $('.support-pop-close').click(function () { 1342 $('.support-pop').hide() 1343 }); 1344 $('.support-go').click(function(e) { 1345 if (location.pathname === '/Support') { 1346 e.preventDefault(); 1347 $('.support-pop').hide() 1348 return; 1349 } 1350 }); 1351 1352 function orient() { 1353 console.log(1); 1354 //; 1355 if ( 1356 !window.orientation || 1357 window.orientation == 0 || 1358 window.orientation == 180 1359 ) { 1360 $(".shupingTip").css("display", "none"); 1361 return false; 1362 } else if (window.orientation == 90 || window.orientation == -90) { 1363 // $("body").attr("class", "landscape"); //å½â横å±Âçšâæâ¶åâ¬â¢Ã¤Â¸Âºbodyç§»éâ¢Â¤Ã¨Â¿â¢Ã¤Â¸Âªclass 1364 1365 // orientation = 'landscape'; 1366 $(".shupingTip").css("display", "flex"); 1367 1368 return false; 1369 } 1370 } 1371 1372 orient(); 1373 1374 $(window).bind("orientationchange", function (e) { 1375 orient(); 1376 }); 1377 1378 resetForm(); 1379 // ------------移动端è§â é¢âæâÂæâ?--------------- 1380 // 1381 1382 $(".video-play").click(function () { 1383 var _href = $(this).attr("video-href"); 1384 $(".pop-video").show(); 1385 $("body").css("overflow", "hidden"); 1386 $(".pop-video-content video").prop("src", _href); 1387 // $('.js-button-go').attr('href', _href) 1388 }); 1389 1390 $(".video-close").click(function () { 1391 $(".pop-video-content video").prop("src", ""); 1392 $(".pop-video").hide(); 1393 $("body").css("overflow", ""); 1394 }); 1395 $(".js-game-list").hide(); 1396 // éâ¬â°Ã¦â¹Â©Ã¦Â¸Â¸Ã¦Ë 1397 $(".js-game-select").click(function (e) { 1398 // e.stopPropagation() 1399 $(".js-game-list").toggle(); 1400 }); 1401 $("input[name='Name']").change(function () { 1402 $("input[name='Name']").val(this.value); 1403 }); 1404 $("input[name='E-mail']").change(function () { 1405 $("input[name='E-mail']").val(this.value); 1406 }); 1407 $("input[name='Subject']").change(function () { 1408 $("input[name='Subject']").val(this.value); 1409 }); 1410 $("textarea[name='Message']").change(function () { 1411 $("textarea[name='Message']").val(this.value); 1412 }); 1413 1414 $(".js-game").click(function () { 1415 $(this).siblings().removeClass("item-active"); 1416 $(this).addClass("item-active"); 1417 const game = $(this).html(); 1418 if (game.indexOf("UNO") > -1) { 1419 $(".form-box .wpcf7:eq(0)").show(); 1420 $(".form-box .wpcf7:eq(1)").hide(); 1421 $(".form-box .wpcf7:eq(2)").hide(); 1422 // $("#wpcf7-f1559-o2").hide() 1423 // $("#wpcf7-f1560-o3").hide() 1424 } else if (game.indexOf("Phase") > -1) { 1425 $(".form-box .wpcf7:eq(0)").hide(); 1426 $(".form-box .wpcf7:eq(1)").show(); 1427 $(".form-box .wpcf7:eq(2)").hide(); 1428 } else { 1429 $(".form-box .wpcf7:eq(0)").hide(); 1430 $(".form-box .wpcf7:eq(1)").hide(); 1431 $(".form-box .wpcf7:eq(2)").show(); 1432 } 1433 $("input[name='Game']").val($(this).html()); 1434 $(".js-game-name").html(game); 1435 $(".js-game-list").hide(); 1436 }); 1437 $(".form-box input").focus(function () { 1438 $(".js-game-list").hide(); 1439 }); 1440 1441 $(".form-box textarea").focus(function () { 1442 $(".js-game-list").hide(); 1443 });
1444 $(".mattel_page").click(function (e) { 1445 if ( 1446 $(".menu-modal.cover-modal.show-modal") && 1447 $(".menu-modal.cover-modal.show-modal").length 1448 ) { 1449 $(".mobile-nav-toggle").trigger("click"); 1450 } 1451 }); 1452 $(".mattel_page_short").click(function (e) { 1453 if ( 1454 $(".menu-modal.cover-modal.show-modal") && 1455 $(".menu-modal.cover-modal.show-modal").length 1456 ) { 1457 $(".mobile-nav-toggle").trigger("click"); 1458 } 1459 }); 1460 $("#site-content").click(function (e) { 1461 if ( 1462 $(".menu-modal.cover-modal.show-modal") && 1463 $(".menu-modal.cover-modal.show-modal").length 1464 ) { 1465 $(".mobile-nav-toggle").trigger("click"); 1466 } 1467 }); 1468 1469 function isIpad() { 1470 var ua = navigator.userAgent.toLowerCase(); 1471 var isMidp = ua.match(/midp/i) == "midp"; 1472 var isUc7 = ua.match(/rv:1.2.3.4/i) == "rv:1.2.3.4"; 1473 var isUc = ua.match(/ucweb/i) == "ucweb"; 1474 var isAndroid = ua.match(/android/i) == "android"; 1475 var isCE = ua.match(/windows ce/i) == "windows ce"; 1476 var isWM = ua.match(/windows mobile/i) == "windows mobile"; 1477 let isIphone = ua.indexOf("iPhone") != -1; 1478 let isIPad = !isIphone && "ontouchend" in document; 1479 if ( 1480 isIPad || 1481 isIphone || 1482 isMidp || 1483 isUc7 || 1484 isUc || 1485 isAndroid || 1486 isCE || 1487 isWM 1488 ) { 1489 return true; 1490 } else { 1491 return false; 1492 } 1493 } 1494 1495 srcoll(); 1496 function srcoll() { 1497 // console.log( 1498 // "navigator.userAgent.toLowerCase()", 1499 // navigator.userAgent.toLowerCase() 1500 // ); 1501 // console.log("isIpad()", isIpad()); 1502 // console.log("isMobile()", isMobile()); 1503 // console.log('$("#pagepiling").length', $("#pagepiling").length); 1504 // console.log( 1505 // '$(".game_swiper_mobile").length', 1506 // $(".game_swiper_mobile").length 1507 // ); 1508 // console.log("window.screen.width", window.screen.width); 1509 // console.log( 1510 // "document.documentElement.clientWidth", 1511 // document.documentElement.clientWidth 1512 // ); 1513 // console.log( 1514 // "document.documentElement.clientHeight", 1515 // document.documentElement.clientHeight 1516 // ); 1517 } 1518 // --------------end--------- 1519 } catch (err) { 1520 // æâ°â¹Ã¥Å ¨æŠâºÃ¥â¡ÂºÃ¥Â¼â常 1521 Sentry.captureException(err); 1522 } 1523});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.