Skip to content

Commit 3b7a9f7

Browse files
author
Jeff Harrell
committed
Updating project to use build task
1 parent 28f7ff9 commit 3b7a9f7

9 files changed

Lines changed: 70 additions & 81 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
node_modules
12
.DS_Store
3+
*.log

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "lib/MiniCart"]
22
path = lib/MiniCart
3-
url = git://github.com/jeffharrell/MiniCart.git
3+
url = git://github.com/jeffharrell/MiniCart.git

.jshintrc

Lines changed: 1 addition & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,144 +1,68 @@
11
{
2-
// Whether the scan should stop on first error.
32
"passfail": false,
4-
// Maximum errors before stopping.
53
"maxerr": 100,
64

75

8-
// Predefined globals
9-
10-
// Whether the standard browser globals should be predefined.
116
"browser": true,
12-
// Whether the Node.js environment globals should be predefined.
137
"node": false,
14-
// Whether the Rhino environment globals should be predefined.
158
"rhino": false,
16-
// Whether CouchDB globals should be predefined.
179
"couch": false,
18-
// Whether the Windows Scripting Host environment globals should be predefined.
1910
"wsh": false,
2011

21-
// Whether jQuery globals should be predefined.
2212
"jquery": false,
23-
// Whether Prototype and Scriptaculous globals should be predefined.
2413
"prototypejs": false,
25-
// Whether MooTools globals should be predefined.
2614
"mootools": false,
27-
// Whether Dojo Toolkit globals should be predefined.
2815
"dojo": false,
2916

30-
// Custom predefined globals.
3117
"predef": [],
3218

33-
// Development
34-
35-
// Whether debugger statements should be allowed.
3619
"debug": false,
37-
// Whether logging globals should be predefined (console, alert, etc.).
3820
"devel": false,
3921

40-
41-
// ECMAScript 5
42-
43-
// Whether ES5 syntax should be allowed.
4422
"es5": true,
45-
// Whether the "use strict"; pragma should be required.
4623
"strict": true,
47-
// Whether global "use strict"; should be allowed (also enables strict).
4824
"globalstrict": false,
4925

50-
51-
// The Good Parts
52-
53-
// Whether automatic semicolon insertion should be allowed.
5426
"asi": false,
55-
// Whether line breaks should not be checked, e.g. `return [\n] x`.
5627
"laxbreak": false,
57-
// Whether bitwise operators (&, |, ^, etc.) should be forbidden.
5828
"bitwise": false,
59-
// Whether assignments inside `if`, `for` and `while` should be allowed. Usually
60-
// conditions and loops are for comparison, not assignments.
6129
"boss": true,
62-
// Whether curly braces around all blocks should be required.
6330
"curly": true,
64-
// Whether `===` and `!==` should be required (instead of `==` and `!=`).
6531
"eqeqeq": true,
66-
// Whether `== null` comparisons should be allowed, even if `eqeqeq` is `true`.
6732
"eqnull": false,
68-
// Whether `eval` should be allowed.
6933
"evil": false,
70-
// Whether ExpressionStatement should be allowed as Programs.
7134
"expr": true,
72-
// Whether `for in` loops must filter with `hasOwnPrototype`.
7335
"forin": false,
74-
// Whether immediate invocations must be wrapped in parens, e.g.
75-
// `( function(){}() );`.
7636
"immed": true,
77-
// Whether use before define should be forbidden.
7837
"latedef": false,
79-
// Whether functions should be allowed to be defined within loops.
8038
"loopfunc": false,
81-
// Whether arguments.caller and arguments.callee should be forbidden.
8239
"noarg": false,
83-
// Whether `.` should be forbidden in regexp literals.
8440
"regexp": false,
85-
// Whether unescaped first/last dash (-) inside brackets in regexps should be allowed.
8641
"regexdash": false,
87-
// Whether script-targeted URLs should be allowed.
8842
"scripturl": false,
89-
// Whether variable shadowing should be allowed.
9043
"shadow": false,
91-
// Whether `new function () { ... };` and `new Object;` should be allowed.
9244
"supernew": false,
93-
// Whether variables must be declared before used.
9445
"undef": true,
95-
// Whether `this` inside a non-constructor function should be allowed.
9646
"validthis": false,
97-
// Whether smarttabs should be allowed
98-
// (http://www.emacswiki.org/emacs/SmartTabs).
9947
"smarttabs": true,
100-
// Whether the `__proto__` property should be allowed.
10148
"proto": false,
102-
// Whether one-case switch statements should be allowed.
10349
"onecase": false,
104-
// Whether non-standard (but widely adopted) globals should be predefined.
10550
"nonstandard": false,
106-
// Allow multiline strings.
10751
"multistr": false,
108-
// Whether line breaks should not be checked around commas.
10952
"laxcomma": false,
110-
// Whether semicolons may be ommitted for the trailing statements inside of a
111-
// one-line blocks.
11253
"lastsemic": false,
113-
// Whether the `__iterator__` property should be allowed.
11454
"iterator": false,
115-
// Whether only function scope should be used for scope tests.
11655
"funcscope": false,
117-
// Whether es.next specific syntax should be allowed.
11856
"esnext": false,
11957

120-
121-
// Style preferences
122-
123-
// Whether constructor names must be capitalized.
12458
"newcap": false,
125-
// Whether empty blocks should be forbidden.
12659
"noempty": false,
127-
// Whether using `new` for side-effects should be forbidden.
12860
"nonew": false,
129-
// Whether names should be checked for leading or trailing underscores
130-
// (object._attribute would be forbidden).
13161
"nomen": false,
132-
// Whether only one var statement per function should be allowed.
13362
"onevar": false,
134-
// Whether increment and decrement (`++` and `--`) should be forbidden.
13563
"plusplus": false,
136-
// Whether all forms of subscript notation are allowed.
13764
"sub": false,
138-
// Whether trailing whitespace rules apply.
13965
"trailing": true,
140-
// Whether strict whitespace rules apply.
141-
"white": false,
142-
// Specify indentation.
66+
"white": true,
14367
"indent": 4
14468
}

