vendor: 4,045 bytes, lines 1-65
1/* jQuery Nice Select - v1.0 2 https://github.com/hernansartorio/jquery-nice-select 3 Made by Hernán Sartorio */ 4! function (e) { 5 e.fn.niceSelect = function (t) { 6 function s(t) { 7 t.after(e("<div></div>").addClass("nice-select").addClass(t.attr("class") || "").addClass(t.attr("disabled") ? "disabled" : "").attr("tabindex", t.attr("disabled") ? null : "0").html('<span class="current"></span><ul class="list"></ul>')); 8 var s = t.next(), 9 n = t.find("option"), 10 i = t.find("option:selected"); 11 s.find(".current").html(i.data("display") || i.text()), n.each(function (t) { 12 var n = e(this), 13 i = n.data("display"); 14 s.find("ul").append(e("<li></li>").attr("data-value", n.val()).attr("data-display", i || null).addClass("option" + (n.is(":selected") ? " selected" : "") + (n.is(":disabled") ? " disabled" : "")).html(n.text())) 15 }) 16 } 17 if ("string" == typeof t) return "update" == t ? this.each(function () { 18 var t = e(this), 19 n = e(this).next(".nice-select"), 20 i = n.hasClass("open"); 21 n.length && (n.remove(), s(t), i && t.next().trigger("click")) 22 }) : "destroy" == t ? (this.each(function () { 23 var t = e(this), 24 s = e(this).next(".nice-select"); 25 s.length && (s.remove(), t.css("display", "")) 26 }), 0 == e(".nice-select").length && e(document).off(".nice_select")) : console.log('Method "' + t + '" does not exist.'), this; 27 this.hide(), this.each(function () { 28 var t = e(this); 29 t.next().hasClass("nice-select") || s(t) 30 }), e(document).off(".nice_select"), e(document).on("click.nice_select", ".nice-select", function (t) { 31 var s = e(this); 32 e(".nice-select").not(s).removeClass("open"), s.toggleClass("open"), s.hasClass("open") ? (s.find(".option"), s.find(".focus").removeClass("focus"), s.find(".selected").addClass("focus")) : s.focus() 33 }), e(document).on("click.nice_select", function (t) { 34 0 === e(t.target).closest(".nice-select").length && e(".nice-select").removeClass("open").find(".option") 35 }), e(document).on("click.nice_select", ".nice-select .option:not(.disabled)", function (t) { 36 var s = e(this), 37 n = s.closest(".nice-select"); 38 n.find(".selected").removeClass("selected"), s.addClass("selected"); 39 var i = s.data("display") || s.text(); 40 n.find(".current").text(i), n.prev("select").val(s.data("value")).trigger("change") 41 }), e(document).on("keydown.nice_select", ".nice-select", function (t) { 42 var s = e(this), 43 n = e(s.find(".focus") || s.find(".list .option.selected")); 44 if (32 == t.keyCode || 13 == t.keyCode) return s.hasClass("open") ? n.trigger("click") : s.trigger("click"), !1; 45 if (40 == t.keyCode) { 46 if (s.hasClass("open")) { 47 var i = n.nextAll(".option:not(.disabled)").first(); 48 i.length > 0 && (s.find(".focus").removeClass("focus"), i.addClass("focus")) 49 } else s.trigger("click"); 50 return !1 51 } 52 if (38 == t.keyCode) { 53 if (s.hasClass("open")) { 54 var l = n.prevAll(".option:not(.disabled)").first(); 55 l.length > 0 && (s.find(".focus").removeClass("focus"), l.addClass("focus")) 56 } else s.trigger("click"); 57 return !1 58 } 59 if (27 == t.keyCode) s.hasClass("open") && s.trigger("click"); 60 else if (9 == t.keyCode && s.hasClass("open")) return !1 61 }); 62 var n = document.createElement("a").style; 63 return n.cssText = "pointer-events:auto", "auto" !== n.pointerEvents && e("html").addClass("no-csspointerevents"), this 64 } 65}(jQuery);
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.