Skip to content

Commit

Permalink
fixed #273
Browse files Browse the repository at this point in the history
  • Loading branch information
Danial Farid authored and Danial Farid committed Jul 21, 2014
1 parent 41c1977 commit 72f8c46
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 15 deletions.
21 changes: 19 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,31 @@ module.exports = function(grunt) {
'dist/<%= pkg.name %>-html5-shim.min.js' : 'dist/<%= pkg.name %>-html5-shim.js'
} ]
}
}
},
replace : {
version : {
src: ['nuget/Package.nuspec', '../angular-file-upload-bower/bower.json',
'../angular-file-upload-shim-bower/bower.json', 'aaaa.txt'
],
overwrite: true,
replacements: [{
from: /"version" *: *".*"/g,
to: '"version": "<%= pkg.version %>"'
}, {
from: /<version>.*<\/version>/g,
to: '<version><%= pkg.version %></version>'
}]
}
}
});

// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-text-replace');


// Default task(s).
grunt.registerTask('default', [ 'copy:build', 'uglify', 'copy:fileapi', 'copy:bower' ]);
grunt.registerTask('default', [ 'copy:build', 'uglify', 'copy:fileapi', 'copy:bower', 'replace:version' ]);

};
2 changes: 1 addition & 1 deletion demo/war/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<title>Angular file upload sample</title>
<script type="text/javascript">
FileAPI = {
debug: true,
//debug: true,
//forceLoad: true, html5: false //to debug flash in HTML5 browsers
//only one of jsPath or jsUrl.
//jsPath: '/js/FileAPI.min.js/folder/',
Expand Down
3 changes: 2 additions & 1 deletion demo/war/js/angular-file-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ angularFileUpload.directive('ngFileDrop', [ '$parse', '$timeout', '$location', f

function extractFiles(evt, callback) {
var files = [], items = evt.dataTransfer.items;
if (items && items.length > 0 && items[0].webkitGetAsEntry && $location.protocol() != 'file') {
if (items && items.length > 0 && items[0].webkitGetAsEntry && $location.protocol() != 'file' &&
items[0].webkitGetAsEntry().isDirectory) {
for (var i = 0; i < items.length; i++) {
var entry = items[i].webkitGetAsEntry();
if (entry != null) {
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-file-upload-html5-shim.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**!
* AngularJS file upload shim for angular XHR HTML5 browsers
* @author Danial <danial.farid@gmail.com>
* @version 1.6.0
* @version 1.6.1
*/
if (window.XMLHttpRequest) {
if (window.FormData) {
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-file-upload-html5-shim.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/angular-file-upload-shim.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**!
* AngularJS file upload shim for HTML5 FormData
* @author Danial <danial.farid@gmail.com>
* @version 1.6.0
* @version 1.6.1
*/
(function() {

Expand Down
2 changes: 1 addition & 1 deletion dist/angular-file-upload-shim.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions dist/angular-file-upload.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**!
* AngularJS file upload/drop directive with http post and progress
* @author Danial <danial.farid@gmail.com>
* @version 1.6.0
* @version 1.6.1
*/
(function() {

Expand Down Expand Up @@ -251,7 +251,8 @@ angularFileUpload.directive('ngFileDrop', [ '$parse', '$timeout', '$location', f

function extractFiles(evt, callback) {
var files = [], items = evt.dataTransfer.items;
if (items && items.length > 0 && items[0].webkitGetAsEntry && $location.protocol() != 'file') {
if (items && items.length > 0 && items[0].webkitGetAsEntry && $location.protocol() != 'file' &&
items[0].webkitGetAsEntry().isDirectory) {
for (var i = 0; i < items.length; i++) {
var entry = items[i].webkitGetAsEntry();
if (entry != null) {
Expand Down
4 changes: 2 additions & 2 deletions dist/angular-file-upload.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion nuget/Package.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<metadata>
<id>angular-file-upload</id>
<title>Angular file upload</title>
<version>1.6.0</version>
<version>1.6.1</version>
<authors>Danial Farid, Georgios Diamantopoulos (nuget package)</authors>
<owners>Danial Farid</owners>
<licenseUrl>https://github.com/danialfarid/angular-file-upload/blob/master/LICENSE</licenseUrl>
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"name": "angular-file-upload",
"version": "1.6.0",
"version": "1.6.1",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-uglify": "~0.2.7",
"grunt-contrib-copy": "~0.4.1"
"grunt-contrib-copy": "~0.4.1",
"grunt-text-replace": "~0.3.12",
"grunt-git": "~0.2.14"
}
}

0 comments on commit 72f8c46

Please sign in to comment.