PageSourceSearch

https://news.unm.edu/media/themes/66e9b0543d63320ab4795bee/js/common.js?ver=2023-03-22

js unm.edu collected 2026-09-24 07:25:44 UTC 10,360 bytes, 357 lines download raw bytes

1(function($){
2
3  $(document).ready(function(){
4
5    //
6    // NAVIGATION LINK
7    //
8    $(".header-nav-link").click(function(){
9      $(".header-nav").toggleClass("opened");
10    });
11
12    $(".headerNewsroom-nav-item-hasSubitem > a,span").click(function(){
13      if($(window).width() < 1024) {
14        $(this).parent().toggleClass("opened");
15        return false;
16      }
17    });
18
19    $(".headerNewsroom-nav-link").click(function(){
20      if($(window).width() < 1024) {
21        $(".headerNewsroom-search-form").toggleClass("collapse");
22      }
23
24      var navLink = $(this);
25      var navContainer = $(".headerNewsroom-nav");
26      if(navLink.hasClass("opened")) {
27        navLink.removeClass("opened");
28        navContainer.removeClass("opened");
29      } else {
30        navLink.addClass("opened");
31        navContainer.addClass("opened");
32      }
33    })
34
35
36    //
37    // CAROUSEL
38    //
39      if($('#film_roll').length) {
40        fr = new FilmRoll({
41          container: '#film_roll',
42          configure_load: true,
43          position: 'center',
44          interval: 10000,
45          no_css: true,
46          pager: false,
47          animation: "1/8"
48        });
49        $('#filmRoll').on('film_roll:resizing', function(event) {
50          var ww = $(window).width();
51          var slide_width = ww*0.7;
52          $('#filmRoll').find(".filmRoll-item").width(slide_width);
53        });
54      }
55
56
57    //
58    // TABS @ HOMEPAGE
59    //
60    if($(".tabs").length) {
61      $(".tabs-link a").click(function(){
62        var tabLink = $(this).parent("li");
63        tabLink.siblings().removeClass("active");
64        tabLink.addClass("active");
65
66        var target=$(this).attr("href");
67        var container = $(target,".tabs");
68        container.siblings(".tabs-panel").removeClass("active");
69        container.addClass("active");
70        return false;
71      });
72    }
73
74
75    //
76    // GALLERY @ HOMEPAGE
77    //
78    if($(".homeGallery").length) {
79      $(".homeGallery-thumbnails-item ").click(function(){
80        var elem = $(this);
81        var id = $(this).attr("data-id");
82        var lg = $(".homeGallery-large").find("#g_"+id);
83
84        elem.siblings().removeClass("active");
85        elem.addClass("active");
86
87        lg.siblings().removeClass("active");
88        lg.addClass("active");
89
90        return false;
91      });
92    }
93
94
95
96  //
97  // Featured video @ Homepage
98  //
99
100  var lg = $(".mediaLibrary-wrapper:not(.noLG)").lightGallery({
101    selector: '.mediaLibrary-item',
102    zoom: false,
103    thumbnail: false,
104    hash: false,
105    mousewheel: false,
106    fullScreen: 0,
107	download: false,
108    autoplayControls: 0,
109    keyPress: 0,
110    escKey: 1
111  });
112
113  lg.on("onBeforeSlide.lg",function(event, prevIndex, index, fromTouch, fromThumb){
114    var item = $(".mediaLibrary-wrapper").find(".mediaLibrary-item").eq(index);
115    var size = item.attr("data-size");
116    $("#lg-download").text("Download (" + size + ")");
117  });
118
119  /* Facepalm for Chrome form videos */
120  lg.on("onAfterSlide.lg",function(event, prevIndex, index, fromTouch, fromThumb){
121    setTimeout(function(){
122      $(".lg-object").width($(".lg-object").width()+1);
123    },1000);
124    setTimeout(function(){
125      $(".lg-object").width($(".lg-object").width()-1);
126    },1000);
127  });
128
129
130
131  //
132  // Gallery in the bottom of the Homepage
133  //
134
135  var lg2 = $(".homeGallery-large").lightGallery({
136    selector: '.homeGallery-large-item',
137    zoom: false,
138    thumbnail: false,
139    hash: false,
140    mousewheel: false,
141    fullScreen: 0,
142    autoplayControls: 0,
143    keyPress: 0,
144    escKey: 1
145  });
146
147  lg2.on("onBeforeSlide.lg",function(event, prevIndex, index, fromTouch, fromThumb){
148    var item = $(".homeGallery-large").find(".homeGallery-large-item").eq(index);
149    var size = item.attr("data-size");
150    $("#lg-download").text("Download (" + size + ")");
151  });
152
153  /* Facepalm for Chrome form videos */
154  lg2.on("onAfterSlide.lg",function(event, prevIndex, index, fromTouch, fromThumb){
155    setTimeout(function(){
156      $(".lg-object").width($(".lg-object").width()+1);
157    },1000);
158    setTimeout(function(){
159      $(".lg-object").width($(".lg-object").width()-1);
160    },1000);
161  });
162
163
164
165  //
166  // Multimedia page
167  //
168  var lg3 = $(".album").lightGallery({
169    selector: '.album-item-image,.album-item-text h5,.album-item-more-view',
170    zoom: false,
171    thumbnail: false,
172    hash: false,
173    mousewheel: false,
174    fullScreen: 0,
175    autoplayControls: 0,
176    keyPress: 0,
177    escKey: 1,
178    controls: 0,
179    counter: 0
180  });
181
182  lg3.on("onBeforeSlide.lg",function(event, prevIndex, index, fromTouch, fromThumb){
183    var item = $(".album").find(".album-item").eq(Math.floor(index/3));
184    var size = item.find(".album-item-image").attr("data-size");
185    $("#lg-download").text("Download (" + size + ")");
186  });
187
188  /* Facepalm for Chrome form videos */
189  lg3.on("onAfterSlide.lg",function(event, prevIndex, index, fromTouch, fromThumb){
190    setTimeout(function(){
191      $(".lg-object").width($(".lg-object").width()+1);
192    },1000);
193    setTimeout(function(){
194      $(".lg-object").width($(".lg-object").width()-1);
195    },1000);
196  });
197
198
199    $(".article-body").find("iframe").each(function(){
200      $("<div class='article-body-iframe'></div>").insertBefore(this);
201      $(this).clone().appendTo($(this).prev());
202      setPlayerResponsive($(this).prev());
203      $(this).remove();
204    });
205
206
207
208    //
209    // Slider @ Homepage
210    //
211    $(".mediaLibrary").each(function(){
212      var $scrollList = $(this);
213      var mySwiper = new Swiper ($scrollList, {
214        freeMode: false,
215        slideClass: 'mediaLibrary-item',
216        wrapperClass: 'mediaLibrary-wrapper',
217        slidesPerView: 'auto'
218      });
219    })
220
221
222    $(function () {
223      var $cont = $(".redblock"),
224      prd = setInterval(function () {
225        if ($cont.find("iframe").contents().find(".timeline-Widget").length > 0) {
226          clearInterval(prd);
227          $body = $cont.find("iframe").contents().find("body");
228          $body.append($("#twitterStyle"));
229        }
230      }, 100);
231    });
232
233    if($(".events").length) {
234      var events = $(".events-item").get().reverse();
235      $(events).each(function(i){
236        var th = $(this);
237        $(this).clone().appendTo($(".events-wrapper"));
238        th.remove();
239      });
240
241      var shown = 0;
242      $(".events-item").each(function(i){
243        if(shown>=3) {
244          return;
245        }
246        var dateItem = Date.parse($(this).attr("data-date"));
247        var now = new Date().valueOf();
248
249        //console.log((parseInt(now) - parseInt(dateItem)) + "; shown=" + shown);
250        if(parseInt(dateItem) - parseInt(now) >= 0) {
251          $(this).attr("data-shown","1");
252          shown++;
253        }
254      })
255    }
256
257  }); // end of document.ready
258
259
260
261  function setPlayerResponsive(container) {
262    var fl = container.children(".flashPlayer,video,audio,iframe");
263    if(fl.attr("data-responsive")) {
264      return;
265    }
266    var w = fl.width(),
267        h = fl.height();
268    container
269              .css("height", '0')
270              .css("padding-bottom",h/w*100+"%")
271              .css("position","relative");
272    fl
273              .attr("data-responsive","1")
274              .css("position","absolute")
275              .css("left","0")
276              .css("top","0")
277              .css("right","0")
278              .css("bottom","0")
279              .css("height","100%")
280              .css("width","100%");
281  }
282})(jQuery)
283
284
285/* Keyboard nav
286document.addEventListener('DOMContentLoaded', function() {
287    const menuItems = document.querySelectorAll('.headerNewsroom-nav-item-hasSubitem > span');
288
289    menuItems.forEach(menuItem => {
290        const submenu = menuItem.nextElementSibling; // Sibling <ul> element
291        const submenuLinks = submenu.querySelectorAll('a');
292
293        // Initially disable tabbing for all submenu links
294        submenuLinks.forEach(link => link.setAttribute('tabindex', '-1'));
295
296        // Enable tabbing and show submenu when the parent span is focused
297        menuItem.addEventListener('focus', function() {
298            submenuLinks.forEach(link => link.setAttribute('tabindex', '0'));
299            submenu.style.display = 'block'; // Show the submenu
300        });
301
302        // Keep submenu visible when submenu links are focused
303        submenuLinks.forEach(link => {
304            link.addEventListener('focus', function() {
305                submenu.style.display = 'block'; // Ensure submenu stays visible
306            });
307        });
308
309        // Handle blur on the parent span (with delay)
310        menuItem.addEventListener('blur', function() {
311            setTimeout(() => {
312                if (!submenu.contains(document.activeElement)) {
313                    submenuLinks.forEach(link => link.setAttribute('tabindex', '-1'));
314                    submenu.style.display = 'none'; // Hide submenu if focus leaves
315                }
316            }, 100); // Small delay to allow tabbing to submenu
317        });
318
319        // Handle blur on the submenu links (with delay)
320        submenuLinks.forEach(link => {
321            link.addEventListener('blur', function() {
322                setTimeout(() => {
323                    if (!menuItem.contains(document.activeElement) && !submenu.contains(document.activeElement)) {
324                        submenuLinks.forEach(link => link.setAttribute('tabindex', '-1'));
325                        submenu.style.display = 'none'; // Hide submenu if focus leaves
326                    }
327                }, 100); // Delay to check if focus is still within the menu
328            });
329        });
330
331        // Ensure submenu stays open when hovered (for mouse users)
332        menuItem.addEventListener('mouseover', function() {
333            submenu.style.display = 'block';
334        });
335
336        submenu.addEventListener('mouseover', function() {
337            submenu.style.display = 'block';
338        });
339
340        // Hide submenu when the mouse leaves
341        menuItem.addEventListener('mouseout', function() {
342            setTimeout(() => {
343                if (!submenu.contains(document.activeElement)) {
344                    submenu.style.display = 'none';
345                }
346            }, 100);
347        });
348
349        submenu.addEventListener('mouseout', function() {
350            setTimeout(() => {
351                if (!submenu.contains(document.activeElement)) {
352                    submenu.style.display = 'none';
353                }
354            }, 100);
355        });
356    });
357}); */

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.