1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
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>
|