-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #148 from Gaya/module-based
Go object based instead of relying on constructors
- Loading branch information
Showing
24 changed files
with
1,011 additions
and
855 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
{ | ||
"esnext": true, | ||
"disallowSpacesInNamedFunctionExpression": { | ||
"beforeOpeningRoundBrace": true | ||
}, | ||
"disallowSpacesInFunctionExpression": { | ||
"beforeOpeningRoundBrace": true | ||
}, | ||
"disallowSpacesInAnonymousFunctionExpression": { | ||
"beforeOpeningRoundBrace": true | ||
}, | ||
"disallowSpacesInFunctionDeclaration": { | ||
"beforeOpeningRoundBrace": true | ||
}, | ||
"disallowEmptyBlocks": true, | ||
"disallowSpacesInCallExpression": true, | ||
"disallowSpacesInsideArrayBrackets": true, | ||
"disallowSpacesInsideParentheses": true, | ||
"disallowQuotedKeysInObjects": true, | ||
"disallowSpaceAfterObjectKeys": true, | ||
"disallowSpaceAfterPrefixUnaryOperators": true, | ||
"disallowSpaceBeforePostfixUnaryOperators": true, | ||
"disallowSpaceBeforeBinaryOperators": [ | ||
"," | ||
], | ||
"disallowMixedSpacesAndTabs": true, | ||
"disallowTrailingWhitespace": true, | ||
"requireTrailingComma": { "ignoreSingleLine": true }, | ||
"disallowSpaceBeforeComma": true, | ||
"requireSpaceAfterComma": true, | ||
"disallowYodaConditions": true, | ||
"disallowKeywords": [ "with" ], | ||
"disallowKeywordsOnNewLine": ["else"], | ||
"disallowMultipleLineBreaks": true, | ||
"disallowMultipleLineStrings": true, | ||
"disallowMultipleVarDecl": true, | ||
"disallowSpaceBeforeSemicolon": true, | ||
"requireSpaceBeforeBlockStatements": true, | ||
"requireParenthesesAroundIIFE": true, | ||
"requireSpacesInConditionalExpression": true, | ||
"requireBlocksOnNewline": 1, | ||
"requireCommaBeforeLineBreak": true, | ||
"requireSpaceBeforeBinaryOperators": true, | ||
"requireSpaceAfterBinaryOperators": true, | ||
"requireCamelCaseOrUpperCaseIdentifiers": true, | ||
"requireLineFeedAtFileEnd": true, | ||
"requireCapitalizedConstructors": true, | ||
"requireDotNotation": true, | ||
"requireSpacesInForStatement": true, | ||
"requireSpaceBetweenArguments": true, | ||
"requireCurlyBraces": [ | ||
"do" | ||
], | ||
"requireSpaceAfterKeywords": [ | ||
"if", | ||
"else", | ||
"for", | ||
"while", | ||
"do", | ||
"switch", | ||
"case", | ||
"return", | ||
"try", | ||
"catch", | ||
"typeof" | ||
], | ||
"requirePaddingNewLinesBeforeLineComments": { | ||
"allExcept": "firstAfterCurly" | ||
}, | ||
"requirePaddingNewLinesAfterBlocks": true, | ||
"requireSemicolons": true, | ||
"safeContextKeyword": "_this", | ||
"validateLineBreaks": "LF", | ||
"validateQuoteMarks": "'", | ||
"validateIndentation": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"bitwise" : true, | ||
"curly" : true, | ||
"eqeqeq" : true, | ||
"forin" : true, | ||
"immed" : true, | ||
"latedef" : "nofunc", | ||
"maxparams" : 4, | ||
"newcap" : false, | ||
"noarg" : true, | ||
"noempty" : true, | ||
"nonew" : true, | ||
"undef" : true, | ||
"unused" : true, | ||
"node" : true, | ||
"browser" : true, | ||
"jquery" : true, | ||
"globals" : { | ||
"define" : false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ node_js: | |
- "node" | ||
- "0.12" | ||
- "0.11" | ||
- "0.10" | ||
- "iojs" | ||
notifications: | ||
email: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "QueryLoader2", | ||
"version": "3.0.16", | ||
"version": "3.1.0", | ||
"homepage": "http://www.gayadesign.com/diy/queryloader2-preload-your-images-with-ease/", | ||
"authors": [ | ||
"Gaya <[email protected]>" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,82 @@ | ||
var gulp = require('gulp'), | ||
browserify = require('browserify'), | ||
source = require('vinyl-source-stream'), | ||
mochaPhantomJS = require('gulp-mocha-phantomjs'), | ||
browserSync = require('browser-sync'), | ||
uglify = require('gulp-uglify'), | ||
rename = require("gulp-rename"), | ||
header = require("gulp-header"); | ||
'use strict'; | ||
var gulp = require('gulp'); | ||
var browserify = require('browserify'); | ||
var source = require('vinyl-source-stream'); | ||
var mochaPhantomJS = require('gulp-mocha-phantomjs'); | ||
var browserSync = require('browser-sync'); | ||
var uglify = require('gulp-uglify'); | ||
var rename = require('gulp-rename'); | ||
var header = require('gulp-header'); | ||
|
||
var config = { | ||
src: 'src', | ||
dist: 'dist', | ||
build: '', | ||
test: 'test' | ||
src: 'src', | ||
dist: 'dist', | ||
build: '', | ||
test: 'test', | ||
}; | ||
var pkg = require('./package.json'); | ||
|
||
gulp.task('browserify', function() { | ||
'use strict'; | ||
return browserify('./' + config.src + '/main.js') | ||
.bundle() | ||
.on('error', function (err) { | ||
console.log(err.toString()); | ||
this.emit('end'); | ||
}) | ||
.pipe(source(pkg.name + '.js')) | ||
.pipe(gulp.dest(config.dist)) | ||
.pipe(browserSync.reload({stream:true})); | ||
return browserify('./' + config.src + '/index.js') | ||
.bundle() | ||
.on('error', function(err) { | ||
console.log(err.toString()); | ||
this.emit('end'); | ||
}) | ||
.pipe(source(pkg.name + '.js')) | ||
.pipe(gulp.dest(config.dist)) | ||
.pipe(browserSync.reload({stream:true})); | ||
}); | ||
|
||
gulp.task('browserify-tests', function() { | ||
'use strict'; | ||
return browserify('./' + config.test + '/tests.js') | ||
.bundle() | ||
.on('error', function (err) { | ||
console.log(err.toString()); | ||
this.emit('end'); | ||
}) | ||
.pipe(source(pkg.name + '-tests.js')) | ||
.pipe(gulp.dest(config.dist)) | ||
.pipe(browserSync.reload({stream:true})); | ||
return browserify('./' + config.test + '/tests.js') | ||
.bundle() | ||
.on('error', function(err) { | ||
console.log(err.toString()); | ||
this.emit('end'); | ||
}) | ||
.pipe(source(pkg.name + '-tests.js')) | ||
.pipe(gulp.dest(config.dist)) | ||
.pipe(browserSync.reload({stream:true})); | ||
}); | ||
|
||
gulp.task('browser-sync', function() { | ||
'use strict'; | ||
browserSync({ | ||
server: { | ||
baseDir: ["./" + config.test + "/browser/", "./"] | ||
} | ||
}); | ||
browserSync({ | ||
server: { | ||
baseDir: ['./' + config.test + '/browser/', './'], | ||
}, | ||
}); | ||
}); | ||
|
||
gulp.task('serve-test', ['browserify', 'browserify-tests'], function () { | ||
'use strict'; | ||
gulp.start('browser-sync'); | ||
gulp.watch(config.test + "/*.js", ['browserify', 'browserify-tests']); | ||
gulp.watch(config.src + "/**/*.js", ['browserify', 'browserify-tests']); | ||
gulp.task('serve-test', ['browserify', 'browserify-tests'], function() { | ||
gulp.start('browser-sync'); | ||
gulp.watch(config.test + '/*.js', ['browserify', 'browserify-tests']); | ||
gulp.watch(config.src + '/**/*.js', ['browserify', 'browserify-tests']); | ||
}); | ||
|
||
gulp.task('build', ['browserify'], function () { | ||
"use strict"; | ||
var headerText = | ||
"/*\n" + | ||
" * QueryLoader2 - A simple script to create a preloader for images\n" + | ||
" *\n" + | ||
" * For instructions read the original post:\n" + | ||
" * http://www.gayadesign.com/diy/queryloader2-preload-your-images-with-ease/\n" + | ||
" *\n" + | ||
" * Copyright (c) 2011 - Gaya Kessler\n" + | ||
" *\n" + | ||
" * Licensed under the MIT license:\n" + | ||
" * http://www.opensource.org/licenses/mit-license.php\n" + | ||
" *\n" + | ||
" * Version: <%= version %>\n" + | ||
" * Last update: <%= date %>\n" + | ||
" */\n"; | ||
gulp.task('build', ['browserify'], function() { | ||
var headerText = | ||
'/*\n' + | ||
' * QueryLoader2 - A simple script to create a preloader for images\n' + | ||
' *\n' + | ||
' * For instructions read the original post:\n' + | ||
' * http://www.gayadesign.com/diy/queryloader2-preload-your-images-with-ease/\n' + | ||
' *\n' + | ||
' * Copyright (c) 2011 - Gaya Kessler\n' + | ||
' *\n' + | ||
' * Licensed under the MIT license:\n' + | ||
' * http://www.opensource.org/licenses/mit-license.php\n' + | ||
' *\n' + | ||
' * Version: <%= version %>\n' + | ||
' * Last update: <%= date %>\n' + | ||
' */\n'; | ||
|
||
gulp.src(config.dist + '/' + pkg.name + '.js') | ||
.pipe(uglify()) | ||
.pipe(rename(pkg.name + '.min.js')) | ||
.pipe(header(headerText, { | ||
version: pkg.version, | ||
date: new Date().toJSON().slice(0,10) | ||
})) | ||
.pipe(gulp.dest(config.build)); | ||
gulp.src(config.dist + '/' + pkg.name + '.js') | ||
.pipe(uglify()) | ||
.pipe(rename(pkg.name + '.min.js')) | ||
.pipe(header(headerText, { | ||
version: pkg.version, | ||
date: new Date().toJSON().slice(0, 10), | ||
})) | ||
.pipe(gulp.dest(config.build)); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.