1(function(c) { 2 c.expander = { 3 version: "1.4.5", 4 defaults: { 5 slicePoint: 100, 6 preserveWords: true, 7 widow: 4, 8 expandText: "read more", 9 expandPrefix: "… ", 10 expandAfterSummary: false, 11 summaryClass: "summary", 12 detailClass: "details", 13 moreClass: "read-more", 14 lessClass: "read-less", 15 collapseTimer: 0, 16 expandEffect: "slideDown", 17 expandSpeed: 250, 18 collapseEffect: "slideUp", 19 collapseSpeed: 200, 20 userCollapse: true, 21 userCollapseText: "read less", 22 userCollapsePrefix: " ", 23 onSlice: null, 24 beforeExpand: null, 25 afterExpand: null, 26 onCollapse: null, 27 afterCollapse: null 28 } 29 }; 30 c.fn.expander = function(l) { 31 function I(a, d) { 32 var e = "span", 33 h = a.summary; 34 if (d) { 35 e = "div"; 36 if (x.test(h) && !a.expandAfterSummary) 37 h = h.replace(x, a.moreLabel + "$1"); 38 else 39 h += a.moreLabel; 40 h = '<div class="' + a.summaryClass + '">' + h + "</div>" 41 } else 42 h += a.moreLabel; 43 return [h, "<", e + ' class="' + a.detailClass + '"', ">", a.details, "</" + e + ">"].join("") 44 } 45 function J(a) { 46 var d = '<span class="' + a.moreClass + '">' + a.expandPrefix; 47 d += '<a href="#">' + a.expandText + "</a></span>"; 48 return d 49 } 50 function y(a, d) { 51 if (a.lastIndexOf("<") > a.lastIndexOf(">")) 52 a = a.slice(0, a.lastIndexOf("<")); 53 if (d) 54 a = a.replace(K, ""); 55 return c.trim(a) 56 } 57 function z(a, d) { 58 d.stop(true, true)[a.collapseEffect](a.collapseSpeed, function() { 59 d.prev("span." + a.moreClass).show().length || d.parent().children("div." + a.summaryClass).show().find("span." + a.moreClass).show(); 60 a.afterCollapse && a.afterCollapse.call(d) 61 }) 62 } 63 function L(a, d, e) { 64 if (a.collapseTimer) 65 A = setTimeout(function() { 66 z(a, d); 67 c.isFunction(a.onCollapse) && a.onCollapse.call(e, false) 68 }, a.collapseTimer) 69 } 70 var u = "init"; 71 if (typeof l == "string") { 72 u = l; 73 l = {} 74 } 75 var v = c.extend({}, c.expander.defaults, l), 76 M = /^<(?:area|br|col|embed|hr|img|input|link|meta|param).*>$/i, 77 K = v.wordEnd || /(&(?:[^;]+;)?|[a-zA-Z\u00C0-\u0100]+)$/, 78 B = /<\/?(\w+)[^>]*>/g, 79 C = /<(\w+)[^>]*>/g, 80 D = /<\/(\w+)>/g, 81 x = /(<\/[^>]+>)\s*$/, 82 N = /^(<[^>]+>)+.?/, 83 A; 84 l = { 85 init: function() { 86 this.each(function() { 87 var a, 88 d, 89 e, 90 h, 91 m, 92 i, 93 n, 94 o, 95 w, 96 E = [], 97 s = [], 98 q = {}, 99 r = this, 100 f = c(this), 101 F = c([]), 102 b = c.extend({}, v, f.data("expander") || c.meta && f.data() || {}); 103 i = !!f.find("." + b.detailClass).length; 104 n = !!f.find("*").filter(function() { 105 return / ^block | table | list / .test(c(this).css("display")) 106 }).length; 107 var t = (n ? "div": "span") + "." + b.detailClass; 108 a = b.moreClass + ""; 109 d = b.lessClass + ""; 110 var O = b.expandSpeed || 0, 111 p = c.trim(f.html()); 112 c.trim(f.text()); 113 var g = p.slice(0, b.slicePoint); 114 b.moreSelector = "span." + a.split(" ").join("."); 115 b.lessSelector = "span." + d.split(" ").join("."); 116 if (!c.data(this, "expanderInit")) { 117 c.data(this, "expanderInit", true); 118 c.data(this, "expander", b); 119 c.each(["onSlice", "beforeExpand", "afterExpand", "onCollapse", "afterCollapse"], function(j, k) { 120 q[k] = c.isFunction(b[k]) 121 }); 122 g = y(g); 123 for (d = g.replace(B, "").length; d < b.slicePoint;) { 124 a = p.charAt(g.length); 125 if (a == "<") 126 a = p.slice(g.length).match(N)[0]; 127 g += a; 128 d++ 129 } 130 g = y(g, b.preserveWords); 131 h = g.match(C) || []; 132 m = g.match(D) || []; 133 e = []; 134 c.each(h, function(j, k) { 135 M.test(k) || e.push(k) 136 }); 137 h = e; 138 d = m.length; 139 for (a = 0; a < d; a++) 140 m[a] = m[a].replace(D, "$1"); 141 c.each(h, function(j, k) { 142 var G = k.replace(C, "$1"), 143 H = c.inArray(G, m); 144 if (H === -1) { 145 E.push(k); 146 s.push("</" + G + ">") 147 } else 148 m.splice(H, 1) 149 }); 150 s.reverse(); 151 if (i) { 152 i = f.find(t).remove().html(); 153 g = f.html(); 154 p = g + i; 155 a = "" 156 } else { 157 i = p.slice(g.length); 158 a = c.trim(i.replace(B, "")); 159 if (a === "" || a.split(/\s+/).length < b.widow) 160 return; 161 a = s.pop() || ""; 162 g += s.join(""); 163 i = E.join("") + i 164 } 165 b.moreLabel = f.find(b.moreSelector).length ? "": J(b); 166 if (n) 167 i = p; 168 g += a; 169 b.summary = g; 170 b.details = i; 171 b.lastCloseTag = a; 172 if (q.onSlice) 173 b = (e = b.onSlice.call(r, b)) && e.details ? e: b; 174 n = I(b, n); 175 f.html(n); 176 o = f.find(t); 177 w = f.find(b.moreSelector); 178 b.collapseEffect === "slideUp" && b.expandEffect !== "slideDown" || f.is(":hidden") ? o.css({ 179 display: "none" 180 }) : o[b.collapseEffect](0);
181 F = f.find("div." + b.summaryClass); 182 w.find("a").unbind("click.expander").bind("click.expander", function(j) { 183 j.preventDefault(); 184 w.hide(); 185 F.hide(); 186 q.beforeExpand && b.beforeExpand.call(r); 187 o.stop(false, true)[b.expandEffect](O, function() { 188 o.css({ 189 zoom: "" 190 }); 191 q.afterExpand && b.afterExpand.call(r); 192 L(b, o, r) 193 }) 194 }); 195 b.userCollapse && !f.find(b.lessSelector).length && f.find(t).append('<span class="' + b.lessClass + '">' + b.userCollapsePrefix + '<a href="#">' + b.userCollapseText + "</a></span>"); 196 f.find(b.lessSelector + " a").unbind("click.expander").bind("click.expander", function(j) { 197 j.preventDefault(); 198 clearTimeout(A); 199 j = c(this).closest(t); 200 z(b, j); 201 q.onCollapse && b.onCollapse.call(r, true) 202 }) 203 } 204 }) 205 }, 206 destroy: function() { 207 this.each(function() { 208 var a, 209 d, 210 e = c(this); 211 if (e.data("expanderInit")) { 212 a = c.extend({}, e.data("expander") || {}, v); 213 d = e.find("." + a.detailClass).contents(); 214 e.removeData("expanderInit"); 215 e.removeData("expander"); 216 e.find(a.moreSelector).remove(); 217 e.find("." + a.summaryClass).remove(); 218 e.find("." + a.detailClass).after(d).remove(); 219 e.find(a.lessSelector).remove() 220 } 221 }) 222 } 223 }; 224 l[u] && l[u].call(this); 225 return this 226 }; 227 c.fn.expander.defaults = c.expander.defaults 228})(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.