cycle2-rails 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/Gemfile.lock +19 -18
- data/README.md +24 -2
- data/Rakefile +64 -5
- data/app/assets/javascripts/jquery.cycle2.all.js +11 -0
- data/app/assets/javascripts/jquery.cycle2.autoheight.js +132 -0
- data/app/assets/javascripts/jquery.cycle2.caption.js +44 -0
- data/app/assets/javascripts/jquery.cycle2.caption2.js +69 -0
- data/app/assets/javascripts/jquery.cycle2.carousel.js +271 -0
- data/app/assets/javascripts/jquery.cycle2.center.js +65 -0
- data/app/assets/javascripts/jquery.cycle2.command.js +182 -0
- data/app/assets/javascripts/jquery.cycle2.core.js +654 -0
- data/app/assets/javascripts/jquery.cycle2.hash.js +53 -0
- data/app/assets/javascripts/jquery.cycle2.ie-fade.js +48 -0
- data/app/assets/javascripts/jquery.cycle2.js +11 -0
- data/app/assets/javascripts/jquery.cycle2.loader.js +107 -0
- data/app/assets/javascripts/jquery.cycle2.pager.js +95 -0
- data/app/assets/javascripts/jquery.cycle2.prevnext.js +67 -0
- data/app/assets/javascripts/jquery.cycle2.progressive.js +133 -0
- data/app/assets/javascripts/jquery.cycle2.scrollVert.js +17 -0
- data/app/assets/javascripts/jquery.cycle2.shuffle.js +64 -0
- data/app/assets/javascripts/jquery.cycle2.swipe.js +72 -0
- data/app/assets/javascripts/jquery.cycle2.tile.js +133 -0
- data/app/assets/javascripts/jquery.cycle2.tmpl.js +42 -0
- data/app/assets/javascripts/jquery.cycle2.video.js +68 -0
- data/lib/cycle2-rails/version.rb +1 -1
- metadata +31 -15
- data/vendor/assets/javascripts/cycle2-rails/jquery.cycle2.js +0 -1490
@@ -0,0 +1,53 @@
|
|
1
|
+
//= require jquery.cycle2.core
|
2
|
+
|
3
|
+
/*! hash plugin for Cycle2; version: 20121120 */
|
4
|
+
(function($) {
|
5
|
+
"use strict";
|
6
|
+
|
7
|
+
$(document).on( 'cycle-pre-initialize', function( e, opts ) {
|
8
|
+
onHashChange( opts, true );
|
9
|
+
|
10
|
+
opts._onHashChange = function() {
|
11
|
+
onHashChange( opts, false );
|
12
|
+
};
|
13
|
+
|
14
|
+
$( window ).on( 'hashchange', opts._onHashChange);
|
15
|
+
});
|
16
|
+
|
17
|
+
$(document).on( 'cycle-update-view', function( e, opts, slideOpts ) {
|
18
|
+
if ( slideOpts.hash ) {
|
19
|
+
opts._hashFence = true;
|
20
|
+
window.location.hash = slideOpts.hash;
|
21
|
+
}
|
22
|
+
});
|
23
|
+
|
24
|
+
$(document).on( 'cycle-destroyed', function( e, opts) {
|
25
|
+
if ( opts._onHashChange ) {
|
26
|
+
$( window ).off( 'hashchange', opts._onHashChange );
|
27
|
+
}
|
28
|
+
});
|
29
|
+
|
30
|
+
function onHashChange( opts, setStartingSlide ) {
|
31
|
+
var hash;
|
32
|
+
if ( opts._hashFence ) {
|
33
|
+
opts._hashFence = false;
|
34
|
+
return;
|
35
|
+
}
|
36
|
+
|
37
|
+
hash = window.location.hash.substring(1);
|
38
|
+
|
39
|
+
opts.slides.each(function(i) {
|
40
|
+
if ( $(this).data( 'cycle-hash' ) == hash ) {
|
41
|
+
if ( setStartingSlide === true ) {
|
42
|
+
opts.startingSlide = i;
|
43
|
+
}
|
44
|
+
else {
|
45
|
+
opts.nextSlide = i;
|
46
|
+
opts.API.prepareTx( true, false );
|
47
|
+
}
|
48
|
+
return false;
|
49
|
+
}
|
50
|
+
});
|
51
|
+
}
|
52
|
+
|
53
|
+
})(jQuery);
|
@@ -0,0 +1,48 @@
|
|
1
|
+
//= require jquery.cycle2
|
2
|
+
|
3
|
+
/*! ie-fade transition plugin for Cycle2; version: 20121120 */
|
4
|
+
(function($) {
|
5
|
+
"use strict";
|
6
|
+
|
7
|
+
function cleartype(before, opts, el) {
|
8
|
+
if ( before && el.style.filter ) {
|
9
|
+
opts._filter = el.style.filter;
|
10
|
+
try { el.style.removeAttribute('filter'); }
|
11
|
+
catch(smother) {} // handle old opera versions
|
12
|
+
}
|
13
|
+
else if ( !before && opts._filter ) {
|
14
|
+
el.style.filter = opts._filter;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
$.extend($.fn.cycle.transitions, {
|
19
|
+
fade: {
|
20
|
+
before: function( opts, curr, next, fwd ) {
|
21
|
+
var css = opts.API.getSlideOpts( opts.nextSlide ).slideCss || {};
|
22
|
+
opts.API.stackSlides( curr, next, fwd );
|
23
|
+
opts.cssBefore = $.extend(css, { opacity: 0, display: 'block' });
|
24
|
+
opts.animIn = { opacity: 1 };
|
25
|
+
opts.animOut = { opacity: 0 };
|
26
|
+
cleartype( true, opts, next );
|
27
|
+
},
|
28
|
+
after: function( opts, curr, next ) {
|
29
|
+
cleartype( false, opts, next );
|
30
|
+
}
|
31
|
+
},
|
32
|
+
fadeout: {
|
33
|
+
before: function( opts , curr, next, fwd ) {
|
34
|
+
var css = opts.API.getSlideOpts( opts.nextSlide ).slideCss || {};
|
35
|
+
opts.API.stackSlides( curr, next, fwd );
|
36
|
+
opts.cssBefore = $.extend(css, { opacity: 1, display: 'block' });
|
37
|
+
opts.animOut = { opacity: 0 };
|
38
|
+
cleartype( true, opts, next );
|
39
|
+
},
|
40
|
+
after: function( opts, curr, next ) {
|
41
|
+
cleartype( false, opts, next );
|
42
|
+
}
|
43
|
+
}
|
44
|
+
});
|
45
|
+
|
46
|
+
})(jQuery);
|
47
|
+
|
48
|
+
|
@@ -0,0 +1,11 @@
|
|
1
|
+
//= require jquery.cycle2.core
|
2
|
+
//= require jquery.cycle2.autoheight
|
3
|
+
//= require jquery.cycle2.caption
|
4
|
+
//= require jquery.cycle2.command
|
5
|
+
//= require jquery.cycle2.hash
|
6
|
+
//= require jquery.cycle2.loader
|
7
|
+
//= require jquery.cycle2.pager
|
8
|
+
//= require jquery.cycle2.prevnext
|
9
|
+
//= require jquery.cycle2.progressive
|
10
|
+
//= require jquery.cycle2.tmpl
|
11
|
+
|
@@ -0,0 +1,107 @@
|
|
1
|
+
//= require jquery.cycle2.core
|
2
|
+
|
3
|
+
/*! loader plugin for Cycle2; version: 20130307 */
|
4
|
+
(function($) {
|
5
|
+
"use strict";
|
6
|
+
|
7
|
+
$.extend($.fn.cycle.defaults, {
|
8
|
+
loader: false
|
9
|
+
});
|
10
|
+
|
11
|
+
$(document).on( 'cycle-bootstrap', function( e, opts ) {
|
12
|
+
var addFn;
|
13
|
+
|
14
|
+
if ( !opts.loader )
|
15
|
+
return;
|
16
|
+
|
17
|
+
// override API.add for this slideshow
|
18
|
+
addFn = opts.API.add;
|
19
|
+
opts.API.add = add;
|
20
|
+
|
21
|
+
function add( slides, prepend ) {
|
22
|
+
var slideArr = [];
|
23
|
+
if ( $.type( slides ) == 'string' )
|
24
|
+
slides = $.trim( slides );
|
25
|
+
else if ( $.type( slides) === 'array' ) {
|
26
|
+
for (var i=0; i < slides.length; i++ )
|
27
|
+
slides[i] = $(slides[i])[0];
|
28
|
+
}
|
29
|
+
|
30
|
+
slides = $( slides );
|
31
|
+
var slideCount = slides.length;
|
32
|
+
|
33
|
+
if ( ! slideCount )
|
34
|
+
return;
|
35
|
+
|
36
|
+
slides.hide().appendTo('body').each(function(i) { // appendTo fixes #56
|
37
|
+
var count = 0;
|
38
|
+
var slide = $(this);
|
39
|
+
var images = slide.is('img') ? slide : slide.find('img');
|
40
|
+
slide.data('index', i);
|
41
|
+
// allow some images to be marked as unimportant (and filter out images w/o src value)
|
42
|
+
images = images.filter(':not(.cycle-loader-ignore)').filter(':not([src=""])');
|
43
|
+
if ( ! images.length ) {
|
44
|
+
--slideCount;
|
45
|
+
slideArr.push( slide );
|
46
|
+
return;
|
47
|
+
}
|
48
|
+
|
49
|
+
count = images.length;
|
50
|
+
images.each(function() {
|
51
|
+
// add images that are already loaded
|
52
|
+
if ( this.complete ) {
|
53
|
+
imageLoaded();
|
54
|
+
}
|
55
|
+
else {
|
56
|
+
$(this).load(function() {
|
57
|
+
imageLoaded();
|
58
|
+
}).error(function() {
|
59
|
+
if ( --count === 0 ) {
|
60
|
+
// ignore this slide
|
61
|
+
opts.API.log('slide skipped; img not loaded:', this.src);
|
62
|
+
if ( --slideCount === 0 && opts.loader == 'wait') {
|
63
|
+
addFn.apply( opts.API, [ slideArr, prepend ] );
|
64
|
+
}
|
65
|
+
}
|
66
|
+
});
|
67
|
+
}
|
68
|
+
});
|
69
|
+
|
70
|
+
function imageLoaded() {
|
71
|
+
if ( --count === 0 ) {
|
72
|
+
--slideCount;
|
73
|
+
addSlide( slide );
|
74
|
+
}
|
75
|
+
}
|
76
|
+
});
|
77
|
+
|
78
|
+
if ( slideCount )
|
79
|
+
opts.container.addClass('cycle-loading');
|
80
|
+
|
81
|
+
|
82
|
+
function addSlide( slide ) {
|
83
|
+
var curr;
|
84
|
+
if ( opts.loader == 'wait' ) {
|
85
|
+
slideArr.push( slide );
|
86
|
+
if ( slideCount === 0 ) {
|
87
|
+
// #59; sort slides into original markup order
|
88
|
+
slideArr.sort( sorter );
|
89
|
+
addFn.apply( opts.API, [ slideArr, prepend ] );
|
90
|
+
opts.container.removeClass('cycle-loading');
|
91
|
+
}
|
92
|
+
}
|
93
|
+
else {
|
94
|
+
curr = $(opts.slides[opts.currSlide]);
|
95
|
+
addFn.apply( opts.API, [ slide, prepend ] );
|
96
|
+
curr.show();
|
97
|
+
opts.container.removeClass('cycle-loading');
|
98
|
+
}
|
99
|
+
}
|
100
|
+
|
101
|
+
function sorter(a, b) {
|
102
|
+
return a.data('index') - b.data('index');
|
103
|
+
}
|
104
|
+
}
|
105
|
+
});
|
106
|
+
|
107
|
+
})(jQuery);
|
@@ -0,0 +1,95 @@
|
|
1
|
+
//= require jquery.cycle2.core
|
2
|
+
|
3
|
+
/*! pager plugin for Cycle2; version: 20130525 */
|
4
|
+
(function($) {
|
5
|
+
"use strict";
|
6
|
+
|
7
|
+
$.extend($.fn.cycle.defaults, {
|
8
|
+
pager: '> .cycle-pager',
|
9
|
+
pagerActiveClass: 'cycle-pager-active',
|
10
|
+
pagerEvent: 'click.cycle',
|
11
|
+
pagerTemplate: '<span>•</span>'
|
12
|
+
});
|
13
|
+
|
14
|
+
$(document).on( 'cycle-bootstrap', function( e, opts, API ) {
|
15
|
+
// add method to API
|
16
|
+
API.buildPagerLink = buildPagerLink;
|
17
|
+
});
|
18
|
+
|
19
|
+
$(document).on( 'cycle-slide-added', function( e, opts, slideOpts, slideAdded ) {
|
20
|
+
if ( opts.pager ) {
|
21
|
+
opts.API.buildPagerLink ( opts, slideOpts, slideAdded );
|
22
|
+
opts.API.page = page;
|
23
|
+
}
|
24
|
+
});
|
25
|
+
|
26
|
+
$(document).on( 'cycle-slide-removed', function( e, opts, index, slideRemoved ) {
|
27
|
+
if ( opts.pager ) {
|
28
|
+
var pagers = opts.API.getComponent( 'pager' );
|
29
|
+
pagers.each(function() {
|
30
|
+
var pager = $(this);
|
31
|
+
$( pager.children()[index] ).remove();
|
32
|
+
});
|
33
|
+
}
|
34
|
+
});
|
35
|
+
|
36
|
+
$(document).on( 'cycle-update-view', function( e, opts, slideOpts ) {
|
37
|
+
var pagers;
|
38
|
+
|
39
|
+
if ( opts.pager ) {
|
40
|
+
pagers = opts.API.getComponent( 'pager' );
|
41
|
+
pagers.each(function() {
|
42
|
+
$(this).children().removeClass( opts.pagerActiveClass )
|
43
|
+
.eq( opts.currSlide ).addClass( opts.pagerActiveClass );
|
44
|
+
});
|
45
|
+
}
|
46
|
+
});
|
47
|
+
|
48
|
+
$(document).on( 'cycle-destroyed', function( e, opts ) {
|
49
|
+
var pager = opts.API.getComponent( 'pager' );
|
50
|
+
|
51
|
+
if ( pager ) {
|
52
|
+
pager.children().off( opts.pagerEvent ); // #202
|
53
|
+
if ( opts.pagerTemplate )
|
54
|
+
pager.empty();
|
55
|
+
}
|
56
|
+
});
|
57
|
+
|
58
|
+
function buildPagerLink( opts, slideOpts, slide ) {
|
59
|
+
var pagerLink;
|
60
|
+
var pagers = opts.API.getComponent( 'pager' );
|
61
|
+
pagers.each(function() {
|
62
|
+
var pager = $(this);
|
63
|
+
if ( slideOpts.pagerTemplate ) {
|
64
|
+
var markup = opts.API.tmpl( slideOpts.pagerTemplate, slideOpts, opts, slide[0] );
|
65
|
+
pagerLink = $( markup ).appendTo( pager );
|
66
|
+
}
|
67
|
+
else {
|
68
|
+
pagerLink = pager.children().eq( opts.slideCount - 1 );
|
69
|
+
}
|
70
|
+
pagerLink.on( opts.pagerEvent, function(e) {
|
71
|
+
e.preventDefault();
|
72
|
+
opts.API.page( pager, e.currentTarget);
|
73
|
+
});
|
74
|
+
});
|
75
|
+
}
|
76
|
+
|
77
|
+
function page( pager, target ) {
|
78
|
+
/*jshint validthis:true */
|
79
|
+
var opts = this.opts();
|
80
|
+
if ( opts.busy && ! opts.manualTrump )
|
81
|
+
return;
|
82
|
+
|
83
|
+
var index = pager.children().index( target );
|
84
|
+
var nextSlide = index;
|
85
|
+
var fwd = opts.currSlide < nextSlide;
|
86
|
+
if (opts.currSlide == nextSlide) {
|
87
|
+
return; // no op, clicked pager for the currently displayed slide
|
88
|
+
}
|
89
|
+
opts.nextSlide = nextSlide;
|
90
|
+
opts.API.prepareTx( true, fwd );
|
91
|
+
opts.API.trigger('cycle-pager-activated', [opts, pager, target ]);
|
92
|
+
}
|
93
|
+
|
94
|
+
})(jQuery);
|
95
|
+
|
@@ -0,0 +1,67 @@
|
|
1
|
+
//= require jquery.cycle2.core
|
2
|
+
|
3
|
+
/*! prevnext plugin for Cycle2; version: 20130307 */
|
4
|
+
(function($) {
|
5
|
+
"use strict";
|
6
|
+
|
7
|
+
$.extend($.fn.cycle.defaults, {
|
8
|
+
next: '> .cycle-next',
|
9
|
+
nextEvent: 'click.cycle',
|
10
|
+
disabledClass: 'disabled',
|
11
|
+
prev: '> .cycle-prev',
|
12
|
+
prevEvent: 'click.cycle',
|
13
|
+
swipe: false
|
14
|
+
});
|
15
|
+
|
16
|
+
$(document).on( 'cycle-initialized', function( e, opts ) {
|
17
|
+
opts.API.getComponent( 'next' ).on( opts.nextEvent, function(e) {
|
18
|
+
e.preventDefault();
|
19
|
+
opts.API.next();
|
20
|
+
});
|
21
|
+
|
22
|
+
opts.API.getComponent( 'prev' ).on( opts.prevEvent, function(e) {
|
23
|
+
e.preventDefault();
|
24
|
+
opts.API.prev();
|
25
|
+
});
|
26
|
+
|
27
|
+
if ( opts.swipe ) {
|
28
|
+
var nextEvent = opts.swipeVert ? 'swipeUp.cycle' : 'swipeLeft.cycle swipeleft.cycle';
|
29
|
+
var prevEvent = opts.swipeVert ? 'swipeDown.cycle' : 'swipeRight.cycle swiperight.cycle';
|
30
|
+
opts.container.on( nextEvent, function(e) {
|
31
|
+
opts.API.next();
|
32
|
+
});
|
33
|
+
opts.container.on( prevEvent, function() {
|
34
|
+
opts.API.prev();
|
35
|
+
});
|
36
|
+
}
|
37
|
+
});
|
38
|
+
|
39
|
+
$(document).on( 'cycle-update-view', function( e, opts, slideOpts, currSlide ) {
|
40
|
+
if ( opts.allowWrap )
|
41
|
+
return;
|
42
|
+
|
43
|
+
var cls = opts.disabledClass;
|
44
|
+
var next = opts.API.getComponent( 'next' );
|
45
|
+
var prev = opts.API.getComponent( 'prev' );
|
46
|
+
var prevBoundry = opts._prevBoundry || 0;
|
47
|
+
var nextBoundry = opts._nextBoundry || opts.slideCount - 1;
|
48
|
+
|
49
|
+
if ( opts.currSlide == nextBoundry )
|
50
|
+
next.addClass( cls ).prop( 'disabled', true );
|
51
|
+
else
|
52
|
+
next.removeClass( cls ).prop( 'disabled', false );
|
53
|
+
|
54
|
+
if ( opts.currSlide === prevBoundry )
|
55
|
+
prev.addClass( cls ).prop( 'disabled', true );
|
56
|
+
else
|
57
|
+
prev.removeClass( cls ).prop( 'disabled', false );
|
58
|
+
});
|
59
|
+
|
60
|
+
|
61
|
+
$(document).on( 'cycle-destroyed', function( e, opts ) {
|
62
|
+
opts.API.getComponent( 'prev' ).off( opts.nextEvent );
|
63
|
+
opts.API.getComponent( 'next' ).off( opts.prevEvent );
|
64
|
+
opts.container.off( 'swipeleft.cycle swiperight.cycle swipeLeft.cycle swipeRight.cycle swipeUp.cycle swipeDown.cycle' );
|
65
|
+
});
|
66
|
+
|
67
|
+
})(jQuery);
|
@@ -0,0 +1,133 @@
|
|
1
|
+
//= require jquery.cycle2.core
|
2
|
+
|
3
|
+
/*! progressive loader plugin for Cycle2; version: 20130315 */
|
4
|
+
(function($) {
|
5
|
+
"use strict";
|
6
|
+
|
7
|
+
$.extend($.fn.cycle.defaults, {
|
8
|
+
progressive: false
|
9
|
+
});
|
10
|
+
|
11
|
+
$(document).on( 'cycle-pre-initialize', function( e, opts ) {
|
12
|
+
if ( !opts.progressive )
|
13
|
+
return;
|
14
|
+
|
15
|
+
var API = opts.API;
|
16
|
+
var nextFn = API.next;
|
17
|
+
var prevFn = API.prev;
|
18
|
+
var prepareTxFn = API.prepareTx;
|
19
|
+
var type = $.type( opts.progressive );
|
20
|
+
var slides, scriptEl;
|
21
|
+
|
22
|
+
if ( type == 'array' ) {
|
23
|
+
slides = opts.progressive;
|
24
|
+
}
|
25
|
+
else if ($.isFunction( opts.progressive ) ) {
|
26
|
+
slides = opts.progressive( opts );
|
27
|
+
}
|
28
|
+
else if ( type == 'string' ) {
|
29
|
+
scriptEl = $( opts.progressive );
|
30
|
+
slides = $.trim( scriptEl.html() );
|
31
|
+
if ( !slides )
|
32
|
+
return;
|
33
|
+
// is it json array?
|
34
|
+
if ( /^(\[)/.test( slides ) ) {
|
35
|
+
try {
|
36
|
+
slides = $.parseJSON( slides );
|
37
|
+
}
|
38
|
+
catch(err) {
|
39
|
+
API.log( 'error parsing progressive slides', err );
|
40
|
+
return;
|
41
|
+
}
|
42
|
+
}
|
43
|
+
else {
|
44
|
+
// plain text, split on delimeter
|
45
|
+
slides = slides.split( new RegExp( scriptEl.data('cycle-split') || '\n') );
|
46
|
+
|
47
|
+
// #95; look for empty slide
|
48
|
+
if ( ! slides[ slides.length - 1 ] )
|
49
|
+
slides.pop();
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
if ( prepareTxFn ) {
|
56
|
+
API.prepareTx = function( manual, fwd ) {
|
57
|
+
var index, slide;
|
58
|
+
|
59
|
+
if ( manual || slides.length === 0 ) {
|
60
|
+
prepareTxFn.apply( opts.API, [ manual, fwd ] );
|
61
|
+
return;
|
62
|
+
}
|
63
|
+
|
64
|
+
if ( fwd && opts.currSlide == ( opts.slideCount-1) ) {
|
65
|
+
slide = slides[ 0 ];
|
66
|
+
slides = slides.slice( 1 );
|
67
|
+
opts.container.one('cycle-slide-added', function(e, opts ) {
|
68
|
+
setTimeout(function() {
|
69
|
+
opts.API.advanceSlide( 1 );
|
70
|
+
},50);
|
71
|
+
});
|
72
|
+
opts.API.add( slide );
|
73
|
+
}
|
74
|
+
else if ( !fwd && opts.currSlide === 0 ) {
|
75
|
+
index = slides.length-1;
|
76
|
+
slide = slides[ index ];
|
77
|
+
slides = slides.slice( 0, index );
|
78
|
+
opts.container.one('cycle-slide-added', function(e, opts ) {
|
79
|
+
setTimeout(function() {
|
80
|
+
opts.currSlide = 1;
|
81
|
+
opts.API.advanceSlide( -1 );
|
82
|
+
},50);
|
83
|
+
});
|
84
|
+
opts.API.add( slide, true );
|
85
|
+
}
|
86
|
+
else {
|
87
|
+
prepareTxFn.apply( opts.API, [ manual, fwd ] );
|
88
|
+
}
|
89
|
+
};
|
90
|
+
}
|
91
|
+
|
92
|
+
if ( nextFn ) {
|
93
|
+
API.next = function() {
|
94
|
+
var opts = this.opts();
|
95
|
+
if ( slides.length && opts.currSlide == ( opts.slideCount - 1 ) ) {
|
96
|
+
var slide = slides[ 0 ];
|
97
|
+
slides = slides.slice( 1 );
|
98
|
+
opts.container.one('cycle-slide-added', function(e, opts ) {
|
99
|
+
nextFn.apply( opts.API );
|
100
|
+
opts.container.removeClass('cycle-loading');
|
101
|
+
});
|
102
|
+
opts.container.addClass('cycle-loading');
|
103
|
+
opts.API.add( slide );
|
104
|
+
}
|
105
|
+
else {
|
106
|
+
nextFn.apply( opts.API );
|
107
|
+
}
|
108
|
+
};
|
109
|
+
}
|
110
|
+
|
111
|
+
if ( prevFn ) {
|
112
|
+
API.prev = function() {
|
113
|
+
var opts = this.opts();
|
114
|
+
if ( slides.length && opts.currSlide === 0 ) {
|
115
|
+
var index = slides.length-1;
|
116
|
+
var slide = slides[ index ];
|
117
|
+
slides = slides.slice( 0, index );
|
118
|
+
opts.container.one('cycle-slide-added', function(e, opts ) {
|
119
|
+
opts.currSlide = 1;
|
120
|
+
opts.API.advanceSlide( -1 );
|
121
|
+
opts.container.removeClass('cycle-loading');
|
122
|
+
});
|
123
|
+
opts.container.addClass('cycle-loading');
|
124
|
+
opts.API.add( slide, true );
|
125
|
+
}
|
126
|
+
else {
|
127
|
+
prevFn.apply( opts.API );
|
128
|
+
}
|
129
|
+
};
|
130
|
+
}
|
131
|
+
});
|
132
|
+
|
133
|
+
})(jQuery);
|