-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Danial Farid
authored and
Danial Farid
committed
Jun 4, 2015
1 parent
ce3dc15
commit 39fa784
Showing
67 changed files
with
10,675 additions
and
4,999 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
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,29 @@ | ||
{ | ||
"node": true, | ||
"browser": true, | ||
"esnext": true, | ||
"camelcase": true, | ||
"curly": false, | ||
"eqeqeq": true, | ||
"eqnull": true, | ||
"immed": true, | ||
"indent": 4, | ||
"latedef": true, | ||
"newcap": true, | ||
"noarg": true, | ||
"quotmark": "single", | ||
"undef": true, | ||
"unused": true, | ||
"trailing": true, | ||
"smarttabs": true, | ||
"jquery": true, | ||
"evil": true, | ||
"globals": { | ||
"angular":false, | ||
"FileAPI":false, | ||
"ngFileUpload":true, | ||
"FormData":true, | ||
"Blob":true, | ||
"ActiveXObject":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 |
---|---|---|
@@ -1,108 +1,129 @@ | ||
module.exports = function(grunt) { | ||
grunt.initConfig({ | ||
pkg : grunt.file.readJSON('package.json'), | ||
'use strict'; | ||
|
||
copy : { | ||
build : { | ||
options : { | ||
processContent : function(content, srcpath) { | ||
return grunt.template.process(content); | ||
} | ||
}, | ||
files : [ { | ||
expand : true, | ||
cwd : 'demo/war/js/', | ||
src : 'ng-file-upload*.js', | ||
dest : 'dist/', | ||
flatten : true, | ||
filter : 'isFile' | ||
}] | ||
}, | ||
fileapi: { | ||
files: [{ | ||
expand : true, | ||
cwd : 'demo/war/js/', | ||
src : 'FileAPI.flash.swf', | ||
dest : 'dist/', | ||
flatten : true, | ||
filter : 'isFile' | ||
}, { | ||
expand : true, | ||
cwd : 'demo/war/js/', | ||
src : 'FileAPI.js', | ||
dest : 'dist/', | ||
flatten : true, | ||
filter : 'isFile' | ||
} ] | ||
}, | ||
bower : { | ||
files : [ { | ||
expand : true, | ||
cwd : 'dist/', | ||
src : '*', | ||
dest : '../angular-file-upload-bower/', | ||
flatten : true, | ||
filter : 'isFile' | ||
}, { | ||
expand : true, | ||
cwd : 'dist/', | ||
src : '*', | ||
dest : '../angular-file-upload-shim-bower/', | ||
flatten : true, | ||
filter : 'isFile' | ||
} ] | ||
} | ||
}, | ||
concat: { | ||
dist: { | ||
options: { | ||
process: function(content, srcpath) { | ||
return grunt.template.process(content); | ||
} | ||
}, | ||
files: { | ||
'demo/war/js/ng-file-upload-all.js': | ||
['demo/war/js/ng-file-upload.js', | ||
'demo/war/js/ng-file-upload-shim.js'] | ||
} | ||
} | ||
}, | ||
uglify : { | ||
options : { | ||
banner : '/*! <%= pkg.version %> */\n' | ||
}, | ||
build : { | ||
files : [ { | ||
'dist/ng-file-upload.min.js' : 'dist/ng-file-upload.js', | ||
'dist/ng-file-upload-shim.min.js' : 'dist/ng-file-upload-shim.js', | ||
'dist/ng-file-upload-all.min.js' : 'dist/ng-file-upload-all.js', | ||
'dist/FileAPI.min.js' : 'dist/FileAPI.js', | ||
'demo/war/js/FileAPI.min.js' : 'demo/war/js/FileAPI.js' | ||
} ] | ||
} | ||
}, | ||
replace : { | ||
version : { | ||
src: ['nuget/Package.nuspec', '../angular-file-upload-bower/bower.json', | ||
'../angular-file-upload-shim-bower/bower.json' | ||
], | ||
overwrite: true, | ||
replacements: [{ | ||
from: /"version" *: *".*"/g, | ||
to: '"version": "<%= pkg.version %>"' | ||
}, { | ||
from: /<version>.*<\/version>/g, | ||
to: '<version><%= pkg.version %></version>' | ||
}] | ||
} | ||
} | ||
}); | ||
module.exports = function (grunt) { | ||
// Load grunt tasks automatically | ||
require('load-grunt-tasks')(grunt); | ||
|
||
grunt.loadNpmTasks('grunt-contrib-copy'); | ||
grunt.loadNpmTasks('grunt-contrib-uglify'); | ||
grunt.loadNpmTasks('grunt-text-replace'); | ||
grunt.loadNpmTasks('grunt-contrib-concat'); | ||
grunt.initConfig({ | ||
pkg: grunt.file.readJSON('package.json'), | ||
concat: { | ||
all: { | ||
options: { | ||
process: function (content) { | ||
return grunt.template.process(content); | ||
} | ||
}, | ||
files: { | ||
'dist/ng-file-upload.js': ['src/upload.js', 'src/select.js', 'src/drop.js'], | ||
'dist/ng-file-upload-shim.js': ['src/shim-upload.js', 'src/shim-elem.js', 'src/shim-filereader.js'], | ||
'dist/ng-file-upload-all.js': ['dist/ng-file-upload.js', 'dist/ng-file-upload-shim.js'] | ||
} | ||
} | ||
}, | ||
uglify: { | ||
options: { | ||
preserveComments: 'some', | ||
banner: '/*! <%= pkg.version %> */\n' | ||
}, | ||
|
||
grunt.registerTask('default', [ 'concat:dist', 'copy:build', 'copy:fileapi', 'uglify', 'copy:bower', 'replace:version' ]); | ||
build: { | ||
files: [{ | ||
'dist/ng-file-upload.min.js': 'dist/ng-file-upload.js', | ||
'dist/ng-file-upload-shim.min.js': 'dist/ng-file-upload-shim.js', | ||
'dist/ng-file-upload-all.min.js': 'dist/ng-file-upload-all.js', | ||
'dist/FileAPI.min.js': 'dist/FileAPI.js' | ||
}] | ||
} | ||
}, | ||
copy: { | ||
build: { | ||
files: [{ | ||
expand: true, | ||
cwd: 'dist/', | ||
src: '*', | ||
dest: 'demo/src/main/webapp/js/', | ||
flatten: true, | ||
filter: 'isFile' | ||
}] | ||
}, | ||
fileapi: { | ||
files: { | ||
'dist/FileAPI.flash.swf': 'src/FileAPI.flash.swf', | ||
'dist/FileAPI.js': 'src/FileAPI.js' | ||
} | ||
}, | ||
bower: { | ||
files: [{ | ||
expand: true, | ||
cwd: 'dist/', | ||
src: '*', | ||
dest: '../angular-file-upload-bower/', | ||
flatten: true, | ||
filter: 'isFile' | ||
}, { | ||
expand: true, | ||
cwd: 'dist/', | ||
src: '*', | ||
dest: '../angular-file-upload-shim-bower/', | ||
flatten: true, | ||
filter: 'isFile' | ||
}] | ||
} | ||
}, | ||
serve: { | ||
options: { | ||
port: 9000 | ||
}, | ||
'path': 'demo/src/main/webapp' | ||
}, | ||
watch: { | ||
js: { | ||
files: ['src/{,*/}*.js'], | ||
tasks: ['jshint:all', 'concat:all', 'uglify', 'copy:build'] | ||
} | ||
}, | ||
jshint: { | ||
options: { | ||
jshintrc: '.jshintrc', | ||
reporter: require('jshint-stylish') | ||
}, | ||
all: [ | ||
'Gruntfile.js', | ||
'src/{,*/}*.js', | ||
'!src/FileAPI*.*', | ||
'test/spec/{,*/}*.js' | ||
] | ||
}, | ||
replace: { | ||
version: { | ||
src: ['nuget/Package.nuspec', '../angular-file-upload-bower/bower.json', | ||
'../angular-file-upload-shim-bower/bower.json' | ||
], | ||
overwrite: true, | ||
replacements: [{ | ||
from: /"version" *: *".*"/g, | ||
to: '"version": "<%= pkg.version %>"' | ||
}, { | ||
from: /<version>.*<\/version>/g, | ||
to: '<version><%= pkg.version %></version>' | ||
}] | ||
} | ||
}, | ||
clean: { | ||
dist: { | ||
files: [{ | ||
dot: true, | ||
src: [ | ||
'dist', | ||
'!dist/.git*' | ||
] | ||
}] | ||
} | ||
} | ||
}); | ||
|
||
grunt.registerTask('dev', ['jshint:all', 'concat:all', 'uglify', 'copy:build', 'watch']); | ||
grunt.registerTask('default', ['jshint:all', 'clean:dist', 'concat:all', | ||
'copy:fileapi', 'uglify', 'copy:build', 'copy:bower', 'replace:version']); | ||
|
||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.