scratch – Blame information for rev 9

Subversion Repositories:
Rev:
Rev Author Line No. Line
5 office 1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4 <meta charset="utf-8">
5 <meta http-equiv="X-UA-Compatible" content="IE=edge">
6 <meta name="viewport" content="width=device-width, initial-scale=1">
7 <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
8 <meta name="description" content="quick file upload">
9 <meta name="author" content="Wizardry and Steamworks">
10 <link rel="icon" href="favicon.ico">
11  
12 <title>Quickload</title>
13  
14 <!-- Bootstrap core CSS -->
15 <link href="css/bootstrap/bootstrap.min.css" rel="stylesheet">
16  
17 <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
18 <link href="css/bootstrap/ie10-viewport-bug-workaround.css" rel="stylesheet">
19  
20 <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
21 <!--[if lt IE 9]><script src="js/bootstrap/ie8-responsive-file-warning.js"></script><![endif]-->
22 <script src="js/bootstrap/ie-emulation-modes-warning.js"></script>
23  
24 <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
25 <!--[if lt IE 9]>
26 <script src="js/bootstrap/html5shiv.min.js"></script>
27 <script src="js/bootstrap/respond.min.js"></script>
28 <![endif]-->
29  
30 <!-- DropZone -->
31 <link href="css/dropzone/dropzone.min.css" rel="stylesheet">
32 <!-- Local style -->
33 <link href="css/style.css" rel="stylesheet">
34 </head>
35  
36 <body>
9 office 37  
38 <!--#include virtual="ssi/body/header.shtml" -->
5 office 39  
40 <div class="container">
41  
42 <!-- Main component for a primary marketing message or call to action -->
43 <div class="jumbotron">
44 <h1>Quickload</h1>
45 <p>HTTP template for sharing assets.</p>
46 </div>
47  
48 <ul class="nav nav-tabs">
49 <li class="active"><a href="#">Files</a></li>
50 </ul>
51  
52 <div id="actions" class="row">
53  
54 <div class="col-lg-7">
55 <!-- The fileinput-button span is used to style the file input field as button -->
56 <span class="btn btn-success fileinput-button">
57 <i class="glyphicon glyphicon-plus"></i>
58 <span>Add files...</span>
59 </span>
60 <button type="submit" class="btn btn-primary start">
61 <i class="glyphicon glyphicon-upload"></i>
62 <span>Start upload</span>
63 </button>
64 <button type="reset" class="btn btn-warning cancel">
65 <i class="glyphicon glyphicon-ban-circle"></i>
66 <span>Cancel upload</span>
67 </button>
68 </div>
69  
70 <div class="col-lg-5">
71 <!-- The global file processing state -->
72 <span class="fileupload-process">
73 <div id="total-progress" class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
74 <div class="progress-bar progress-bar-success" style="width:0%;" data-dz-uploadprogress></div>
75 </div>
76 </span>
77 </div>
78  
79 </div>
80 <div class="table table-striped files" id="previews">
81  
82 <div id="template" class="file-row">
83 <!-- This is used as the file preview template -->
84 <div>
85 <span class="preview"><img data-dz-thumbnail /></span>
86 </div>
87 <div>
88 <p id="name" class="name" data-dz-name></p>
89 <input id="URL" type="text" class='form-control' readonly>
90 <span class="input-group-button">
91 <button id="clippy" class="btn clipBtn" type="button">
92 <img class="clippy" src="img/clipboard/clippy.svg" width="13" alt="Copy to clipboard">
93 </button>
94 </span>
95 <strong class="error text-danger" data-dz-errormessage></strong>
96 </div>
97 <div>
98 <p class="size" data-dz-size></p>
99 <div id="progress" class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
100 <div class="progress-bar progress-bar-success" style="width:0%;" data-dz-uploadprogress></div>
101 </div>
102 </div>
103 <div>
104 <button class="btn btn-primary start">
105 <i class="glyphicon glyphicon-upload"></i>
106 <span>Start</span>
107 </button>
108 <button data-dz-remove class="btn btn-warning cancel">
109 <i class="glyphicon glyphicon-ban-circle"></i>
110 <span>Cancel</span>
111 </button>
112 <button data-dz-remove class="btn btn-danger delete">
113 <i class="glyphicon glyphicon-trash"></i>
114 <span>Delete</span>
115 </button>
116 </div>
117 </div>
118  
119 </div>
120  
121 </div> <!-- /container -->
122  
9 office 123 <!--#include virtual="ssi/body/footer.shtml" -->
5 office 124  
125 <script src="js/jquery/jquery.min.js"></script>
126 <script src="js/bootstrap/bootstrap.min.js"></script>
127 <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
128 <script src="js/bootstrap/ie10-viewport-bug-workaround.js"></script>
129  
130 <!-- DropZone -->
131 <script src="js/dropzone/dropzone.min.js"></script>
132 <!-- <script src="js/dropzone/dropzone-amd-module.min.js"></script> -->
133 <!-- Clipboard -->
134 <script src="js/clipboard/clipboard.min.js"></script>
135 <script>
136 $(document).ready(function(){
137 // Get the template HTML and remove it from the doument
138 var previewNode = document
139 .querySelector("#template");
140 previewNode.id = "";
141 var previewTemplate = previewNode
142 .parentNode
143 .innerHTML;
144 previewNode
145 .parentNode
146 .removeChild(previewNode);
147  
148 var myDropzone = new Dropzone(document.body, { // Make the whole body a dropzone
149 url: "upload.php", // Set the url
150 paramName: "file",
151 thumbnailWidth: 80,
152 thumbnailHeight: 80,
153 parallelUploads: 20,
154 previewTemplate: previewTemplate,
155 autoQueue: false, // Make sure the files aren't queued until manually added
156 previewsContainer: "#previews", // Container to display the previews
157 clickable: ".fileinput-button" // Element that should be used as click trigger to select files.
158 });
159  
160 myDropzone.on("addedfile", (file) => {
161 // Hookup the start button
162 file.previewElement.querySelector(".start").onclick = () => {
163 myDropzone.enqueueFile(file);
164 };
165 });
166  
167 // Update the total progress bar
168 myDropzone.on("totaluploadprogress", (progress) => {
169 document
170 .querySelector("#total-progress .progress-bar")
171 .style
172 .width = progress + "%";
173 });
174  
175 myDropzone.on("sending", (file) => {
176 // Show the total progress bar when upload starts
177 document.querySelector("#total-progress")
178 .style
179 .opacity = 1;
180  
181 // And disable the start button.
182 file
183 .previewElement
184 .querySelector(".start")
185 .setAttribute("disabled", "disabled");
186 });
187  
188 // Hide the total progress bar when nothing's uploading anymore
189 myDropzone.on("queuecomplete", (progress) => {
190 document.querySelector("#total-progress")
191 .style
192 .opacity = "0";
193 });
194  
195 // Display the URL of the file.
196 myDropzone.on("success", (file, data) => {
197  
198 var boxURLID = '_' + Math.random().toString(36).substr(2, 9);
199 file
200 .previewElement
201 .querySelector("#URL")
202 .value = data;
203  
204 file
205 .previewElement
206 .querySelector("#URL")
207 .setAttribute('id', boxURLID)
208  
209 // Clipboard button.
210 clipButtonID = '_' + Math.random().toString(36).substr(2, 9);
211 file
212 .previewElement
213 .querySelector("#clippy")
214 .setAttribute('data-clipboard-target', '#' + boxURLID)
215  
216 file
217 .previewElement
218 .querySelector("#clippy")
219 .setAttribute('id', clipButtonID);
220  
221 new Clipboard('#' + clipButtonID);
222 });
223  
224 // Setup the buttons for all transfers
225 // The "add files" button doesn't need to be setup because the config
226 // `clickable` has already been specified.
227 document.querySelector("#actions .start").onclick = function() {
228 myDropzone.enqueueFiles(myDropzone.getFilesWithStatus(Dropzone.ADDED));
229 };
230 document.querySelector("#actions .cancel").onclick = function() {
231 myDropzone.removeAllFiles(true);
232 };
233 });
234 </script>
235 </body>
236 </html>