Skip to content
This repository has been archived by the owner on Nov 20, 2018. It is now read-only.

Commit

Permalink
feat(features.js): auto-detect folder support
Browse files Browse the repository at this point in the history
closes #1703
  • Loading branch information
rnicholus committed Oct 20, 2017
1 parent be3da37 commit b8bb659
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions client/js/features.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@ qq.supportedFeatures = (function() {
return supported;
}

//only way to test for Filesystem API support since webkit does not expose the DataTransfer interface
function isChrome21OrHigher() {
return (qq.chrome() || qq.opera()) &&
navigator.userAgent.match(/Chrome\/[2][1-9]|Chrome\/[3-9][0-9]/) !== undefined;
}

//only way to test for complete Clipboard API support at this time
function isChrome14OrHigher() {
return (qq.chrome() || qq.opera()) &&
Expand Down Expand Up @@ -109,7 +103,13 @@ qq.supportedFeatures = (function() {

supportsFileDrop = supportsAjaxFileUploading && isDragAndDropSupported();

supportsFolderDrop = supportsFileDrop && isChrome21OrHigher();
// adapted from https://stackoverflow.com/a/23278460/486979
supportsFolderDrop = supportsFileDrop && (function() {
var input = document.createElement("input");

input.type = "file";
return !!("webkitdirectory" in (input || document.querySelectorAll("input[type=file]")[0]));
}());

supportsChunking = supportsAjaxFileUploading && qq.isFileChunkingSupported();

Expand Down
2 changes: 1 addition & 1 deletion client/js/version.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/*global qq */
qq.version = "5.16.0-alpha.14";
qq.version = "5.16.0-alpha.15";
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"title": "Fine Uploader",
"main": "lib/traditional.js",
"types" : "typescript/fine-uploader.d.ts",
"version": "5.16.0-alpha.14",
"version": "5.16.0-alpha.15",
"description": "Multiple file upload plugin with progress-bar, drag-and-drop, direct-to-S3 & Azure uploading, client-side image scaling, preview generation, form support, chunking, auto-resume, and tons of other features.",
"keywords": [
"amazon",
Expand Down

0 comments on commit b8bb659

Please sign in to comment.