Skip to content

Commit

Permalink
added multifile select option to file input injector, and set to true…
Browse files Browse the repository at this point in the history
… for obj's, so .mtl's can be selected again
  • Loading branch information
sambaas committed Dec 9, 2021
1 parent d8f523d commit 11a45b3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions 3DAmsterdam/Assets/Netherlands3D/Plugins/Jslib/FileUploads.jslib
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,22 @@ mergeInto(LibraryManager.library, {
window.dbVersion = 21;

//Inject our required html input fields
window.InjectHiddenFileInput = function InjectHiddenFileInput(type, acceptedExtentions) {
window.InjectHiddenFileInput = function InjectHiddenFileInput(type, acceptedExtentions, multiFileSelect) {
var newInput = document.createElement("input");
newInput.id = type + '-input';
newInput.type = 'file';
newInput.accept = acceptedExtentions;
newInput.multiple = multiFileSelect;
newInput.onchange = function () {
window.ReadFiles(this.files);
};
newInput.style.cssText = 'display:none; cursor:pointer; opacity: 0; position: fixed; bottom: 0; left: 0; z-index: 2; width: 0px; height: 0px;';
document.body.appendChild(newInput);
};
window.InjectHiddenFileInput('obj', '.obj,.mtl');
window.InjectHiddenFileInput('csv', '.csv,.tsv');
window.InjectHiddenFileInput('fzp', '.fzp');
window.InjectHiddenFileInput('geojson', '.json,.geojson');
window.InjectHiddenFileInput('obj', '.obj,.mtl', true);
window.InjectHiddenFileInput('csv', '.csv,.tsv', false);
window.InjectHiddenFileInput('fzp', '.fzp', false);
window.InjectHiddenFileInput('geojson', '.json,.geojson', false);

//Support for dragging dropping files on browser window
document.addEventListener("dragover", function (event) {
Expand Down

0 comments on commit 11a45b3

Please sign in to comment.