diff options
author | Patrick Simianer <p@simianer.de> | 2016-06-19 21:54:57 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2016-06-19 21:54:57 +0200 |
commit | 9097ff1e4ecdf42c99585bc9d399590442720052 (patch) | |
tree | c298079001da6f986ea2b0fd92b3f7178479a345 /public/upload.html | |
parent | 6cb1b8d9f1447bad605bcecdab9bb0d5e5b2f123 (diff) |
init
Diffstat (limited to 'public/upload.html')
-rw-r--r-- | public/upload.html | 131 |
1 files changed, 131 insertions, 0 deletions
diff --git a/public/upload.html b/public/upload.html new file mode 100644 index 0000000..a6876ac --- /dev/null +++ b/public/upload.html @@ -0,0 +1,131 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <title>Upload</title> + <script type='text/javascript' src='https://code.jquery.com/jquery-3.0.0.min.js'></script> + <link href="fine-uploader.css" rel="stylesheet"> + <script src="fine-uploader.js"></script> + <script type="text/template" id="qq-template"> + <div class="qq-uploader-selector qq-uploader" qq-drop-area-text="Drop files here"> + <div class="qq-total-progress-bar-container-selector qq-total-progress-bar-container"> + <div role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" class="qq-total-progress-bar-selector qq-progress-bar qq-total-progress-bar"></div> + </div> + <div class="qq-upload-drop-area-selector qq-upload-drop-area" qq-hide-dropzone> + <span class="qq-upload-drop-area-text-selector"></span> + </div> + <div class="qq-upload-button-selector qq-upload-button"> + <div>Dateien auswählen/Select files</div> + </div> + <span class="qq-drop-processing-selector qq-drop-processing"> + <span>Processing dropped files...</span> + <span class="qq-drop-processing-spinner-selector qq-drop-processing-spinner"></span> + </span> + <ul class="qq-upload-list-selector qq-upload-list" aria-live="polite" aria-relevant="additions removals"> + <li> + <div class="qq-progress-bar-container-selector"> + <div role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" class="qq-progress-bar-selector qq-progress-bar"></div> + </div> + <span class="qq-upload-spinner-selector qq-upload-spinner"></span> + <span class="qq-upload-file-selector qq-upload-file"></span> + <span class="qq-edit-filename-icon-selector qq-edit-filename-icon" aria-label="Edit filename"></span> + <input class="qq-edit-filename-selector qq-edit-filename" tabindex="0" type="text"> + <span class="qq-upload-size-selector qq-upload-size"></span> + <button type="button" class="qq-btn qq-upload-cancel-selector qq-upload-cancel">Cancel</button> + <button type="button" class="qq-btn qq-upload-retry-selector qq-upload-retry">Retry</button> + <button type="button" class="qq-btn qq-upload-delete-selector qq-upload-delete">Delete</button> + <span role="status" class="qq-upload-status-text-selector qq-upload-status-text"></span> + </li> + </ul> + + <dialog class="qq-alert-dialog-selector"> + <div class="qq-dialog-message-selector"></div> + <div class="qq-dialog-buttons"> + <button type="button" class="qq-cancel-button-selector">Close</button> + </div> + </dialog> + + <dialog class="qq-confirm-dialog-selector"> + <div class="qq-dialog-message-selector"></div> + <div class="qq-dialog-buttons"> + <button type="button" class="qq-cancel-button-selector">No</button> + <button type="button" class="qq-ok-button-selector">Yes</button> + </div> + </dialog> + + <dialog class="qq-prompt-dialog-selector"> + <div class="qq-dialog-message-selector"></div> + <input type="text"> + <div class="qq-dialog-buttons"> + <button type="button" class="qq-cancel-button-selector">Cancel</button> + <button type="button" class="qq-ok-button-selector">Ok</button> + </div> + </dialog> + </div> + </script> + <script type='text/javascript'> + function createUploader(dirname,token) { + var uploader = new qq.FineUploader({ + element: document.getElementById('fine-uploader'), + template: document.getElementById('qq-template'), + request: { + endpoint: '/upload?dirname='+dirname+'&token='+token, + }, + callbacks: { + onAllComplete: function () { list_dir(dirname,token) } + } + }); + } + var get_param = function (url,param) + { + var regex = new RegExp(param+"=(\\w+)"); + var match = document.URL.match(regex); + if (match) { + return match[1]; + } + + return ""; + } + + var list_dir = function (dirname,token) { + $.ajax({ + url: '/list_dir/'+dirname+'/'+token, + success: function (response) { + $("#list").html(response); + } + }) + } + + $(document).ready(function() { + var dirname = get_param(document.URL, "dirname"); + var token = get_param(document.URL, "token"); + if (dirname != "" && token != "") { + createUploader(dirname,token); + } + list_dir(dirname, token); + $("#dirname").text(dirname); + $("#token").text(token); + $.ajax({ + url: '/check/'+dirname+'/'+token, + success: function (response) { + $("#ok").text(response); + } + }); + }); + </script> + </head> + + <body> + + <div id="fine-uploader"></div> + <br /> + <br /> + <br /> + Derzeitige Dateien/Current files: + <div id="list"></div> + <p><strong>Verzeichnis/Directory: <span id="dirname"></span>, + token: <span id="token"></span>, token OK: <span id="ok"></span></strong></p> + + </body> +</html> + |