diff --git a/Gruntfile.js b/Gruntfile.js index c55ce2e..be629db 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -4,6 +4,7 @@ module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), + fileName: grunt.file.readJSON('package.json')['name'].replace(/-/g, '.'), banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' + '<%= grunt.template.today("yyyy-mm-dd") %>\n' + '<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' + @@ -13,7 +14,7 @@ module.exports = function(grunt) { options: { jshintrc: true }, - build: ['<%= pkg.name %>.js'] + build: ['<%= fileName %>.js'] }, concat: { options: { @@ -23,8 +24,8 @@ module.exports = function(grunt) { } }, build: { - src: ['<%= pkg.name %>.js'], - dest: '<%= pkg.name %>.js' + src: ['<%= fileName %>.js'], + dest: '<%= fileName %>.js' } }, uglify: { @@ -33,8 +34,8 @@ module.exports = function(grunt) { mangle: true }, build: { - src: '<%= pkg.name %>.js', - dest: '<%= pkg.name %>.min.js' + src: '<%= fileName %>.js', + dest: '<%= fileName %>.min.js' } }, bump: { diff --git a/README.md b/README.md index fecf12c..d2355ab 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -rl-velocity +velocity-ui-angular =========== Velocity UI Pack integration for AngularJS. Combines the power of ngAnimate with the performance and simplicity of Velocity's UI Pack! @@ -15,13 +15,13 @@ Velocity UI Pack integration for AngularJS. Combines the power of ngAnimate with * Install via bower: ``` shell -$ bower install rl-velocity --save +$ bower install velocity-ui-angular --save ``` -* Add the `rl.velocity` module to your application: +* Add the `velocity.ui` module to your application: ``` Javascript -angular.module('yourApp', ['rl.velocity', 'ngAnimate']); +angular.module('yourApp', ['velocity.ui', 'ngAnimate']); ``` @@ -36,18 +36,18 @@ angular.module('yourApp', ['rl.velocity', 'ngAnimate']); Durations can be set on an individual basis by using the `velocity-duration-400` class, where 400 is the animation duration in milliseconds. ## Setting Default Options -The following options can be configured via `rlVelocityConfig`: +The following options can be configured via `ngVelocityConfig`: ### duration Type: `String|Number` Default: `300` -To configure rl-velocity globally, set it via your applications `config` block: +To configure velocity-ui-angular globally, set it via your applications `config` block: ``` Javascript -angular.module('yourApp').config(function(rlVelocityConfig) { - rlVelocityConfig.duration = 1000; +angular.module('yourApp').config(function(ngVelocityConfig) { + ngVelocityConfig.duration = 1000; }); ``` diff --git a/bower.json b/bower.json index b52de4e..502cdd0 100644 --- a/bower.json +++ b/bower.json @@ -1,9 +1,9 @@ { - "name": "rl-velocity", + "name": "velocity-ui-angular", "version": "0.3.2", "author": "Ross Lavery ", - "description": "Velocity integration for AngularJS", - "main": "rl-velocity.min.js", + "description": "Velocity UI integration for AngularJS", + "main": "velocity.ui.angular.min.js", "keywords": [ "AngularJS", "angular", diff --git a/package.json b/package.json index 76c2023..588640c 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,11 @@ { - "name": "rl-velocity", + "name": "velocity-ui-angular", "version": "0.3.2", - "description": "Velocity integration for AngularJS", - "main": "rl-velocity.js", + "description": "Velocity UI integration for AngularJS", + "main": "velocity.ui.angular.min.js", "repository": { "type": "git", - "url": "git://github.com/rosslavery/rl-velocity.git" + "url": "git://github.com/rosslavery/velocity-ui-angular.git" }, "keywords": [ "AngularJS", @@ -19,9 +19,9 @@ "author": "Ross Lavery ", "license": "MIT", "bugs": { - "url": "https://github.com/rosslavery/rl-velocity/issues" + "url": "https://github.com/rosslavery/velocity-ui-angular/issues" }, - "homepage": "https://github.com/rosslavery/rl-velocity", + "homepage": "https://github.com/rosslavery/velocity-ui-angular", "devDependencies": { "grunt": "~0.4.5", "grunt-contrib-jshint": "~0.10.0", diff --git a/rl-velocity.js b/velocity.ui.angular.js similarity index 85% rename from rl-velocity.js rename to velocity.ui.angular.js index 9116b18..131e7fe 100644 --- a/rl-velocity.js +++ b/velocity.ui.angular.js @@ -1,5 +1,5 @@ -/*! rl-velocity - v0.3.2 - 2014-07-10 -* https://github.com/rosslavery/rl-velocity +/*! velocity-ui-angular - v0.3.2 - 2014-07-14 +* https://github.com/rosslavery/velocity-ui-angular * Copyright (c) 2014 Ross Lavery ; License: MIT */ (function(angular) { 'use strict'; @@ -9,13 +9,13 @@ throw new Error('Velocity UI Pack: Velocity must be loaded first. Aborting.'); } - Container.rlVelocity = angular.module('rl.velocity', ['ngAnimate']) + Container.ngVelocity = angular.module('velocity.ui', ['ngAnimate']) - .constant('rlVelocityConfig', { + .constant('ngVelocityConfig', { duration: 300 }) - .factory('VelocityUtils', ['rlVelocityConfig', function(rlVelocityConfig) { + .factory('VelocityUtils', ['ngVelocityConfig', function(ngVelocityConfig) { return { @@ -56,7 +56,7 @@ return function($el, done) { var parsedOptions = self._parseClassList($el[0].classList); - var options = angular.extend(rlVelocityConfig, parsedOptions); + var options = angular.extend(ngVelocityConfig, parsedOptions); Container.Velocity.animate($el, animation, options).then(done); }; @@ -67,7 +67,7 @@ return function ($el, className, done) { var parsedOptions = self._parseClassList($el[0].classList); - var options = angular.extend(rlVelocityConfig, parsedOptions); + var options = angular.extend(ngVelocityConfig, parsedOptions); if (className === 'ng-hide') { Container.Velocity.animate($el, animation, options).then(done); @@ -95,7 +95,7 @@ className = _getClassName(animationName); - Container.rlVelocity.animation(className, ['VelocityUtils', function(VelocityUtils) { + Container.ngVelocity.animation(className, ['VelocityUtils', function(VelocityUtils) { return VelocityUtils._createAngularAnimation(animationName); }]); diff --git a/rl-velocity.min.js b/velocity.ui.angular.min.js similarity index 81% rename from rl-velocity.min.js rename to velocity.ui.angular.min.js index 7289c9a..01161ee 100644 --- a/rl-velocity.min.js +++ b/velocity.ui.angular.min.js @@ -1,4 +1,4 @@ -/*! rl-velocity - v0.3.2 - 2014-07-10 -* https://github.com/rosslavery/rl-velocity +/*! velocity-ui-angular - v0.3.2 - 2014-07-14 +* https://github.com/rosslavery/velocity-ui-angular * Copyright (c) 2014 Ross Lavery ; License: MIT */ -!function(a){"use strict";function b(a){return".velocity-"+a.replace(".","-")}var c=window.jQuery||window.Zepto||window;if(!c.Velocity||!c.Velocity.Utilities||!c.Velocity.RegisterUI)throw new Error("Velocity UI Pack: Velocity must be loaded first. Aborting.");c.rlVelocity=a.module("rl.velocity",["ngAnimate"]).constant("rlVelocityConfig",{duration:300}).factory("VelocityUtils",["rlVelocityConfig",function(b){return{_parseClassList:function(b){var c={};return a.forEach(b,function(a){a.indexOf("velocity-duration-")>-1&&(c.duration=a.split("velocity-duration-")[1])}),c},_createAngularAnimation:function(a){var b=this,c=a.replace("In","Out");return c.indexOf("Down")>-1?c=c.replace("Down","Up"):c.indexOf("Up")>-1&&(c=c.replace("Up","Down")),{enter:b._createVelocityAnimation(a),leave:b._createVelocityAnimation(c),move:b._createVelocityAnimation(a),beforeAddClass:b._createVelocityClassAnimation(c),removeClass:b._createVelocityClassAnimation(a)}},_createVelocityAnimation:function(d){var e=this;return function(f,g){var h=e._parseClassList(f[0].classList),i=a.extend(b,h);c.Velocity.animate(f,d,i).then(g)}},_createVelocityClassAnimation:function(d){var e=this;return function(f,g,h){var i=e._parseClassList(f[0].classList),j=a.extend(b,i);"ng-hide"===g?c.Velocity.animate(f,d,j).then(h):h()}}}}]);var d;a.forEach(c.Velocity.RegisterUI.packagedEffects,function(a,e){d=b(e),c.rlVelocity.animation(d,["VelocityUtils",function(a){return a._createAngularAnimation(e)}])})}(angular); \ No newline at end of file +!function(a){"use strict";function b(a){return".velocity-"+a.replace(".","-")}var c=window.jQuery||window.Zepto||window;if(!c.Velocity||!c.Velocity.Utilities||!c.Velocity.RegisterUI)throw new Error("Velocity UI Pack: Velocity must be loaded first. Aborting.");c.ngVelocity=a.module("velocity.ui",["ngAnimate"]).constant("ngVelocityConfig",{duration:300}).factory("VelocityUtils",["ngVelocityConfig",function(b){return{_parseClassList:function(b){var c={};return a.forEach(b,function(a){a.indexOf("velocity-duration-")>-1&&(c.duration=a.split("velocity-duration-")[1])}),c},_createAngularAnimation:function(a){var b=this,c=a.replace("In","Out");return c.indexOf("Down")>-1?c=c.replace("Down","Up"):c.indexOf("Up")>-1&&(c=c.replace("Up","Down")),{enter:b._createVelocityAnimation(a),leave:b._createVelocityAnimation(c),move:b._createVelocityAnimation(a),beforeAddClass:b._createVelocityClassAnimation(c),removeClass:b._createVelocityClassAnimation(a)}},_createVelocityAnimation:function(d){var e=this;return function(f,g){var h=e._parseClassList(f[0].classList),i=a.extend(b,h);c.Velocity.animate(f,d,i).then(g)}},_createVelocityClassAnimation:function(d){var e=this;return function(f,g,h){var i=e._parseClassList(f[0].classList),j=a.extend(b,i);"ng-hide"===g?c.Velocity.animate(f,d,j).then(h):h()}}}}]);var d;a.forEach(c.Velocity.RegisterUI.packagedEffects,function(a,e){d=b(e),c.ngVelocity.animation(d,["VelocityUtils",function(a){return a._createAngularAnimation(e)}])})}(angular); \ No newline at end of file