scratch – Diff between revs 71 and 74

Subversion Repositories:
Rev:
Only display areas with differencesIgnore whitespace
Rev 71 Rev 74
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 http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> 6 <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
7 <meta http-equiv="Pragma" content="no-cache" /> 7 <meta http-equiv="Pragma" content="no-cache" />
8 <meta http-equiv="Expires" content="0" /> 8 <meta http-equiv="Expires" content="0" />
9 <meta name="viewport" content="width=device-width, initial-scale=1"> 9 <meta name="viewport" content="width=device-width, initial-scale=1">
10 <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> 10 <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
11 <meta name="description" content="quick asset upload"> 11 <meta name="description" content="quick asset upload">
12 <meta name="author" content="Wizardry and Steamworks"> 12 <meta name="author" content="Wizardry and Steamworks">
13 <link rel="icon" href="favicon.ico"> 13 <link rel="icon" href="favicon.ico">
14   14  
15 <title>scratch</title> 15 <title>scratch</title>
16   16  
17 <!-- Bootstrap core CSS --> 17 <!-- Bootstrap core CSS -->
18 <link href="bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"> 18 <link href="bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
19 <!-- Font Awesome --> 19 <!-- Font Awesome -->
20 <link href="bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet"> 20 <link href="bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet">
21 <!-- Trumbowyg --> 21 <!-- Trumbowyg -->
22 <link href="bower_components/trumbowyg/dist/ui/trumbowyg.min.css" rel="stylesheet"> 22 <link href="bower_components/trumbowyg/dist/ui/trumbowyg.min.css" rel="stylesheet">
23   23  
24 <!-- Site-wide style CCS --> 24 <!-- Site-wide style CCS -->
25 <link href="css/style.css" rel="stylesheet"> 25 <link href="css/style.css" rel="stylesheet">
26 26
27 <!-- Local style --> 27 <!-- Local style -->
28 <link href="css/text/style.css" rel="stylesheet"> 28 <link href="css/text/style.css" rel="stylesheet">
29 </head> 29 </head>
30   30  
31 <body> 31 <body>
32   32  
33 <!-- Main component for a primary marketing message or call to action --> 33 <!-- Main component for a primary marketing message or call to action -->
34 <div class="paralax-background"></div> 34 <div class="paralax-background"></div>
35 <div class="jumbotron"> 35 <div class="jumbotron">
36 <h1>scratch copy</h1> 36 <h1>scratch copy</h1>
37 <p class="quote">the asset sharer</p> 37 <p class="quote">the asset sharer</p>
38 </div> 38 </div>
39   39  
40 <div class="container"> 40 <div class="container">
41 41
42 <ul class="nav nav-tabs"> 42 <ul class="nav nav-tabs">
43 <li><a href="index.html">Home</a></li> 43 <li><a href="index.html">Home</a></li>
44 <li><a href="file.html">File</a></li> 44 <li><a href="file.html">File</a></li>
45 <li class="active"><a href="#">Text</a></li> 45 <li class="active"><a href="#">Text</a></li>
46 </ul> 46 </ul>
47 47
48 <div class="panel panel-default"> 48 <div class="panel panel-default">
49 <div class="panel-heading"> 49 <div class="panel-heading">
50 <div class="form-group"> 50 <div class="form-group">
51 <div class="input-group"> 51 <div class="input-group">
52 <span class="input-group-btn"> 52 <span class="input-group-btn">
53 <button id="save" class="btn btn-default" type="button" data-toggle="tooltip" data-placement="auto" title="Generate link."> 53 <button id="save" class="btn btn-default" type="button" data-toggle="tooltip" data-placement="auto" title="Generate link.">
54 <i class="glyphicon glyphicon-share"></i> 54 <i class="glyphicon glyphicon-share"></i>
55 </button> 55 </button>
56 </span> 56 </span>
57 <input id="URL" type="text" class="form-control" readonly> 57 <input id="URL" type="text" class="form-control" readonly>
58 <span class="input-group-btn"> 58 <span class="input-group-btn">
59 <button id="copy-url" class="btn btn-default" type="button" data-clipboard-target="#URL" data-toggle="tooltip" data-placement="auto" title="Copy to clipboard."><i class="glyphicon glyphicon-paperclip"></i></button> 59 <button id="copy-url" class="btn btn-default" type="button" data-clipboard-target="#URL" data-toggle="tooltip" data-placement="auto" title="Copy to clipboard."><i class="glyphicon glyphicon-paperclip"></i></button>
60 </span> 60 </span>
61 </div> 61 </div>
62 </div> 62 </div>
63 <form id="nick-form" role="form"> 63 <form id="nick-form" role="form">
64 <div class="form-group has-feedback"> 64 <div class="form-group has-feedback">
65 <div class="input-group"> 65 <div class="input-group">
66 <span class="input-group-btn"> 66 <span class="input-group-btn">
67 <button id="go" class="btn btn-default" type="button" data-toggle="tooltip" data-placement="auto" title="Load document."> 67 <button id="go" class="btn btn-default" type="button" data-toggle="tooltip" data-placement="auto" title="Load document.">
68 <i class="glyphicon glyphicon-play"></i> 68 <i class="glyphicon glyphicon-play"></i>
69 </button> 69 </button>
70 </span> 70 </span>
71 <span class="input-group-btn"> 71 <span class="input-group-btn">
72 <button id="reset" class="btn btn-default" type="button" data-toggle="tooltip" data-placement="auto" title="Reset document."> 72 <button id="reset" class="btn btn-default" type="button" data-toggle="tooltip" data-placement="auto" title="Reset document.">
73 <i id="home-icon" class="glyphicon glyphicon-home"></i> 73 <i id="home-icon" class="glyphicon glyphicon-home"></i>
74 </button> 74 </button>
75 </span> 75 </span>
76 <input id="nick" type="text" class="form-control" pattern="^[A-Za-z0-9]{32}$" maxlength="32"> 76 <input id="nick" type="text" class="form-control" pattern="^[A-Za-z0-9]{32}$" maxlength="32">
77 <span class="input-group-btn"> 77 <span class="input-group-btn">
78 <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> 78 <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>
79 </span> 79 </span>
80 </div> 80 </div>
81 </div> 81 </div>
82 </form> 82 </form>
83 </div> 83 </div>
84 <div class="panel-body" id="editorpanel"> 84 <div class="panel-body" id="editorpanel">
85 <div id="trumbowyg" style="display: none; font-family: monospace;"> 85 <div id="trumbowyg">
86 </div> 86 </div>
87 </div> 87 </div>
88 </div> 88 </div>
89   89  
90 </div> <!-- /container --> 90 </div> <!-- /container -->
91 91
92 <div id="footer"> 92 <div id="footer">
93 <div class="container"> 93 <div class="container">
94 <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> 94 <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>
95 </div> 95 </div>
96 </div> 96 </div>
97   97  
98 <!-- jQuery --> 98 <!-- jQuery -->
99 <script src="bower_components/jquery/dist/jquery.min.js"></script> 99 <script src="bower_components/jquery/dist/jquery.min.js"></script>
100 <!-- BootStrap --> 100 <!-- BootStrap -->
101 <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script> 101 <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
102 102
103 <!-- Trumbowyg --> 103 <!-- Trumbowyg -->
104 <script src="bower_components/trumbowyg/dist/trumbowyg.min.js"></script> 104 <script src="bower_components/trumbowyg/dist/trumbowyg.min.js"></script>
105 <!-- Clipboard --> 105 <!-- Clipboard -->
106 <script src="bower_components/clipboard/dist/clipboard.min.js"></script> 106 <script src="bower_components/clipboard/dist/clipboard.min.js"></script>
107 <!-- Fingerprint 2 --> 107 <!-- Fingerprint 2 -->
108 <script src="bower_components/fingerprintjs2/dist/fingerprint2.min.js"></script> 108 <script src="bower_components/fingerprintjs2/dist/fingerprint2.min.js"></script>
109 <!-- js-cookie --> 109 <!-- js-cookie -->
110 <script src="bower_components/js-cookie/src/js.cookie.js"></script> 110 <script src="bower_components/js-cookie/src/js.cookie.js"></script>
111 <!-- Bootstrap Validator --> 111 <!-- Bootstrap Validator -->
112 <script src="bower_components/bootstrap-validator/dist/validator.min.js"></script> 112 <script src="bower_components/bootstrap-validator/dist/validator.min.js"></script>
113 <script> 113 <script>
114 $(document).ready(() => { 114 $(document).ready(() => {
115 // Attach the form validator. 115 // Attach the form validator.
116 $('#nick-form').validator({ 116 $('#nick-form').validator({
117 focus: false 117 focus: false
118 }); 118 });
119 119
120 // Enable the Clipboard button. 120 // Enable the Clipboard button.
121 new Clipboard('#copy-url'); 121 new Clipboard('#copy-url');
122 122
123 // Get the fingerprint. 123 // Get the fingerprint.
124 new Fingerprint2({ 124 new Fingerprint2({
125 //excludeUserAgent: true, 125 //excludeUserAgent: true,
126 //excludeLanguage: true, 126 //excludeLanguage: true,
127 excludeColorDepth: true, 127 excludeColorDepth: true,
128 excludeScreenResolution: true, 128 excludeScreenResolution: true,
129 excludeAvailableScreenResolution: true, 129 excludeAvailableScreenResolution: true,
130 //excludeTimezoneOffset: true, 130 //excludeTimezoneOffset: true,
131 excludeSessionStorage: true, 131 excludeSessionStorage: true,
132 excludeIndexedDB: true, 132 excludeIndexedDB: true,
133 excludeAddBehavior: true, 133 excludeAddBehavior: true,
134 excludeOpenDatabase: true, 134 excludeOpenDatabase: true,
135 //excludeCpuClass: true, 135 //excludeCpuClass: true,
136 //excludePlatform: true, 136 //excludePlatform: true,
137 excludeDoNotTrack: true, 137 excludeDoNotTrack: true,
138 excludeCanvas: true, 138 excludeCanvas: true,
139 excludeWebGL: true, 139 excludeWebGL: true,
140 excludeAdBlock: true, 140 excludeAdBlock: true,
141 //excludeHasLiedLanguages: true, 141 //excludeHasLiedLanguages: true,
142 //excludeHasLiedResolution: true, 142 //excludeHasLiedResolution: true,
143 //excludeHasLiedOs: true, 143 //excludeHasLiedOs: true,
144 //excludeHasLiedBrowser: true, 144 //excludeHasLiedBrowser: true,
145 excludeJsFonts: true, 145 excludeJsFonts: true,
146 excludeFlashFonts: true, 146 excludeFlashFonts: true,
147 excludePlugins: true, 147 excludePlugins: true,
148 excludeIEPlugins: true, 148 excludeIEPlugins: true,
149 //excludeTouchSupport: true, 149 //excludeTouchSupport: true,
150 excludePixelRatio: true 150 excludePixelRatio: true
151 }).get((result, components) => { 151 }).get((result, components) => {
152 // Set the nick as a cookie. 152 // Set the nick as a cookie.
153 const fingerprint = result; 153 const fingerprint = result;
154 var nick = Cookies.get('nick'); 154 var nick = Cookies.get('nick');
155 if(!nick || nick.length !== 32) { 155 if(!nick || nick.length !== 32) {
156 Cookies.set('nick', result, { path: '' }); 156 Cookies.set('nick', result, { path: '' });
157 nick = result; 157 nick = result;
158 } 158 }
159 else 159 else
160 result = nick; 160 result = nick;
161 161
162 // Set the nick. 162 // Set the nick.
163 $('#nick').val(result); 163 $('#nick').val(result);
164 new Clipboard('#copy-nick'); 164 new Clipboard('#copy-nick');
165 165
166 if(fingerprint == nick) 166 if(fingerprint == nick)
167 $('#home-icon').addClass("text-success"); 167 $('#home-icon').addClass("text-success");
168 else 168 else
169 $('#home-icon').addClass("text-danger"); 169 $('#home-icon').addClass("text-danger");
170 170
171 function saveTextFile() { 171 function saveTextFile() {
172 $.post('text.php', { 172 $.post('text.php', {
173 data: $('#trumbowyg').trumbowyg('html'), 173 data: $('#trumbowyg').trumbowyg('html'),
174 fingerprint: result, 174 fingerprint: result,
175 action: 'SAVE', 175 action: 'SAVE',
176 timeout: 0 176 timeout: 0
177 }); 177 });
178 } 178 }
179 var autoSaveTimeoutID = window.setTimeout(saveTextFile, 250); 179 var autoSaveTimeoutID = window.setTimeout(saveTextFile, 250);
180 180
181 // Load the editor. 181 // Load the editor.
182 $('#trumbowyg').trumbowyg({ 182 $('#trumbowyg').trumbowyg({
-   183 semantic: true,
183 autogrow: true, 184 autogrow: true,
184 disabled: true 185 disabled: true
185 }).on('tbwchange', () => { 186 }).on('tbwchange', () => {
186 // Clear the value of the URL box because the URL will have changed. 187 // Clear the value of the URL box because the URL will have changed.
187 $('#URL').val(''); 188 $('#URL').val('');
188 // Reschedule saving of the file. 189 // Reschedule saving of the file.
189 window.clearTimeout(autoSaveTimeoutID); 190 window.clearTimeout(autoSaveTimeoutID);
190 autoSaveTimeoutID = window.setTimeout(saveTextFile, 250); 191 autoSaveTimeoutID = window.setTimeout(saveTextFile, 250);
191 }); 192 });
192 193
193 // Retrieve the contents of the shared file. 194 // Retrieve the contents of the shared file.
194 $('#trumbowyg').trumbowyg('disable'); 195 $('#trumbowyg').trumbowyg('disable');
195 $.post('text.php', 196 $.post('text.php',
196 { 197 {
197 timestamp: window.performance.now(), 198 timestamp: window.performance.now(),
198 fingerprint: result, 199 fingerprint: result,
199 action: 'LOAD' 200 action: 'LOAD'
200 }).done((data) => {; 201 }).done((data) => {;
201 $('#trumbowyg') 202 $('#trumbowyg')
202 .trumbowyg('html', data); 203 .trumbowyg('html', data);
203 $('#trumbowyg').trumbowyg('enable'); 204 $('#trumbowyg').trumbowyg('enable');
204 $('#trumbowyg').show(); 205 $('#trumbowyg').show();
205 }).fail(() => { 206 }).fail(() => {
206 $('#trumbowyg').trumbowyg('enable'); 207 $('#trumbowyg').trumbowyg('enable');
207 $('#trumbowyg').show(); 208 $('#trumbowyg').show();
208 }); 209 });
209 210
210 $('#save').click(() => { 211 $('#save').click(() => {
211 $('#editor').trumbowyg('disable'); 212 $('#editor').trumbowyg('disable');
212 var formData = new FormData(); 213 var formData = new FormData();
213 formData.append('file', new Blob( 214 formData.append('file', new Blob(
214 [ 215 [
215 $('#trumbowyg').trumbowyg('html') 216 $('#trumbowyg').trumbowyg('html')
216 ] 217 ]
217 ), 218 ),
218 '.html' 219 '.html'
219 ); 220 );
220 221
221 $.ajax({ 222 $.ajax({
222 url: 'file.php', 223 url: 'file.php',
223 type: 'POST', 224 type: 'POST',
224 data: formData, 225 data: formData,
225 // cache: false // FF 226 // cache: false // FF
226 processData: false, 227 processData: false,
227 contentType: false 228 contentType: false
228 }).done((data) => { 229 }).done((data) => {
229 $('#URL').val(data); 230 $('#URL').val(data);
230 $('#trumbowyg').trumbowyg('enable'); 231 $('#trumbowyg').trumbowyg('enable');
231 }).fail(() => { 232 }).fail(() => {
232 $('#trumbowyg').trumbowyg('enable'); 233 $('#trumbowyg').trumbowyg('enable');
233 }); 234 });
234 }); 235 });
235 236
236 // When the button is clicked, navigate to the fingerprint. 237 // When the button is clicked, navigate to the fingerprint.
237 $('#go').click(() => { 238 $('#go').click(() => {
238 nick = $('#nick').val(); 239 nick = $('#nick').val();
239 if(!nick || nick.length != 32) 240 if(!nick || nick.length != 32)
240 return; 241 return;
241 Cookies.set('nick', nick, { path: '' }); 242 Cookies.set('nick', nick, { path: '' });
242 result = nick; 243 result = nick;
243 244
244 // Retrieve the contents of the shared file. 245 // Retrieve the contents of the shared file.
245 $('#editor').trumbowyg('disable'); 246 $('#editor').trumbowyg('disable');
246 $.post('text.php', 247 $.post('text.php',
247 { 248 {
248 timestamp: window.performance.now(), 249 timestamp: window.performance.now(),
249 fingerprint: nick, 250 fingerprint: nick,
250 action: 'LOAD' 251 action: 'LOAD'
251 }).done((data) => {; 252 }).done((data) => {;
252 $('#trumbowyg') 253 $('#trumbowyg')
253 .trumbowyg('html', data); 254 .trumbowyg('html', data);
254 $('#trumbowyg').trumbowyg('enable'); 255 $('#trumbowyg').trumbowyg('enable');
255 $('#trumbowyg').show(); 256 $('#trumbowyg').show();
256 257
257 if(fingerprint == nick) 258 if(fingerprint == nick)
258 $('#home-icon').addClass("text-success").removeClass("text-danger"); 259 $('#home-icon').addClass("text-success").removeClass("text-danger");
259 else 260 else
260 $('#home-icon').addClass("text-danger").removeClass("text-success"); 261 $('#home-icon').addClass("text-danger").removeClass("text-success");
261 262
262 }).fail(() => { 263 }).fail(() => {
263 $('#trumbowyg').trumbowyg('enable'); 264 $('#trumbowyg').trumbowyg('enable');
264 $('#trumbowyg').show(); 265 $('#trumbowyg').show();
265 }); 266 });
266 }); 267 });
267 268
268 // When the form is submitted, naigate to the fingerprint. 269 // When the form is submitted, naigate to the fingerprint.
269 $('#nick-form').submit((e) => { 270 $('#nick-form').submit((e) => {
270 e.preventDefault(); 271 e.preventDefault();
271 272
272 nick = $('#nick').val(); 273 nick = $('#nick').val();
273 if(!nick || nick.length != 32) 274 if(!nick || nick.length != 32)
274 return; 275 return;
275 Cookies.set('nick', nick, { path: '' }); 276 Cookies.set('nick', nick, { path: '' });
276 result = nick; 277 result = nick;
277 278
278 // Retrieve the contents of the shared file. 279 // Retrieve the contents of the shared file.
279 $('#editor').trumbowyg('disable'); 280 $('#editor').trumbowyg('disable');
280 $.post('text.php', 281 $.post('text.php',
281 { 282 {
282 timestamp: window.performance.now(), 283 timestamp: window.performance.now(),
283 fingerprint: nick, 284 fingerprint: nick,
284 action: 'LOAD' 285 action: 'LOAD'
285 }).done((data) => {; 286 }).done((data) => {;
286 $('#trumbowyg') 287 $('#trumbowyg')
287 .trumbowyg('html', data); 288 .trumbowyg('html', data);
288 $('#trumbowyg').trumbowyg('enable'); 289 $('#trumbowyg').trumbowyg('enable');
289 $('#trumbowyg').show(); 290 $('#trumbowyg').show();
290 291
291 if(fingerprint == nick) 292 if(fingerprint == nick)
292 $('#home-icon').addClass("text-success").removeClass("text-danger"); 293 $('#home-icon').addClass("text-success").removeClass("text-danger");
293 else 294 else
294 $('#home-icon').addClass("text-danger").removeClass("text-success"); 295 $('#home-icon').addClass("text-danger").removeClass("text-success");
295 296
296 }).fail(() => { 297 }).fail(() => {
297 $('#trumbowyg').trumbowyg('enable'); 298 $('#trumbowyg').trumbowyg('enable');
298 $('#trumbowyg').show(); 299 $('#trumbowyg').show();
299 }); 300 });
300 }); 301 });
301 302
302 // While the nick is changing, navigate to the changed fingerprint. 303 // While the nick is changing, navigate to the changed fingerprint.
303 $("#nick").on('input', () => { 304 $("#nick").on('input', () => {
304 nick = $('#nick').val(); 305 nick = $('#nick').val();
305 if(!nick || nick.length != 32) 306 if(!nick || nick.length != 32)
306 return; 307 return;
307 Cookies.set('nick', nick, { path: '' }); 308 Cookies.set('nick', nick, { path: '' });
308 result = nick; 309 result = nick;
309 310
310 // Retrieve the contents of the shared file. 311 // Retrieve the contents of the shared file.
311 $('#editor').trumbowyg('disable'); 312 $('#editor').trumbowyg('disable');
312 $.post('text.php', 313 $.post('text.php',
313 { 314 {
314 timestamp: window.performance.now(), 315 timestamp: window.performance.now(),
315 fingerprint: nick, 316 fingerprint: nick,
316 action: 'LOAD' 317 action: 'LOAD'
317 }).done((data) => {; 318 }).done((data) => {;
318 $('#trumbowyg') 319 $('#trumbowyg')
319 .trumbowyg('html', data); 320 .trumbowyg('html', data);
320 $('#trumbowyg').trumbowyg('enable'); 321 $('#trumbowyg').trumbowyg('enable');
321 $('#trumbowyg').show(); 322 $('#trumbowyg').show();
322 323
323 if(fingerprint == nick) 324 if(fingerprint == nick)
324 $('#home-icon').addClass("text-success").removeClass("text-danger"); 325 $('#home-icon').addClass("text-success").removeClass("text-danger");
325 else 326 else
326 $('#home-icon').addClass("text-danger").removeClass("text-success"); 327 $('#home-icon').addClass("text-danger").removeClass("text-success");
327 }).fail(() => { 328 }).fail(() => {
328 $('#trumbowyg').trumbowyg('enable'); 329 $('#trumbowyg').trumbowyg('enable');
329 $('#trumbowyg').show(); 330 $('#trumbowyg').show();
330 }); 331 });
331 }); 332 });
332 333
333 // When the reset button is pressed, navigate to the fingerprint. 334 // When the reset button is pressed, navigate to the fingerprint.
334 $('#reset').click(() => { 335 $('#reset').click(() => {
335 Cookies.set('nick', fingerprint, { path: '' }); 336 Cookies.set('nick', fingerprint, { path: '' });
336 $('#nick').val(fingerprint); 337 $('#nick').val(fingerprint);
337 result = fingerprint; 338 result = fingerprint;
338 nick = fingerprint; 339 nick = fingerprint;
339 340
340 // Retrieve the contents of the shared file. 341 // Retrieve the contents of the shared file.
341 $('#editor').trumbowyg('disable'); 342 $('#editor').trumbowyg('disable');
342 $.post('text.php', 343 $.post('text.php',
343 { 344 {
344 timestamp: window.performance.now(), 345 timestamp: window.performance.now(),
345 fingerprint: fingerprint, 346 fingerprint: fingerprint,
346 action: 'LOAD' 347 action: 'LOAD'
347 }).done((data) => {; 348 }).done((data) => {;
348 $('#trumbowyg') 349 $('#trumbowyg')
349 .trumbowyg('html', data); 350 .trumbowyg('html', data);
350 $('#trumbowyg').trumbowyg('enable'); 351 $('#trumbowyg').trumbowyg('enable');
351 $('#trumbowyg').show(); 352 $('#trumbowyg').show();
352 if(fingerprint == nick) 353 if(fingerprint == nick)
353 $('#home-icon').addClass("text-success").removeClass("text-danger"); 354 $('#home-icon').addClass("text-success").removeClass("text-danger");
354 else 355 else
355 $('#home-icon').addClass("text-danger").removeClass("text-success"); 356 $('#home-icon').addClass("text-danger").removeClass("text-success");
356 }).fail(() => { 357 }).fail(() => {
357 $('#trumbowyg').trumbowyg('enable'); 358 $('#trumbowyg').trumbowyg('enable');
358 $('#trumbowyg').show(); 359 $('#trumbowyg').show();
359 }); 360 });
360 }); 361 });
361 }); 362 });
362 }); 363 });
363 </script> 364 </script>
364 <!-- Jumbotron parallax effect --> 365 <!-- Jumbotron parallax effect -->
365 <script> 366 <script>
366 var jumboHeight = $('.jumbotron').outerHeight(); 367 var jumboHeight = $('.jumbotron').outerHeight();
367 function parallax(){ 368 function parallax(){
368 var scrolled = $(window).scrollTop(); 369 var scrolled = $(window).scrollTop();
369 $('.paralax-background').css('height', (jumboHeight-scrolled) + 'px'); 370 $('.paralax-background').css('height', (jumboHeight-scrolled) + 'px');
370 } 371 }
371   372  
372 $(window).scroll(function(e){ 373 $(window).scroll(function(e){
373 parallax(); 374 parallax();
374 }); 375 });
375 </script> 376 </script>
376 </body> 377 </body>
377 </html> 378 </html>
378   379