scratch – Diff between revs 72 and 73

Subversion Repositories:
Rev:
Show entire fileIgnore whitespace
Rev 72 Rev 73
Line 87... Line 87...
87 </span> 87 </span>
88 <span class="input-group-btn"> 88 <span class="input-group-btn">
89 <button id="btn-mailto" class="btn btn-default" type="button"><i class="glyphicon glyphicon-envelope"></i></button> 89 <button id="btn-mailto" class="btn btn-default" type="button"><i class="glyphicon glyphicon-envelope"></i></button>
90 </span> 90 </span>
91 </div> 91 </div>
-   92 <div class="input-group">
-   93 <input id="deleteURL" type="text" class="form-control" readonly>
-   94 <span class="input-group-btn">
-   95 <button id="btn-clipboard-delete" class="btn btn-default" type="button"><i class="glyphicon glyphicon-paperclip"></i></button>
-   96 </span>
-   97 </div>
92 <strong class="error text-danger" data-dz-errormessage></strong> 98 <strong class="error text-danger" data-dz-errormessage></strong>
93 </div> 99 </div>
94 <div> 100 <div>
95 <p class="size" data-dz-size></p> 101 <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"> 102 <div id="progress" class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
Line 191... Line 197...
191 }).on("queuecomplete", (progress) => { 197 }).on("queuecomplete", (progress) => {
192 document.querySelector("#total-progress") 198 document.querySelector("#total-progress")
193 .style 199 .style
194 .opacity = "0"; 200 .opacity = "0";
195 }).on("success", (file, data) => { 201 }).on("success", (file, data) => {
196 -  
-   202 // Set the ID of the URL box.
197 const boxURLID = '_' + Math 203 const boxURLID = '_' + Math
198 .random() 204 .random()
199 .toString(36) 205 .toString(36)
200 .substr(2, 9); 206 .substr(2, 9);
201 file 207 file
202 .previewElement 208 .previewElement
203 .querySelector("#URL") 209 .querySelector("#URL")
-   210 .value = location.protocol
-   211 .concat("//")
-   212 .concat(window.location.hostname)
-   213 .concat("/")
204 .value = data; 214 .concat(data);
Line 205... Line 215...
205 215
206 file 216 file
207 .previewElement 217 .previewElement
208 .querySelector("#URL") 218 .querySelector("#URL")
209 .setAttribute('id', boxURLID) 219 .setAttribute('id', boxURLID)
-   220  
-   221 // Set the ID of the delete URL box.
-   222 const deleteBoxURLID = '_' + Math
-   223 .random()
-   224 .toString(36)
-   225 .substr(2, 9);
-   226 file
-   227 .previewElement
-   228 .querySelector("#deleteURL")
-   229 .value = location.protocol.concat("//")
-   230 .concat(window.location.hostname)
-   231 .concat("/")
-   232 .concat("delete")
-   233 .concat("/")
-   234 .concat(data);
-   235
210 236 file
-   237 .previewElement
-   238 .querySelector("#deleteURL")
-   239 .setAttribute('id', deleteBoxURLID)
-   240
211 // Clipboard button. 241 // Set the ID of the URL clipboard button.
212 const clipButtonID = '_' + Math 242 const clipButtonID = '_' + Math
213 .random() 243 .random()
214 .toString(36) 244 .toString(36)
215 .substr(2, 9); 245 .substr(2, 9);
Line 220... Line 250...
220 250
221 file 251 file
222 .previewElement 252 .previewElement
223 .querySelector("#btn-clipboard") 253 .querySelector("#btn-clipboard")
-   254 .setAttribute('id', clipButtonID);
-   255
-   256 new Clipboard('#' + clipButtonID);
-   257
-   258 // Set the ID of the delete URL clipboard button.
-   259 const clipButtonDeleteID = '_' + Math
-   260 .random()
-   261 .toString(36)
-   262 .substr(2, 9);
-   263 file
-   264 .previewElement
-   265 .querySelector("#btn-clipboard-delete")
-   266 .setAttribute('data-clipboard-target', '#' + deleteBoxURLID)
-   267
-   268 file
-   269 .previewElement
-   270 .querySelector("#btn-clipboard-delete")
-   271 .setAttribute('id', clipButtonDeleteID);
-   272
Line 224... Line 273...
224 .setAttribute('id', clipButtonID); 273 new Clipboard('#' + clipButtonDeleteID);
225 274
226 // Mailto button. 275 // Set the ID of the mailto button.
227 const mailToButtonID = '_' + Math 276 const mailToButtonID = '_' + Math
228 .random() 277 .random()
Line 240... Line 289...
240 .setAttribute("disabled", "disabled"); 289 .setAttribute("disabled", "disabled");
241 file 290 file
242 .previewElement 291 .previewElement
243 .querySelector(".cancel") 292 .querySelector(".cancel")
244 .setAttribute("disabled", "disabled"); 293 .setAttribute("disabled", "disabled");
245 -  
246 new Clipboard('#' + clipButtonID); -  
Line 247... Line 294...
247 294
248 $('#' + mailToButtonID).on('click', () => { 295 $('#' + mailToButtonID).on('click', () => {
249 window.location.href = "mailto:user@domain.tld?subject="+ 296 window.location.href = "mailto:user@domain.tld?subject="+
250 encodeURIComponent('Check this out!') + "&body=" + 297 encodeURIComponent('Check this out!') + "&body=" +