1/* Aura version: 1.8.5 */ 2 3 4function PiSlider(el, options) { 5 6 var o = {}, 7 $ = jQuery; 8 9 o.$el = el; 10 11 o.s = { 12 speed: 2000, 13 slideDelay: 35, 14 autoplayDelay: 0, 15 preload: 0, 16 preloadDelay: 1000, 17 action: 'fade', 18 circular: 0, 19 enableArrows: 0, 20 enablePagination: 0, 21 enableSwipes: 0, 22 enableKeys: 0, 23 c: { 24 pane: 'pi-slider', 25 paneWrapper: 'pi-slider-wrapper', 26 paneFast: 'pi-slider-fast', 27 slide: 'pi-slide', 28 slideTransparent: 'pi-slide-transparent', 29 pagination: 'pi-slider-pagination', 30 page: 'pi-slider-page', 31 arrow: 'pi-slider-arrow', 32 arrowLeft: 'pi-slider-arrow-left', 33 arrowRight: 'pi-slider-arrow-right', 34 slideActive: 'pi-slide-active', 35 pageActive: 'pi-slider-page-active', 36 arrowActive: 'pi-slider-arrow-active', 37 arrowDisabled: 'pi-slider-arrow-disabled' 38 }, 39 debug: 0 40 }; 41 42 if (options) { 43 $.extend(o.s, options); 44 } 45 46 o.init = function () { 47 o.$doc = $(document); 48 o.cssTransisions = 1; 49 o.$paneWrapper = o.$el.parents('.' + o.s.c.paneWrapper).eq(0); 50 o.$pane = o.$el.hasClass(o.s.c.pane) ? o.$el : o.$el.find('.' + o.s.c.pane); 51 o.$slides = o.$el.find('.' + o.s.c.slide); 52 o.autoPlayInterval = 0; 53 o.slidesQ = o.$slides.length; 54 55 if (o.slidesQ <= 0) { 56 return; 57 } 58 59 o.slideWidth = o.$slides.eq(0).width(); 60 o.slideOuterWidth = o.$slides.eq(0).outerWidth(); 61 o.slideMargin = (o.slideOuterWidth - o.slideWidth) / 2; 62 o.slidesWidth = o.slideOuterWidth * o.slidesQ; 63 o.sceneWidth = o.$paneWrapper.width(); 64 o.margin = (o.sceneWidth - o.slideWidth) / 2; 65 o.way = o.slideWidth - o.margin; 66 67 o.slidesTransparent = []; 68 69 o.current = -1; 70 71 if (o.s.debug) { 72 console.log('SCENE' + o.sceneWidth); 73 console.log('MARGIN' + o.margin); 74 console.log('WAY' + o.way); 75 } 76 77 o.beforeStart(); 78 o.addSwipeActions(); 79 } 80 81 o.beforeStart = function () { 82 if (o.s.preload) { 83 var preloader = new PiImagesLoader(o.$paneWrapper, o.start, o.s.preloadDelay); 84 } else { 85 o.start(); 86 } 87 } 88 89 o.start = function () { 90 91 if (o.s.enablePagination && o.slidesQ > 1) { 92 93 o.$paneWrapper.append('<div class="' + o.s.c.pagination + '"></div>'); 94 o.$pagination = o.$paneWrapper.find('.' + o.s.c.pagination); 95 96 var n = 0; 97 o.$slides.each(function () { 98 99 if (n == 0) { 100 active = o.s.c.pageActive; 101 } else { 102 active = ''; 103 } 104 105 o.$pagination.append('<span class="' + o.s.c.page + ' ' + active + '"><span></span></span>'); 106 n++; 107 }); 108 109 o.$pages = o.$pagination.find('.' + o.s.c.page); 110 111 o.$pages.click(function () { 112 var n = $(this).index(); 113 114 if (o.current != n) { 115 o.applyAnimation(n); 116 } 117 118 }); 119 if(o.s.action == 'slide'){ 120 o.prepareSlides(); 121 } 122 123 } 124 125 if (o.s.enableArrows && o.slidesQ > 1) { 126 127 o.$paneWrapper.append('<div class="' + o.s.c.arrow + ' ' + o.s.c.arrowLeft +' "><span></span></div>'); 128 o.$paneWrapper.append('<div class="' + o.s.c.arrow + ' ' + o.s.c.arrowRight +' "><span></span></div>'); 129 o.$leftArrow = o.$paneWrapper.find('.' + o.s.c.arrowLeft); 130 o.$rightArrow = o.$paneWrapper.find('.' + o.s.c.arrowRight); 131 132 if(!o.s.circular) { 133 o.$leftArrow.addClass(o.s.c.arrowDisabled); 134 } 135 136 o.$leftArrow.click(function () { 137 o.toPrev(); 138 }); 139 o.$rightArrow.click(function () { 140 o.toNext(); 141 }); 142 } 143 144 if (o.s.enableKeys && o.slidesQ > 1) { 145 146 o.$doc.keydown(function (e) { 147 if ((e.keyCode || e.which) == '37') { 148 o.toPrev(); 149 } else if ((e.keyCode || e.which) == '39') { 150 o.toNext(); 151 } 152 }); 153 154 } 155 156 o.applyAnimation(0); 157 if(o.s.autoplayDelay){ 158 o.startAutoplay(); 159 } 160 161 o.resizeGallery(); 162 163 } 164 165 o.applyAnimation = function (n, f) { 166 167 if (!f) { 168 f = 0; 169 } 170 171 if (o.s.action == 'slide') { 172 o.moveSlide(n, f); 173 } else if (o.s.action == 'fade') { 174 o.fadeSlide(n); 175 } 176 177 o.current = n; 178 o.checkArrowsState(n); 179 o.checkPagesState(n); 180 181 } 182 183 o.checkPagesState = function (n) { 184 if (o.s.enablePagination && o.slidesQ > 1) { 185 o.$pages.removeClass(o.s.c.pageActive); 186 o.$pages.eq(n).addClass(o.s.c.pageActive); 187 } 188 } 189 190 o.checkArrowsState = function (n) { 191 if (o.s.enableArrows && o.slidesQ > 1 && !o.s.circular) { 192 if (n == 0) { 193 o.$leftArrow.addClass(o.s.c.arrowDisabled); 194 } else { 195 o.$leftArrow.removeClass(o.s.c.arrowDisabled); 196 } 197 if (n == o.slidesQ - 1) { 198 o.$rightArrow.addClass(o.s.c.arrowDisabled); 199 } else { 200 o.$rightArrow.removeClass(o.s.c.arrowDisabled); 201 } 202 } 203 } 204 205 o.moveSlide = function(n, f) { 206 207 var fast = f || 0, 208 speed = fast ? 0 : o.s.speed, 209 $prev = o.$slides.eq(o.current), 210 $next = o.$slides.eq(n); 211 212 $prev.removeClass(o.s.c.slideActive); 213 214 if(!o.cssTransisions){ 215 $prev.stop().animate({ 216 left: -o.slideOuterWidth, 217 opacity: 0 218 }, speed, 'easeInOutExpo',function(){ 219 $(this).css({ 220 left: o.slideOuterWidth 221 }); 222 }); 223 $next.stop().animate({ 224 left: 0, 225 opacity: 1 226 }, speed, 'easeInOutExpo'); 227 $next.addClass(o.s.c.slideActive); 228 229 } else { 230 $prev.css({ 231 '-webkit-transform': 'translateX(' + -o.slideOuterWidth + 'px)', 232 '-moz-transform': 'translateX(' + -o.slideOuterWidth + 'px)', 233 '-o-transform': 'translateX(' + -o.slideOuterWidth + 'px)', 234 'transform': 'translateX(' + -o.slideOuterWidth + 'px)' 235 }); 236 $next.addClass('pi-no-transitions').css({ 237 '-webkit-transform': 'translateX(' + o.slideOuterWidth + 'px)', 238 '-moz-transform': 'translateX(' + o.slideOuterWidth + 'px)', 239 '-o-transform': 'translateX(' + o.slideOuterWidth + 'px)', 240 'transform': 'translateX(' + o.slideOuterWidth + 'px)' 241 }); 242 //debugger; 243 setTimeout(function(){ 244 $next.removeClass('pi-no-transitions').addClass(o.s.c.slideActive).css({ 245 '-webkit-transform': 'translateX(' + 0 + 'px)', 246 '-moz-transform': 'translateX(' + 0 + 'px)', 247 '-o-transform': 'translateX(' + 0 + 'px)', 248 'transform': 'translateX(' + 0 + 'px)' 249 }); 250 },10); 251 } 252 253 } 254 255 256 o.fadeSlide = function (n) { 257 258 var $prev = o.$slides.eq(o.current), 259 $next = o.$slides.eq(n); 260 261 $prev.removeClass(o.s.c.slideActive); 262 $next.addClass(o.s.c.slideActive); 263 264 if(!o.cssTransisions){ 265 $next.stop().animate({ 266 opacity: 1 267 }, o.s.speed, 'easeOutQuad', function () { 268 $prev.fadeTo(0, 0); 269 }); 270 } 271 272 } 273 274 o.prepareSlides = function () { 275 276 o.$slides.each(function(i){ 277 if(i != 0) { 278 if (o.cssTransisions) { 279 $(this).css({ 280 '-webkit-transform': 'translateX(' + o.slideOuterWidth + 'px)', 281 '-moz-transform': 'translateX(' + o.slideOuterWidth + 'px)', 282 '-o-transform': 'translateX(' + o.slideOuterWidth + 'px)', 283 'transform': 'translateX(' + o.slideOuterWidth + 'px)' 284 }); 285 } else { 286 $(this).css({ 287 'left': o.slideOuterWidth + 'px' 288 }); 289 } 290 } 291 }); 292 293 } 294 295 o.toNext = function () { 296 if (o.current < o.slidesQ - 1) { 297 o.applyAnimation(o.current + 1); 298 } else if(o.s.circular){ 299 o.applyAnimation(0); 300 } 301 } 302 303 o.toPrev = function () { 304 if (o.current > 0) { 305 o.applyAnimation(o.current - 1); 306 } else if(o.s.circular){ 307 o.applyAnimation(o.slidesQ - 1); 308 } 309 } 310 311 o.startAutoplay = function(){ 312 o.autoPlayInterval = setInterval(function(){ 313 o.toNext(); 314 }, o.s.autoplayDelay); 315 } 316 317 o.stopAutoplay = function(){ 318 clearInterval(o.autoPlayInterval); 319 } 320 321 o.resizeGallery = function () { 322 /*o.slideOuterWidth = o.$slides.eq(0).outerWidth(); 323 o.sceneWidth = o.$paneWrapper.width(); 324 o.margin = (o.sceneWidth - o.slideOuterWidth) / 2; 325 326 if (o.s.action == 'fade') { 327 o.$pane.css('left', o.margin); 328 }*/ 329 } 330 331 o.addSwipeActions = function() { 332 if(o.s.enableSwipes && $.fn.swipe && typeof($.fn.swipe) === 'function') { 333 o.$pane.swipe({ 334 swipeStatus:function(event, phase, direction, distance, duration, fingers){ 335 if (phase == 'end'){ 336 if(direction == 'left'){ 337 o.toNext(); 338 } else if(direction == 'right'){ 339 o.toPrev(); 340 } 341 } 342 }, 343 allowPageScroll:"vertical", 344 excludedElements:'' 345 }); 346 } 347 } 348 349 o.init(); 350 351 return o; 352 353}
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.