vendor: 5,700 bytes, lines 1-110
1/*! 2 * SlickNav Responsive Mobile Menu v1.0.10 3 * (c) 2016 Josh Cope 4 * licensed under MIT 5 */ 6! function(e, t, n) { 7 function a(t, n) { 8 this.element = t, this.settings = e.extend({}, i, n), this.settings.duplicate || n.hasOwnProperty("removeIds") || (this.settings.removeIds = !1), this._defaults = i, this._name = s, this.init() 9 } 10 var i = { 11 label: "MENU", 12 duplicate: !0, 13 duration: 200, 14 easingOpen: "swing", 15 easingClose: "swing", 16 closedSymbol: "►", 17 openedSymbol: "▼", 18 prependTo: "body .responsive_menu_wrap", 19 appendTo: "", 20 parentTag: "a", 21 closeOnClick: !1, 22 allowParentLinks: !1, 23 nestedParentLinks: !0, 24 showChildren: !1, 25 removeIds: !0, 26 removeClasses: !1, 27 removeStyles: !1, 28 brand: "", 29 animations: "jquery", 30 init: function() {}, 31 beforeOpen: function() {}, 32 beforeClose: function() {}, 33 afterOpen: function() {}, 34 afterClose: function() {} 35 }, 36 s = "slicknav", 37 o = "slicknav", 38 l = { 39 DOWN: 40, 40 ENTER: 13, 41 ESCAPE: 27, 42 LEFT: 37, 43 RIGHT: 39, 44 SPACE: 32, 45 TAB: 9, 46 UP: 38 47 }; 48 a.prototype.init = function() { 49 var n, a, i = this, 50 s = e(this.element), 51 r = this.settings; 52 if (r.duplicate ? i.mobileNav = s.clone() : i.mobileNav = s, r.removeIds && (i.mobileNav.removeAttr("id"), i.mobileNav.find("*").each(function(t, n) { 53 e(n).removeAttr("id") 54 })), r.removeClasses && (i.mobileNav.removeAttr("class"), i.mobileNav.find("*").each(function(t, n) { 55 e(n).removeAttr("class") 56 })), r.removeStyles && (i.mobileNav.removeAttr("style"), i.mobileNav.find("*").each(function(t, n) { 57 e(n).removeAttr("style") 58 })), n = o + "_icon", "" === r.label && (n += " " + o + "_no-text"), "a" == r.parentTag && (r.parentTag = 'a href="#"'), i.mobileNav.attr("class", o + "_nav"), a = e('<div class="' + o + '_menu"></div>'), "" !== r.brand) { 59 var c = e('<div class="' + o + '_brand">' + r.brand + "</div>"); 60 e(a).append(c) 61 } 62 i.btn = e(["<" + r.parentTag + ' aria-haspopup="true" role="button" tabindex="0" class="' + o + "_btn " + o + '_collapsed">', '<span class="' + o + '_menutxt">' + r.label + "</span>", '<span class="' + n + '">', '<span class="' + o + '_icon-bar"></span>', '<span class="' + o + '_icon-bar"></span>', '<span class="' + o + '_icon-bar"></span>', "</span>", "</" + r.parentTag + ">"].join("")), e(a).append(i.btn), "" !== r.appendTo ? e(r.appendTo).append(a) : e(r.prependTo).prepend(a), a.append(i.mobileNav); 63 var p = i.mobileNav.find("li"); 64 e(p).each(function() { 65 var t = e(this), 66 n = {}; 67 if (n.children = t.children("ul").attr("role", "menu"), t.data("menu", n), n.children.length > 0) { 68 var a = t.contents(), 69 s = !1, 70 l = []; 71 e(a).each(function() { 72 return e(this).is("ul") ? !1 : (l.push(this), void(e(this).is("a") && (s = !0))) 73 }); 74 var c = e("<" + r.parentTag + ' role="menuitem" aria-haspopup="true" tabindex="-1" class="' + o + '_item"/>'); 75 if (r.allowParentLinks && !r.nestedParentLinks && s) e(l).wrapAll('<span class="' + o + "_parent-link " + o + '_row"/>').parent(); 76 else { 77 var p = e(l).wrapAll(c).parent(); 78 p.addClass(o + "_row") 79 } 80 r.showChildren ? t.addClass(o + "_open") : t.addClass(o + "_collapsed"), t.addClass(o + "_parent"); 81 var d = e('<span class="' + o + '_arrow">' + (r.showChildren ? r.openedSymbol : r.closedSymbol) + "</span>"); 82 r.allowParentLinks && !r.nestedParentLinks && s && (d = d.wrap(c).parent()), e(l).last().after(d) 83 } else 0 === t.children().length && t.addClass(o + "_txtnode"); 84 t.children("a").attr("role", "menuitem").click(function(t) { 85 r.closeOnClick && !e(t.target).parent().closest("li").hasClass(o + "_parent") && e(i.btn).click() 86 }), r.closeOnClick && r.allowParentLinks && (t.children("a").children("a").click(function(t) { 87 e(i.btn).click() 88 }), t.find("." + o + "_parent-link a:not(." + o + "_item)").click(function(t) { 89 e(i.btn).click() 90 })) 91 }), e(p).each(function() { 92 var t = e(this).data("menu"); 93 r.showChildren || i._visibilityToggle(t.children, null, !1, null, !0) 94 }), i._visibilityToggle(i.mobileNav, null, !1, "init", !0), i.mobileNav.attr("role", "menu"), e(t).mousedown(function() { 95 i._outlines(!1) 96 }), e(t).keyup(function() { 97 i._outlines(!0) 98 }), e(i.btn).click(function(e) { 99 e.preventDefault(), i._menuToggle() 100 }), i.mobileNav.on("click", "." + o + "_item", function(t) { 101 t.preventDefault(), i._itemClick(e(this)) 102 }), e(i.btn).keydown(function(t) { 103 var n = t || event; 104 switch (n.keyCode) { 105 case l.ENTER: 106 case l.SPACE: 107 case l.DOWN: 108 t.preventDefault(), n.keyCode === l.DOWN && e(i.btn).hasClass(o + "_open") || i._menuToggle(), e(i.btn).next().find('[role="menuitem"]').first().focus() 109 } 110 }
110), i.mobileNav.on("keydown", "." + o + "_item", function(t) { 111 var n = t || event; 112 switch (n.keyCode) { 113 case l.ENTER: 114 break; 115 case l.RIGHT: 116 t.preventDefault(), e(t.target).parent().hasClass(o + "_collapsed") && i._itemClick(e(t.target)), e(t.target).next().find('[role="menuitem"]').first().focus() 117 } 118 }), i.mobileNav.on("keydown", '[role="menuitem"]', function(t) { 119 var n = t || event; 120 switch (n.keyCode) { 121 case l.DOWN: 122 t.preventDefault(); 123 var a = e(t.target).parent().parent().children().children('[role="menuitem"]:visible'), 124 s = a.index(t.target), 125 r = s + 1; 126 a.length <= r && (r = 0); 127 var c = a.eq(r); 128 c.focus(); 129 break; 130 case l.UP: 131 t.preventDefault(); 132 var a = e(t.target).parent().parent().children().children('[role="menuitem"]:visible'), 133 s = a.index(t.target), 134 c = a.eq(s - 1); 135 c.focus(); 136 break; 137 case l.LEFT: 138 if (t.preventDefault(), e(t.target).parent().parent().parent().hasClass(o + "_open")) { 139 var p = e(t.target).parent().parent().prev(); 140 p.focus(), i._itemClick(p) 141 } else e(t.target).parent().parent().hasClass(o + "_nav") && (i._menuToggle(), e(i.btn).focus()); 142 break; 143 case l.ESCAPE: 144 t.preventDefault(), i._menuToggle(), e(i.btn).focus() 145 } 146 }), r.allowParentLinks && r.nestedParentLinks && e("." + o + "_item a").click(function(e) { 147 e.stopImmediatePropagation() 148 }) 149 }, a.prototype._menuToggle = function(e) { 150 var t = this, 151 n = t.btn, 152 a = t.mobileNav; 153 n.hasClass(o + "_collapsed") ? (n.removeClass(o + "_collapsed"), n.addClass(o + "_open")) : (n.removeClass(o + "_open"), n.addClass(o + "_collapsed")), n.addClass(o + "_animating"), t._visibilityToggle(a, n.parent(), !0, n) 154 }, a.prototype._itemClick = function(e) { 155 var t = this, 156 n = t.settings, 157 a = e.data("menu"); 158 a || (a = {}, a.arrow = e.children("." + o + "_arrow"), a.ul = e.next("ul"), a.parent = e.parent(), a.parent.hasClass(o + "_parent-link") && (a.parent = e.parent().parent(), a.ul = e.parent().next("ul")), e.data("menu", a)), a.parent.hasClass(o + "_collapsed") ? (a.arrow.html(n.openedSymbol), a.parent.removeClass(o + "_collapsed"), a.parent.addClass(o + "_open"), a.parent.addClass(o + "_animating"), t._visibilityToggle(a.ul, a.parent, !0, e)) : (a.arrow.html(n.closedSymbol), a.parent.addClass(o + "_collapsed"), a.parent.removeClass(o + "_open"), a.parent.addClass(o + "_animating"), t._visibilityToggle(a.ul, a.parent, !0, e)) 159 }, a.prototype._visibilityToggle = function(t, n, a, i, s) { 160 function l(t, n) { 161 e(t).removeClass(o + "_animating"), e(n).removeClass(o + "_animating"), s || p.afterOpen(t) 162 } 163 164 function r(n, a) { 165 t.attr("aria-hidden", "true"), d.attr("tabindex", "-1"), c._setVisAttr(t, !0), t.hide(), e(n).removeClass(o + "_animating"), e(a).removeClass(o + "_animating"), s ? "init" == n && p.init() : p.afterClose(n) 166 } 167 var c = this, 168 p = c.settings, 169 d = c._getActionItems(t), 170 u = 0; 171 a && (u = p.duration), t.hasClass(o + "_hidden") ? (t.removeClass(o + "_hidden"), s || p.beforeOpen(i), "jquery" === p.animations ? t.stop(!0, !0).slideDown(u, p.easingOpen, function() { 172 l(i, n) 173 }) : "velocity" === p.animations && t.velocity("finish").velocity("slideDown", { 174 duration: u, 175 easing: p.easingOpen, 176 complete: function() { 177 l(i, n) 178 } 179 }), t.attr("aria-hidden", "false"), d.attr("tabindex", "0"), c._setVisAttr(t, !1)) : (t.addClass(o + "_hidden"), s || p.beforeClose(i), "jquery" === p.animations ? t.stop(!0, !0).slideUp(u, this.settings.easingClose, function() { 180 r(i, n) 181 }) : "velocity" === p.animations && t.velocity("finish").velocity("slideUp", { 182 duration: u, 183 easing: p.easingClose, 184 complete: function() { 185 r(i, n) 186 } 187 })) 188 }, a.prototype._setVisAttr = function(t, n) { 189 var a = this, 190 i = t.children("li").children("ul").not("." + o + "_hidden"); 191 n ? i.each(function() { 192 var t = e(this); 193 t.attr("aria-hidden", "true"); 194 var i = a._getActionItems(t); 195 i.attr("tabindex", "-1"), a._setVisAttr(t, n) 196 }) : i.each(function() { 197 var t = e(this); 198 t.attr("aria-hidden", "false"); 199 var i = a._getActionItems(t); 200 i.attr("tabindex", "0"), a._setVisAttr(t, n) 201 }) 202 }, a.prototype._getActionItems = function(e) { 203 var t = e.data("menu"); 204 if (!t) { 205 t = {}; 206 var n = e.children("li"), 207 a = n.find("a"); 208 t.links = a.add(n.find("." + o + "_item")), e.data("menu", t) 209 } 210 return t.links 211 }, a.prototype._outlines = function(t) { 212 t ? e("." + o + "_item, ." + o + "_btn").css("outline", "") : e("." + o + "_item, ." + o + "_btn").css("outline", "none") 213 }, a.prototype.toggle = function() { 214 var e = this; 215 e._menuToggle() 216 }, a.prototype.open = function() { 217 var e = this; 218 e.btn.hasClass(o + "_collapsed") && e._menuToggle() 219 }, a.prototype.close = function() { 220 var e = this; 221 e.btn.hasClass(o + "_open") && e._menuToggle() 222 }, e.fn[s] = function(t) { 223 var n = arguments; 224 if (void 0 === t || "object" == typeof t) return this.each(function() { 225 e.data(this, "plugin_" + s) || e.data(this, "plugin_" + s, new a(this, t)) 226 }); 227 if ("string" == typeof t && "_" !== t[0] && "init" !== t) { 228 var i; 229 return this.each(function() { 230 var o = e.data(this, "plugin_" + s); 231 o instanceof a && "function" == typeof o[t] && (i = o[t].apply(o, Array.prototype.slice.call(n, 1))) 232 }), void 0 !== i ? i : this 233 } 234 } 235}(jQuery, document, window);
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.