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

Commit e6ae625

Browse files
author
rnicholus
committed
Merge branch 'develop'
2 parents 868f4a8 + a3eaa77 commit e6ae625

File tree

9 files changed

+401
-36
lines changed

9 files changed

+401
-36
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
## Type of issue
22
- [ ] Bug report
33
- [ ] Feature request
4-
- [ ] Support request
54

65
## Uploader type
76
- [ ] Traditional
87
- [ ] S3
98
- [ ] Azure
109

11-
10+
### Note: Support requests cannot be accepted due to lack of time.
1211

1312

1413
<details>
@@ -49,19 +48,3 @@ For example:
4948
#### Feature request details
5049
{why is this feature important, not just for you, but for many others?}
5150
</details>
52-
53-
54-
55-
56-
<details>
57-
<summary>Support Request</summary>
58-
59-
#### Fine Uploader version
60-
{example: 5.5.1}
61-
62-
#### Question
63-
{ask your support question here & be as detailed and clear as possible}
64-
65-
#### Related code
66-
{post any code related to your question here}
67-
</details>

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ zip-all:
363363
setup-dist:
364364
mkdir -p $(pub-dir)
365365
cp LICENSE README.md package.json $(pub-dir)
366-
cp -pR $(src-dir)/commonjs/ $(pub-dir)/lib/
366+
cp -pR $(src-dir)/commonJs/ $(pub-dir)/lib/
367367
cp -pR $(src-dir)/typescript $(pub-dir)/
368368

369369
copy-build-to-dist:

client/js/dnd.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,10 @@ qq.DragAndDrop = function(o) {
273273
});
274274

275275
disposeSupport.attach(document, "drop", function(e) {
276-
e.preventDefault();
277-
maybeHideDropZones();
276+
if (isFileDrag(e)) {
277+
e.preventDefault();
278+
maybeHideDropZones();
279+
}
278280
});
279281

280282
disposeSupport.attach(document, HIDE_ZONES_EVENT_NAME, maybeHideDropZones);
@@ -379,12 +381,16 @@ qq.UploadDropZone = function(o) {
379381
isSafari = qq.safari();
380382

381383
// dt.effectAllowed is none in Safari 5
382-
// dt.types.contains check is for firefox
383384

384385
// dt.effectAllowed crashes IE 11 & 10 when files have been dragged from
385386
// the filesystem
386387
effectTest = qq.ie() && qq.supportedFeatures.fileDrop ? true : dt.effectAllowed !== "none";
387-
return dt && effectTest && (dt.files || (!isSafari && dt.types.contains && dt.types.contains("Files")));
388+
return dt && effectTest &&
389+
(
390+
(dt.files && dt.files.length) || // Valid for drop events with files
391+
(!isSafari && dt.types.contains && dt.types.contains("Files")) || // Valid in Chrome/Firefox
392+
(dt.types.includes && dt.types.includes("Files")) // Valid in IE
393+
);
388394
}
389395

390396
function isOrSetDropDisabled(isDisabled) {
@@ -492,4 +498,7 @@ qq.UploadDropZone = function(o) {
492498
return element;
493499
}
494500
});
501+
502+
this._testing = {};
503+
this._testing.isValidFileDrag = isValidFileDrag;
495504
};

