PageSourceSearch

https://www.hotelmanagement-network.com/wp-content/themes/goodlife-wp-B2B/assets/js/modules.js?ver=1.43934

js hotelmanagement-network.com collected 2026-10-02 04:28:06 UTC 19,495 bytes, 539 lines download raw bytes

1// Index file for importing all modules
2// import CheckMyForm from "./modules/gdm-form-validation.js";
3// import CloseOneTrustBanner from "./modules/gdm-close-one-trust-banner.js";
4import CloneElement from "./modules/gdm-clone-element.js"; // import CloneElement from "./modules/gdm-clone-element.js";
5// import Add169ImageContainer from "./modules/gdm-add-16-9-image-container.js";
6import LoadLiveImages from "./modules/gdm-load-live-images.js";
7import RewritePantheonBranchImages from "./modules/gdm-rewrite-pantheon-branch-images.js";
8// import AddSharesBottom from "./modules/gdm-add-shares-bottom.js";
9import GDMAccordion from "./modules/gdm-accordion.js";
10import GDMLazyLoading from "./modules/gdm-lazy-loading.js";
11// import GDMDataCollection from "./modules/gdm-data-collection.js";
12import GDMSocialTracking from "./modules/gdm-social-tracking.js";
13import GDMOpenModal from "./modules/GDMOpenModal.js";
14import GDMCloseModal from "./modules/GDMCloseModal.js";
15import GDMFiltersAccordion from "./modules/GDMFiltersAccordion.js";
16import GDMDisableJobsDetailsForGuests from "./modules/GDMDisableJobsDetailsForGuests.js";
17import GDMJobsRegisterModal from "./modules/GDMJobsRegisterModal.js";
18import GDMTooltipModal from "./modules/gdm-tooltip-modal.js";
19import GDMAddCloseButton from "./modules/GDMAddCloseButton.js";
20import GDMMoveCheckedFiltersToTop from "./modules/gdm-move-checked-filters-to-top.js";
21import GDMMovePlaceholdersonFocus from "./modules/GDMMovePlaceholdersOnFocus.js";
22// import GDMSupplementsModals from "./modules/GDMSupplementsModals.js"; // This is only needed on Figaro2
23import GDMLoadThankYouModal from "./modules/GDMLoadThankYouModal.js";
24import GDMMyAccount from "./modules/GDMMyAccount.js";
25import GDMSaveArticle from "./modules/GDMSaveArticle.js";
26import GDMTabs from "./modules/GDMTabs.js";
27import GDMToggleClassOnChildElement from "./modules/GDMToggleClassOnChildElement.js";
28import GDMAllNewsletters from "./modules/GDMAllNewsletters.js";
29import GDMProjectDetails from "./modules/GDMToggleMoreElements.js";
30import GDMSlideshow from "./modules/GDMSlideshow.js";
31import gdmAddClassOnLoad from "./modules/gdmAddClassOnLoad.js";
32// import GDMMediaPlayer from "./modules/gdmMediaPlayer.js";
33import GDMLimitText from "./modules/GDMLimitText.js";
34import GDMPollResultsHeightFix from "./modules/GDMPollResultsHeightFix.js";
35import GDMCopyUrl from "./modules/GDMCopyUrl.js";
36import { initImageAndTextCarousel } from "./modules/imageAndTextCarousel.js";
37import { initSectionsNav } from "./modules/sectionsNav.js";
38import initTabs from "./modules/tabs.js";
39import initProductCarousel from "./modules/productCarousel.js";
40import enquiryModal from "./modules/enquiryModal.js";
41//import fauxSelects from "./modules/fauxSelects.js";
42import initFauxSelects from "./modules/initFauxSelects.js";
43import paywall from "./modules/paywall.js";
44import articleCardCarousel from "./modules/articleCardCarousel.js";
45import gdmImageSizeWatcher from "./modules/gdmImageSizeWatcher.js";
46import { initScrollDepthBanner } from "./modules/scrollDepthBanner.js";
47import fancyTreeFrontEnd from "./modules/fancyTreeFrontEnd.js?ver=1.43935";
48import GDMContentToggle from "./modules/GDMContentToggle.js";
49import GDMDateLineChart from "./modules/GDMDateLineChart.js";
50import GDMRemoteStatusChart from "./modules/GDMRemoteStatusChart.js";
51import GDMRegionChart from "./modules/GDMRegionChart.js";
52import GDMJobsListUnwrapText from "./modules/GDMJobsListUnwrapText.js";
53
54///////////////////////////////////////
55//  Press Escape to remove the OneTrust banner! Used on every page and environment
56///////////////////////////////////////
57// CloseOneTrustBanner();
58
59///////////////////////////////////////
60//  Clone elements. Use it where ever you need it to move an element on a page
61///////////////////////////////////////
62if (document.querySelector("#slot-two"))
63  CloneElement("#slot-two", "BLOCKQUOTE", "", "beforebegin", false);
64if (document.querySelector(".sponsored-whitepaper"))
65  CloneElement(".sponsored-whitepaper", "BLOCKQUOTE", "", "beforebegin", false);
66
67///////////////////////////////////////
68//  Add a 16:9 container to images. Used in single post, but you can execute it anywhere you need it
69///////////////////////////////////////
70// if (document.querySelector('.wp-block-image')) Add169ImageContainer('.wp-block-image', '.wp-block-image img');
71
72///////////////////////////////////////
73//  Load live images on your branch
74///////////////////////////////////////
75const devURLs = [
76  "localhost",
77  "pr-sing-re-b2b-gdm-figaro1.pantheonsite.io",
78  "test-b2b-gdm-figaro1.pantheonsite.io",
79  "b2b-gdm-figaro2.pantheonsite.io",
80];
81[...devURLs].some((url) => window.location.href.includes(url)) &&
82  LoadLiveImages();
83
84if (window.location.hostname.startsWith("pr-")) {
85  RewritePantheonBranchImages();
86}
87
88///////////////////////////////////////
89//  Accordion
90///////////////////////////////////////
91if (document.querySelector(".gdm-accordion ul"))
92  GDMAccordion(".gdm-accordion ul", false, false);
93if (document.querySelector(".faq .accordion"))
94  GDMAccordion(".faq .accordion", false, true);
95
96if (document.querySelector(".gdm-accordion ul.form-stages"))
97  GDMAccordion(".gdm-accordion ul.form-stages", true, true);
98
99///////////////////////////////////////
100//  Move the selected filter to the top on the data insights page
101///////////////////////////////////////
102// document.querySelector("#wpsolr_section_facets") && gdmMoveSelectedFilterToTop();
103
104///////////////////////////////////////
105//  Lazyload images
106///////////////////////////////////////
107if (document.querySelector("img")) GDMLazyLoading();
108
109///////////////////////////////////////
110//  Collect number of views per headline
111///////////////////////////////////////
112// if (document.querySelector(".article-header")) GDMDataCollection();
113
114///////////////////////////////////////
115//  Social sharing buttons tracking
116///////////////////////////////////////
117if (document.querySelector(".gdm-article-share__button")) GDMSocialTracking();
118
119///////////////////////////////////////
120//  Close Modal by toggling the open class(s)
121///////////////////////////////////////
122if (document.querySelector(".gdm-newsletter-modal"))
123  GDMCloseModal("#cancel-modal", ".gdm-newsletter-modal", "open", "expanded");
124
125///////////////////////////////////////
126//  Jobs filters modal toggle (mobile)
127///////////////////////////////////////
128if (
129  document.querySelector(".filters-toggle, .toggle-buttons .icon-filters") &&
130  document.querySelector(".insights_filters")
131) {
132  GDMOpenModal(
133    ".insights_filters",
134    ".filters-toggle, .toggle-buttons .icon-filters",
135    "insights-filters-open",
136  );
137
138  if (!document.querySelector(".insights_filters .insights-filters-close")) {
139    const insightsFiltersPanel = document.querySelector(".insights_filters");
140    const closeButton = document.createElement("button");
141    closeButton.type = "button";
142    closeButton.className = "insights-filters-close";
143    closeButton.setAttribute("aria-label", "Close filters");
144    closeButton.textContent = "Close";
145    insightsFiltersPanel.prepend(closeButton);
146  }
147
148  GDMCloseModal(
149    ".insights_filters .insights-filters-close",
150    ".insights_filters",
151    "open",
152    "insights-filters-open",
153  );
154}
155
156if (document.querySelector(".insights_filters")) {
157  GDMFiltersAccordion(".insights_filters");
158}
159
160if (document.querySelector(".jobs-results")) {
161  GDMDisableJobsDetailsForGuests(".jobs-results");
162}
163
164if (document.querySelector("[data-gdm-content-toggle]")) {
165  GDMContentToggle({
166    rootSelector: "[data-gdm-content-toggle]",
167    buttonSelector: "[data-toggle-key]",
168    contentSelector: ".toggle-content",
169    activeClass: "is-active",
170    bodyClassPrefix: "gd-jobs-view-",
171    stateAttr: "data-active-key",
172    buttonKeyAttr: "data-toggle-key",
173    contentKeyAttr: "data-toggle-content-key",
174  });
175}
176
177if (document.querySelector("[data-gdm-region-chart]")) {
178  GDMRegionChart({
179    rootSelector: "[data-gdm-region-chart]",
180  });
181}
182
183if (document.querySelector("[data-gdm-date-line-chart]")) {
184  GDMDateLineChart({
185    rootSelector: "[data-gdm-date-line-chart]",
186    showRangeTrigger: true,
187  });
188}
189
190if (
191  document.querySelector("[data-gdm-remote-status-chart]") ||
192  document.querySelector("[data-gdm-donut-chart]")
193) {
194  GDMRemoteStatusChart({
195    rootSelector: "[data-gdm-remote-status-chart], [data-gdm-donut-chart]",
196  });
197}
198
199if (
200  document.querySelector(".register-modal") ||
201  document.querySelector(".gdm-jobs-list .load-register-modal") ||
202  document.querySelector(".load-more-jobs") ||
203  document.querySelector(".login-create-account p a")
204) {
205  GDMJobsRegisterModal();
206}
207
208///////////////////////////////////////
209//  Tooltip modal -- toggles a class on the next element to open/close a modal
210///////////////////////////////////////
211if (document.querySelector(".gdm-tooltip-modal")) {
212  GDMTooltipModal(
213    ".gdm-article-list .button-toggle",
214    ".gdm-tooltip-modal",
215    ".close-cross",
216  );
217}
218
219if (document.querySelector(".gdm-article-save")) {
220  GDMTooltipModal(
221    ".gdm-article-list .button-toggle",
222    ".gdm-tooltip-modal",
223    ".close-cross",
224    "save-modal-open",
225  );
226}
227
228///////////////////////////////////////
229//  Move checked filter to top
230///////////////////////////////////////
231if (document.querySelector(".search-wrapper ul")) {
232  GDMMoveCheckedFiltersToTop();
233}
234
235///////////////////////////////////////
236//  Turn input placeholders into floating labels on focus
237///////////////////////////////////////
238if (
239  document.querySelector(".gdm-form") &&
240  !document.querySelector(".c-search-and-filters")
241) {
242  setTimeout(() => {
243    GDMMovePlaceholdersonFocus(
244      ".gdm-form input[type=text], .gdm-form input[type=tel], .gdm-form input[type=number], .gdm-form input[type=search], .gdm-form input[type=url]",
245      ".gdm-form input[type=email]",
246      ".gdm-form select",
247      ".gdm-form textarea",
248    );
249  }, 1000);
250}
251
252///////////////////////////////////////
253//  Faux selects: only initialize when .gdm-form select exists
254///////////////////////////////////////
255if (document.querySelectorAll(".gdm-form select").length > 0) {
256  initFauxSelects();
257}
258
259///////////////////////////////////////
260//  Inject lock-screen content into locked data center cards
261///////////////////////////////////////
262if (document.querySelector(".article-grid-2025")) {
263  paywall();
264}
265
266///////////////////////////////////////
267//  Inject lock-screen content into jobs list articles
268///////////////////////////////////////
269if (document.querySelector(".gdm-jobs-list li article.locked")) {
270  paywall(".gdm-jobs-list li article.locked", {
271    title: "Jobs Listing Locked",
272    description: "To view all job listings login or create a FREE account",
273  });
274}
275
276///////////////////////////////////////
277// Automatically add a standard close button to a standard GDM Modal
278///////////////////////////////////////
279if (document.querySelector(".gdm-modal"))
280  GDMAddCloseButton(
281    ".gdm-modal",
282    "modal-close",
283    "Close",
284    "",
285    "open",
286    "expanded",
287  );
288
289///////////////////////////////////////
290// Add open class to modal on supplements
291///////////////////////////////////////
292// if (document.querySelector("#supplements-load li"))
293//   GDMSupplementsModals("#supplements-load li", "open expanded", true);
294
295// if (document.querySelector(".gdm-latest-supplements"))
296//   GDMSupplementsModals(".gdm-latest-supplements li", "open expanded", true);
297
298///////////////////////////////////////
299// Load a thank you modal when a form is submitted
300///////////////////////////////////////
301if (document.querySelector(".gdm-modal")) {
302  document.querySelectorAll(".gdm-modal").forEach((modal) => {
303    const formSubmitButton = modal.querySelector("#formSubmit");
304    if (!formSubmitButton) return;
305
306    formSubmitButton.addEventListener("click", () => {
307      GDMLoadThankYouModal(modal);
308    });
309  });
310}
311
312///////////////////////////////////////
313// My account page
314///////////////////////////////////////
315document.querySelector(".gdm-paywall-account") && GDMMyAccount();
316
317///////////////////////////////////////
318//  Save Article
319//  Close Modal by toggling the open class(s)
320///////////////////////////////////////
321document.querySelector(".gdm-article-save") && GDMSaveArticle();
322
323///////////////////////////////////////
324// Tabs -- used in storefront and magazine page
325///////////////////////////////////////
326
327if (document.querySelector(".tabs-navigation"))
328  GDMTabs(".tabs-nav li", ".tabs-content__panel", "", ".tabs-nav");
329
330if (document.querySelector(".gdm-tabs")) {
331  GDMTabs(".gdm-tabs-nav li", ".gdm-tabs-panel", "", ".gdm-tabs-nav ul", true);
332
333  window.addEventListener("resize", (e) => {
334    GDMTabs(".gdm-tabs-nav li", ".gdm-tabs-panel", "", ".gdm-tabs-nav ul");
335  });
336}
337
338///////////////////////////////////////
339// Toggle the article share buttons open and closed
340///////////////////////////////////////
341// if (document.querySelector(".gdm-article-share__button"))
342//   GDMToggleClassOnChildElement(
343//     ".gdm-article-share__button",
344//     ".gdm-article-share-list__container",
345//     "active"
346//   );
347
348if (document.querySelector(".gdm-article-share .button-toggle"))
349  GDMToggleClassOnChildElement(
350    ".gdm-article-share .button-toggle",
351    ".gdm-article-share ul",
352    "active",
353  );
354
355///////////////////////////////////////
356//  All newsletters page
357///////////////////////////////////////
358if (
359  document.querySelector(".gdm-all-newsletters-form .select-newsletter ul li")
360)
361  GDMAllNewsletters(".gdm-all-newsletters-form .select-newsletter ul li");
362
363///////////////////////////////////////
364// Project details
365///////////////////////////////////////
366
367document.querySelector(".project-details") &&
368  GDMProjectDetails(".project-details ul", 4, "Expand", "Collapse");
369
370///////////////////////////////////////
371// GDM Slideshow
372///////////////////////////////////////
373if (document.querySelector(".gdm-slideshow")) {
374  GDMSlideshow(".gdm-slideshow", "440", true, "300");
375  window.addEventListener("load", (e) => {
376    GDMSlideshow(".gdm-slideshow", "440", true, "300");
377  });
378  window.addEventListener("resize", (e) => {
379    GDMSlideshow(".gdm-slideshow", "440", true, "300");
380  });
381}
382
383///////////////////////////////////////
384// Add gdm-form class to all forms inside the articles
385///////////////////////////////////////
386if (document.querySelector("form.hs-form"))
387  gdmAddClassOnLoad(".form.hs-form", "gdm-form");
388
389// Because the element is generated by a script, we need to wait until it is generated before we run this script to add the class
390function onElementAvailable(selector, callback) {
391  const observer = new MutationObserver((mutations) => {
392    if (document.querySelector(selector)) {
393      observer.disconnect();
394      callback();
395    }
396  });
397
398  observer.observe(document.body, { childList: true, subtree: true });
399}
400
401onElementAvailable("form.hs-form", () =>
402  gdmAddClassOnLoad("form.hs-form", "gdm-form"),
403);
404
405///////////////////////////////////////
406// Limit text for Read More toggle on whitepaper descriptions and buyers guides descriptions
407///////////////////////////////////////
408
409if (document.querySelectorAll("#vms_description"))
410  GDMLimitText("#vms_description", 266, "Read more", "Read less");
411
412if (document.querySelectorAll(".buyers-guide__description"))
413  GDMLimitText(".buyersGuideDescription", 200, "Read more", "Read less");
414
415if (document.querySelectorAll(".whitepaper-header__excerpt"))
416  GDMLimitText(".whitepaper-header__excerpt", 210, "Read more", "Read less");
417
418///////////////////////////////////////
419// GDM Media Player
420///////////////////////////////////////
421// document.querySelector('.gdm-media-player') && GDMMediaPlayer('.gdm-media-player', '.total-time', '.current-time', 77, '.play', '.track div div', '.pause');
422
423///////////////////////////////////////
424// Fix the height of the polls
425///////////////////////////////////////
426onElementAvailable("#Sgpollsputhere iframe", () => GDMPollResultsHeightFix());
427
428///////////////////////////////////////
429// Copy URL
430///////////////////////////////////////
431document.querySelector(".gdm-article-share .copy-link") &&
432  GDMCopyUrl(
433    ".gdm-article-share .copy-link",
434    `Sucessfully copied ${window.location.href} to your clipboard`,
435  );
436
437///////////////////////////////////////
438// Image and Text Carousel
439///////////////////////////////////////
440
441// Feature carousel
442document.querySelector(".image-and-text-carousel.has-dots-nav.feature") &&
443  initImageAndTextCarousel({
444    selector: ".image-and-text-carousel.has-dots-nav.feature",
445    autoTransitionDelay: 5,
446    hasDotsNav: true,
447  });
448
449// Interchangeable CTA slot
450document.querySelector(".interchangeable-cta-slot .image-and-text-carousel") &&
451  initImageAndTextCarousel({
452    selector: ".interchangeable-cta-slot .image-and-text-carousel",
453    autoTransitionDelay: 5,
454    hasDotsNav: true,
455  });
456
457// Our legacy
458document.querySelector(".our-legacy .image-and-text-carousel") &&
459  initImageAndTextCarousel({
460    selector: ".our-legacy .image-and-text-carousel",
461    autoTransitionDelay: 5,
462    hasDotsNav: false,
463    AllImagesVisible: true,
464  });
465
466if (document.querySelector(".gdm-page-links")) {
467  initSectionsNav({
468    sectionNavSelector: ".gdm-page-links",
469    sectionTitle: "What are you looking for today?",
470    excludeHeaders: [], // Add any header text to exclude here
471  });
472}
473
474///////////////////////////////////////
475// Accessible Tabs functionality
476///////////////////////////////////////
477if (document.querySelector(".tabs")) {
478  initTabs({
479    excludeFromTabsSelector: [
480      ".tabs-nav .button",
481      ".tabs-nav .show-enquiry-form",
482      ".button",
483    ],
484  });
485}
486
487///////////////////////////////////////
488// Product Carousel functionality
489///////////////////////////////////////
490if (document.querySelector(".product-carousel")) initProductCarousel();
491
492///////////////////////////////////////
493// Enquiry Modal functionality
494///////////////////////////////////////
495if (document.getElementById("enquiry-modal")) enquiryModal.init();
496
497///////////////////////////////////////
498// Faux Selects for modal select elements
499///////////////////////////////////////
500//if (document.querySelector(".modal select")) fauxSelects();
501
502///////////////////////////////////////
503// Article Card Carousel functionality
504///////////////////////////////////////
505if (document.querySelector(".article-card-carousel"))
506  articleCardCarousel.init();
507
508///////////////////////////////////////
509// Add class when linked images render smaller than their container
510///////////////////////////////////////
511// if (document.querySelector("figure a img")) {
512//   gdmImageSizeWatcher();
513// }
514
515///////////////////////////////////////
516// Scroll depth banner for premium intelligence
517///////////////////////////////////////
518if (document.querySelector("main .article-header .premium-intelligence-tag")) {
519  initScrollDepthBanner();
520}
521
522///////////////////////////////////////
523// FancyTree front-end enhancements for data insights filters
524///////////////////////////////////////
525if (
526  document.querySelector(".insights_custom_filters .insights_filters") ||
527  document.querySelector('[id$="_fancy"]')
528) {
529  fancyTreeFrontEnd();
530}
531
532///////////////////////////////////////
533// Remove the .text wrapper from each job list item on screens
534// narrower than 1024px (keeps contents in place). Runs when the
535// jobs list is on the page, at any screen width; the module itself
536// checks the width and re-runs its check on window resize.
537///////////////////////////////////////
538if (document.querySelector(".gdm-article-list.gdm-jobs-list"))
539  GDMJobsListUnwrapText();

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.