PageSourceSearch

https://plusalliance.org/themes/custom/plusalliancetheme/js/button.js?tm318d

js plusalliance.org collected 2026-10-03 23:46:04 UTC 7,638 bytes, 254 lines download raw bytes

1(function ($, Drupal, drupalSettings) {
2  setTimeout(function () {
3    $(".buttonBar").append("<span class='buttontext'></span>");
4
5    $(".mb_YTPPlayPause").click(function () {
6      $(".buttontext").toggleClass("pause");
7    });
8
9    $(".buttonBar").wrapAll('<div class="wrapbutton"></div>');
10
11    $("#block-plusvideos .product__slider-main .slick-arrow").click(
12      function () {
13        $("iframe.yt_player_iframe").each(function () {
14          this.contentWindow.postMessage(
15            '{"event":"command", "func":"pauseVideo", "args":""}',
16            "*"
17          );
18        });
19      }
20    );
21
22    $("#block-plusalliancetheme-main-menu ul li:last-child").addClass("last");
23
24    $("li.last button").click(function () {
25      $("#contact").css("display", "block");
26      $("#contact-form").css("display", "block");
27      $("#form-messages").css("display", "none");
28    });
29
30    $(".rfi-close").click(function () {
31      $("#contact").css("display", "none");
32    });
33
34    var url = jQuery(location).attr("href");
35    if (url.includes("/plus-research-projects")) {
36      jQuery(".plus-research-back-to-top").addClass("d-sm-flex");
37    } else {
38      jQuery(".plus-research-back-to-top").addClass("d-none");
39      jQuery(".plus-research-back-to-top").removeClass("d-sm-flex");
40    }
41    jQuery("#edit-combine--2").attr(
42      "placeholder",
43      "Search programs and courses"
44    );
45  }, 3000);
46
47  $(document).ready(function () {
48    jQuery(document).click(function () {
49      jQuery(".form--inline .degree-filters").toggle("slide");
50    });
51
52    $(".close-only-researchers span, .researcher-modal").on(
53      "click",
54      function () {
55        $(".modal-backdrop").eq(1).remove();
56        var closename = $(this).data("close");
57
58        $(".project-researcher-popup.modal").hide();
59        $(".project-researcher-popup.modal").attr("aria-hidden", "true");
60        $(".project-researcher-popup.modal").removeClass("show");
61        $('.researcherName[data-target="' + closename + '"]').click();
62      }
63    );
64
65    const player = document.getElementById("twelfthLottie");
66    if (player) {
67      LottieInteractivity.create({
68        player: player,
69        mode: "scroll",
70        actions: [
71          {
72            visibility: [0.0, 1.0],
73            type: "playOnce",
74          },
75        ],
76      });
77    }
78  });
79
80  //////////////////
81
82  // $('div.closing-the-gender-gap').on('mouseenter', function () {
83  //   $(this).addClass('animate');
84  // });
85
86  $(window).on("scroll", function () {
87    $("div.closing-the-gender-gap").each(function () {
88      var elementPosition = $(this).offset().top;
89      var windowHeight = $(window).height();
90      var scrollPosition = $(window).scrollTop();
91
92      if (scrollPosition > elementPosition - windowHeight + 100) {
93        $(this).addClass("animate");
94      }
95    });
96  });
97
98  $(".contactButton").click(function () {
99    $("#contact").css("display", "block");
100  });
101
102  $(".ipadContact").click(function () {
103    $("#contact").css("display", "block");
104  });
105
106  $(".rfi-close").click(function () {
107    $("#contact").css("display", "none");
108  });
109  //////////////////////////////////////////////////////////////////
110
111  if ($(".product__slider-main").length) {
112    var $slider = $(".product__slider-main")
113      .on("init", function (slick) {
114        $(".product__slider-main").fadeIn(1000);
115      })
116      .slick({
117        slidesToShow: 1,
118        slidesToScroll: 1,
119        // variableWidth: true,
120        arrows: true,
121        // autoplay: true,
122        lazyLoad: "ondemand",
123        autoplaySpeed: 3000,
124        asNavFor: ".product__slider-thmb",
125        nextArrow:
126          '<button type="button" data-role="none" class="slick-next hello">Next</button>',
127        prevArrow:
128          '<button type="button" data-role="none" class="slick-prev">Previous</button>',
129      });
130
131    var $slider2 = $(".product__slider-thmb")
132      .on("init", function (slick) {
133        $(".product__slider-thmb").fadeIn(1000);
134      })
135      .slick({
136        slidesToShow: 3,
137        slidesToScroll: 1,
138        lazyLoad: "ondemand",
139        asNavFor: ".product__slider-main",
140        dots: false,
141        centerMode: false,
142        focusOnSelect: true,
143      });
144
145    //remove active class from all thumbnail slides
146    $(".product__slider-thmb .slick-slide").removeClass("slick-active");
147
148    //set active class to first thumbnail slides
149    $(".product__slider-thmb .slick-slide").eq(0).addClass("slick-active");
150
151    // On before slide change match active thumbnail to current slide
152    $(".product__slider-main").on(
153      "beforeChange",
154      function (event, slick, currentSlide, nextSlide) {
155        var mySlideNumber = nextSlide;
156        $(".product__slider-thmb .slick-slide").removeClass("slick-active");
157        $(".product__slider-thmb .slick-slide")
158          .eq(mySlideNumber)
159          .addClass("slick-active");
160        // var currentslide=$(".product__slider-thmb .slick-active").attr("data-slick-index");
161        // $(".slidenumber").text(currentSlide+1+'/3');
162      }
163    );
164
165    // init slider
166    require(["js-sliderWithProgressbar"], function (slider) {
167      $(".product__slider-main").each(function () {
168        me.slider = new slider(
169          $(this),
170          options,
171          sliderOptions,
172          previewSliderOptions
173        );
174      });
175    });
176    var options = {
177      progressbarSelector: ".bJS_progressbar",
178      slideSelector: ".bJS_slider",
179      previewSlideSelector: ".bJS_previewSlider",
180      progressInterval: "",
181      // add your own progressbar animation function to sync it i.e. with a video
182      // function will be called if the current preview slider item (".b_previewItem") has the data-customprogressbar="true" property set
183      onCustomProgressbar: function ($slide, $progressbar) {},
184    };
185
186    // slick slider options
187    // see: https://kenwheeler.github.io/slick/
188    var sliderOptions = {
189      slidesToShow: 1,
190      slidesToScroll: 1,
191      arrows: false,
192      fade: true,
193      // autoplay: true,
194    };
195
196    // slick slider options
197    // see: https://kenwheeler.github.io/slick/
198    var previewSliderOptions = {
199      slidesToShow: 3,
200      slidesToScroll: 1,
201      dots: false,
202      focusOnSelect: true,
203      centerMode: true,
204    };
205
206    var currentSlide;
207    var slidesCount;
208    var sliderCounter = document.getElementsByClassName("slidenumber");
209    sliderCounter.classList.add("slider__counter");
210
211    var updateSliderCounter = function (slick, currentIndex) {
212      currentSlide = slick.slickCurrentSlide() + 1;
213      slidesCount = slick.slideCount;
214      $(sliderCounter).text(currentSlide + "/" + slidesCount);
215    };
216
217    $slider.on("init", function (event, slick) {
218      $slider.append(sliderCounter);
219      updateSliderCounter(slick);
220    });
221
222    $slider.on("afterChange", function (event, slick, currentSlide) {
223      updateSliderCounter(slick, currentSlide);
224    });
225  }
226
227  // Disabling enter pres on filter input
228  $(document).on("keydown", ".js-form-item-combine input", function (e) {
229    // Key code 13 is Enter
230    if (e.keyCode === 13) {
231      e.preventDefault();
232      return false;
233    }
234  });
235})(jQuery, once);
236
237let tokenz = window.location.pathname;
238
239let tokens = window.location.search;
240
241const urlParams = new URLSearchParams(tokens);
242
243const product = urlParams.get("title");
244
245'"' + product + '"';
246const products = JSON.stringify(product);
247if (tokenz == "/newsroom/article/search") {
248  let app = document.querySelector(
249    ".view-id-pressroom_hero.view-display-id-page_1 .searchresults"
250  );
251
252  app.append(products);
253  jQuery("#newsroom-box").attr("placeholder", products.replace(/[""]/g, ""));
254}

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.