-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adding drag and fill for component import * client-side filetype checking * client-side file size checking 5MB max. missing div. * missing listed catalog for CMMC. Delete extra migration. adjust test for drag-n-fill. import_project_submit for import project view/test * json_content not id_file * spelling * del * hot fix for external catalogs
- Loading branch information
Showing
6 changed files
with
136 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<div class="file-droppable"> | ||
<div>Drag-n-drop a file here</div> | ||
<span>×</span> | ||
<input type="file" id="json_content" /> | ||
</div> | ||
|
||
{% block scripts %} | ||
<script> | ||
document.addEventListener("DOMContentLoaded", function() { | ||
document.querySelectorAll('.file-droppable').forEach(function(droppable) { | ||
var originalText = droppable.querySelector('div').innerHTML; | ||
var input = droppable.querySelector('input'); | ||
var fileChanged = function() { | ||
var files = input.files; | ||
if (files.length) { | ||
droppable.querySelector('span').style.display = 'block'; | ||
droppable.querySelector('div').innerHTML = ''; | ||
for (var i = 0; i < files.length; i++) { | ||
droppable.querySelector('div').innerHTML += files[i].name + '<br>'; | ||
} | ||
droppable.classList.add('filled'); | ||
fillJSONContent(files)// file json box | ||
} else { | ||
droppable.querySelector('div').innerHTML = originalText; | ||
droppable.classList.remove('filled'); | ||
droppable.querySelector('span').style.display = 'none'; | ||
} | ||
}; | ||
input.addEventListener('change', fileChanged); | ||
fileChanged(input); | ||
droppable.querySelector('span').addEventListener('click', function() { | ||
input.value = ''; | ||
fileChanged(input); | ||
}); | ||
}); | ||
|
||
}); | ||
</script> | ||
|
||
{% endblock %} |