PageSourceSearch

https://minnowboard.org/wp-content/themes/shapely-child/js/minnowboard_ver-4.9.8.js

js minnowboard.org collected 2026-10-02 04:49:32 UTC 22,150 bytes, 684 lines download raw bytes

1;(function ($) {
2  var cl_nav,
3      cl_navOuterHeight;
4
5  jQuery(document).ready(function ($) {
6    "use strict";
7
8    $('.dropdown-menu[data-parent]').hide();
9
10    $(document).on('click', 'body', function(){
11      $('.dropdown-menu[data-parent]').hide();
12    });
13
14    var $buttonGroup = null,
15        $ul;
16
17    $(document).on('click', '.table-responsive [data-toggle="dropdown"]', function () {
18        // if the button is inside a modal
19        if ($('body').hasClass('modal-open')) {
20            throw new Error("This solution is not working inside a responsive table inside a modal, you need to find out a way to calculate the modal Z-index and add it to the element")
21            return true;
22        }
23
24        $buttonGroup = $(this).parent();
25
26        if (!$buttonGroup.attr('data-attachedUl')) {
27            var ts = +new Date;
28            $ul = $(this).siblings('ul');
29            $ul.attr('data-parent', ts);
30            $buttonGroup.attr('data-attachedUl', ts);
31            $(window).resize(function () {
32                $ul.css('display', 'none').data('top');
33            });
34        } else {
35            $ul = $('[data-parent=' + $buttonGroup.attr('data-attachedUl') + ']');
36        }
37        if (!$buttonGroup.hasClass('open')) {
38            $ul.css('display', 'none');
39            return;
40        }
41
42        var container = $(this).parent();
43
44        if (!container[0].hasAttribute('data-left')) {
45          $(this).parent().attr('data-left', $(this).parent().offset().left - $ul.width() + $(this).parent().width() + 15);
46        }
47        
48        dropDownFixPosition($(this).parent(), $ul);
49        function dropDownFixPosition(button, dropdown) {
50            var dropDownTop = button.offset().top + ($('body').hasClass('admin-bar') ? 0 : button.height()),
51                left = $(button).attr('data-left');
52      
53            dropdown.css('top', dropDownTop + "px");
54            dropdown.css('left', left + "px");
55            dropdown.css('position', "absolute");
56            dropdown.css('width', (parseInt(left) + 18));
57   
58            dropdown.find('a').css('white-space', 'unset');
59            dropdown.css('display', 'block');
60            dropdown.appendTo('body');
61        }
62    });
63
64    // Smooth scroll to inner links
65    jQuery('.inner-link').each(function () {
66      var href = jQuery(this).attr('href');
67      if ( href.charAt(0) !== "#" ) {
68        jQuery(this).removeClass('inner-link');
69      }
70    });
71
72    jQuery('.inner-link').click(function () {
73      jQuery('html, body').animate({
74        scrollTop: 0
75      }, 1000);
76      return false;
77    });
78
79    // Append .background-image-holder <img>'s as CSS backgrounds
80    jQuery('.background-image-holder').each(function () {
81      var imgSrc = jQuery(this).children('img').attr('src');
82      jQuery(this).css('background', 'url("' + imgSrc + '")');
83      jQuery(this).children('img').hide();
84      jQuery(this).css('background-position', 'initial');
85    });
86
87    // Fade in background images
88    setTimeout(function () {
89      jQuery('.background-image-holder').each(function () {
90        jQuery(this).addClass('fadeIn');
91      });
92    }, 200);
93
94
95    // Fix nav to top while scrolling
96    /*cl_nav = $('body .nav-container nav:first');
97    cl_navOuterHeight = $('body .nav-container nav:first').outerHeight();
98    var window_w = jQuery(window).width();
99    if ( window_w > 991 ) {
100      window.addEventListener("scroll", updateNav, false);
101      updateNav();
102    }
103
104    $(window).resize(function () {
105      window_w = $(window).width();
106      if ( window_w < 992 ) {
107        cl_nav.removeClass('fixed scrolled outOfSight');
108      } else {
109        window.addEventListener("scroll", updateNav, false);
110        updateNav();
111      }
112    });*/
113
114    // Menu dropdown positioning
115    $('.menu > li > ul').each(function () {
116      var menu = $(this).offset();
117      var farRight = menu.left + $(this).outerWidth(true);
118      if ( farRight > $(window).width() && !$(this).hasClass('mega-menu') ) {
119        $(this).addClass('make-right');
120      } else if ( farRight > $(window).width() && $(this).hasClass('mega-menu') ) {
121        var isOnScreen = $(window).width() - menu.left;
122        var difference = $(this).outerWidth(true) - isOnScreen;
123        $(this).css('margin-left', -(difference));
124      }
125    });
126
127    // Mobile Menu
128    $('.mobile-toggle').click(function () {
129      $('.nav-bar').toggleClass('nav-open');
130      $(this).toggleClass('active');
131      $('.search-widget-handle').toggleClass('hidden-xs hidden-sm');
132    });
133
134    $('.menu li').click(function (e) {
135      if ( !e ) e = window.event;
136      e.stopPropagation();
137      if ( $(this).find('ul').length ) {
138        $(this).toggleClass('toggle-sub');
139      } else {
140        $(this).parents('.toggle-sub').removeClass('toggle-sub');
141      }
142    });
143
144    $('.menu li a').click(function () {
145      if ( $(this).hasClass('inner-link') ) {
146        $(this).closest('.nav-bar').removeClass('nav-open');
147      }
148    });
149
150    $('.module.widget-handle').click(function () {
151      $(this).toggleClass('toggle-search');
152    });
153
154    $('.search-widget-handle .search-form input').click(function (e) {
155      if ( !e ) e = window.event;
156      e.stopPropagation();
157    });
158
159    // Image Sliders
160    if ($('.slider-all-controls').length > 0) {
161      $('.slider-all-controls').flexslider({
162        start: function (slider) {
163          if ( slider.find('.slides li:first-child').find('.fs-vid-background video').length ) {
164            slider.find('.slides li:first-child').find('.fs-vid-background video').get(0).play();
165          }
166        },
167        after: function (slider) {
168          if ( slider.find('.fs-vid-background video').length ) {
169            if ( slider.find('li:not(.flex-active-slide)').find('.fs-vid-background video').length ) {
170              slider.find('li:not(.flex-active-slide)').find('.fs-vid-background video').get(0).pause();
171            }
172            if ( slider.find('.flex-active-slide').find('.fs-vid-background video').length ) {
173              slider.find('.flex-active-slide').find('.fs-vid-background video').get(0).play();
174            }
175          }
176        }
177      });
178      $('.slider-paging-controls').flexslider({
179        animation   : "slide",
180        directionNav: false
181      });
182      $('.slider-arrow-controls').flexslider({
183        controlNav: false
184      });
185      $('.slider-thumb-controls .slides li').each(function () {
186        var imgSrc = $(this).find('img').attr('src');
187        $(this).attr('data-thumb', imgSrc);
188      });
189      $('.slider-thumb-controls').flexslider({
190        animation   : "slide",
191        controlNav  : "thumbnails",
192        directionNav: true
193      });
194      $('.logo-carousel').flexslider({
195        minItems      : 1,
196        maxItems      : 4,
197        move          : 1,
198        itemWidth     : 200,
199        itemMargin    : 0,
200        animation     : "slide",
201        slideshow     : true,
202        slideshowSpeed: 3000,
203        directionNav  : false,
204        controlNav    : false
205      });
206    }
207
208    // Lightbox gallery titles
209    $('.lightbox-grid li a').each(function () {
210      var galleryTitle = $(this).closest('.lightbox-grid').attr('data-gallery-title');
211      $(this).attr('data-lightbox', galleryTitle);
212    });
213
214    // Video widget 
215    var videos = $('.video-widget');
216    if ( videos.length ) {
217      $.each(videos, function () {
218        var play = $(this).find('.play-button'),
219            pause = $(this).find('.pause-button'),
220            isYoutube = $(this).hasClass('youtube');
221
222        if ( isYoutube ) {
223          var videoId = $(this).attr('data-video-id'),
224              fitToBackground = $(this).attr('data-background'),
225              autoplay = parseInt($(this).attr('data-autoplay')),
226              instance = $(this).YTPlayer({
227                fitToBackground: fitToBackground,
228                videoId        : videoId,
229                playerVars     : {
230                  modestbranding: 0,
231                  autoplay      : autoplay,
232                  controls      : 0,
233                  showinfo      : 0,
234                  branding      : 0,
235                  rel           : 0,
236                  autohide      : 0
237                }
238              }),
239              self = $(this);
240
241          $(document).on('YTBGREADY', function () {
242            var iframe = self.find('iframe'),
243                height = iframe.height();
244
245            if ( self.height() == 0 ) {
246              //self.height(height);
247            }
248          });
249
250          $(play).on('click', function (e) {
251            e.preventDefault();
252            var parent = $(this).parents('.video-widget'),
253                instance = $(parent).data('ytPlayer').player;
254            instance.playVideo();
255          });
256
257          $(pause).on('click', function (e) {
258            e.preventDefault();
259            var parent = $(this).parents('.video-widget'),
260                instance = $(parent).data('ytPlayer').player;
261            instance.pauseVideo();
262          });
263
264        } else {
265          $(play).on('click', function (e) {
266            e.preventDefault();
267            var parent = $(this).parents('.video-widget'),
268                instance = $(parent).data('vide'),
269                video = instance.getVideoObject();
270
271            video.play();
272          });
273
274          $(pause).on('click', function (e) {
275            e.preventDefault();
276            var parent = $(this).parents('.video-widget'),
277                instance = $(parent).data('vide'),
278                video = instance.getVideoObject();
279
280            video.pause();
281          });
282        }
283      });
284    }
285
286    var recent_entries = $('.widget_recent_entries').find('li');
287    $.each(recent_entries, function () {
288      $(this).find('a').insertAfter($(this).find('.post-date'));
289    });
290
291    $('.comment-form').find('textarea').insertAfter($('.comment-form > #url'));
292
293    if ( typeof $.fn.owlCarousel !== 'undefined' ) {
294
295      $('.owlCarousel').each(function (index) {
296
297        var sliderSelector = '#owlCarousel-' + $(this).data('slider-id'); // this is the slider selector
298        var sliderItems = $(this).data('slider-items');
299        var sliderSpeed = $(this).data('slider-speed');
300        var sliderAutoPlay = $(this).data('slider-auto-play');
301        var sliderSingleItem = $(this).data('slider-single-item');
302
303        //conversion of 1 to true & 0 to false
304
305
306        // auto play
307        sliderAutoPlay = !(sliderAutoPlay == 0 || sliderAutoPlay == 'false');
308        // Custom Navigation events outside of the owlCarousel mark-up
309        $(".shapely-owl-next").on('click', function (event) {
310          event.preventDefault();
311          $(sliderSelector).trigger('next.owl.carousel');
312        });
313        $(".shapely-owl-prev").on('click', function (event) {
314          event.preventDefault();
315          $(sliderSelector).trigger('prev.owl.carousel');
316        });
317
318
319        // instantiate the slider with all the options
320        $(sliderSelector).owlCarousel({
321          items          : sliderItems,
322          loop           : false,
323          margin         : 2,
324          autoplay       : sliderAutoPlay,
325          dots           : false,
326          autoplayTimeout: sliderSpeed * 10,
327          responsive     : {
328            0  : {
329              items: 1
330            },
331            768: {
332              items: sliderItems
333            }
334          }
335        });
336      });
337    } // end
338    
339    // Copy to clipboard
340    $('pre').each(function(i){
341      $(this).attr('id', 'code' + i);
342      $(this).addClass('copy-clipboard');
343      $(this).wrap('<div class="code-container"></div>');
344      $(this).before('<button class="btn-copy"><span class="fa fa-clipboard" data-clipboard-target="#code' + i + '"></span></button>');
345    });
346    new Clipboard('.fa-clipboard');
347
348    // Responsive bootstrap tables
349    $('table').wrap('<div class="table-responsive"></div>');
350
351    $('.table-manual-freeze').before('<div class="table-fixed custom-table-manual-freeze"><div class="container"><table class="table table-responsive specs-table-header" id="specs-table-header">' + $('.table-manual-freeze').find('tr:first-child').html() + '</table></div></div>');
352
353    $('.table-manual-freeze').find('tr:first-child').remove();
354
355    // ToC anchors
356    var logged_in = $('#wpadminbar').outerHeight(true),
357        board_nav = $('#secondary-nav').outerHeight(true),
358        board_hero = $('#board-hero').outerHeight(true),
359        header = $('header').outerHeight(true),
360        sidebar_header = $('.entry-sidebar-header').outerHeight(true),
361        footer = $('footer').outerHeight(true) + 20,
362        isBoard = $('body').hasClass('post-template-board-documentation') || $('body').hasClass('post-template-board-tutorials') || $('body').hasClass('post-template-board-no-sidebar'),
363        scrollspy_offset = isBoard ? $('#secondary-nav').outerHeight(true) : 10;
364
365    $('body').scrollspy({ target: '.scrollspy', offset: scrollspy_offset });
366    
367    $('.post-template-board-documentation .menu-anchors').affix({
368      offset: {
369        top: function(){
370          var top = board_nav + sidebar_header;
371
372          if ($('body').hasClass('scroll-up')) {
373            //top += header;
374          }
375
376          if ($('body').hasClass('logged-in')) {
377            top += logged_in;
378          }
379          return top;
380        },
381        bottom: function(){
382          return footer;
383        }
384      }
385    });
386
387    var custom_sidebar = header + $('.entry-sidebar-header').outerHeight(true) + ($('body').hasClass('logged-in') ? logged_in : 0);
388    $('.toc-container').affix({
389      offset: {
390        top: function(){
391          return custom_sidebar;
392        },
393        bottom: function(){
394          return footer;
395        }
396      }
397    });
398
399    $('.table-fixed').affix({
400      offset: {
401        top: function(){
402          if ($('#secondary-nav').length > 0){
403            return header + board_nav;
404          }
405          return header;
406        },
407        bottom: function(){
408          return footer;
409        }
410      }
411    });
412
413    $('#secondary-nav').affix({
414      offset: {
415        top: function(){
416          return header + board_hero;
417        },
418        bottom: function(){
419          return 0;
420        }
421      }
422    });
423
424    if ($('.custom-table-manual-freeze').length > 0) {
425      $('.custom-table-manual-freeze').data('bs.affix').options.offset.top = $('.custom-table-manual-freeze').offset().top - 150;
426
427      $('.custom-table-manual-freeze').data('bs.affix').options.offset.bottom = 0;
428    }
429
430    $('#nav-title').click(function(evt){
431      if (!$('#secondary-nav .navbar-nav').is(':visible')) {
432        evt.preventDefault();
433        $('#secondary-nav .navbar-nav').slideToggle();
434        $('#nav-title').addClass('navbar-open');
435      } else {
436        if ($('#nav-title').hasClass('navbar-open')) {
437          evt.preventDefault();
438          $('#secondary-nav .navbar-nav').slideToggle();
439          $('#nav-title').removeClass('navbar-open');
440        }
441      }
442    });
443    
444    // Expand/Collapse content
445    $('.faq-question').click(function(evt){
446      $(this).toggleClass('expanded');
447      if (evt.target.nodeName == 'SPAN') {
448        $(this).parent('p').next().find('.faq-answer').slideToggle();
449      } else {
450        $(this).next('.faq-answer').slideToggle();
451      }
452    });
453
454    // ToC scrollbar for small screens
455    var $container = $('.toc-container'),
456        $toc = $('.toc-container .menu-anchors');
457
458    $(window).scroll(function(){
459      if ($toc.hasClass('small-screen') && $container.hasClass('affix')) {
460        $active = $toc.find('.active');
461        
462        if ($active.length > 0 && !$active.tocIsInViewport() && ($active.offset().top + $active.outerHeight()) > $toc.height() + $toc.scrollTop()) {
463          $toc.scrollTop($active.position().top);
464        }
465      }
466    });
467
468    $('a[href*="#"]').click(function(event) {
469      scroll_anchor = true;
470    });
471
472    reviewToc();
473
474    $(window).resize(function(){
475      reviewToc();
476    });
477
478    // ToC for small screens
479    function reviewToc() {
480      if (window.innerHeight < $toc.height()) {
481        $toc.addClass('small-screen');
482      } else {
483        $toc.removeClass('small-screen');
484      }
485    }
486
487    // Returns true if element of ToC is in view port
488    $.fn.tocIsInViewport = function() {
489      var elementTop = $(this).offset().top - $toc.offset().top; // relative pos
490      var elementBottom = elementTop + $(this).outerHeight(); // relative pos + height
491      var viewportTop = $toc.scrollTop(); //
492      var viewportBottom = viewportTop + $toc.height();
493      return elementBottom < $toc.height();
494    };
495
496    // Grid display modes
497    var list = [],
498        grid = [],
499        section = $('body').hasClass('single-mb_board') ? 'board-overview' : 'global';
500
501    list['article'] = 'row';
502    list['header'] = 'col-sm-3 col-xs-3';
503    list['content'] = 'col-sm-9 col-xs-9';
504
505    grid['article'] = [];
506    grid['article']['global'] = 'col-md-3';
507    grid['article']['board-overview'] = '';
508
509    $('#view-list').click(function(e){
510      $('#primary').addClass('list-layout');
511      $(this).addClass('active');
512      $('#view-grid').removeClass('active');
513      $('.post-grid-small').removeClass(grid['article'][section]);
514      $('.post-grid-small').addClass(list['article']);
515      $('.entry-header').addClass(list['header']);
516      $('.entry-content').addClass(list['content']);
517    });
518
519    $('#view-grid').click(function(e){
520      $('#primary').removeClass('list-layout');
521      $(this).addClass('active');
522      $('#view-list').removeClass('active');
523      $('.post-grid-small').addClass(grid['article'][section]);
524      $('.post-grid-small').removeClass(list['article']);
525      $('.entry-header').removeClass(list['header']);
526      $('.entry-content').removeClass(list['content']);
527    });
528
529    if ($('body').hasClass('single-mb_board')) {
530      listForTablet('#tutorials');
531
532      $(window).resize(function(){
533        listForTablet('#tutorials');
534      });
535    } else {
536      if ($('#grid-content').length > 0){
537        listForTablet();
538
539        $(window).resize(function(){
540          listForTablet();
541        });
542      }
543    }
544    
545    function listForTablet(el){
546      if (!el) {
547        el = '#primary';
548      }
549
550      if (window.innerWidth < 992){
551        $(el).addClass('list-layout');
552        $(el).find('.post-grid-small').removeClass(grid['article']);
553        $(el).find('.post-grid-small').addClass(list['article']);
554        $(el).find('.entry-header').addClass(list['header']);
555        $(el).find('.entry-content').addClass(list['content']);
556      } else {
557        if ($(el).hasClass('list-layout')) {
558          $(el).removeClass('list-layout');
559          $(el).find('.post-grid-small').addClass(grid['article']);
560          $(el).find('.post-grid-small').removeClass(list['article']);
561          $(el).find('.entry-header').removeClass(list['header']);
562          $(el).find('.entry-content').removeClass(list['content']);
563        }
564      }
565    }
566
567    var scroll_pos = $(window).scrollTop(),
568        scroll_anchor = false;
569
570    $(window).scroll(function(){
571      if (!$('body').hasClass('scroll-up') && scroll_pos > $(this).scrollTop() && $(this).scrollTop() > (header + logged_in) && scroll_anchor == false) {
572        $('body').addClass('scroll-up');
573      } else {
574        if ($('body').hasClass('scroll-up') && (scroll_pos < $(this).scrollTop() || $(this).scrollTop() <= (header + logged_in))) {
575          $('body').removeClass('scroll-up');
576        }
577      }
578      scroll_pos = $(this).scrollTop();
579      scroll_anchor = false;
580    });
581  });
582
583  jQuery(window).load(function ($) {
584    // "use strict";
585
586    // Resetting testimonial parallax height
587    if ( jQuery('.testimonial-section').length != 0 ) {
588      testimonialHeight();
589      setTimeout(function () {
590        testimonialHeight();
591      }, 3000);
592    }
593
594    // Initialize Masonry
595
596    if ( jQuery('.masonry').length && typeof Masonry != 'undefined' ) {
597      var container = document.querySelector('.masonry');
598      var msnry = new Masonry(container, {
599        itemSelector: '.masonry-item'
600      });
601
602      msnry.on('layoutComplete', function ($) {
603
604        cl_firstSectionHeight = jQuery('.main-container section:nth-of-type(1)').outerHeight(true);
605
606        // Fix floating project filters to bottom of projects container
607
608        if ( jQuery('.filters.floating').length ) {
609          setupFloatingProjectFilters();
610          updateFloatingFilters();
611          window.addEventListener("scroll", updateFloatingFilters, false);
612        }
613
614        jQuery('.masonry').addClass('fadeIn');
615        jQuery('.masonry-loader').addClass('fadeOut');
616        if ( jQuery('.masonryFlyIn').length ) {
617          masonryFlyIn();
618        }
619      });
620
621      msnry.layout();
622    }
623    // Navigation height
624    cl_firstSectionHeight = jQuery('.main-container section:nth-of-type(1)').outerHeight(true);
625
626
627  });
628
629  /* Function To
630   * keep menu fixed
631   **/
632  function updateNav() {
633    var scroll = $(window).scrollTop();
634    var window_w = jQuery(window).width();
635
636    if ( window_w < 992 ) {
637      return;
638    }
639
640    if ( scroll > cl_navOuterHeight ) {
641      cl_nav.addClass('outOfSight');
642    }
643
644    if ( $(window).scrollTop() > (cl_navOuterHeight + 65) ) {//if href = #element id
645      cl_nav.addClass('fixed scrolled');
646    }
647
648    if ( $(window).scrollTop() == 0 ) {
649      cl_nav.removeClass('fixed scrolled outOfSight');
650    }
651  }
652
653  function masonryFlyIn() {
654    var $items = jQuery('.masonryFlyIn .masonry-item');
655    var time = 0;
656
657    $items.each(function () {
658      var item = jQuery(this);
659      setTimeout(function () {
660        item.addClass('fadeIn');
661      }, time);
662      time += 170;
663    });
664  }
665})(jQuery);
666
667/*
668 * Resetting testimonial parallax height
669 */
670function testimonialHeight() {
671  jQuery('.testimonial-section .parallax-window').css('height', jQuery('.testimonial-section .parallax-window .container').outerHeight() + 150);
672  jQuery(window).trigger('resize').trigger('scroll');
673}
674
675WebFontConfig = {
676  google: { families: ['Roboto'] }
677};
678
679(function(d) {
680  var wf = d.createElement('script'), s = d.scripts[0];
681  wf.src = 'https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js';
682  wf.async = true;
683  s.parentNode.insertBefore(wf, s);
684})(document);

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.