PageSourceSearch

https://studycli.org/wp-content/plugins/nextlevel-custom-functions/assets/js/custom.js?144687046=1623827389

js studycli.org collected 2026-09-24 19:28:41 UTC 17,111 bytes, 530 lines download raw bytes

1jQuery(document).ready(function ($) {
2
3  /* Will find `#svg-fancy_icon-19-11528` and replace it with SVG “X”. Works even if Oxygen loads the markup
4 later.*/
5  (function () {
6    const ICON_ID = "svg-fancy_icon-19-11528";
7    const PATH_D =
8      "M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z";
9    const NS = "http://www.w3.org/2000/svg";
10
11    function apply(svg) {
12      // Force correct viewport & size
13      svg.setAttribute("viewBox", "0 0 24 24");
14      svg.setAttribute("width", "28");
15      svg.setAttribute("height", "28");
16
17      // Force styles (important to override Oxygen rules like fill: currentColor)
18      svg.style.setProperty("width", "28px", "important");
19      svg.style.setProperty("height", "28px", "important");
20      svg.style.setProperty("fill", "#ffffff", "important");
21      svg.style.setProperty("display", "block", "important");
22
23      // Clear old content (e.g. <use>)
24      while (svg.firstChild) svg.removeChild(svg.firstChild);
25
26      // Build X icon
27      const g = document.createElementNS(NS, "g");
28      const path = document.createElementNS(NS, "path");
29      path.setAttribute("d", PATH_D);
30
31      // Force fill on path too
32      path.setAttribute("fill", "#ffffff");
33      path.style.setProperty("fill", "#ffffff", "important");
34
35      g.appendChild(path);
36      svg.appendChild(g);
37    }
38
39    function run() {
40      const svg = document.getElementById(ICON_ID);
41      if (!svg) return false;
42      apply(svg);
43      return true;
44    }
45
46    // Run now, or wait for Oxygen render
47    if (run()) return;
48
49    const mo = new MutationObserver(() => {
50      if (run()) mo.disconnect();
51    });
52    mo.observe(document.documentElement, { childList: true, subtree: true });
53    setTimeout(() => mo.disconnect(), 5000);
54  })();
55  /* END Will find `#svg-fancy_icon-19-11528` and replace it with SVG “X”. Works even if Oxygen loads the markup
56   later.*/
57
58  //Fix (when a user clicks the X to close the popup, the page resets to the top of the page. Instead, the modal should simply close and the scroll position on the page should remain unchanged)
59  $(".ct-modal > .ct-link-button[href='#']").click(function (event) {
60    event.preventDefault();
61  });
62
63  /*Gtranslate switcher*/
64  $(".oxy-pro-menu-list .gtranslate_wrapper").addClass("sub-menu aos-animate");
65  /*END Gtranslate switcher*/
66
67  /* Home Magnific Popup Video */
68  /*if($('.video-wrap').length) {
69        $( '.video-wrap' ).magnificPopup( {
70          type: 'inline',
71          items: {
72            src: '<div class="white-popup" id="my-video-popup">' +
73              '<video width="100%" height="auto" controls>' +
74              '<source src="https://studycli.org/wp-content/uploads/2021/08/introducing-the-cli-center.mp4" type="video/mp4">Your browser does not support the video tag.</video>' +
75              '</div>'
76          },
77          closeBtnInside: true,
78          midClick: true
79        } );
80      }*/
81
82  //Fix SubMenu
83  let body = $("body");
84  let menuItem;
85
86  if (body.hasClass("page-id-27")) {
87    menuItem = $("#menu-main-menu #menu-item-10");
88  } else if (body.hasClass("page-id-624")) {
89    menuItem = $("#menu-main-menu #menu-item-11");
90  } else if (body.hasClass("page-id-648")) {
91    menuItem = $("#menu-main-menu #menu-item-12");
92    /* /study-abroad-in-china-v2 */
93  } else if (body.hasClass("page-id-11100")) {
94    menuItem = $("#menu-main-menu #menu-item-10");
95  }
96
97  if (menuItem && !menuItem.hasClass("current-menu-item")) {
98    menuItem.addClass("current-menu-item");
99  }
100
101  $(".post-type-modal #link_button-139-456").on("click", function (event) {
102    event.preventDefault();
103  });
104
105  $(".gtranslate_menu li a").click(function (e) {
106    e.preventDefault();
107    if ($(this).parent().hasClass("lang-zh-CN")) {
108      doGTranslate("en|zh-CN");
109    }
110    if ($(this).parent().hasClass("lang-en")) {
111      doGTranslate("en|en");
112    }
113    if ($(this).parent().hasClass("lang-ko")) {
114      doGTranslate("en|ko");
115    }
116    if ($(this).parent().hasClass("lang-es")) {
117      doGTranslate("en|es");
118    }
119  });
120
121  $("a.inline_play").on("click touchend", function (e) {
122    e.preventDefault();
123    e.stopPropagation();
124    var robot_audio_url = $(this).attr("href");
125    var audio = new Audio(robot_audio_url);
126    audio.play();
127  });
128
129  /* Expand/Collapse Content */
130  jQuery(".color-block").each(function () {
131    jQuery(this)
132      .find(".expand")
133      .click(function () {
134        jQuery(this).hide();
135        jQuery(this).parent().find(".collapse").show();
136        jQuery(this).parent().parent().find(".block-text").animate(
137          {
138            maxHeight: 4000,
139          },
140          400
141        );
142      });
143    jQuery(this)
144      .find(".collapse")
145      .click(function () {
146        jQuery(this).hide();
147        jQuery(this).parent().find(".expand").show();
148        jQuery(this).parent().parent().find(".block-text").animate(
149          {
150            maxHeight: 190,
151          },
152          400
153        );
154
155        if (jQuery(this).parents(".color-block").outerHeight() > 500) {
156          var destination = jQuery(this).parents(".color-block").attr("id");
157          var blockID = "#" + destination;
158          event.preventDefault();
159          jQuery("html, body").animate(
160            {
161              scrollTop: jQuery(blockID).position().top,
162            },
163            500,
164            "swing"
165          );
166        }
167      });
168  });
169
170  jQuery(".color-block").each(function () {
171    jQuery(this)
172      .find(".cb-zdy")
173      .click(function () {
174        if (jQuery(this).parent().find(".expand").is(":visible")) {
175          jQuery(this).parent().find(".expand").click();
176        } else {
177          jQuery(this).parent().find(".collapse").click();
178        }
179      });
180  });
181  /* Expand/Collapse Content */
182
183  /* Expand/Collapse Graded Content */
184  jQuery(".graded-audio-text").css({
185    maxHeight: "0",
186  });
187  jQuery(".audio-read-more").each(function () {
188    jQuery(this)
189      .find(".graded-audio-more-button")
190      .click(function () {
191        jQuery(this).hide();
192        jQuery(this).parent().find(".graded-audio-less-button").show();
193        jQuery(this).parent().parent().find(".graded-audio-text").animate(
194          {
195            maxHeight: 4000,
196          },
197          400
198        );
199      });
200    jQuery(this)
201      .find(".graded-audio-less-button")
202      .click(function () {
203        jQuery(this).hide();
204        jQuery(this).parent().find(".graded-audio-more-button").show();
205        jQuery(this).parent().parent().find(".graded-audio-text").animate(
206          {
207            maxHeight: 0,
208          },
209          400
210        );
211
212        if (jQuery(this).parents(".audio-read-more").outerHeight() > 100) {
213          var destination = jQuery(this).parents(".audio-read-more").attr("id");
214          var blockID = "#" + destination;
215          event.preventDefault();
216          jQuery("html, body").animate(
217            {
218              scrollTop: jQuery(blockID).position().top - 400,
219            },
220            500,
221            "swing"
222          );
223        }
224      });
225  });
226  /* Expand/Collapse Graded Content */
227
228  $(".switcher, #menu-main-menu .sub-menu").css("opacity", "1");
229
230  /* Current Menu For single & category posts */
231  if (
232    jQuery("section").hasClass("single-post-section") ||
233    jQuery("body").hasClass("category") ||
234    jQuery("body").hasClass("author") ||
235    jQuery("body").hasClass("search")
236  ) {
237    jQuery(".menu-item-experience").addClass("current-menu-parent");
238    jQuery("#menu-item-78").addClass("current-menu-item");
239  }
240  if (jQuery("body").hasClass("single-post")) {
241    jQuery(".menu-item-experience").addClass("menu-underlined");
242  }
243  /* Current Menu For single & category posts */
244
245  /* Close Mobile Menu by Clicking Content */
246  jQuery(".ct-inner-content").click(function () {
247    jQuery(this)
248      .parent()
249      .find(".oxy-pro-menu-off-canvas .hamburger-menu-box")
250      .trigger("click");
251  });
252  jQuery("body > .ct-section").click(function () {
253    jQuery(this)
254      .parent()
255      .find(".oxy-pro-menu-off-canvas .hamburger-menu-box")
256      .trigger("click");
257  });
258
259  /* Phones Dropdown Animation */
260
261  /* Team Carousel */
262  if (jQuery("body.page-id-3971").length) {
263    jQuery(".team-carousel > .oxy-posts").addClass("owl-carousel");
264    jQuery(".team-carousel > .oxy-posts").owlCarousel({
265      items: 1,
266      nav: false,
267      dots: false,
268      mouseDrag: false,
269      touchDrag: false,
270      fluidSpeed: 3000,
271    });
272    var owl = jQuery(".team-carousel .owl-carousel");
273    owl.owlCarousel();
274    jQuery(".hero-navRight").click(function () {
275      owl.trigger("next.owl.carousel");
276    });
277    jQuery(".hero-navLeft").click(function () {
278      owl.trigger("prev.owl.carousel");
279    });
280
281    /* Open Specific Slide */
282    var $carouselItem = jQuery(".team-member-col").attr("carousel-trigger");
283    jQuery(".team-member-col").click(function () {
284      var $carouselItem = jQuery(this).attr("carousel-trigger");
285
286      jQuery(".team-carousel > .oxy-posts").trigger(
287        "to.owl.carousel",
288        $carouselItem
289      );
290    });
291
292    jQuery(".profile-nav .hero-navRight a").each(function () {
293      var $navLink = jQuery(this).html();
294      var $firstWord = $navLink.split(" ").slice(0, 2).join(" ");
295      jQuery(this).text($firstWord);
296    });
297
298    jQuery(".profile-nav .hero-navLeft a").each(function () {
299      var $navLink = jQuery(this).html();
300      var $firstWord = $navLink.split(" ").slice(0, 2).join(" ");
301      jQuery(this).text($firstWord);
302    });
303
304    jQuery(".team-carousel .hero-nav").hover(function () {
305      jQuery(".team-carousel .hero-nav label").show();
306    });
307  }
308
309  jQuery(".team-member-wrap").click(function (event) {
310    event.stopPropagation();
311  });
312  jQuery(".team-member-wrap .oxy-close-modal, .oxy-modal-backdrop").click(
313    function () {
314      oxyCloseModal();
315    }
316  );
317  /* Team Carousel */
318
319  jQuery(".sub-menu").wrapInner("<div class='sub-menu-wrap'></div>");
320
321  if (jQuery("#menu-main-menu > li > ul.sub-menu").is(":visible")) {
322    jQuery(".banner-section").addClass("submenu-visible");
323  }
324
325  /* Faq Toggle Animation */
326  jQuery(".faq-toggle").each(function () {
327    jQuery(this)
328      .find(".faq-toggle-heading")
329      .click(function () {
330        jQuery(this).parents().toggleClass("toggle-active");
331        jQuery(this).parent().find(".faq-toggle-content").slideToggle(400);
332      });
333  });
334  /* Faq Toggle Animation */
335
336  /* Custom Humburger */
337  jQuery(".oxy-pro-menu-mobile-open-icon").append(
338    "<span class='hamburger-menu-box'><span class='hamburger-menu-inner'></span></span>"
339  );
340  /* Custom Humburger */
341
342  /* Mobile Menu Open - Content Slide */
343  jQuery(".oxy-pro-menu-mobile-open-icon").click(function () {
344    jQuery("body > .ct-inner-content").toggleClass("slide-right");
345    jQuery("body > .single-post-section").toggleClass("slide-right");
346  });
347  /* Mobile Menu Open - Content Slide */
348
349  /* Close Mobile Menu by Clicking Content */
350});
351
352getProgramsInfo = function (callback) {
353  if (window.programsInfoCLI) {
354    callback();
355    return;
356  }
357};
358
359readPrices = function () {
360  var priceBlocks = jQuery(".price-block");
361  if (priceBlocks.length < 1) return;
362  var callback = function () {
363    var program, time, lodging;
364    jQuery.each(priceBlocks, function (index, block) {
365      program = block.getAttribute("data-program");
366      time = block.getAttribute("data-time");
367      lodging = block.getAttribute("data-lodging");
368      jQuery(block).html(window.programsInfoCLI[program][time][lodging]);
369    });
370  };
371  getProgramsInfo(callback);
372};
373
374registerProgramsSpecialDropdown = function () {
375  if (jQuery(".programs-country").length < 1) return false;
376  if (jQuery(".programs-special").length < 1) return false;
377  jQuery.getJSON(
378    "https://cryptic-headland-7512.herokuapp.com/ajaxs-info?do=all&jsoncallback=?",
379    function (data) {
380      var dropdownCountry = jQuery(".programs-country");
381      var dropdown = jQuery(".programs-special");
382      var dropdownCountry_datas;
383      dropdownCountry
384        .append("<option disabled selected>Please Select</option>")
385        .change(function () {
386          var key = jQuery(this).val();
387          dropdown
388            .empty()
389            .append("<option disabled selected>Please Select</option>");
390          jQuery.each(dropdownCountry_datas[key], function (index, option) {
391            dropdown.append(
392              '<option value="' +
393                option.replace(/\'/g, "'") +
394                '">' +
395                option +
396                "</option>"
397            );
398          });
399        });
400      jQuery.each(data.countrys, function (index, option) {
401        dropdownCountry.append(
402          '<option value="' + index + '">
402' + option + "</option>"
403        );
404      });
405      dropdown.append("<option disabled selected>Please Select</option>");
406      dropdownCountry_datas = data.programs;
407    }
408  );
409};
410
411registerProgramDropdowns = function () {
412  if (jQuery("form select[name='Term']").length < 1) return false;
413  var classMap = {
414    "Immersion Program": "default",
415    "College Study Abroad (Standard)": "abroad-standard",
416    "College Study Abroad (Intensive)": "abroad-intensive",
417    "Teach in China": "teach",
418  };
419  var programChosen = function () {
420    var program = jQuery("select[name='Program']").val();
421    var term = jQuery("select[name='Term']").val();
422    jQuery("select[name='Term']").html(window.termOptions[classMap[program]]);
423    var firstOptionVal = jQuery("select[name='Term']").eq(0).val();
424    if (program == "Immersion Program") {
425      firstOptionVal = "8 weeks";
426    }
427    jQuery("select[name='Term']").val(firstOptionVal);
428    jQuery("select[name='Housing']").html(
429      window.housingOptions[classMap[program]]
430    );
431    var firstOptionVal = jQuery("select[name='Housing']").eq(0).val();
432    jQuery("select[name='Housing']").val(firstOptionVal);
433    jQuery("input[name='Start Date']")
434      .parents(".row")
435      .toggleClass("hidden", program != "Immersion Program");
436    jQuery("input[name='Buddy System']")
437      .parents(".row")
438      .toggleClass("hidden", program == "Teach in China");
439    jQuery("select[name='Desired Level']")
440      .parents(".row")
441      .toggleClass("hidden", program != "Teach in China");
442  };
443  jQuery("#startdate").prop("required", true);
444  jQuery("#startdate").show();
445  jQuery("select[name=Program]").change(function () {
446    if (jQuery(this).val() == "Immersion Program") {
447      jQuery("#startdate").prop("required", true);
448      jQuery("#startdate").show();
449    } else {
450      jQuery("#startdate").hide();
451      jQuery("#startdate").prop("required", false);
452    }
453  });
454  var termChosen = function () {
455    var program = jQuery("select[name='Program']").val();
456    var term = jQuery("select[name='Term']").val();
457    var programLong =
458      program == "Immersion Program" &&
459      jQuery("select[name='Term'] option[value='" + term + "']").hasClass(
460        "long"
461      );
462    if (!programLong)
463      jQuery("select[name='Housing'] option.long-only").remove();
464    else {
465      if (jQuery("select[name='Housing'] option.long-only").length < 1)
466        jQuery("select[name='Housing']").append(window.longHousingOption);
467      jQuery("select[name='Housing'] option.long-only").removeClass("hidden");
468    }
469  };
470
471  window.termOptions = {};
472  window.termOptions["default"] = jQuery("select[name='Term'] option.default");
473  window.termOptions["abroad-standard"] = jQuery(
474    "select[name='Term'] option.abroad-standard"
475  );
476  window.termOptions["abroad-intensive"] = jQuery(
477    "select[name='Term'] option.abroad-intensive"
478  );
479  window.termOptions["teach"] = jQuery("select[name='Term'] option.teach");
480  window.housingOptions = {};
481  window.housingOptions["default"] = jQuery(
482    "select[name='Housing'] option.default"
483  );
484  window.housingOptions["abroad-standard"] = jQuery(
485    "select[name='Housing'] option.abroad-standard"
486  );
487  window.housingOptions["abroad-intensive"] = jQuery(
488    "select[name='Housing'] option.abroad-intensive"
489  );
490  window.housingOptions["teach"] = jQuery(
491    "select[name='Housing'] option.teach"
492  );
493  window.longHousingOption = jQuery("select[name='Housing'] option.long-only");
494  jQuery("select[name='Program']").on("change", programChosen);
495  jQuery("select[name='Term']").on("change", termChosen);
496  programChosen();
497  termChosen();
498};
499
500initialize = function () {
501  registerProgramsSpecialDropdown();
502};
503jQuery(document).ready(function ($) {
504  initialize();
505});
506
507jQuery(document).ready(function ($) {
508  $(".gt_selected").click(function (e) {
509    $(this).addClass("hidden");
510  });
511  $(document).click(function (e) {
512    if (!$(e.target).closest(".gt_switcher").length) {
513      $(".gt_selected").removeClass("hidden");
514    }
515  });
516});
517
518jQuery(function ($) {
519  $(document).on("oxy-modal:open", function () {
520    $(
521      "#_posts_grid-437-3971 .profile-nav .hero-nav label.next-arrow"
522    ).removeAttr("style");
523  });
524
525  setTimeout(function () {
526    $(
527      "#_posts_grid-437-3971 .profile-nav .hero-nav label.next-arrow"
528    ).removeAttr("style");
529  }, 0);
530});

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.