scratch – Diff between revs 90 and 91
?pathlinks?
Rev 90 | Rev 91 | |||
---|---|---|---|---|
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 | <li><a href="draw.html">Draw</a></li> |
44 | <li><a href="draw.html">Draw</a></li> |
|
- | 45 | <li><a href="link.html">Link</a></li> |
||
45 | </ul> |
46 | </ul> |
|
46 | |
47 | |
|
47 | <div id="main-panel" class="panel panel-default"> |
48 | <div id="main-panel" class="panel panel-default"> |
|
48 | <div class="panel-heading"> |
49 | <div class="panel-heading"> |
|
49 | <div id="actions" class="row"> |
50 | <div id="actions" class="row"> |
|
50 | <div class="col-lg-5"> |
51 | <div class="col-lg-5"> |
|
51 | <div class="btn-group btn-group-justified" role="group"> |
52 | <div class="btn-group btn-group-justified" role="group"> |
|
52 | <!-- The fileinput-button span is used to style the file input field as button --> |
53 | <!-- The fileinput-button span is used to style the file input field as button --> |
|
53 | <div class="btn-group" role="group"> |
54 | <div class="btn-group" role="group"> |
|
54 | <button id="uploadbutton" type="button" class="btn btn-default"> |
55 | <button id="uploadbutton" type="button" class="btn btn-default"> |
|
55 | <i class="glyphicon glyphicon-plus"></i> |
56 | <i class="glyphicon glyphicon-plus"></i> |
|
56 | <span>Add...</span> |
57 | <span>Add...</span> |
|
57 | </button> |
58 | </button> |
|
58 | </div> |
59 | </div> |
|
59 | <div class="btn-group" role="group"> |
60 | <div class="btn-group" role="group"> |
|
60 | <button type="submit" class="btn btn-default start"> |
61 | <button type="submit" class="btn btn-default start"> |
|
61 | <i class="glyphicon glyphicon-upload"></i> |
62 | <i class="glyphicon glyphicon-upload"></i> |
|
62 | <span>Upload All</span> |
63 | <span>Upload All</span> |
|
63 | </button> |
64 | </button> |
|
64 | </div> |
65 | </div> |
|
65 | <div class="btn-group" role="group"> |
66 | <div class="btn-group" role="group"> |
|
66 | <button type="reset" class="btn btn-default cancel"> |
67 | <button type="reset" class="btn btn-default cancel"> |
|
67 | <i class="glyphicon glyphicon-ban-circle"></i> |
68 | <i class="glyphicon glyphicon-ban-circle"></i> |
|
68 | <span>Cancel All</span> |
69 | <span>Cancel All</span> |
|
69 | </button> |
70 | </button> |
|
70 | </div> |
71 | </div> |
|
71 | </div> |
72 | </div> |
|
72 | </div> |
73 | </div> |
|
73 | </div> |
74 | </div> |
|
74 | </div> |
75 | </div> |
|
75 | <div class="panel-body" id="uploadpanel"> |
76 | <div class="panel-body" id="uploadpanel"> |
|
76 | <div class="table table-striped files" id="previews"> |
77 | <div class="table table-striped files" id="previews"> |
|
77 | <div id="template" class="file-row"> |
78 | <div id="template" class="file-row"> |
|
78 | <!-- This is used as the file preview template --> |
79 | <!-- This is used as the file preview template --> |
|
79 | <div> |
80 | <div> |
|
80 | <span class="preview"><img src="img/fileholder.svg" width="58" alt="Upload file thumbnail" data-dz-thumbnail></span> |
81 | <span class="preview"><img src="img/fileholder.svg" width="58" alt="Upload file thumbnail" data-dz-thumbnail></span> |
|
81 | </div> |
82 | </div> |
|
82 | <div> |
83 | <div> |
|
83 | <p id="name" class="name" data-dz-name></p> |
84 | <p id="name" class="name" data-dz-name></p> |
|
84 | <div class="input-group"> |
85 | <div class="input-group"> |
|
85 | <input id="URL" type="text" class="form-control" readonly> |
86 | <input id="URL" type="text" class="form-control" readonly> |
|
86 | <span class="input-group-btn"> |
87 | <span class="input-group-btn"> |
|
87 | <button id="btn-mailto" class="btn btn-default" type="button"><i class="glyphicon glyphicon-envelope"></i></button> |
88 | <button id="btn-mailto" class="btn btn-default" type="button"><i class="glyphicon glyphicon-envelope"></i></button> |
|
88 | </span> |
89 | </span> |
|
89 | <span class="input-group-btn"> |
90 | <span class="input-group-btn"> |
|
90 | <button id="btn-facebook" class="btn btn-default" type="button" disabled="disabled"><i class="fa fa-facebook"></i></button> |
91 | <button id="btn-facebook" class="btn btn-default" type="button" disabled><i class="fa fa-facebook"></i></button> |
|
91 | </span> |
92 | </span> |
|
92 | <span class="input-group-btn"> |
93 | <span class="input-group-btn"> |
|
93 | <button id="btn-clipboard" class="btn btn-default" type="button"><i class="glyphicon glyphicon-paperclip"></i></button> |
94 | <button id="btn-clipboard" class="btn btn-default" type="button"><i class="glyphicon glyphicon-paperclip"></i></button> |
|
94 | </span> |
95 | </span> |
|
95 | </div> |
96 | </div> |
|
96 | <div class="input-group"> |
97 | <div class="input-group"> |
|
97 | <input id="deleteURL" type="text" class="form-control" readonly> |
98 | <input id="deleteURL" type="text" class="form-control" readonly> |
|
98 | <span class="input-group-btn"> |
99 | <span class="input-group-btn"> |
|
99 | <button id="btn-clipboard-delete" class="btn btn-default" type="button"><i class="glyphicon glyphicon-paperclip"></i></button> |
100 | <button id="btn-clipboard-delete" class="btn btn-default" type="button"><i class="glyphicon glyphicon-paperclip"></i></button> |
|
100 | </span> |
101 | </span> |
|
101 | </div> |
102 | </div> |
|
102 | <strong class="error text-danger" data-dz-errormessage></strong> |
103 | <strong class="error text-danger" data-dz-errormessage></strong> |
|
103 | </div> |
104 | </div> |
|
104 | <div> |
105 | <div> |
|
105 | <p class="size" data-dz-size></p> |
106 | <p class="size" data-dz-size></p> |
|
106 | <div id="progress" class="progress active" role="progressbar"> |
107 | <div id="progress" class="progress active" role="progressbar"> |
|
107 | <div class="progress-bar progress-bar-custom" style="width:0%;" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0" data-dz-uploadprogress></div> |
108 | <div class="progress-bar progress-bar-custom" style="width:0%;" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0" data-dz-uploadprogress></div> |
|
108 | </div> |
109 | </div> |
|
109 | </div> |
110 | </div> |
|
110 | <div> |
111 | <div> |
|
111 | <button id="start" class="btn btn-default start"> |
112 | <button id="start" class="btn btn-default start"> |
|
112 | <i class="glyphicon glyphicon-upload"></i> |
113 | <i class="glyphicon glyphicon-upload"></i> |
|
113 | <span>Upload</span> |
114 | <span>Upload</span> |
|
114 | </button> |
115 | </button> |
|
115 | <button id="cancel" data-dz-cancel class="btn btn-default cancel"> |
116 | <button id="cancel" data-dz-cancel class="btn btn-default cancel"> |
|
116 | <i class="glyphicon glyphicon-ban-circle"></i> |
117 | <i class="glyphicon glyphicon-ban-circle"></i> |
|
117 | <span>Cancel</span> |
118 | <span>Cancel</span> |
|
118 | </button> |
119 | </button> |
|
119 | <button id="remove" data-dz-remove class="btn btn-danger remove"> |
120 | <button id="remove" data-dz-remove class="btn btn-danger remove"> |
|
120 | <i class="glyphicon glyphicon-remove"></i> |
121 | <i class="glyphicon glyphicon-remove"></i> |
|
121 | <span>Remove</span> |
122 | <span>Remove</span> |
|
122 | </button> |
123 | </button> |
|
123 | </div> |
124 | </div> |
|
124 | </div> |
125 | </div> |
|
125 | |
126 | |
|
126 | </div> |
127 | </div> |
|
127 | </div> |
128 | </div> |
|
128 | <!-- The global file processing state --> |
129 | <!-- The global file processing state --> |
|
129 | <div class="fileupload-process"> |
130 | <div class="fileupload-process"> |
|
130 | <div id="total-progress" class="progress active" role="progressbar"> |
131 | <div id="total-progress" class="progress active" role="progressbar"> |
|
131 | <div class="progress-bar progress-bar-custom" style="width:0%;" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0" data-dz-uploadprogress></div> |
132 | <div class="progress-bar progress-bar-custom" style="width:0%;" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0" data-dz-uploadprogress></div> |
|
132 | </div> |
133 | </div> |
|
133 | </div> |
134 | </div> |
|
134 | </div> |
135 | </div> |
|
135 | |
136 | |
|
136 | </div> <!-- /container --> |
137 | </div> <!-- /container --> |
|
137 | |
138 | |
|
138 | <div id="footer"> |
139 | <div id="footer"> |
|
139 | <div class="container"> |
140 | <div class="container"> |
|
140 | <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> |
141 | <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> |
|
141 | </div> |
142 | </div> |
|
142 | </div> |
143 | </div> |
|
143 | |
144 | |
|
144 | <!-- jQuery --> |
145 | <!-- jQuery --> |
|
145 | <script src="bower_components/jquery/dist/jquery.min.js"></script> |
146 | <script src="bower_components/jquery/dist/jquery.min.js"></script> |
|
146 | <!-- BootStrap --> |
147 | <!-- BootStrap --> |
|
147 | <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script> |
148 | <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script> |
|
148 | <!-- DropZone --> |
149 | <!-- DropZone --> |
|
149 | <script src="bower_components/dropzone/dist/min/dropzone.min.js"></script> |
150 | <script src="bower_components/dropzone/dist/min/dropzone.min.js"></script> |
|
150 | <!-- Clipboard --> |
151 | <!-- Clipboard --> |
|
151 | <script src="bower_components/clipboard/dist/clipboard.min.js"></script> |
152 | <script src="bower_components/clipboard/dist/clipboard.min.js"></script> |
|
152 | <script> |
153 | <script> |
|
153 | $(document).ready(() => { |
154 | $(document).ready(() => { |
|
154 | // Get the template HTML and remove it from the doument |
155 | // Get the template HTML and remove it from the doument |
|
155 | var previewNode = document |
156 | var previewNode = document |
|
156 | .querySelector("#template"); |
157 | .querySelector("#template"); |
|
157 | previewNode.id = ""; |
158 | previewNode.id = ""; |
|
158 | var previewTemplate = previewNode |
159 | var previewTemplate = previewNode |
|
159 | .parentNode |
160 | .parentNode |
|
160 | .innerHTML; |
161 | .innerHTML; |
|
161 | previewNode |
162 | previewNode |
|
162 | .parentNode |
163 | .parentNode |
|
163 | .removeChild(previewNode); |
164 | .removeChild(previewNode); |
|
164 | |
165 | |
|
165 | var myDropzone = new Dropzone('.panel-body', { // Make the whole body a dropzone |
166 | var myDropzone = new Dropzone('.panel-body', { // Make the whole body a dropzone |
|
166 | url: "file.php", // Set the url |
167 | url: "file.php", // Set the url |
|
167 | paramName: "file", |
168 | paramName: "file", |
|
168 | thumbnailWidth: 80, |
169 | thumbnailWidth: 80, |
|
169 | thumbnailHeight: 80, |
170 | thumbnailHeight: 80, |
|
170 | //parallelUploads: 20, |
171 | //parallelUploads: 20, |
|
171 | previewTemplate: previewTemplate, |
172 | previewTemplate: previewTemplate, |
|
172 | autoQueue: false, // Make sure the files aren't queued until manually added |
173 | autoQueue: false, // Make sure the files aren't queued until manually added |
|
173 | previewsContainer: "#previews", // Container to display the previews |
174 | previewsContainer: "#previews", // Container to display the previews |
|
174 | clickable: [ |
175 | clickable: [ |
|
175 | "#uploadbutton", |
176 | "#uploadbutton", |
|
176 | "#uploadpanel" |
177 | "#uploadpanel" |
|
177 | ], |
178 | ], |
|
178 | //clickable: "#uploadbutton" // Element that should be used as click trigger to select files. |
179 | //clickable: "#uploadbutton" // Element that should be used as click trigger to select files. |
|
179 | }).on("addedfile", (file) => { |
180 | }).on("addedfile", (file) => { |
|
180 | // Hookup the start button |
181 | // Hookup the start button |
|
181 | file.previewElement.querySelector(".start").onclick = () => { |
182 | file.previewElement.querySelector(".start").onclick = () => { |
|
182 | myDropzone.enqueueFile(file); |
183 | myDropzone.enqueueFile(file); |
|
183 | }; |
184 | }; |
|
184 | }).on("totaluploadprogress", (progress) => { |
185 | }).on("totaluploadprogress", (progress) => { |
|
185 | document |
186 | document |
|
186 | .querySelector("#total-progress .progress-bar") |
187 | .querySelector("#total-progress .progress-bar") |
|
187 | .style |
188 | .style |
|
188 | .width = progress + "%"; |
189 | .width = progress + "%"; |
|
189 | }).on("sending", (file) => { |
190 | }).on("sending", (file) => { |
|
190 | // Show the total progress bar when upload starts |
191 | // Show the total progress bar when upload starts |
|
191 | document.querySelector("#total-progress") |
192 | document.querySelector("#total-progress") |
|
192 | .style |
193 | .style |
|
193 | .opacity = 1; |
194 | .opacity = 1; |
|
194 | |
195 | |
|
195 | // And disable the start button. |
196 | // And disable the start button. |
|
196 | file |
197 | file |
|
197 | .previewElement |
198 | .previewElement |
|
198 | .querySelector(".start") |
199 | .querySelector(".start") |
|
199 | .setAttribute("disabled", "disabled"); |
200 | .setAttribute("disabled", "disabled"); |
|
200 | }).on("queuecomplete", (progress) => { |
201 | }).on("queuecomplete", (progress) => { |
|
201 | document.querySelector("#total-progress") |
202 | document.querySelector("#total-progress") |
|
202 | .style |
203 | .style |
|
203 | .opacity = "0"; |
204 | .opacity = "0"; |
|
204 | }).on("success", (file, data) => { |
205 | }).on("success", (file, data) => { |
|
205 | // Serialize JSON to object. |
206 | // Serialize JSON to object. |
|
206 | data = JSON.parse(data); |
207 | data = JSON.parse(data); |
|
207 | |
208 | |
|
208 | // Set the ID of the URL box. |
209 | // Set the ID of the URL box. |
|
209 | const boxURLID = '_' + Math |
210 | const boxURLID = '_' + Math |
|
210 | .random() |
211 | .random() |
|
211 | .toString(36) |
212 | .toString(36) |
|
212 | .substr(2, 9); |
213 | .substr(2, 9); |
|
213 | file |
214 | file |
|
214 | .previewElement |
215 | .previewElement |
|
215 | .querySelector("#URL") |
216 | .querySelector("#URL") |
|
216 | .value = location.protocol |
217 | .value = location.protocol |
|
217 | .concat("//") |
218 | .concat("//") |
|
218 | .concat(window.location.hostname) |
219 | .concat(window.location.hostname) |
|
219 | .concat("/") |
220 | .concat("/") |
|
220 | .concat(data.hash); |
221 | .concat(data.hash); |
|
221 | |
222 | |
|
222 | file |
223 | file |
|
223 | .previewElement |
224 | .previewElement |
|
224 | .querySelector("#URL") |
225 | .querySelector("#URL") |
|
225 | .setAttribute('id', boxURLID) |
226 | .setAttribute('id', boxURLID) |
|
226 | |
227 | |
|
227 | // Set the ID of the delete URL box. |
228 | // Set the ID of the delete URL box. |
|
228 | const deleteBoxURLID = '_' + Math |
229 | const deleteBoxURLID = '_' + Math |
|
229 | .random() |
230 | .random() |
|
230 | .toString(36) |
231 | .toString(36) |
|
231 | .substr(2, 9); |
232 | .substr(2, 9); |
|
232 | file |
233 | file |
|
233 | .previewElement |
234 | .previewElement |
|
234 | .querySelector("#deleteURL") |
235 | .querySelector("#deleteURL") |
|
235 | .value = location.protocol.concat("//") |
236 | .value = location.protocol.concat("//") |
|
236 | .concat(window.location.hostname) |
237 | .concat(window.location.hostname) |
|
237 | .concat("/") |
238 | .concat("/") |
|
238 | .concat(data.timestamp) |
239 | .concat(data.timestamp) |
|
239 | .concat("/") |
240 | .concat("/") |
|
240 | .concat(data.hash); |
241 | .concat(data.hash); |
|
241 | |
242 | |
|
242 | file |
243 | file |
|
243 | .previewElement |
244 | .previewElement |
|
244 | .querySelector("#deleteURL") |
245 | .querySelector("#deleteURL") |
|
245 | .setAttribute('id', deleteBoxURLID) |
246 | .setAttribute('id', deleteBoxURLID) |
|
246 | |
247 | |
|
247 | // Set the ID of the URL clipboard button. |
248 | // Set the ID of the URL clipboard button. |
|
248 | const clipButtonID = '_' + Math |
249 | const clipButtonID = '_' + Math |
|
249 | .random() |
250 | .random() |
|
250 | .toString(36) |
251 | .toString(36) |
|
251 | .substr(2, 9); |
252 | .substr(2, 9); |
|
252 | file |
253 | file |
|
253 | .previewElement |
254 | .previewElement |
|
254 | .querySelector("#btn-clipboard") |
255 | .querySelector("#btn-clipboard") |
|
255 | .setAttribute('data-clipboard-target', '#' + boxURLID) |
256 | .setAttribute('data-clipboard-target', '#' + boxURLID) |
|
256 | |
257 | |
|
257 | file |
258 | file |
|
258 | .previewElement |
259 | .previewElement |
|
259 | .querySelector("#btn-clipboard") |
260 | .querySelector("#btn-clipboard") |
|
260 | .setAttribute('id', clipButtonID); |
261 | .setAttribute('id', clipButtonID); |
|
261 | |
262 | |
|
262 | new Clipboard('#' + clipButtonID); |
263 | new Clipboard('#' + clipButtonID); |
|
263 | |
264 | |
|
264 | // Set the ID of the delete URL clipboard button. |
265 | // Set the ID of the delete URL clipboard button. |
|
265 | const clipButtonDeleteID = '_' + Math |
266 | const clipButtonDeleteID = '_' + Math |
|
266 | .random() |
267 | .random() |
|
267 | .toString(36) |
268 | .toString(36) |
|
268 | .substr(2, 9); |
269 | .substr(2, 9); |
|
269 | file |
270 | file |
|
270 | .previewElement |
271 | .previewElement |
|
271 | .querySelector("#btn-clipboard-delete") |
272 | .querySelector("#btn-clipboard-delete") |
|
272 | .setAttribute('data-clipboard-target', '#' + deleteBoxURLID) |
273 | .setAttribute('data-clipboard-target', '#' + deleteBoxURLID) |
|
273 | |
274 | |
|
274 | file |
275 | file |
|
275 | .previewElement |
276 | .previewElement |
|
276 | .querySelector("#btn-clipboard-delete") |
277 | .querySelector("#btn-clipboard-delete") |
|
277 | .setAttribute('id', clipButtonDeleteID); |
278 | .setAttribute('id', clipButtonDeleteID); |
|
278 | |
279 | |
|
279 | new Clipboard('#' + clipButtonDeleteID); |
280 | new Clipboard('#' + clipButtonDeleteID); |
|
280 | |
281 | |
|
281 | // Set the ID of the mailto button. |
282 | // Set the ID of the mailto button. |
|
282 | const mailToButtonID = '_' + Math |
283 | const mailToButtonID = '_' + Math |
|
283 | .random() |
284 | .random() |
|
284 | .toString(36) |
285 | .toString(36) |
|
285 | .substr(2, 9); |
286 | .substr(2, 9); |
|
286 | |
287 | |
|
287 | file |
288 | file |
|
288 | .previewElement |
289 | .previewElement |
|
289 | .querySelector("#btn-mailto") |
290 | .querySelector("#btn-mailto") |
|
290 | .setAttribute('id', mailToButtonID); |
291 | .setAttribute('id', mailToButtonID); |
|
291 | |
292 | |
|
292 | file |
293 | file |
|
293 | .previewElement |
294 | .previewElement |
|
294 | .querySelector(".start") |
295 | .querySelector(".start") |
|
295 | .setAttribute("disabled", "disabled"); |
296 | .setAttribute("disabled", "disabled"); |
|
296 | file |
297 | file |
|
297 | .previewElement |
298 | .previewElement |
|
298 | .querySelector(".cancel") |
299 | .querySelector(".cancel") |
|
299 | .setAttribute("disabled", "disabled"); |
300 | .setAttribute("disabled", "disabled"); |
|
300 | |
301 | |
|
301 | $('#' + mailToButtonID).on('click', () => { |
302 | $('#' + mailToButtonID).on('click', () => { |
|
302 | window.location.href = "mailto:?subject="+ |
303 | window.location.href = "mailto:?subject="+ |
|
303 | encodeURIComponent("Can't scratch this!") + "&body=" + |
304 | encodeURIComponent("Can't scratch this!") + "&body=" + |
|
304 | encodeURIComponent($('#' + boxURLID).val()); |
305 | encodeURIComponent($('#' + boxURLID).val()); |
|
305 | }); |
306 | }); |
|
306 | |
307 | |
|
307 | // Set the ID of the facebook button. |
308 | // Set the ID of the facebook button. |
|
308 | const faceBookButtonID = '_' + Math |
309 | const faceBookButtonID = '_' + Math |
|
309 | .random() |
310 | .random() |
|
310 | .toString(36) |
311 | .toString(36) |
|
311 | .substr(2, 9); |
312 | .substr(2, 9); |
|
312 | |
313 | |
|
313 | file |
314 | file |
|
314 | .previewElement |
315 | .previewElement |
|
315 | .querySelector("#btn-facebook") |
316 | .querySelector("#btn-facebook") |
|
316 | .setAttribute('id', faceBookButtonID); |
317 | .setAttribute('id', faceBookButtonID); |
|
317 | |
318 | |
|
318 | switch(data.opengraph) { |
319 | switch(data.opengraph) { |
|
319 | case true: |
320 | case true: |
|
320 | // Enable the facebook button. |
321 | // Enable the facebook button. |
|
321 | file |
322 | file |
|
322 | .previewElement |
323 | .previewElement |
|
323 | .querySelector('#' + faceBookButtonID) |
324 | .querySelector('#' + faceBookButtonID) |
|
324 | .removeAttribute("disabled"); |
325 | .removeAttribute("disabled"); |
|
325 | |
326 | |
|
326 | // Change the URL when the user clicks the button. |
327 | // Change the URL when the user clicks the button. |
|
327 | $('#' + faceBookButtonID).on('click', () => { |
328 | $('#' + faceBookButtonID).on('click', () => { |
|
328 | $('#' + boxURLID) |
329 | $('#' + boxURLID) |
|
329 | .val( |
330 | .val( |
|
330 | location.protocol.concat("//") |
331 | location.protocol.concat("//") |
|
331 | .concat(window.location.hostname) |
332 | .concat(window.location.hostname) |
|
332 | .concat("/") |
333 | .concat("/") |
|
333 | .concat("og") |
334 | .concat("og") |
|
334 | .concat("/") |
335 | .concat("/") |
|
335 | .concat(data.hash) |
336 | .concat(data.hash) |
|
336 | ); |
337 | ); |
|
337 | }); |
338 | }); |
|
338 | break; |
339 | break; |
|
339 | default: |
340 | default: |
|
340 | // Disable the facebook button. |
341 | // Disable the facebook button. |
|
341 | file |
342 | file |
|
342 | .previewElement |
343 | .previewElement |
|
343 | .querySelector('#' + faceBookButtonID) |
344 | .querySelector('#' + faceBookButtonID) |
|
344 | .setAttribute("disabled", "disabled"); |
345 | .setAttribute("disabled", "disabled"); |
|
345 | break; |
346 | break; |
|
346 | } |
347 | } |
|
347 | }); |
348 | }); |
|
348 | |
349 | |
|
349 | document.querySelector("#actions .start").onclick = () => { |
350 | document.querySelector("#actions .start").onclick = () => { |
|
350 | myDropzone.enqueueFiles( |
351 | myDropzone.enqueueFiles( |
|
351 | myDropzone |
352 | myDropzone |
|
352 | .getFilesWithStatus(Dropzone.ADDED)); |
353 | .getFilesWithStatus(Dropzone.ADDED)); |
|
353 | }; |
354 | }; |
|
354 | |
355 | |
|
355 | document.querySelector("#actions .cancel").onclick = () => { |
356 | document.querySelector("#actions .cancel").onclick = () => { |
|
356 | myDropzone.removeAllFiles(true); |
357 | myDropzone.removeAllFiles(true); |
|
357 | }; |
358 | }; |
|
358 | |
359 | |
|
359 | // Scroll to the panel. |
360 | // Scroll to the panel. |
|
360 | $('html, body').animate({ |
361 | $('html, body').animate({ |
|
361 | scrollTop: $('#main-panel').offset().top |
362 | scrollTop: $('#main-panel').offset().top |
|
362 | }, 'slow'); |
363 | }, 'slow'); |
|
363 | }); |
364 | }); |
|
364 | </script> |
365 | </script> |
|
365 | <!-- Jumbotron parallax effect --> |
366 | <!-- Jumbotron parallax effect --> |
|
366 | <script> |
367 | <script> |
|
367 | const jumboHeight = $('.jumbotron').outerHeight(); |
368 | const jumboHeight = $('.jumbotron').outerHeight(); |
|
368 | function parallax(){ |
369 | function parallax(){ |
|
369 | var scrolled = $(window).scrollTop(); |
370 | var scrolled = $(window).scrollTop(); |
|
370 | $('.paralax-background').css('height', (jumboHeight-scrolled) + 'px'); |
371 | $('.paralax-background').css('height', (jumboHeight-scrolled) + 'px'); |
|
371 | } |
372 | } |
|
372 | |
373 | |
|
373 | $(window).scroll(function(e){ |
374 | $(window).scroll(function(e){ |
|
374 | parallax(); |
375 | parallax(); |
|
375 | }); |
376 | }); |
|
376 | </script> |
377 | </script> |
|
377 | </body> |
378 | </body> |
|
378 | </html> |
379 | </html> |
|
379 | |
380 | |