scratch – Blame information for rev 72

Subversion Repositories:
Rev:
Rev Author Line No. Line
24 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 asset upload">
9 <meta name="author" content="Wizardry and Steamworks">
10 <link rel="icon" href="favicon.ico">
11  
64 office 12 <title>scratch</title>
24 office 13  
14 <!-- Bootstrap core CSS -->
58 office 15 <link href="bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
65 office 16 <!-- Font Awesome -->
17 <link href="bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet">
24 office 18  
19 <!-- DropZone -->
58 office 20 <link href="bower_components/dropzone/dist/min/dropzone.min.css" rel="stylesheet">
71 office 21  
22 <!-- Site-wide style CCS -->
23 <link href="css/style.css" rel="stylesheet">
24  
24 office 25 <!-- Local style -->
26 <link href="css/files/style.css" rel="stylesheet">
27 </head>
28  
29 <body>
30  
71 office 31 <!-- Main component for a primary marketing message or call to action -->
32 <div class="paralax-background"></div>
33 <div class="jumbotron">
34 <h1>scratch copy</h1>
35 <p class="quote">the asset sharer</p>
36 </div>
37  
24 office 38 <div class="container">
39  
40 <ul class="nav nav-tabs">
41 <li><a href="index.html">Home</a></li>
56 office 42 <li class="active"><a href="#">File</a></li>
24 office 43 <li><a href="text.html">Text</a></li>
44 </ul>
45  
46 <div class="panel panel-default">
47 <div class="panel-heading">
48 <div id="actions" class="row">
49 <div class="col-lg-5">
50 <div class="btn-group btn-group-justified" role="group">
51 <!-- The fileinput-button span is used to style the file input field as button -->
52 <div class="btn-group" role="group">
53 <button id="uploadbutton" type="button" class="btn btn-default">
54 <i class="glyphicon glyphicon-plus"></i>
55 <span>Add...</span>
56 </button>
57 </div>
58 <div class="btn-group" role="group">
59 <button type="submit" class="btn btn-default start">
60 <i class="glyphicon glyphicon-upload"></i>
57 office 61 <span>Upload All</span>
24 office 62 </button>
63 </div>
64 <div class="btn-group" role="group">
65 <button type="reset" class="btn btn-default cancel">
66 <i class="glyphicon glyphicon-ban-circle"></i>
57 office 67 <span>Cancel All</span>
24 office 68 </button>
69 </div>
70 </div>
71 </div>
72 </div>
73 </div>
74 <div class="panel-body" id="uploadpanel">
75 <div class="table table-striped files" id="previews">
76 <div id="template" class="file-row">
77 <!-- This is used as the file preview template -->
78 <div>
79 <span class="preview"><img src="img/fileholder.svg" width="58" alt="Upload file thumbnail" data-dz-thumbnail></span>
80 </div>
81 <div>
82 <p id="name" class="name" data-dz-name></p>
83 <div class="input-group">
84 <input id="URL" type="text" class="form-control" readonly>
85 <span class="input-group-btn">
39 office 86 <button id="btn-clipboard" class="btn btn-default" type="button"><i class="glyphicon glyphicon-paperclip"></i></button>
24 office 87 </span>
72 office 88 <span class="input-group-btn">
89 <button id="btn-mailto" class="btn btn-default" type="button"><i class="glyphicon glyphicon-envelope"></i></button>
90 </span>
24 office 91 </div>
92 <strong class="error text-danger" data-dz-errormessage></strong>
93 </div>
94 <div>
95 <p class="size" data-dz-size></p>
96 <div id="progress" class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
97 <div class="progress-bar progress-bar-success" style="width:0%;" data-dz-uploadprogress></div>
98 </div>
99 </div>
100 <div>
101 <button id="start" class="btn btn-default start">
102 <i class="glyphicon glyphicon-upload"></i>
103 <span>Upload</span>
104 </button>
105 <button id="cancel" data-dz-remove class="btn btn-default cancel">
106 <i class="glyphicon glyphicon-ban-circle"></i>
107 <span>Cancel</span>
108 </button>
109 <button id="remove" data-dz-remove class="btn btn-danger remove">
110 <i class="glyphicon glyphicon-remove"></i>
111 <span>Remove</span>
112 </button>
113 </div>
114 </div>
115  
116 </div>
117 </div>
118 <!-- The global file processing state -->
119 <div class="fileupload-process">
120 <div id="total-progress" class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
121 <div class="progress-bar progress-bar-success" style="width:0%;" data-dz-uploadprogress></div>
122 </div>
123 </div>
124 </div>
125  
126 </div> <!-- /container -->
127  
128 <div id="footer">
129 <div class="container">
71 office 130 <p class="text-muted credit text-center">Copyright <i class="glyphicon glyphicon-copyright-mark"></i> 2017 <a href="http://grimore.org">Wizardry and Steamworks</a>.</p>
24 office 131 </div>
132 </div>
133  
58 office 134 <!-- jQuery -->
135 <script src="bower_components/jquery/dist/jquery.min.js"></script>
136 <!-- BootStrap -->
137 <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
24 office 138  
139 <!-- DropZone -->
58 office 140 <script src="bower_components/dropzone/dist/min/dropzone.min.js"></script>
24 office 141 <!-- Clipboard -->
58 office 142 <script src="bower_components/clipboard/dist/clipboard.min.js"></script>
24 office 143 <script>
26 office 144 $(document).ready(() => {
24 office 145 // Get the template HTML and remove it from the doument
146 var previewNode = document
147 .querySelector("#template");
148 previewNode.id = "";
149 var previewTemplate = previewNode
150 .parentNode
151 .innerHTML;
152 previewNode
153 .parentNode
154 .removeChild(previewNode);
155  
156 var myDropzone = new Dropzone('.panel-body', { // Make the whole body a dropzone
49 office 157 url: "file.php", // Set the url
24 office 158 paramName: "file",
159 thumbnailWidth: 80,
160 thumbnailHeight: 80,
161 //parallelUploads: 20,
162 previewTemplate: previewTemplate,
163 autoQueue: false, // Make sure the files aren't queued until manually added
164 previewsContainer: "#previews", // Container to display the previews
165 clickable: [
166 "#uploadbutton",
167 "#uploadpanel"
168 ],
169 //clickable: "#uploadbutton" // Element that should be used as click trigger to select files.
170 }).on("addedfile", (file) => {
171 // Hookup the start button
172 file.previewElement.querySelector(".start").onclick = () => {
173 myDropzone.enqueueFile(file);
174 };
175 }).on("totaluploadprogress", (progress) => {
176 document
177 .querySelector("#total-progress .progress-bar")
178 .style
179 .width = progress + "%";
180 }).on("sending", (file) => {
181 // Show the total progress bar when upload starts
182 document.querySelector("#total-progress")
183 .style
184 .opacity = 1;
185  
186 // And disable the start button.
187 file
188 .previewElement
189 .querySelector(".start")
190 .setAttribute("disabled", "disabled");
191 }).on("queuecomplete", (progress) => {
192 document.querySelector("#total-progress")
193 .style
194 .opacity = "0";
195 }).on("success", (file, data) => {
196  
72 office 197 const boxURLID = '_' + Math
24 office 198 .random()
199 .toString(36)
200 .substr(2, 9);
201 file
202 .previewElement
203 .querySelector("#URL")
204 .value = data;
205  
206 file
207 .previewElement
208 .querySelector("#URL")
209 .setAttribute('id', boxURLID)
210  
211 // Clipboard button.
72 office 212 const clipButtonID = '_' + Math
24 office 213 .random()
214 .toString(36)
215 .substr(2, 9);
216 file
217 .previewElement
218 .querySelector("#btn-clipboard")
219 .setAttribute('data-clipboard-target', '#' + boxURLID)
220  
221 file
222 .previewElement
223 .querySelector("#btn-clipboard")
224 .setAttribute('id', clipButtonID);
72 office 225  
226 // Mailto button.
227 const mailToButtonID = '_' + Math
228 .random()
229 .toString(36)
230 .substr(2, 9);
231  
232 file
233 .previewElement
234 .querySelector("#btn-mailto")
235 .setAttribute('id', mailToButtonID);
24 office 236  
237 file
238 .previewElement
239 .querySelector(".start")
240 .setAttribute("disabled", "disabled");
241 file
242 .previewElement
243 .querySelector(".cancel")
244 .setAttribute("disabled", "disabled");
245  
246 new Clipboard('#' + clipButtonID);
72 office 247  
248 $('#' + mailToButtonID).on('click', () => {
249 window.location.href = "mailto:user@domain.tld?subject="+
250 encodeURIComponent('Check this out!') + "&body=" +
251 encodeURIComponent($('#' + boxURLID).val());
252 });
24 office 253 });
254  
255 document.querySelector("#actions .start").onclick = () => {
256 myDropzone.enqueueFiles(
257 myDropzone
258 .getFilesWithStatus(Dropzone.ADDED));
259 };
260  
261 document.querySelector("#actions .cancel").onclick = () => {
262 myDropzone.removeAllFiles(true);
263 };
264 });
265 </script>
71 office 266 <!-- Jumbotron parallax effect -->
70 office 267 <script>
71 office 268 const jumboHeight = $('.jumbotron').outerHeight();
70 office 269 function parallax(){
270 var scrolled = $(window).scrollTop();
271 $('.paralax-background').css('height', (jumboHeight-scrolled) + 'px');
272 }
273  
274 $(window).scroll(function(e){
275 parallax();
276 });
277 </script>
24 office 278 </body>
279 </html>