client/js/s3/util.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ qq.s3.util = qq.s3.util || (function() {
4444
"Content-Disposition",
4545
"Content-Encoding",
4646
"Content-MD5",
47+
"x-amz-server-side-encryption",
48+
"x-amz-server-side-encryption-aws-kms-key-id",
4749
"x-amz-server-side-encryption-customer-algorithm",
4850
"x-amz-server-side-encryption-customer-key",
4951
"x-amz-server-side-encryption-customer-key-MD5"

client/js/templating.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ qq.Templating = function(spec) {
9090
log,
9191
isEditElementsExist,
9292
isRetryElementExist,
93-
templateHtml,
93+
templateDom,
9494
container,
9595
fileList,
9696
showThumbnails,
@@ -341,7 +341,7 @@ qq.Templating = function(spec) {
341341
scriptHtml,
342342
fileListNode,
343343
tempTemplateEl,
344-
fileListHtml,
344+
fileListEl,
345345
defaultButton,
346346
dropArea,
347347
thumbnail,
@@ -452,7 +452,7 @@ qq.Templating = function(spec) {
452452
throw new Error("Could not find the file list container in the template!");
453453
}
454454

455-
fileListHtml = fileListNode.innerHTML;
455+
fileListEl = fileListNode.children[0].cloneNode(true);
456456
fileListNode.innerHTML = "";
457457

458458
// We must call `createElement` in IE8 in order to target and hide any <dialog> via CSS
@@ -463,8 +463,8 @@ qq.Templating = function(spec) {
463463
log("Template parsing complete");
464464

465465
return {
466-
template: qq.trimStr(tempTemplateEl.innerHTML),
467-
fileTemplate: qq.trimStr(fileListHtml)
466+
template: tempTemplateEl,
467+
fileTemplate: fileListEl
468468
};
469469
},
470470

@@ -625,7 +625,7 @@ qq.Templating = function(spec) {
625625

626626
container = options.containerEl;
627627
showThumbnails = options.imageGenerator !== undefined;
628-
templateHtml = parseAndGetTemplate();
628+
templateDom = parseAndGetTemplate();
629629

630630
cacheThumbnailPlaceholders();
631631

@@ -635,7 +635,7 @@ qq.Templating = function(spec) {
635635

636636
generatedThumbnails = 0;
637637

638-
container.innerHTML = templateHtml.template;
638+
container.appendChild(templateDom.template.cloneNode(true));
639639
hide(getDropProcessing());
640640
this.hideTotalProgress();
641641
fileList = options.fileContainerEl || getTemplateEl(container, selectorClasses.list);
@@ -662,7 +662,7 @@ qq.Templating = function(spec) {
662662
},
663663

664664
addFile: function(id, name, prependInfo, hideForever, batch) {
665-
var fileEl = qq.toElement(templateHtml.fileTemplate),
665+
var fileEl = templateDom.fileTemplate.cloneNode(true),
666666
fileNameEl = getTemplateEl(fileEl, selectorClasses.file),
667667
uploaderEl = getTemplateEl(container, selectorClasses.uploader),
668668
fileContainer = batch ? fileBatch.content : fileList,

docs/features/s3.jmd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ following "special" headers:
8686
* Content-Disposition
8787
* Content-Encoding
8888
* Content-MD5
89+
* x-amz-server-side-encryption-aws-kms-key-id
90+
* x-amz-server-side-encryption
8991
* x-amz-server-side-encryption-customer-algorithm
9092
* x-amz-server-side-encryption-customer-key
9193
* x-amz-server-side-encryption-customer-key-MD5

docs/quickstart/01-getting-started.jmd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ Remember, when using the "core" build, you will need to build your own UI and up
523523
<script>
524524
// Some options to pass to the uploader are discussed on the next page
525525
var uploader = new qq.s3.FineUploader({
526-
element: getElementById("uploader")
526+
element: document.getElementById("uploader")
527527
})
528528
</script>
529529
</body>
@@ -648,7 +648,7 @@ Remember, when using the "core" build, you will need to build your own UI and up
648648
<script>
649649
// Some options to pass to the uploader are discussed on the next page
650650
var uploader = new qq.azure.FineUploader({
651-
element: getElementById("uploader")
651+
element: document.getElementById("uploader")
652652
})
653653
</script>
654654
</body>
@@ -786,19 +786,19 @@ Remember, when using the "core" build, you will need to build your own UI and up
786786
// For a traditional endpoint instance:
787787
// Some options to pass to the uploader are discussed on the next page
788788
var traditionalUploader = new qq.FineUploader({
789-
element: getElementById("traditional-uploader")
789+
element: document.getElementById("traditional-uploader")
790790
})
791791

792792
// For an S3 endpoint instance:
793793
// Some options to pass to the uploader are discussed on the next page
794794
var s3Uploader = new qq.s3.FineUploader({
795-
element: getElementById("s3-uploader")
795+
element: document.getElementById("s3-uploader")
796796
})
797797

798798
// For an Azure endpoint instance:
799799
// Some options to pass to the uploader are discussed on the next page
800800
var azureUploader = new qq.azure.FineUploader({
801-
element: getElementById("azure-uploader")
801+
element: document.getElementById("azure-uploader")
802802
})
803803
</script>
804804
</body>

0 commit comments

Comments
 (0)