Permalink
Browse files

Updating project to use build task

  • Loading branch information...
1 parent 28f7ff9 commit 3b7a9f774d2a2af3283887538ca0f9bfd535c5b0 @jeffharrell jeffharrell committed Nov 7, 2012
View
@@ -1 +1,3 @@
+node_modules
.DS_Store
+*.log
View
@@ -1,3 +1,3 @@
[submodule "lib/MiniCart"]
path = lib/MiniCart
- url = git://github.com/jeffharrell/MiniCart.git
+ url = git://github.com/jeffharrell/MiniCart.git
View
@@ -1,144 +1,68 @@
{
- // Whether the scan should stop on first error.
"passfail": false,
- // Maximum errors before stopping.
"maxerr": 100,
- // Predefined globals
-
- // Whether the standard browser globals should be predefined.
"browser": true,
- // Whether the Node.js environment globals should be predefined.
"node": false,
- // Whether the Rhino environment globals should be predefined.
"rhino": false,
- // Whether CouchDB globals should be predefined.
"couch": false,
- // Whether the Windows Scripting Host environment globals should be predefined.
"wsh": false,
- // Whether jQuery globals should be predefined.
"jquery": false,
- // Whether Prototype and Scriptaculous globals should be predefined.
"prototypejs": false,
- // Whether MooTools globals should be predefined.
"mootools": false,
- // Whether Dojo Toolkit globals should be predefined.
"dojo": false,
- // Custom predefined globals.
"predef": [],
- // Development
-
- // Whether debugger statements should be allowed.
"debug": false,
- // Whether logging globals should be predefined (console, alert, etc.).
"devel": false,
-
- // ECMAScript 5
-
- // Whether ES5 syntax should be allowed.
"es5": true,
- // Whether the "use strict"; pragma should be required.
"strict": true,
- // Whether global "use strict"; should be allowed (also enables strict).
"globalstrict": false,
-
- // The Good Parts
-
- // Whether automatic semicolon insertion should be allowed.
"asi": false,
- // Whether line breaks should not be checked, e.g. `return [\n] x`.
"laxbreak": false,
- // Whether bitwise operators (&, |, ^, etc.) should be forbidden.
"bitwise": false,
- // Whether assignments inside `if`, `for` and `while` should be allowed. Usually
- // conditions and loops are for comparison, not assignments.
"boss": true,
- // Whether curly braces around all blocks should be required.
"curly": true,
- // Whether `===` and `!==` should be required (instead of `==` and `!=`).
"eqeqeq": true,
- // Whether `== null` comparisons should be allowed, even if `eqeqeq` is `true`.
"eqnull": false,
- // Whether `eval` should be allowed.
"evil": false,
- // Whether ExpressionStatement should be allowed as Programs.
"expr": true,
- // Whether `for in` loops must filter with `hasOwnPrototype`.
"forin": false,
- // Whether immediate invocations must be wrapped in parens, e.g.
- // `( function(){}() );`.
"immed": true,
- // Whether use before define should be forbidden.
"latedef": false,
- // Whether functions should be allowed to be defined within loops.
"loopfunc": false,
- // Whether arguments.caller and arguments.callee should be forbidden.
"noarg": false,
- // Whether `.` should be forbidden in regexp literals.
"regexp": false,
- // Whether unescaped first/last dash (-) inside brackets in regexps should be allowed.
"regexdash": false,
- // Whether script-targeted URLs should be allowed.
"scripturl": false,
- // Whether variable shadowing should be allowed.
"shadow": false,
- // Whether `new function () { ... };` and `new Object;` should be allowed.
"supernew": false,
- // Whether variables must be declared before used.
"undef": true,
- // Whether `this` inside a non-constructor function should be allowed.
"validthis": false,
- // Whether smarttabs should be allowed
- // (http://www.emacswiki.org/emacs/SmartTabs).
"smarttabs": true,
- // Whether the `__proto__` property should be allowed.
"proto": false,
- // Whether one-case switch statements should be allowed.
"onecase": false,
- // Whether non-standard (but widely adopted) globals should be predefined.
"nonstandard": false,
- // Allow multiline strings.
"multistr": false,
- // Whether line breaks should not be checked around commas.
"laxcomma": false,
- // Whether semicolons may be ommitted for the trailing statements inside of a
- // one-line blocks.
"lastsemic": false,
- // Whether the `__iterator__` property should be allowed.
"iterator": false,
- // Whether only function scope should be used for scope tests.
"funcscope": false,
- // Whether es.next specific syntax should be allowed.
"esnext": false,
-
- // Style preferences
-
- // Whether constructor names must be capitalized.
"newcap": false,
- // Whether empty blocks should be forbidden.
"noempty": false,
- // Whether using `new` for side-effects should be forbidden.
"nonew": false,
- // Whether names should be checked for leading or trailing underscores
- // (object._attribute would be forbidden).
"nomen": false,
- // Whether only one var statement per function should be allowed.
"onevar": false,
- // Whether increment and decrement (`++` and `--`) should be forbidden.
"plusplus": false,
- // Whether all forms of subscript notation are allowed.
"sub": false,
- // Whether trailing whitespace rules apply.
"trailing": true,
- // Whether strict whitespace rules apply.
- "white": false,
- // Specify indentation.
+ "white": true,
"indent": 4
}
Oops, something went wrong.
Oops, something went wrong.
View
@@ -0,0 +1,36 @@
+var grunt = require('grunt'),
+ fs = require('fs'),
+ jshintOptions = JSON.parse(fs.readFileSync('./.jshintrc'));
+
+
+module.exports = function (grunt) {
+
+ // Project configuration.
+ grunt.initConfig({
+ pkg: '<json:package.json>',
+ meta: {
+ 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 */"
+ },
+ lint: {
+ all: [ 'src/*.js', 'test/*.js' ]
+ },
+ jshint: {
+ options: jshintOptions
+ },
+ min: {
+ dist: {
+ src: [ '<banner:meta.banner>', 'src/paypal-button.js' ],
+ dest: 'dist/paypal-button.min.js'
+ },
+ bundled: {
+ src: [ '<banner:meta.banner>', 'lib/MiniCart/minicart.js', 'src/paypal.button.js' ],
+ dest: 'dist/paypal-button-minicart.min.js'
+ }
+ }
+ });
+
+
+ // Default task.
+ grunt.registerTask('default', 'lint min');
+
+};
View
@@ -0,0 +1,13 @@
+{
+ "name": "PayPalJSButtons",
+ "description": "JavaScript integration for PayPal's payment buttons",
+ "version": "1.0.0",
+ "author": {
+ "name": "Jeff Harrell",
+ "url": "https://github.com/jeffharrell/"
+ },
+ "dependencies": {},
+ "devDependencies": {
+ "grunt": "*"
+ }
+}
@@ -20,7 +20,7 @@ PAYPAL.apps = PAYPAL.apps || {};
buttonUrls = {
buynow: '//www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif',
cart: '//www.paypalobjects.com/en_US/i/btn/btn_cart_LG.gif',
- default: '//www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif'
+ basic: '//www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif'
};
@@ -106,8 +106,8 @@ PAYPAL.apps = PAYPAL.apps || {};
* @return {String}
*/
function getButtonUrl(type) {
- return buttonUrls[type] || buttonUrls.default;
- }
+ return buttonUrls[type] || buttonUrls.basic;
+ }
/**
File renamed without changes.

0 comments on commit 3b7a9f7

Please sign in to comment.