1(function (e) { 2 function t(e) { 3 if ("string" === typeof e) { 4 var t = e.indexOf("_"); 5 -1 != t && (e = e.substr(t + 1)) 6 } 7 return e 8 } 9 10 function n(n) { 11 n.preventDefault(); 12 n = t(e(this).attr("data-id")); 13 var r = s[n]; 14 e(this).unbind(); 15 r.prev.unbind(); 16 e.fn.als("next", n) 17 } 18 19 function i(n) { 20 n.preventDefault(); 21 n = t(e(this).attr("data-id")); 22 var r = s[n]; 23 e(this).unbind(); 24 r.next.unbind(); 25 e.fn.als("prev", n) 26 } 27 28 var s = [], o = 0, u = {init:function (t) { 29 this.each(function () { 30 var u = e(this), a = u.data("als"), f = e(), a = e(), l = e(), h = e(), p = e(), d = e(), v = 0, m = 0, g = 0, y = 0, b = 0, w = 0, E = 0, S = 0, x = 0, f = e.extend({visible_items:3, scrolling_items:1, orientation:"horizontal", circular:"no", autoscroll:"no", interval:4e3, direction:"left", start_from:0}, t); 31 "no" == f.circular && "yes" == f.autoscroll && (f.circular = "yes"); 32 u.attr("id") && "" != u.attr("id") || u.attr("id", "als-container_" + o); 33 h = u.find(".als-viewport").attr("id", "als-viewport_" + o); 34 l = u.find(".als-wrapper").attr("id", "als-wrapper_" + o); 35 a = u.find(".als-item"); 36 v = a.size(); 37 f.visible_items > v && (f.visible_items = v - 1); 38 f.scrolling_items > f.visible_items && (f.scrolling_items = f.visible_items - 1); 39 f.start_from > v - f.visible_items && (f.start_from = 0); 40 p = u.find(".als-prev").attr("data-id", "als-prev_" + o); 41 d = u.find(".als-next").attr("data-id", "als-next_" + o); 42 switch (f.orientation) { 43 default: 44 a.each(function (t) { 45 e(this).attr("id", "als-item_" + o + "_" + t); 46 g += e(this).outerWidth(!0); 47 E < f.visible_items && (0 == f.start_from ? (m += e(this).outerWidth(!0), E++) : t >= f.start_from && (m += e(this).outerWidth(!0), E++)); 48 0 != f.start_from && (S < f.start_from && (w += e(this).outerWidth(!0), S++), x = f.start_from) 49 }); 50 l.css("width", g); 51 a.css("left", -w); 52 h.css("width", m); 53 l.css("height", a.outerHeight(!0)); 54 h.css("height", a.outerHeight(!0)); 55 if ("yes" == f.circular && 0 != f.start_from)for (r = 0; r < f.start_from; r++) { 56 var T = a.last().position(), T = T.left + a.last().outerWidth(!0); 57 a.eq(r).css("left", T) 58 } 59 break; 60 case"vertical": 61 if (a.each(function (t) { 62 e(this).attr("id", "als-item_" + o + "_" + t); 63 b += e(this).outerHeight(!0); 64 E < f.visible_items && (0 == f.start_from ? (y += e(this).outerHeight(!0), E++) : t >= f.start_from && (y += e(this).outerHeight(!0), E++)); 65 0 != f.start_from && (S < f.start_from && (w += e(this).outerHeight(!0), S++), x = f.start_from) 66 }), l.css("height", b), a.css("top", -w), h.css("height", y), l.css("width", a.outerWidth(!0)), h.css("width", a.outerWidth(!0)), "yes" == f.circular && 0 != f.start_from)for (r = 0; r < f.start_from; r++)T = a.last().position(), T = T.top + a.last().outerHeight(!0), a.eq(r).css("top", T) 67 } 68 "no" == f.circular && (0 == f.start_from && p.css("display", "none"), f.visible_items + f.start_from == v && d.css("display", "none")); 69 u.data("als", {container:u, instance:o, options:f, viewport:h, wrapper:l, prev:p, next:d, item:a, num_items:v, wrapper_width:g, viewport_width:m, wrapper_height:b, viewport_height:y, current:x, timer:0}); 70 a = u.data("als"); 71 s[o] = a; 72 d.bind("click", n); 73 p.bind("click", i); 74 "yes" == f.autoscroll ? (e.fn.als("start", o), l.hover(function () { 75 e.fn.als("stop", e(this).attr("id")) 76 }, function () { 77 e.fn.als("start", e(this).attr("id")) 78 })) : "no" == f.autoscroll && e.fn.als("stop", o); 79 o++; 80 return s 81 }) 82 }, next:function (e) { 83 e = t(e); 84 var r = s[e], o = 0, o = 0; 85 if (r.options.beforeSwitchedCallback != null) { 86 r.options.beforeSwitchedCallback(r.item.eq(r.current), r.current) 87 } 88 switch (r.options.orientation) { 89 default: 90 var u = 0, a = 0; 91 switch (r.options.circular) { 92 default: 93 for (o = r.current; o < r.current + r.options.scrolling_items; o++)u += r.item.eq(o).outerWidth(!0); 94 r.current += r.options.scrolling_items; 95 for (o = r.current; o < r.current + r.options.visible_items; o++)a += r.item.eq(o).outerWidth(!0); 96 r.viewport.animate({width:a}, 600); 97 r.item.animate({left:"-=" + u}, 600); 98 r.item.promise().done(function () { 99 r.next.bind("click", n); 100 r.prev.bind("click", i); 101 if (r.options.switchedCallback != null) { 102 r.options.switchedCallback(r.item.eq(r.current)) 103 } 104 }); 105 0 < r.current && r.prev.show(); 106 r.current + r.options.visible_items >= r.num_items && r.next.hide(); 107 break; 108 case"yes": 109 for (var f = 0, l = [], o = r.current; o < r.current + r.options.scrolling_items; o++) { 110 var c = o; 111 o >= r.num_items && (c = o - r.num_items); 112 u += r.item.eq(c).outerWidth(!0); 113 l[f] = c; 114 f++ 115 } 116 r.current += r.options.scrolling_items; 117 r.current >= r.num_items && (r.current -= r.num_items); 118 for (o = r.current; o < r.current + r.options.visible_items; o++)f = o, o >= r.num_items && (f = o - r.num_items), a += r.item.eq(f).outerWidth(!0); 119 r.viewport.animate({width:a}, 600); 120 r.item.animate({left:"-=" + u}, 600); 121 r.item.promise().done(function () { 122 var e = r.item.last().position(), e = e.left + r.item.last().outerWidth(!0); 123 for (k5 = 0; k5 < l.length; k5++)0 == l[k5] && (e = r.item.last().position(), e = e.left + r.item.last().outerWidth(!0)), r.item.eq(l[k5]).css("left", e); 124 r.next.bind("click", n); 125 r.prev.bind("click", i); 126 if (r.options.switchedCallback != null) { 127 r.options.switchedCallback(r.item.eq(r.current)) 128 } 129 }) 130 } 131 break; 132 case"vertical": 133 switch (a = u = 0, r.options.circular) { 134 default: 135 for (o = r.current; o < r.current + r.options.scrolling_items; o++)u += r.item.eq(o).outerHeight(!0); 136 r.current += r.options.scrolling_items; 137 for (o = r.current; o < r.current + r.options.visible_items; o++)a += r.item.eq(o).outerHeight(!0); 138 r.viewport.animate({height:a}, 600); 139 r.item.animate({top:"-=" + u}, 600); 140 r.item.promise().done(function () { 141 r.next.bind("click", n); 142 r.prev.bind("click", i); 143 if (r.options.switchedCallback != null) { 144 r.options.switchedCallback(r.item.eq(r.current)) 145 } 146 }); 147 0 < r.current && r.prev.show(); 148 r.current + r.options.visible_items >= r.num_items && r.next.hide(); 149 break; 150 case"yes": 151 f = 0; 152 l = []; 153 for (o = r.current; o < r.current + r.options.scrolling_items; o++)c = o, o >= r.num_items && (c = o - r.num_items), u += r.item.eq(c).outerHeight(!0), l[f] = c, f++; 154 r.current += r.options.scrolling_items; 155 r.current >= r.num_items && (r.current -= r.num_items); 156 for (o = r.current; o < r.current + r.options.visible_items; o++)f = o, o >= r.num_items && (f = o - r.num_items), a += r.item.eq(f).outerHeight(!0); 157 r.viewport.animate({height:a}); 158 r.item.animate({top:"-=" + u}); 159 r.item.promise().done(function () { 160 var e = r.item.last().position(), e = e.top + r.item.last().outerHeight(!0); 161 for (k5 = 0; k5 < l.length; k5++)0 == l[k5] && (e = r.item.last().position(), e = e.top + r.item.last().outerHeight(!0)), r.item.eq(l[k5]).css("top", e); 162 r.next.bind("click", n); 163 r.prev.bind("click", i) 164 }); 165 if (r.options.switchedCallback != null) { 166 r.options.switchedCallback(r.item.eq(r.current)) 167 } 168 } 169 } 170 s[e] = r; 171 return s 172 }, prev:function (e) { 173 e = t(e); 174 var r = s[e], o = 0, o = 0; 175 switch (r.options.orientation) { 176 default: 177 var u = 0, a = 0; 178 switch (r.options.circular) { 179 default: 180 r.current -= r.options.scrolling_items; 181 for (o = r.current; o < r.current + r.options.scrolling_items; o++)u += r.item.eq(o).outerWidth(!0); 182 for (o = r.current; o < r.current + r.options.visible_items; o++)a += r.item.eq(o).outerWidth(!0); 183 r.viewport.animate({width:a}); 184 r.item.animate({left:"+=" + u}, 600); 185 r.item.promise().done(function () { 186 r.prev.bind("click", i); 187 r.next.bind("click", n); 188 if (r.options.switchedCallback != null) { 189 r.options.switchedCallback(r.item.eq(r.current)) 190 } 191 }); 192 0 >= r.current && r.prev.hide(); 193 r.current + r.options.visible_items < r.num_items && r.next.show(); 194 break; 195 case"yes": 196 var f = 0, l = []; 197 r.current -= r.options.scrolling_items; 198 0 > r.current && (r.current += r.num_items); 199 for (o = r.current; o < r.current + r.options.scrolling_items; o++) { 200 var c = o; 201 o >= r.num_items && (c = o - r.num_items); 202 u += r.item.eq(c).outerWidth(!0); 203 l[f] = c; 204 f++ 205 } 206 for (o = r.current; o < r.current + r.options.visible_items; o++)f = o, o >= r.num_items && (f = o - r.num_items), a += r.item.eq(f).outerWidth(!0); 207 o = r.item.first().position(); 208 o = o.left - r.wrapper_width; 209 for (k5 = 0; k5 < l.length; k5++)r.item.eq(l[k5]).css("left", o), 0 == l[k5] && l[k5 - 1] == r.num_items - 1 && (o = r.item.first().position(), o = o.left - r.wrapper_width, r.item.eq(l[k5 - 1]).css("left", o)); 210 setTimeout(function () { 211 r.viewport.animate({width:a}); 212 r.item.animate({left:"+=" + u}, 600); 213 r.item.promise().done(function () { 214 r.prev.bind("click", i); 215 r.next.bind("click", n); 216 if (r.options.switchedCallback != null) { 217 r.options.switchedCallback(r.item.eq(r.current)) 218 } 219 }) 220 }, 200) 221 } 222 break; 223 case"vertical": 224 var h = 0, d = 0; 225 switch (r.options.circular) { 226 default: 227 r.current -= r.options.scrolling_items; 228 for (o = r.current; o < r.current + r.options.scrolling_items; o++)h += r.item.eq(o).outerHeight(!0); 229 for (o = r.current; o < r.current + r.options.visible_items; o++)d += r.item.eq(o).outerHeight(!0); 230 r.viewport.animate({height:d}); 231 r.item.animate({top:"+=" + h}, 600); 232 r.item.promise().done(function () { 233 r.prev.bind("click", i); 234 r.next.bind("click", n); 235 if (r.options.switchedCallback != null) { 236 r.options.switchedCallback(r.item.eq(r.current)) 237 } 238 }); 239 0 >= r.current && r.prev.hide(); 240 r.current + r.options.visible_items < r.num_items && r.next.show(); 241 break; 242 case"yes": 243 f = 0; 244 l = []; 245 r.current -= r.options.scrolling_items; 246 0 > r.current && (r.current += r.num_items); 247 for (o = r.current; o < r.current + r.options.scrolling_items; o++)c = o, o >= r.num_items && (c = o - r.num_items), h += r.item.eq(c).outerHeight(!0), l[f] = c, f++; 248 for (o = r.current; o < r.current + r.options.visible_items; o++)f = o, o >= r.num_items && (f = o - r.num_items), d += r.item.eq(f).outerHeight(!0); 249 o = r.item.first().position(); 250 o = o.top - r.wrapper_height; 251 for (k5 = 0; k5 < l.length; k5++)r.item.eq(l[k5]).css("top", o), 0 == l[k5] && l[k5 - 1] == r.num_items - 1 && (o = r.item.first().position(), o = o.top - r.wrapper_height, r.item.eq(l[k5 - 1]).css("top", o)); 252 setTimeout(function () { 253 r.viewport.animate({height:d}, 600); 254 r.item.animate({top:"+=" + h}, 600); 255 r.item.promise().done(function () { 256 r.prev.bind("click", i); 257 r.next.bind("click", n); 258 if (r.options.switchedCallback != null) { 259 r.options.switchedCallback(r.item.eq(r.current)) 260 } 261 }) 262 }, 200) 263 } 264 } 265 s[e] = r; 266 return s 267 }, start:function (n) { 268 n = t(n); 269 var r = s[n]; 270 0 != r.timer && clearInterval(r.timer); 271 switch (r.options.direction) { 272 default: 273 r.timer = setInterval(function () { 274 r.next.unbind(); 275 r.prev.unbind(); 276 e.fn.als("next", n) 277 }, r.options.interval); 278 break; 279 case"right": 280 case"down": 281 r.timer = setInterval(function () { 282
282 r.prev.unbind(); 283 r.next.unbind(); 284 e.fn.als("prev", n) 285 }, r.options.interval) 286 } 287 s[n] = r; 288 return s 289 }, stop:function (e) { 290 e = t(e); 291 var n = s[e]; 292 clearInterval(n.timer); 293 s[e] = n; 294 return s 295 }, destroy:function (n) { 296 n = t(n); 297 var r = s[n]; 298 r.prev.unbind(); 299 r.next.unbind(); 300 e.fn.als("stop", n); 301 e.removeData(r, this.name); 302 this.removeClass(this.name); 303 this.unbind(); 304 this.element = null 305 }}; 306 e.fn.als = function (t) { 307 if (u[t])return u[t].apply(this, Array.prototype.slice.call(arguments, 1)); 308 if ("object" !== typeof t && t)e.error("Method " + t + " does not exist on jQuery.als"); else return u.init.apply(this, arguments) 309 } 310})(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.