Skip to content

Commit

Permalink
* Fixed formatting.
Browse files Browse the repository at this point in the history
* Updated to work with angularjs 1.2.6
* Added watch and jsHint tasks to the grunt file.
* Corrected code to pass jsHint.
  • Loading branch information
cubicleWar committed Apr 17, 2014
1 parent 95133c1 commit 3fdd4a0
Show file tree
Hide file tree
Showing 15 changed files with 1,716 additions and 1,696 deletions.
109 changes: 66 additions & 43 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,46 +1,69 @@
module.exports = function(grunt) {

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
separator: ';'
},
dist: {
src: ['src/module.js',
'src/common.js',
'src/cards.js',
'src/format.js',
'src/validate.js',
'src/form.js'],
dest: 'lib/<%= pkg.name %>.js'
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
},
dist: {
files: {
'lib/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>']
}
}
},
connect: {
server: {
options: {
port: 8000,
base: '.',
keepalive: true
}
}
}
});

grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-connect');

grunt.registerTask('default', ['concat', 'uglify']);

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

files : {
src: [ 'src/module.js',
'src/common.js',
'src/cards.js',
'src/format.js',
'src/validate.js',
'src/form.js'],
},

jshint: {
all: {
src: '<%= files.src %>'
}
},

concat: {
dist: {
src: '<%= files.src %>',
dest: 'lib/<%= pkg.name %>.js'
}
},

uglify: {
options: {
preserveComments: false,
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
report: 'min',
compress: {
drop_console: true
}
},
dist: {
files: {
'lib/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>']
}
}
},

watch : {
js: {
files: '<%= files.src %>',
tasks: ['jshint', 'concat']
}
},

connect: {
server: {
options: {
port: 8000,
base: '.',
keepalive: true
}
}
}
});

grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');

grunt.registerTask('default', ['jshint', 'concat', 'uglify']);
};
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ All I did was port and combine these great libraries. Cheers!

## Usage

To use Angular Payments, add angularPayments as a dependency to your AngularJS module or app.
To use Angular Payments, add ngStripePayments as a dependency to your AngularJS module or app.

Angular Payments it self depends on 2 libraries:

Expand Down
12 changes: 6 additions & 6 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"name": "angular-payments",
"name": "ng-stripe-payments",
"version": "0.1.0",
"homepage": "https://github.com/laurihy/angular-payments",
"homepage": "https://github.com/cubicleWar/ng-stripe-payments",
"authors": [
"Lauri Hynynen <@laurihy>"
"Trevor Walker <@cubicleWar>"
],
"description": "Directive for formatting and validating credit card forms",
"description": "Directive for formatting and validating credit card forms, forked from laurihy/angular-payments",
"keywords": [
"stripe",
"stripe.js",
"stripejs",
"stripe-angular",
"stripeAngular",
"angular-payments",
"angularPayments"
"ng-stripe-payments",
"ngStripePayments"
],
"license": "MIT",
"ignore": [
Expand Down
6 changes: 3 additions & 3 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@

<script type="text/javascript" src="https://js.stripe.com/v2/"></script>

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.min.js"></script>

<script src="../lib/angular-payments.min.js"></script>
<script src="../lib/ng-stripe-payments.js"></script>

<script>


Stripe.setPublishableKey('fillMePlease')

angular.module('app', ['angularPayments'])
angular.module('app', ['ngStripePayments'])

MainController = function($scope){
$scope.handleStripe = function(status, response){
Expand Down
Loading

0 comments on commit 3fdd4a0

Please sign in to comment.