Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 34 additions & 34 deletions build/jquery.cycle2.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@

var version = '2.1.5';

$.fn.cycle = function( options ) {
$.fn.cycle2 = function( options ) {
// fix mistakes with the ready state
var o;
if ( this.length === 0 && !$.isReady ) {
o = { s: this.selector, c: this.context };
$.fn.cycle.log('requeuing slideshow (dom not ready)');
$.fn.cycle2.log('requeuing slideshow (dom not ready)');
$(function() {
$( o.s, o.c ).cycle(options);
$( o.s, o.c ).cycle2(options);
});
return this;
}

return this.each(function() {
var data, opts, shortName, val;
var container = $(this);
var log = $.fn.cycle.log;
var log = $.fn.cycle2.log;

if ( container.data('cycle.opts') )
return; // already initialized
Expand All @@ -48,14 +48,14 @@ $.fn.cycle = function( options ) {
}
}

opts = $.extend( {}, $.fn.cycle.defaults, data, options || {});
opts = $.extend( {}, $.fn.cycle2.defaults, data, options || {});

opts.timeoutId = 0;
opts.paused = opts.paused || false; // #57
opts.container = container;
opts._maxZ = opts.maxZ;

opts.API = $.extend ( { _container: container }, $.fn.cycle.API );
opts.API = $.extend ( { _container: container }, $.fn.cycle2.API );
opts.API.log = log;
opts.API.trigger = function( eventName, args ) {
opts.container.trigger( eventName, args );
Expand All @@ -76,7 +76,7 @@ $.fn.cycle = function( options ) {
});
};

$.fn.cycle.API = {
$.fn.cycle2.API = {
opts: function() {
return this._container.data( 'cycle.opts' );
},
Expand All @@ -99,7 +99,7 @@ $.fn.cycle.API = {
preInitSlideshow: function() {
var opts = this.opts();
opts.API.trigger('cycle-pre-initialize', [ opts ]);
var tx = $.fn.cycle.transitions[opts.fx];
var tx = $.fn.cycle2.transitions[opts.fx];
if (tx && $.isFunction(tx.preInit))
tx.preInit( opts );
opts._preInitialized = true;
Expand All @@ -108,7 +108,7 @@ $.fn.cycle.API = {
postInitSlideshow: function() {
var opts = this.opts();
opts.API.trigger('cycle-post-initialize', [ opts ]);
var tx = $.fn.cycle.transitions[opts.fx];
var tx = $.fn.cycle2.transitions[opts.fx];
if (tx && $.isFunction(tx.postInit))
tx.postInit( opts );
},
Expand Down Expand Up @@ -287,18 +287,18 @@ $.fn.cycle.API = {
var tx;

if ( opts._tempFx )
tx = $.fn.cycle.transitions[opts._tempFx];
tx = $.fn.cycle2.transitions[opts._tempFx];
else if ( manual && opts.manualFx )
tx = $.fn.cycle.transitions[opts.manualFx];
tx = $.fn.cycle2.transitions[opts.manualFx];

if ( !tx )
tx = $.fn.cycle.transitions[opts.fx];
tx = $.fn.cycle2.transitions[opts.fx];

opts._tempFx = null;
this.opts()._tempFx = null;

if (!tx) {
tx = $.fn.cycle.transitions.fade;
tx = $.fn.cycle2.transitions.fade;
opts.API.log('Transition "' + opts.fx + '" not found. Using fade.');
}
return tx;
Expand Down Expand Up @@ -476,7 +476,7 @@ $.fn.cycle.API = {
}
}

slideOpts = $.extend( {}, $.fn.cycle.defaults, opts, slideOpts );
slideOpts = $.extend( {}, $.fn.cycle2.defaults, opts, slideOpts );
slideOpts.slideNum = opts.slideCount;

try {
Expand Down Expand Up @@ -602,13 +602,13 @@ $.fn.cycle.API = {
}; // API

// default logger
$.fn.cycle.log = function log() {
$.fn.cycle2.log = function log() {
/*global console:true */
if (window.console && console.log)
console.log('[cycle2] ' + Array.prototype.join.call(arguments, ' ') );
};

$.fn.cycle.version = function() { return 'Cycle2: ' + version; };
$.fn.cycle2.version = function() { return 'Cycle2: ' + version; };

// helper functions

Expand All @@ -617,7 +617,7 @@ function lowerCase(s) {
}

// expose transition object
$.fn.cycle.transitions = {
$.fn.cycle2.transitions = {
custom: {
},
none: {
Expand Down Expand Up @@ -656,7 +656,7 @@ $.fn.cycle.transitions = {
};

// @see: http://jquery.malsup.com/cycle2/api
$.fn.cycle.defaults = {
$.fn.cycle2.defaults = {
allowWrap: true,
autoSelector: '.cycle-slideshow[data-cycle-auto-init!=false]',
delay: 0,
Expand All @@ -683,7 +683,7 @@ $.fn.cycle.defaults = {

// automatically find and run slideshows
$(document).ready(function() {
$( $.fn.cycle.defaults.autoSelector ).cycle();
$( $.fn.cycle2.defaults.autoSelector ).cycle2();
});

})(jQuery);
Expand All @@ -692,7 +692,7 @@ $(document).ready(function() {
(function($) {
"use strict";

$.extend($.fn.cycle.defaults, {
$.extend($.fn.cycle2.defaults, {
autoHeight: 0, // setting this option to false disables autoHeight logic
autoHeightSpeed: 250,
autoHeightEasing: null
Expand Down Expand Up @@ -824,7 +824,7 @@ function onDestroy( e, opts ) {
(function($) {
"use strict";

$.extend($.fn.cycle.defaults, {
$.extend($.fn.cycle2.defaults, {
caption: '> .cycle-caption',
captionTemplate: '{{slideNum}} / {{slideCount}}',
overlay: '> .cycle-overlay',
Expand Down Expand Up @@ -867,14 +867,14 @@ $(document).on( 'cycle-destroyed', function( e, opts ) {
(function($) {
"use strict";

var c2 = $.fn.cycle;
var c2 = $.fn.cycle2;

$.fn.cycle = function( options ) {
$.fn.cycle2 = function( options ) {
var cmd, cmdFn, opts;
var args = $.makeArray( arguments );

if ( $.type( options ) == 'number' ) {
return this.cycle( 'goto', options );
return this.cycle2( 'goto', options );
}

if ( $.type( options ) == 'string' ) {
Expand Down Expand Up @@ -907,7 +907,7 @@ $.fn.cycle = function( options ) {
};

// copy props
$.extend( $.fn.cycle, c2 );
$.extend( $.fn.cycle2, c2 );

$.extend( c2.API, {
next: function() {
Expand Down Expand Up @@ -1000,7 +1000,7 @@ $.extend( c2.API, {
reinit: function() {
var opts = this.opts();
opts.API.destroy();
opts.container.cycle();
opts.container.cycle2();
},

remove: function( index ) {
Expand Down Expand Up @@ -1042,7 +1042,7 @@ $(document).on('click.cycle', '[data-cycle-cmd]', function(e) {
var el = $(this);
var command = el.data('cycle-cmd');
var context = el.data('cycle-context') || '.cycle-slideshow';
$(context).cycle(command, el.data('cycle-arg'));
$(context).cycle2(command, el.data('cycle-arg'));
});


Expand Down Expand Up @@ -1105,7 +1105,7 @@ function onHashChange( opts, setStartingSlide ) {
(function($) {
"use strict";

$.extend($.fn.cycle.defaults, {
$.extend($.fn.cycle2.defaults, {
loader: false
});

Expand Down Expand Up @@ -1211,7 +1211,7 @@ $(document).on( 'cycle-bootstrap', function( e, opts ) {
(function($) {
"use strict";

$.extend($.fn.cycle.defaults, {
$.extend($.fn.cycle2.defaults, {
pager: '> .cycle-pager',
pagerActiveClass: 'cycle-pager-active',
pagerEvent: 'click.cycle',
Expand Down Expand Up @@ -1307,7 +1307,7 @@ function page( pager, target ) {
(function($) {
"use strict";

$.extend($.fn.cycle.defaults, {
$.extend($.fn.cycle2.defaults, {
next: '> .cycle-next',
nextEvent: 'click.cycle',
disabledClass: 'disabled',
Expand Down Expand Up @@ -1375,7 +1375,7 @@ $(document).on( 'cycle-destroyed', function( e, opts ) {
(function($) {
"use strict";

$.extend($.fn.cycle.defaults, {
$.extend($.fn.cycle2.defaults, {
progressive: false
});

Expand Down Expand Up @@ -1507,13 +1507,13 @@ $(document).on( 'cycle-pre-initialize', function( e, opts ) {
(function($) {
"use strict";

$.extend($.fn.cycle.defaults, {
$.extend($.fn.cycle2.defaults, {
tmplRegex: '{{((.)?.*?)}}'
});

$.extend($.fn.cycle.API, {
$.extend($.fn.cycle2.API, {
tmpl: function( str, opts /*, ... */) {
var regex = new RegExp( opts.tmplRegex || $.fn.cycle.defaults.tmplRegex, 'g' );
var regex = new RegExp( opts.tmplRegex || $.fn.cycle2.defaults.tmplRegex, 'g' );
var args = $.makeArray( arguments );
args.shift();
return str.replace(regex, function(_, str) {
Expand Down
Loading