PageSourceSearch

https://www.kent.edu/themes/custom/ksu_kent_zurb_2018/js/custom.js?v=10.6.17&tlsd5q

js kent.edu collected 2026-10-01 08:40:41 UTC 11,430 bytes, 337 lines download raw bytes

1(function ($, Drupal, drupalSettings) {
2
3  $(document).ready(function () {
4    var paragraph_id = 0;
5    jQuery('[id^=paragraph-item-]').each(function () {
6      // console.log(paragraph_id + 1);
7      // console.log(jQuery('[id^=paragraph-item-]')[i]);
8      jQuery(this).attr('id', 'paragraph-item-' + (paragraph_id + 1));
9      paragraph_id = paragraph_id + 1;
10    });
11
12    jQuery('.node-type-article .panel-layout-fifty-fifty-bricks .pane-node-created').parent().addClass('text-align-center');
13
14    jQuery("#tabs-0-feature_bottom").tabs({
15      classes: {
16        "ui-tabs": "ui-corner-all"
17      }
18    });
19
20    jQuery('.calendar-slide').slick({
21      infinite: true,
22      speed: 300,
23      slidesToShow: 4,
24      slidesToScroll: 4,
25      prevArrow: jQuery('.calendar-left'),
26      nextArrow: jQuery('.calendar-right'),
27      responsive: [{
28          breakpoint: 1024,
29          settings: {
30            slidesToShow: 4,
31            slidesToScroll: 4,
32            infinite: true
33          }
34        },
35        {
36          breakpoint: 600,
37          settings: {
38            slidesToShow: 2,
39            slidesToScroll: 2,
40            infinite: true
41          }
42        },
43        {
44          breakpoint: 480,
45          settings: {
46            slidesToShow: 1,
47            slidesToScroll: 1,
48            infinite: true
49          }
50        }
51      ]
52    });
53
54    jQuery(".page-node-788156 .block-views.block-views-blockrendered-content-block-52").each(function () {
55      jQuery(this).find('.media-element').css('margin-right', '20px');
56      jQuery(this).find('.media-element').detach().prependTo(jQuery(this).find('.field--node-body'));
57      jQuery(this).find('.field--node-field-basic-page-sub-title').addClass('researcher-title');
58      jQuery(this).find('.pane-title').parent().addClass('panel-pane pane-node');
59    });
60
61    if (jQuery('#toolbar-item-administration-tray').hasClass('is-active')) {
62      if (jQuery(window).width() < 582) {
63        $('.block-kent-state-og-user-utility-bar').css('top', '150px');
64      } else if (jQuery(window).width() < 1134) {
65        $('.block-kent-state-og-user-utility-bar').css('top', '110px');
66      } else {
67        $('.block-kent-state-og-user-utility-bar').css('top', '75px');
68      }
69    }
70
71
72    $('.toolbar-item').on("click", function () {
73      if ($(this).hasClass("is-active")) {
74        $('.block-kent-state-og-user-utility-bar').css('top', '39px');
75      } else {
76        if(jQuery(window).width() < 439) {
77          $('.block-kent-state-og-user-utility-bar').css('top', '185px');
78        } else if (jQuery(window).width() > 439 && jQuery(window).width() < 582) {
79          $('.block-kent-state-og-user-utility-bar').css('top', '150px');
80        } else if (jQuery(window).width() < 1134) {
81          $('.block-kent-state-og-user-utility-bar').css('top', '110px');
82        } else {
83          $('.block-kent-state-og-user-utility-bar').css('top', '75px');
84        }
85      }
86    });
87
88    var theUrl = window.location.href
89    var hashValue = theUrl.split('#')[1];
90    if (theUrl.indexOf(hashValue) != -1) {
91      console.log(hashValue);
92      var headerheight = jQuery("header").outerHeight() * 2;
93      var elementpos = jQuery('a[href="#' + hashValue + '"]').parent().offset().top;
94      console.log(headerheight);
95      console.log(elementpos);
96      console.log(elementpos - headerheight);
97      // console.log(jQuery('.accordian-navigation').has('a[href="#' + hashValue + '"]').length);
98      // console.log(jQuery('a[href="#' + hashValue + '"]').parent().offset().top - (headerheight));
99      if(jQuery('.accordian-navigation').has('a[href="#' + hashValue + '"]').length){
100        jQuery('a[href="#' + hashValue + '"]').closest('.accordion-item').addClass('is-active');
101        jQuery('a[href="#' + hashValue + '"]').next().toggle();
102        if (jQuery('body.node-type-administrative-group-par').length) {
103          jQuery('html,body').animate({
104            scrollTop: (elementpos + headerheight - 100)
105          }, 2000);
106
107        } else {
108          jQuery('html,body').animate({
109            scrollTop: (elementpos - headerheight - 100)
110          }, 2000);
111        }
112      }
113      setTimeout(
114        function() 
115        {
116          if(jQuery('.tabs').has('a[href="#' + hashValue + '"]').length){
117            jQuery('.tabs-title a[href="#' + hashValue + '"]').trigger('click');
118            if (jQuery('body.node-type-administrative-group-par').length) {
119              jQuery('html,body').animate({
120                scrollTop: (elementpos + headerheight + 200)
121              }, 2000);
122    
123            } else {
124              jQuery('html,body').animate({
125                scrollTop: (elementpos - headerheight + 200)
126              }, 2000);
127            }
128          }
129        }, 500);
130    }
131    // console.log(hashValue.length);
132
133    // jQuery( ".ui-Tabs .block.block-views" ).wrapAll( "<div id='tabs-feature-ui' />");
134
135    // var ctl =  jQuery( ".ui-Tabs .block.block-views" ).wrapAll( "<div id='tabs-feature-ui' />");
136    // var title = [];
137
138    // for (let i = 0; i<ctl.length ; i++ ){
139    //   let p1 = ctl[i].firstChild;
140    //   let p2 = p1.firstChild;
141    //   title.push(p2.innerHTML);
142    //   p1.removeChild(p2);
143    // }
144
145    // console.log(title);
146    // //Unbind jquery ui tab default click binding
147    //  $(".ui-tabs-nav li a").unbind('click');
148
149    // var $prev_tab;
150    // var $next_tab;
151
152    // $('.ui-tabs-nav li a').click(function (e) {
153    //   e.preventDefault();
154
155    //   //get prev active tab
156    //   $prev_tab = jQuery('.ui-tabs-nav > li.ui-state-active');
157    //   //get next active tab
158    //   $next_tab = jQuery(this).parent();
159
160    //   //  let d1 = ($prev_tab).attr('aria-labelledby').substring(6);
161    //   //  let d2 = ($next_tab).attr('aria-labelledby').substring(6);
162    //   console.log(jQuery(this).attr('id').substring(6) - 2);
163    //   console.log($prev_tab.attr('aria-labelledby').substring(6) - 2);
164
165    //   if (jQuery(this).attr('id').substring(6) - 2 > $prev_tab.attr('aria-labelledby').substring(6) - 2) {
166    //     // console.log(d1);
167    //     console.log("moving left");
168    //     $prev_tab.removeClass('ui-state-active');
169    //     $('#' + $prev_tab.attr('aria-controls')).hide("slide", {direction: "right"}, 400, function () {
170
171    //       //show new tab
172    //       $next_tab.addClass('ui-state-active');
173    //       $('#' + $next_tab.attr('aria-controls')).show("slide", {direction: "left"}, 400);
174
175
176    //     }).delay(1000);
177    //   } else {
178    //     // console.log(d2);
179    //     console.log("moving right");
180    //     $prev_tab.removeClass('ui-state-active');
181    //     $('#' + $prev_tab.attr('aria-controls')).hide("slide", {direction: "left"}, 400, function () {
182
183    //       //show new tab
184    //       $next_tab.addClass('ui-state-active');
185    //       $('#' + $next_tab.attr('aria-controls')).show("slide", {direction: "right"}, 400);
186
187    //     }).delay(1000);
188    //   }
189    //   // Find direction
190    //   //  if ( d1 > d2 ) {
191    //   //    // out to the right, in from left to right
192    //   //    //alert('moving left');
193    //   //    //hide prev tab
194    //     //  $prev_tab.removeClass('ui-state-active');
195    //     //  $('#' + $prev_tab.attr('aria-controls')).hide("slide", {direction: "right"}, 400, function () {
196
197    //     //    //show new tab
198    //     //    $next_tab.addClass('ui-state-active');
199    //     //    $('#' + $next_tab.attr('aria-controls')).show("slide", {direction: "left"}, 400);
200
201
202    //     //  }).delay(1000);
203
204    //   //  } else {
205    //   //    // out to the left, in from right to left
206    //   //    //alert('moving right');
207    //   //    //hide prev tab
208    //     //  $prev_tab.removeClass('ui-state-active');
209    //     //  $('#' + $prev_tab.attr('aria-controls')).hide("slide", {direction: "left"}, 400, function () {
210
211    //     //    //show new tab
212    //     //    $next_tab.addClass('ui-state-active');
213    //     //    $('#' + $next_tab.attr('aria-controls')).show("slide", {direction: "right"}, 400);
214
215    //     //  }).delay(1000);
216
217    //   //  }
218
219
220    // });
221
222
223  });
224
225  $(window).resize(function () {
226
227    // console.log($(window).width());
228    if(jQuery(window).width() < 439) {
229      $('.block-kent-state-og-user-utility-bar').css('top', '185px');
230    } else if (jQuery(window).width() > 439 && jQuery(window).width() < 582) {
231      $('.block-kent-state-og-user-utility-bar').css('top', '150px');
232    } else if (jQuery(window).width() < 1134) {
233      $('.block-kent-state-og-user-utility-bar').css('top', '110px');
234    } else {
235      $('.block-kent-state-og-user-utility-bar').css('top', '75px');
236    }
237
238  });
239
240
241
242  // $(window).on('load', function () {
243  $(document).ready(function () {
244    var ctl = jQuery(".ui-Tabs .block.block-views").wrapAll("<div id='tabs-feature-ui' />");
245    var title = [];
246
247    for (let i = 0; i < ctl.length; i++) {
248      ctl[i].setAttribute('id', 'tabs-' + i);
249      let p1 = ctl[i].childNodes[1];
250      // p1.setAttribute('id', 'tabs-' + i);
251      // console.log(ctl[i]);
252      // p1.wrap('<div id=tabs' + i + '/>' );
253      let p2 = p1.childNodes[1];
254      // console.log(p2.innerHTML);
255      title.push(p2.innerHTML);
256      p1.removeChild(p2);
257      // console.log(p1);
258    }
259
260    var container = document.createElement('div');
261    container.setAttribute('class', 'item-list');
262    // list.setAttribute()
263    var list = document.createElement('ul');
264
265    for (let i = 0; i < title.length; i++) {
266      let litemp = document.createElement('li');
267      let anchor = document.createElement('a');
268      anchor.href = '#tabs-' + i;
269      anchor.setAttribute('class', 'ui-tabs-anchor');
270      anchor.innerHTML = title[i];
271      litemp.appendChild(anchor);
272      list.appendChild(litemp);
273    }
274
275    container.appendChild(list);
276
277    var test = document.getElementById('tabs-feature-ui');
278    jQuery(container).prependTo(test);
279
280    jQuery("#tabs-feature-ui").tabs({
281      // classes: {
282      //   "ui-tabs": "ui-corner-all"
283      // }
284      // .tabs({
285      show: {
286        // easing: "swing",
287        slide: "right",
288        // duration: 500
289      },
290      hide: {
291        // easing: "swing",
292        slide: "left",
293        // duration: 500
294      },
295
296      // });
297    });
298
299    if ($('div.ui-tabs').length) {
300      /*
301      if cookie is available, make sure path is correct
302      if path is correct last selected tab prior to
303      leaving will be clicked
304      
305      attempted to use the documentation for
306      foundation tabs, but would nto work
307      this does.
308      */
309      if (document.cookie.match(/^(.*;)?\s*ksu_tab_remember\s*=\s*[^;]+(.*)?$/)) {
310        var cook = JSON.parse(Cookies.get('ksu_tab_remember'));
311        var path = window.location.pathname;
312        var tabb = cook.tabButt;
313        if (path === cook.path) {
314          $("#" + tabb).click();
315        }
316      }
317      //when tab button clicked, set the cookie
318      $('a.ui-tabs-anchor').on('click touch', function (e) {
319        e.preventDefault();
320        var tabberid = $(e.currentTarget.hash).closest('div.ui-tabs').attr('id');
321        console.log(e.currentTarget.hash);
322        Cookies.set('ksu_tab_remember', {
323          tabButt: e.currentTarget.id,
324          tab: e.currentTarget.hash,
325          tabberId: tabberid,
326          path: window.location.pathname
327        }, {expires: 1});
328        return false;
329      });
330      // console.log(document.cookie);
331
332    }
333
334    // console.log(title);
335
336  });
337})(jQuery, Drupal, drupalSettings);

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.