dist/paypal-button-minicart.min.js

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/paypal-button.min.js

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

grunt.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
var grunt = require('grunt'),
2+
fs = require('fs'),
3+
jshintOptions = JSON.parse(fs.readFileSync('./.jshintrc'));
4+
5+
6+
module.exports = function (grunt) {
7+
8+
// Project configuration.
9+
grunt.initConfig({
10+
pkg: '<json:package.json>',
11+
meta: {
12+
banner: "/*!\n * <%= pkg.name %>\n * <%= pkg.description %>\n * @version <%= pkg.version %> - <%= grunt.template.today('yyyy-mm-dd') %>\n * @author <%= pkg.author.name %> <<%= pkg.author.url %>>\n */"
13+
},
14+
lint: {
15+
all: [ 'src/*.js', 'test/*.js' ]
16+
},
17+
jshint: {
18+
options: jshintOptions
19+
},
20+
min: {
21+
dist: {
22+
src: [ '<banner:meta.banner>', 'src/paypal-button.js' ],
23+
dest: 'dist/paypal-button.min.js'
24+
},
25+
bundled: {
26+
src: [ '<banner:meta.banner>', 'lib/MiniCart/minicart.js', 'src/paypal.button.js' ],
27+
dest: 'dist/paypal-button-minicart.min.js'
28+
}
29+
}
30+
});
31+
32+
33+
// Default task.
34+
grunt.registerTask('default', 'lint min');
35+
36+
};

package.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "PayPalJSButtons",
3+
"description": "JavaScript integration for PayPal's payment buttons",
4+
"version": "1.0.0",
5+
"author": {
6+
"name": "Jeff Harrell",
7+
"url": "https://github.com/jeffharrell/"
8+
},
9+
"dependencies": {},
10+
"devDependencies": {
11+
"grunt": "*"
12+
}
13+
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ PAYPAL.apps = PAYPAL.apps || {};
2020
buttonUrls = {
2121
buynow: '//www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif',
2222
cart: '//www.paypalobjects.com/en_US/i/btn/btn_cart_LG.gif',
23-
default: '//www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif'
23+
basic: '//www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif'
2424
};
2525

2626

@@ -106,8 +106,8 @@ PAYPAL.apps = PAYPAL.apps || {};
106106
* @return {String}
107107
*/
108108
function getButtonUrl(type) {
109-
return buttonUrls[type] || buttonUrls.default;
110-
}
109+
return buttonUrls[type] || buttonUrls.basic;
110+
}
111111

112112

113113
/**

0 commit comments

Comments
 (0)