Skip to content

Commit

Permalink
fixed 285
Browse files Browse the repository at this point in the history
  • Loading branch information
Danial Farid authored and Danial Farid committed Aug 1, 2014
1 parent c3278b3 commit 2a6a624
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 23 deletions.
2 changes: 1 addition & 1 deletion demo/war/WEB-INF/appengine-web.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>angular-file-upload</application>
<version>1-6-2</version>
<version>1-6-4</version>

<!--
Allows App Engine to send multiple requests to one instance in parallel:
Expand Down
5 changes: 2 additions & 3 deletions demo/war/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link type="text/css" rel="stylesheet" href="common.css">
<title>Angular file upload sample</title>
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript">
FileAPI = {
//debug: true,
debug: true,
//forceLoad: true, html5: false //to debug flash in HTML5 browsers
//wrapInsideDiv: true, //experimental for fixing css issues
//only one of jsPath or jsUrl.
Expand Down Expand Up @@ -101,6 +100,6 @@ <h3>
</ul>
</div>
</div>
<div style="position:fixed;bottom:10px;right:10px;font-size:smaller;color:#777">Last update: 2014-07-27</div>
<div style="position:fixed;bottom:10px;right:10px;font-size:smaller;color:#777">Last update: 2014-07-29</div>
</body>
</html>
10 changes: 5 additions & 5 deletions demo/war/js/angular-file-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,15 +251,14 @@ 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' &&
items[0].webkitGetAsEntry().isDirectory) {
if (items && items.length > 0 && items[0].webkitGetAsEntry && $location.protocol() != 'file') {
for (var i = 0; i < items.length; i++) {
var entry = items[i].webkitGetAsEntry();
if (entry != null) {
//fix for chrome bug https://code.google.com/p/chromium/issues/detail?id=149735
if (isASCII(entry.name)) {
traverseFileTree(files, entry);
} else {
} else if (!items[i].webkitGetAsEntry().isDirectory) {
files.push(items[i].getAsFile());
}
}
Expand All @@ -284,21 +283,22 @@ angularFileUpload.directive('ngFileDrop', [ '$parse', '$timeout', '$location', f
}

var processing = 0;
function traverseFileTree(files, entry) {
function traverseFileTree(files, entry, path) {
if (entry != null) {
if (entry.isDirectory) {
var dirReader = entry.createReader();
processing++;
dirReader.readEntries(function(entries) {
for (var i = 0; i < entries.length; i++) {
traverseFileTree(files, entries[i]);
traverseFileTree(files, entries[i], (path ? path : "") + entry.name + "/");
}
processing--;
});
} else {
processing++;
entry.file(function(file) {
processing--;
file._relativePath = (path ? path : "") + file.name;
files.push(file);
});
}
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.4
* @version 1.6.5
*/
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.4
* @version 1.6.5
*/
(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.

12 changes: 6 additions & 6 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.4
* @version 1.6.5
*/
(function() {

Expand Down Expand Up @@ -251,15 +251,14 @@ 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' &&
items[0].webkitGetAsEntry().isDirectory) {
if (items && items.length > 0 && items[0].webkitGetAsEntry && $location.protocol() != 'file') {
for (var i = 0; i < items.length; i++) {
var entry = items[i].webkitGetAsEntry();
if (entry != null) {
//fix for chrome bug https://code.google.com/p/chromium/issues/detail?id=149735
if (isASCII(entry.name)) {
traverseFileTree(files, entry);
} else {
} else if (!items[i].webkitGetAsEntry().isDirectory) {
files.push(items[i].getAsFile());
}
}
Expand All @@ -284,21 +283,22 @@ angularFileUpload.directive('ngFileDrop', [ '$parse', '$timeout', '$location', f
}

var processing = 0;
function traverseFileTree(files, entry) {
function traverseFileTree(files, entry, path) {
if (entry != null) {
if (entry.isDirectory) {
var dirReader = entry.createReader();
processing++;
dirReader.readEntries(function(entries) {
for (var i = 0; i < entries.length; i++) {
traverseFileTree(files, entries[i]);
traverseFileTree(files, entries[i], (path ? path : "") + entry.name + "/");
}
processing--;
});
} else {
processing++;
entry.file(function(file) {
processing--;
file._relativePath = (path ? path : "") + file.name;
files.push(file);
});
}
Expand Down
Loading

0 comments on commit 2a6a624

Please # to comment.