[13656] | 1 |
|
---|
| 2 |
|
---|
| 3 | <div>
|
---|
| 4 |
|
---|
| 5 | <ul class="nav nav-tabs">
|
---|
| 6 | <li role="presentation" class="active"><a asp-controller="Job" asp-action="Index">Jobs <span class="badge"></span></a></li>
|
---|
| 7 | <li role="presentation"><a asp-controller="User" asp-action="Index">User management</a></li>
|
---|
| 8 | <li role="presentation"><a asp-controller="Resource" asp-action="Index">Resources</a></li>
|
---|
| 9 | </ul>
|
---|
| 10 | <div style="margin:10px">
|
---|
| 11 | <form method="post" asp-action="Upload" asp-controller="Job" enctype="multipart/form-data">
|
---|
| 12 | <input onchange="printFiles()" type="file" id="files" name="files" multiple accept=".hl" style="display:none" />
|
---|
| 13 | <div onclick="firefilebutton()" class="btn btn-info btn-lg btn-block ">Choose file(s)</div>
|
---|
| 14 | <div class="row" style="margin:10px">
|
---|
| 15 | <div id="selectedfiles"></div>
|
---|
| 16 | <div style="visibility:hidden; margin-bottom:10px;" id="del" class='btn btn-danger' onclick='deletefiles()'>
|
---|
| 17 | <span class='glyphicon glyphicon-trash' aria-hidden='true'></span> Remove files
|
---|
| 18 | </div>
|
---|
| 19 | <input style="visibility:hidden;" id="upl" class="btn btn-lg btn-block btn-success" type="submit" value="Check contents" />
|
---|
| 20 | </div>
|
---|
| 21 |
|
---|
| 22 | </form>
|
---|
| 23 | </div>
|
---|
| 24 |
|
---|
| 25 | <script type="text/javascript">
|
---|
| 26 | function printFiles() {
|
---|
| 27 | var div = document.getElementById("selectedfiles");
|
---|
| 28 | var files = document.getElementById("files").files;
|
---|
| 29 | div.innerHTML = "";
|
---|
| 30 | if (files.length > 0) {
|
---|
| 31 | document.getElementById("upl").style.visibility = "visible";
|
---|
| 32 | document.getElementById("del").style.visibility = "visible";
|
---|
| 33 |
|
---|
| 34 | div.innerHTML += "<h3>Files</h3>";
|
---|
| 35 | for (var i = 0; i < files.length; i++) {
|
---|
| 36 | div.innerHTML += "<p>File " + (i + 1) + ":" + files[i].name +
|
---|
| 37 | "</p>";
|
---|
| 38 | }
|
---|
| 39 |
|
---|
| 40 | }
|
---|
| 41 | else{
|
---|
| 42 | document.getElementById("upl").style.visibility = "hidden";
|
---|
| 43 | document.getElementById("del").style.visibility = "hidden";
|
---|
| 44 | }
|
---|
| 45 |
|
---|
| 46 | }
|
---|
| 47 | function firefilebutton() {
|
---|
| 48 | document.getElementById("files").click();
|
---|
| 49 |
|
---|
| 50 | }
|
---|
| 51 | function deletefiles() {
|
---|
| 52 | var filesarr = document.getElementById("files").files;
|
---|
| 53 | document.getElementById("files").value = "";
|
---|
| 54 | printFiles();
|
---|
| 55 | }
|
---|
| 56 | </script>
|
---|
| 57 | </div> |
---|