PageSourceSearch

https://www.nyic.org/wp-content/plugins/pronto-sidebar-navigation/js/jquery.flexnav.js?ver=4.0

js nyic.org collected 2026-10-01 10:41:05 UTC 5,751 bytes, 151 lines download raw bytes

1/*
2	FlexNav.js 1.3.3
3
4	Created by Jason Weaver http://jasonweaver.name
5	Released under http://unlicense.org/
6
7//
8*/
9
10
11(function() {
12  var $;
13
14  $ = jQuery;
15
16  $.fn.flexNav = function(options) {
17    var $nav, $top_nav_items, breakpoint, count, nav_percent, nav_width, resetMenu, resizer, settings, showMenu, toggle_selector, touch_selector;
18    settings = $.extend({
19      'animationSpeed': 250,
20      'transitionOpacity': true,
21      'buttonSelector': '.menu-button',
22      'hoverIntent': false,
23      'hoverIntentTimeout': 150,
24      'calcItemWidths': false,
25      'hover': true
26    }, options);
27    $nav = $(this);
28    $nav.addClass('with-js');
29    if (settings.transitionOpacity === true) {
30      $nav.addClass('opacity');
31    }
32    $nav.find("li").each(function() {
33      if ($(this).has("ul").length) {
34        if($(this).has(".active").length){
35          return $(this).addClass("item-with-ul");
36        }else{
37          return $(this).addClass("item-with-ul").find("ul").hide();
38        }
39      }
40    });
41    if (settings.calcItemWidths === true) {
42      $top_nav_items = $nav.find('>li');
43      count = $top_nav_items.length;
44      nav_width = 100 / count;
45      nav_percent = nav_width + "%";
46    }
47    if ($nav.data('breakpoint')) {
48      breakpoint = $nav.data('breakpoint');
49    }
50
51    $('a.current-page').next('ul').css({display:'block'}).addClass('flexnav-show');
52
53    showMenu = function() {
54      if ($nav.hasClass('lg-screen') === true && settings.hover === true) {
55        if (settings.transitionOpacity === true) {
56          return $(this).find('>ul').addClass('flexnav-show').stop(true, true).animate({
57            height: ["toggle", "swing"],
58            opacity: "toggle"
59          }, settings.animationSpeed);
60        } else {
61          return $(this).find('>ul').addClass('flexnav-show').stop(true, true).animate({
62            height: ["toggle", "swing"]
63          }, settings.animationSpeed);
64        }
65      }
66    };
67    resetMenu = function() {
68      if ($nav.hasClass('lg-screen') === true && $(this).find('>ul').hasClass('flexnav-show') === true && settings.hover === true) {
69        if (settings.transitionOpacity === true) {
70          return $(this).find('>ul').removeClass('flexnav-show').stop(true, true).animate({
71            height: ["toggle", "swing"],
72            opacity: "toggle"
73          }, settings.animationSpeed);
74        } else {
75          return $(this).find('>ul').removeClass('flexnav-show').stop(true, true).animate({
76            height: ["toggle", "swing"]
77          }, settings.animationSpeed);
78        }
79      }
80    };
81    resizer = function() {
82      var selector;
83      console.log($(window).width());
84      //if ($(window).width() <= breakpoint) {
85      if (true) {
86        $nav.removeClass("lg-screen").addClass("sm-screen");
87        if (settings.calcItemWidths === true) {
88          $top_nav_items.css('width', '100%');
89        }
90        selector = settings['buttonSelector'] + ', ' + settings['buttonSelector'] + ' .touch-button';
91        $(selector).removeClass('active');
92        return $('.one-page li a').on('click', function() {
93          return $nav.removeClass('flexnav-show');
94        });
95      } /*else if ($(window).width() > breakpoint) {
96        $nav.removeClass("sm-screen").addClass("lg-screen");
97        if (settings.calcItemWidths === true) {
98          $top_nav_items.css('width', nav_percent);
99        }
100        $nav.removeClass('flexnav-show').find('.item-with-ul').on();
101        $('.item-with-ul').find('ul').removeClass('flexnav-show');
102        resetMenu();
103        if (settings.hoverIntent === true) {
104          return $('.item-with-ul').hoverIntent({
105            over: showMenu,
106            out: resetMenu,
107            timeout: settings.hoverIntentTimeout
108          });
109        } else if (settings.hoverIntent === false) {
110          return $('.item-with-ul').on('mouseenter', showMenu).on('mouseleave', resetMenu);
111        }
112      } */
113    };
114    $(settings['buttonSelector']).data('navEl', $nav);
115    touch_selector = '.item-with-ul, ' + settings['buttonSelector'];
116    $(touch_selector).append('<span class="touch-button"><i class="pull-right icon icon-angle-down navicon"></i></span>');
117    toggle_selector = settings['buttonSelector'] + ', ' + settings['buttonSelector'] + ' .touch-button';
118    $(toggle_selector).on('click', function(e) {
119      var $btnParent, $thisNav, bs;
120      $(toggle_selector).toggleClass('active');
121      e.preventDefault();
122      e.stopPropagation();
123      bs = settings['buttonSelector'];
124      $btnParent = $(this).is(bs) ? $(this) : $(this).parent(bs);
125      $thisNav = $btnParent.data('navEl');
126      return $thisNav.toggleClass('flexnav-show');
127    });
128    $('.touch-button').on('click', function(e) {
129      var $sub, $touchButton;
130      $sub = $(this).parent('.item-with-ul').find('>ul');
131      $touchButton = $(this).parent('.item-with-ul').find('>span.touch-button');
132      if ($nav.hasClass('lg-screen') === true) {
133        $(this).parent('.item-with-ul').siblings().find('ul.flexnav-show').removeClass('flexnav-show').hide();
134      }
135      if ($sub.hasClass('flexnav-show') === true) {
136        $sub.removeClass('flexnav-show').slideUp(settings.animationSpeed);
137        return $touchButton.removeClass('active');
138      } else if ($sub.hasClass('flexnav-show') === false) {
139        $sub.addClass('flexnav-show').slideDown(settings.animationSpeed);
140        return $touchButton.addClass('active');
141      }
142    });
143    $nav.find('.item-with-ul *').focus(function() {
144      $(this).parent('.item-with-ul').parent().find(".open").not(this).removeClass("open").hide();
145      return $(this).parent('.item-with-ul').find('>ul').addClass("open").show();
146    });
147    resizer();
148    return $(window).on('resize', resizer);
149  };
150
151}).call(this);

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.