scratch – Diff between revs 71 and 72

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