1/* 2 Ridiculously Responsive Social Sharing Buttons 3 Team: @dbox, @seagoat 4 Site: http://www.kurtnoble.com/labs/pbs 5 Twitter: @therealkni 6 7 ___ ___ 8 /__/| /__/\ ___ 9 | |:| \ \:\ / /\ 10 | |:| \ \:\ / /:/ 11 __| |:| _____\__\:\ /__/::\ 12 /__/\_|:|____ /__/::::::::\ \__\/\:\__ 13 \ \:\/:::::/ \ \:\~~\~~\/ \ \:\/\ 14 \ \::/~~~~ \ \:\ ~~~ \__\::/ 15 \ \:\ \ \:\ /__/:/ 16 \ \:\ \ \:\ \__\/ 17 \__\/ \__\/ 18 */(function (e, t, n) { 19 "use strict"; 20 var r = function () { 21 t(".pbs-buttons").each(function (e) { 22 var n = t(this), r = t("li", n).length, i = 100 / r; 23 t("li", n).css("width", i + "%").attr("data-initwidth", i) 24 }) 25 }, i = function () { 26 t(".pbs-buttons").each(function (e) { 27 var n = t(this), r = parseFloat(t(n).width()), i = t("li", n).not(".small").first().width(), s = t("li.small", n).length; 28 i > 170 && s < 1 ? t(n).addClass("large-format") : t(n).removeClass("large-format"); 29 r < 200 ? t(n).removeClass("small-format").addClass("tiny-format") : t(n).removeClass("tiny-format") 30 }) 31 }, s = function () { 32 t(".pbs-buttons").each(function (e) { 33 var n = t(this), r = 0, i = 0, s, o, a = t("li.small", n).length; 34 if (a === t("li", n).length) { 35 var f = a * 42, l = parseFloat(t(n).width()); 36 s = t("li.small", n).first(); 37 o = parseFloat(t(s).attr("data-size")) + 55; 38 if (f + o < l) { 39 t(n).removeClass("small-format"); 40 t("li.small", n).first().removeClass("small"); 41 u() 42 } 43 } else { 44 t("li", n).not(".small").each(function (e) { 45 var n = parseFloat(t(this).attr("data-size")) + 55, s = parseFloat(t(this).width()); 46 r += s; 47 i += n 48 }); 49 var c = r - i; 50 s = t("li.small", n).first(); 51 o = parseFloat(t(s).attr("data-size")) + 55; 52 if (o < c) { 53 t(s).removeClass("small"); 54 u() 55 } 56 } 57 }) 58 }, o = function (e) { 59 t(".pbs-buttons").each(function (e) { 60 var n = t(this), r = t("li", n).nextAll(), i = r.length; 61 t(t("li", n).get().reverse()).each(function (e, r) { 62 if (t(this).hasClass("small") === !1) { 63 var i = parseFloat(t(this).attr("data-size")) + 55, o = parseFloat(t(this).width()); 64 if (i > o) { 65 var a = t("li", n).not(".small").last(); 66 t(a).addClass("small"); 67 u() 68 } 69 } 70 --r || s() 71 }) 72 }); 73 e === !0 && f(u) 74 }, u = function () { 75 t(".pbs-buttons").each(function (e) { 76 var n = t(this), i, s, o, u, a, f = t("li.small", n).length; 77 if (f > 0 && f !== t("li", n).length) { 78 t(n).removeClass("small-format"); 79 t("li.small", n).css("width", "42px"); 80 o = f * 42; 81 i = t("li", n).not(".small").length; 82 s = 100 / i; 83 a = o / i; 84 navigator.userAgent.indexOf("Chrome") >= 0 || navigator.userAgent.indexOf("Safari") >= 0 ? u = "-webkit-calc(" + s + "% - " + a + "px)" : navigator.userAgent.indexOf("Firefox") >= 0 ? u = "-moz-calc(" + s + "% - " + a + "px)" : u = "calc(" + s + "% - " + a + "px)"; 85 t("li", n).not(".small").css("width", u) 86 } else if (f === t("li", n).length) { 87 t(n).addClass("small-format"); 88 r() 89 } else { 90 t(n).removeClass("small-format"); 91 r() 92 } 93 }); 94 i() 95 }, a = function () { 96 t(".pbs-buttons").each(function (e) { 97 t(this).addClass("pbs-" + (e + 1)) 98 }); 99 r(); 100 t(".pbs-buttons li .text").each(function (e) { 101 var n = parseFloat(t(this).width()); 102 t(this).closest("li").attr("data-size", n) 103 }); 104 o(!0) 105 }, f = function (e) { 106 t(".pbs-buttons li.small").removeClass("small"); 107 o(); 108 e() 109 }, l = function (t, r, i, s) { 110 var o = e.screenLeft !== n ? e.screenLeft : screen.left, u = e.screenTop !== n ? e.screenTop : screen.top, a = e.innerWidth ? e.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width, f = e.innerHe
110ight ? e.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height, l = a / 2 - i / 2 + o, c = f / 3 - s / 3 + u, h = e.open(t, r, "scrollbars=yes, width=" + i + ", height=" + s + ", top=" + c + ", left=" + l); 111 e.focus && h.focus() 112 }, c = function () { 113 var e = {}; 114 return function (t, n, r) { 115 r || (r = "Don't call this twice without a uniqueId"); 116 e[r] && clearTimeout(e[r]); 117 e[r] = setTimeout(t, n) 118 } 119 }(); 120 t(".pbs-buttons a.popup").on("click", function (e) { 121 var n = t(this); 122 l(n.attr("href"), n.find(".text").html(), 580, 470); 123 e.preventDefault() 124 }); 125 t(e).resize(function () { 126 f(u); 127 c(function () { 128 f(u) 129 }, 200, "finished resizing") 130 }); 131 t(document).ready(function () { 132 a() 133 }) 134})(window, 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.