vendor: 5,787 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", 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 t.preventDefault(), i._itemClick(e(t.target)); 115 break; 116 case l.RIGHT: 117 t.preventDefault(), e(t.target).parent().hasClass(o + "_collapsed") && i._itemClick(e(t.target)), e(t.target).next().find('[role="menuitem"]').first().focus() 118 } 119 }), i.mobileNav.on("keydown", '[role="menuitem"]', function(t) { 120 var n = t || event; 121 switch (n.keyCode) { 122 case l.DOWN: 123 t.preventDefault(); 124 var a = e(t.target).parent().parent().children().children('[role="menuitem"]:visible'), 125 s = a.index(t.target), 126 r = s + 1; 127 a.length <= r && (r = 0); 128 var c = a.eq(r); 129 c.focus(); 130 break; 131 case l.UP: 132 t.preventDefault(); 133 var a = e(t.target).parent().parent().children().children('[role="menuitem"]:visible'), 134 s = a.index(t.target), 135 c = a.eq(s - 1); 136 c.focus(); 137 break; 138 case l.LEFT: 139 if (t.preventDefault(), e(t.target).parent().parent().parent().hasClass(o + "_open")) { 140 var p = e(t.target).parent().parent().prev(); 141 p.focus(), i._itemClick(p) 142 } else e(t.target).parent().parent().hasClass(o + "_nav") && (i._menuToggle(), e(i.btn).focus()); 143 break; 144 case l.ESCAPE: 145 t.preventDefault(), i._menuToggle(), e(i.btn).focus() 146 } 147 }), r.allowParentLinks && r.nestedParentLinks && e("." + o + "_item a").click(function(e) { 148 e.stopImmediatePropagation() 149 }) 150 }, a.prototype._menuToggle = function(e) { 151 var t = this, 152 n = t.btn, 153 a = t.mobileNav; 154 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) 155 }, a.prototype._itemClick = function(e) { 156 var t = this, 157 n = t.settings, 158 a = e.data("menu"); 159 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)) 160 }, a.prototype._visibilityToggle = function(t, n, a, i, s) { 161 function l(t, n) { 162 e(t).removeClass(o + "_animating"), e(n).removeClass(o + "_animating"), s || p.afterOpen(t) 163 } 164 165 function r(n, a) { 166 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) 167 } 168 var c = this, 169 p = c.settings, 170 d = c._getActionItems(t), 171 u = 0; 172 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() { 173 l(i, n) 174 }) : "velocity" === p.animations && t.velocity("finish").velocity("slideDown", { 175 duration: u, 176 easing: p.easingOpen, 177 complete: function() { 178 l(i, n) 179 } 180 }), 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() { 181 r(i, n) 182 }) : "velocity" === p.animations && t.velocity("finish").velocity("slideUp", { 183 duration: u, 184 easing: p.easingClose, 185 complete: function() { 186 r(i, n) 187 } 188 })) 189 }, a.prototype._setVisAttr = function(t, n) { 190 var a = this, 191 i = t.children("li").children("ul").not("." + o + "_hidden"); 192 n ? i.each(function() { 193 var t = e(this); 194 t.attr("aria-hidden", "true"); 195 var i = a._getActionItems(t); 196 i.attr("tabindex", "-1"), a._setVisAttr(t, n) 197 }) : i.each(function() { 198 var t = e(this); 199 t.attr("aria-hidden", "false"); 200 var i = a._getActionItems(t); 201 i.attr("tabindex", "0"), a._setVisAttr(t, n) 202 }) 203 }, a.prototype._getActionItems = function(e) { 204 var t = e.data("menu"); 205 if (!t) { 206 t = {}; 207 var n = e.children("li"), 208 a = n.find("a"); 209 t.links = a.add(n.find("." + o + "_item")), e.data("menu", t) 210 } 211 return t.links 212 }, a.prototype._outlines = function(t) { 213 t ? e("." + o + "_item, ." + o + "_btn").css("outline", "") : e("." + o + "_item, ." + o + "_btn").css("outline", "none") 214 }, a.prototype.toggle = function() { 215 var e = this; 216 e._menuToggle() 217 }, a.prototype.open = function() { 218 var e = this; 219 e.btn.hasClass(o + "_collapsed") && e._menuToggle() 220 }, a.prototype.close = function() { 221 var e = this; 222 e.btn.hasClass(o + "_open") && e._menuToggle() 223 }, e.fn[s] = function(t) { 224 var n = arguments; 225 if (void 0 === t || "object" == typeof t) return this.each(function() { 226 e.data(this, "plugin_" + s) || e.data(this, "plugin_" + s, new a(this, t)) 227 }); 228 if ("string" == typeof t && "_" !== t[0] && "init" !== t) { 229 var i; 230 return this.each(function() { 231 var o = e.data(this, "plugin_" + s); 232 o instanceof a && "function" == typeof o[t] && (i = o[t].apply(o, Array.prototype.slice.call(n, 1))) 233 }), void 0 !== i ? i : this 234 } 235 } 236}(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.