Skip to content
Merged
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
3 changes: 2 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
"unused": true,
"strict": true,
"trailing": true,
"smarttabs": true
"smarttabs": true,
"jquery": true
}
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<a name="1.1.4-0"></a>
<a name="1.1.5"></a>
### 1.1.5 (2014-05-27)


<a name="1.1.4"></a>
### 1.1.4-0 (2014-05-27)


Expand Down
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ module.exports = function (grunt) {
},
dist: {
options: {
jshintrc: 'src/.jshintrc'
jshintrc: '.jshintrc'
},
src: ['.tmp/{,*/}*.js']
}
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ A jQuery plugin to dynamically apply [Dan Eden's animate.css][animate.css] anima

[animate.css]: http://daneden.github.io/animate.css/

[![Code Climate](https://codeclimate.com/github/craigmdennis/animateCSS.png)](https://codeclimate.com/github/craigmdennis/animateCSS)

## Getting Started

### Bower
Expand Down
2 changes: 1 addition & 1 deletion animateCSS.jquery.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "animateCSS",
"title": "Animate CSS jQuery Plugin",
"description": "A jQuery plugin to dynamically apply animate.css animations with callbacks",
"version": "1.1.4",
"version": "1.1.5",
"homepage": "https://github.com/craigmdennis/animateCSS.git",
"author": {
"name": "Craig Dennis",
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "animateCSS",
"description": "A jQuery plugin to dynamically apply animate.css animations with callbacks",
"main": "dist/jquery.animatecss.js",
"version": "1.1.4",
"version": "1.1.5",
"dependencies": {
"animate.css": "~3.1.1"
},
Expand Down
20 changes: 10 additions & 10 deletions dist/jquery.animatecss.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! animateCSS - v1.1.3-1 - 2014-05-27
/*! animateCSS - v1.1.5 - 2014-05-27
* https://github.com/craigmdennis/animateCSS
* Copyright (c) 2014 Craig Dennis; Licensed MIT */

Expand All @@ -14,19 +14,19 @@
settings = {
effect: effect,
delay: 0,
animationClass: "animated",
animationClass: 'animated',
infinite: false,
callback: options,
debug: false
};
transitionEnd = "webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend";
transitionEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
settings = $.extend(settings, options);
init = function(element) {
return animate(element);
};
animate = function(element) {
if (settings.infinite === true) {
settings.animationClass += " infinite";
settings.animationClass += ' infinite';
}
return setTimeout(function() {
unhide(element);
Expand All @@ -35,24 +35,24 @@
}, settings.delay);
};
addClass = function(element) {
return element.addClass(settings.effect + " " + settings.animationClass + " ");
return element.addClass(settings.effect + ' ' + settings.animationClass + ' ');
};
unhide = function(element) {
if (element.css("visibility") === "hidden") {
element.css("visibility", "visible");
if (element.css('visibility') === 'hidden') {
element.css('visibility', 'visible');
}
if (element.is(":hidden")) {
if (element.is(':hidden')) {
return element.show();
}
};
removeClass = function(element) {
return element.removeClass(settings.effect + " " + settings.animationClass);
return element.removeClass(settings.effect + ' ' + settings.animationClass);
};
callback = function(element) {
if (settings.infinite === false) {
removeClass(element);
}
if (typeof settings.callback === "function") {
if (typeof settings.callback === 'function') {
return settings.callback.call(element);
}
};
Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.animatecss.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "animateCSS",
"version": "1.1.4",
"version": "1.1.5",
"description": "Animate CSS jQuery Plugin",
"keywords": [
"jquery-plugin",
Expand Down
16 changes: 0 additions & 16 deletions src/.jshintrc

This file was deleted.

16 changes: 8 additions & 8 deletions src/animatecss.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ $.fn.extend
settings =
effect: effect
delay: 0
animationClass: "animated",
animationClass: 'animated',
infinite: false
callback: options
debug: false

# Vendor prefixed transition callbacks
transitionEnd = "webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend"
transitionEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend'

# Merge default settings with options.
settings = $.extend settings, options
Expand All @@ -31,7 +31,7 @@ $.fn.extend
# Add the animation effect with classes
animate = ( element ) ->
if settings.infinite == true
settings.animationClass += " infinite"
settings.animationClass += ' infinite'

# Run a timer regardless of delay (as 0 will fire instantly anyway)
setTimeout ->
Expand All @@ -42,23 +42,23 @@ $.fn.extend

# Add the animation ad effect classes to kick everything off
addClass = ( element ) ->
element.addClass( settings.effect + " " + settings.animationClass + " ")
element.addClass( settings.effect + ' ' + settings.animationClass + ' ')

# Check if the element has been hidden to start with
unhide = ( element ) ->
element.css("visibility", "visible") if element.css( "visibility" ) == "hidden"
element.show() if element.is(":hidden")
element.css('visibility', 'visible') if element.css( 'visibility' ) == 'hidden'
element.show() if element.is(':hidden')

# Remove the animation classes the were applied
removeClass = ( element ) ->
element.removeClass( settings.effect + " " + settings.animationClass )
element.removeClass( settings.effect + ' ' + settings.animationClass )

callback = ( element ) ->
# Only remove the animation classes if `infinite` is false
removeClass( element ) if settings.infinite == false

# Check if the callback is a function
if typeof settings.callback == "function"
if typeof settings.callback == 'function'
# Execute the callback and return the origin element as `this`
settings.callback.call( element )

Expand Down