scratch – Diff between revs 41 and 42
?pathlinks?
Rev 41 | Rev 42 | |||
---|---|---|---|---|
Line 78... | Line 78... | |||
78 | <i class="glyphicon glyphicon-play"></i> |
78 | <i class="glyphicon glyphicon-play"></i> |
|
79 | </button> |
79 | </button> |
|
80 | </span> |
80 | </span> |
|
81 | <span class="input-group-btn"> |
81 | <span class="input-group-btn"> |
|
82 | <button id="reset" class="btn btn-default" type="button" data-toggle="tooltip" data-placement="auto" title="Reset document."> |
82 | <button id="reset" class="btn btn-default" type="button" data-toggle="tooltip" data-placement="auto" title="Reset document."> |
|
83 | <i class="glyphicon glyphicon-home"></i> |
83 | <i id="home-icon" class="glyphicon glyphicon-home"></i> |
|
84 | </button> |
84 | </button> |
|
85 | </span> |
85 | </span> |
|
86 | <input id="nick" type="text" class="form-control" pattern="^[A-Za-z0-9]{32}$" maxlength="32"> |
86 | <input id="nick" type="text" class="form-control" pattern="^[A-Za-z0-9]{32}$" maxlength="32"> |
|
87 | <span class="input-group-btn"> |
87 | <span class="input-group-btn"> |
|
88 | <button id="copy-nick" class="btn btn-default" type="button" data-clipboard-target="#nick" data-toggle="tooltip" data-placement="auto" title="Copy to clipboard."><i class="glyphicon glyphicon-paperclip"></i></button> |
88 | <button id="copy-nick" class="btn btn-default" type="button" data-clipboard-target="#nick" data-toggle="tooltip" data-placement="auto" title="Copy to clipboard."><i class="glyphicon glyphicon-paperclip"></i></button> |
|
Line 139... | Line 139... | |||
139 | |
139 | |
|
140 | // Set the nick. |
140 | // Set the nick. |
|
141 | $('#nick').val(result); |
141 | $('#nick').val(result); |
|
Line -... | Line 142... | |||
- | 142 | new Clipboard('#copy-nick'); |
||
- | 143 | |
||
- | 144 | if(fingerprint == nick) |
||
- | 145 | $('#home-icon').addClass("text-success"); |
||
- | 146 | else |
||
142 | new Clipboard('#copy-nick'); |
147 | $('#home-icon').addClass("text-danger"); |
|
143 | |
148 | |
|
144 | // Load the editor. |
149 | // Load the editor. |
|
145 | $('#trumbowyg').trumbowyg({ |
150 | $('#trumbowyg').trumbowyg({ |
|
146 | autogrow: true, |
151 | autogrow: true, |
|
Line 198... | Line 203... | |||
198 | contentType: false |
203 | contentType: false |
|
199 | }).done((data) => { |
204 | }).done((data) => { |
|
200 | $('#URL').val(data); |
205 | $('#URL').val(data); |
|
201 | $('#trumbowyg').trumbowyg('enable'); |
206 | $('#trumbowyg').trumbowyg('enable'); |
|
202 | }).fail(() => { |
207 | }).fail(() => { |
|
203 | alert('failed'); |
- | ||
204 | $('#trumbowyg').trumbowyg('enable'); |
208 | $('#trumbowyg').trumbowyg('enable'); |
|
205 | }); |
209 | }); |
|
206 | }); |
210 | }); |
|
Line 207... | Line 211... | |||
207 | |
211 | |
|
Line 211... | Line 215... | |||
211 | if(!nick || nick.length != 32) |
215 | if(!nick || nick.length != 32) |
|
212 | return; |
216 | return; |
|
213 | Cookies.set('nick', nick, { path: '' }); |
217 | Cookies.set('nick', nick, { path: '' }); |
|
214 | result = nick; |
218 | result = nick; |
|
Line -... | Line 219... | |||
- | 219 | |
||
- | 220 | if(fingerprint == nick) |
||
- | 221 | $('#home-icon').addClass("text-success").removeClass("text-danger"); |
||
- | 222 | else |
||
- | 223 | $('#home-icon').addClass("text-danger").removeClass("text-success"); |
||
215 | |
224 | |
|
216 | // Retrieve the contents of the shared file. |
225 | // Retrieve the contents of the shared file. |
|
217 | $.post('share-text.php', |
226 | $.post('share-text.php', |
|
218 | { |
227 | { |
|
219 | timestamp: window.performance.now(), |
228 | timestamp: window.performance.now(), |
|
Line 222... | Line 231... | |||
222 | }).done((data) => {; |
231 | }).done((data) => {; |
|
223 | $('#trumbowyg') |
232 | $('#trumbowyg') |
|
224 | .trumbowyg('html', data); |
233 | .trumbowyg('html', data); |
|
225 | $('#trumbowyg').trumbowyg('enable'); |
234 | $('#trumbowyg').trumbowyg('enable'); |
|
226 | $('#trumbowyg').show(); |
235 | $('#trumbowyg').show(); |
|
- | 236 | |
||
- | 237 | if(fingerprint == nick) |
||
- | 238 | $('#home-icon').addClass("text-success"); |
||
- | 239 | else |
||
- | 240 | $('#home-icon').addClass("text-danger"); |
||
- | 241 | |
||
227 | }).fail(() => { |
242 | }).fail(() => { |
|
228 | $('#trumbowyg').trumbowyg('enable'); |
243 | $('#trumbowyg').trumbowyg('enable'); |
|
229 | $('#trumbowyg').show(); |
244 | $('#trumbowyg').show(); |
|
230 | }); |
245 | }); |
|
231 | }); |
246 | }); |
|
Line 238... | Line 253... | |||
238 | if(!nick || nick.length != 32) |
253 | if(!nick || nick.length != 32) |
|
239 | return; |
254 | return; |
|
240 | Cookies.set('nick', nick, { path: '' }); |
255 | Cookies.set('nick', nick, { path: '' }); |
|
241 | result = nick; |
256 | result = nick; |
|
Line -... | Line 257... | |||
- | 257 | |
||
- | 258 | if(fingerprint == nick) |
||
- | 259 | $('#home-icon').addClass("text-success"); |
||
- | 260 | else |
||
- | 261 | $('#home-icon').addClass("text-danger"); |
||
242 | |
262 | |
|
243 | // Retrieve the contents of the shared file. |
263 | // Retrieve the contents of the shared file. |
|
244 | $.post('share-text.php', |
264 | $.post('share-text.php', |
|
245 | { |
265 | { |
|
246 | timestamp: window.performance.now(), |
266 | timestamp: window.performance.now(), |
|
Line 249... | Line 269... | |||
249 | }).done((data) => {; |
269 | }).done((data) => {; |
|
250 | $('#trumbowyg') |
270 | $('#trumbowyg') |
|
251 | .trumbowyg('html', data); |
271 | .trumbowyg('html', data); |
|
252 | $('#trumbowyg').trumbowyg('enable'); |
272 | $('#trumbowyg').trumbowyg('enable'); |
|
253 | $('#trumbowyg').show(); |
273 | $('#trumbowyg').show(); |
|
- | 274 | |
||
- | 275 | if(fingerprint == nick) |
||
- | 276 | $('#home-icon').addClass("text-success").removeClass("text-danger"); |
||
- | 277 | else |
||
- | 278 | $('#home-icon').addClass("text-danger").removeClass("text-success"); |
||
- | 279 | |
||
254 | }).fail(() => { |
280 | }).fail(() => { |
|
255 | $('#trumbowyg').trumbowyg('enable'); |
281 | $('#trumbowyg').trumbowyg('enable'); |
|
256 | $('#trumbowyg').show(); |
282 | $('#trumbowyg').show(); |
|
257 | }); |
283 | }); |
|
258 | }); |
284 | }); |
|
Line 263... | Line 289... | |||
263 | if(!nick || nick.length != 32) |
289 | if(!nick || nick.length != 32) |
|
264 | return; |
290 | return; |
|
265 | Cookies.set('nick', nick, { path: '' }); |
291 | Cookies.set('nick', nick, { path: '' }); |
|
266 | result = nick; |
292 | result = nick; |
|
Line -... | Line 293... | |||
- | 293 | |
||
- | 294 | if(fingerprint == nick) |
||
- | 295 | $('#home-icon').addClass("text-success").removeClass("text-danger"); |
||
- | 296 | else |
||
- | 297 | $('#home-icon').addClass("text-danger").removeClass("text-success"); |
||
267 | |
298 | |
|
268 | // Retrieve the contents of the shared file. |
299 | // Retrieve the contents of the shared file. |
|
269 | $.post('share-text.php', |
300 | $.post('share-text.php', |
|
270 | { |
301 | { |
|
271 | timestamp: window.performance.now(), |
302 | timestamp: window.performance.now(), |
|
Line 285... | Line 316... | |||
285 | // When the reset button is pressed, navigate to the fingerprint. |
316 | // When the reset button is pressed, navigate to the fingerprint. |
|
286 | $('#reset').click(() => { |
317 | $('#reset').click(() => { |
|
287 | Cookies.set('nick', fingerprint, { path: '' }); |
318 | Cookies.set('nick', fingerprint, { path: '' }); |
|
288 | $('#nick').val(fingerprint); |
319 | $('#nick').val(fingerprint); |
|
289 | result = fingerprint; |
320 | result = fingerprint; |
|
- | 321 | nick = fingerprint; |
||
- | 322 | |
||
- | 323 | if(fingerprint == nick) |
||
- | 324 | $('#home-icon').addClass("text-success").removeClass("text-danger"); |
||
- | 325 | else |
||
- | 326 | $('#home-icon').addClass("text-danger").removeClass("text-success"); |
||
Line 290... | Line 327... | |||
290 | |
327 | |
|
291 | // Retrieve the contents of the shared file. |
328 | // Retrieve the contents of the shared file. |
|
292 | $.post('share-text.php', |
329 | $.post('share-text.php', |
|
293 | { |
330 | { |