vendor: 5,703 bytes, lines 1-137
1/*! 2 * jquery.customSelect() - v0.5.1 3 * http://adam.co/lab/jquery/customselect/ 4 * 2014-04-19 5 * 6 * Copyright 2013 Adam Coulombe 7 * @license http://www.opensource.org/licenses/mit-license.html MIT License 8 * @license http://www.gnu.org/licenses/gpl.html GPL2 License 9 */ 10(function(a) { 11 a.fn.extend({ 12 customSelect: function(c) { 13 if (typeof document.body.style.maxHeight === "undefined") { 14 return this 15 } 16 var e = { 17 customClass: "customSelect", 18 mapClass: true, 19 mapStyle: true 20 }, 21 c = a.extend(e, c), 22 d = c.customClass, 23 f = function(h, k) { 24 var g = h.find(":selected"), 25 j = k.children(":first"), 26 i = g.html() || " "; 27 j.html(i); 28 if (g.attr("disabled")) { 29 k.addClass(b("DisabledOption")) 30 } else { 31 k.removeClass(b("DisabledOption")) 32 } 33 setTimeout(function() { 34 k.removeClass(b("Open")); 35 a(document) 36 .off("mouseup.customSelect") 37 }, 60) 38 }, 39 b = function(g) { 40 return d + g 41 }; 42 return this.each(function() { 43 var g = a(this), 44 i = a("<span />") 45 .addClass(b("Inner")), 46 h = a("<span />"); 47 g.after(h.append(i)); 48 h.addClass(d); 49 if (c.mapClass) { 50 h.addClass(g.attr("class")) 51 } 52 if (c.mapStyle) { 53 h.attr("style", g.attr("style")) 54 } 55 g.addClass("hasCustomSelect") 56 .on("render.customSelect", function() { 57 f(g, h); 58 g.css("width", ""); 59 var k = parseInt(g.outerWidth(), 10) - (parseInt(h.outerWidth(), 10) - parseInt(h.width(), 10)); 60 h.css({ 61 display: "inline-block" 62 }); 63 var j = h.outerHeight(); 64 if (g.attr("disabled")) { 65 h.addClass(b("Disabled")) 66 } else { 67 h.removeClass(b("Disabled")) 68 } 69 i.css({ 70 width: k, 71 display: "inline-block" 72 }); 73 g.css({ 74 "-webkit-appearance": "menulist-button", 75 width: h.outerWidth(), 76 position: "absolute", 77 opacity: 0, 78 height: j, 79 fontSize: h.css("font-size") 80 }) 81 }) 82 .on("change.customSelect", function() { 83 h.addClass(b("Changed")); 84 f(g, h) 85 }) 86 .on("keyup.customSelect", function(j) { 87 if (!h.hasClass(b("Open"))) { 88 g.trigger("blur.customSelect"); 89 g.trigger("focus.customSelect") 90 } else { 91 if (j.which == 13 || j.which == 27) { 92 f(g, h) 93 } 94 } 95 }) 96 .on("mousedown.customSelect", function() { 97 h.removeClass(b("Changed")) 98 }) 99 .on("mouseup.customSelect", function(j) { 100 if (!h.hasClass(b("Open"))) { 101 if (a("." + b("Open")) 102 .not(h) 103 .length > 0 && typeof InstallTrigger !== "undefined") { 104 g.trigger("focus.customSelect") 105 } else { 106 h.addClass(b("Open")); 107 j.stopPropagation(); 108 a(document) 109 .one("mouseup.customSelect", function(k) { 110 if (k.target != g.get(0) && a.inArray(k.target, g.find("*") 111 .get()) < 0) { 112 g.trigger("blur.customSelect") 113 } else { 114 f(g, h) 115 } 116 }) 117 } 118 } 119 }) 120 .on("focus.customSelect", function() { 121 h.removeClass(b("Changed")) 122 .addClass(b("Focus")) 123 }) 124 .on("blur.customSelect", function() { 125 h.removeClass(b("Focus") + " " + b("Open")) 126 }) 127 .on("mouseenter.customSelect", function() { 128 h.addClass(b("Hover")) 129 }) 130 .on("mouseleave.customSelect", function() { 131 h.removeClass(b("Hover")) 132 }) 133 .trigger("render.customSelect") 134 }) 135 } 136 }) 137})(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.