scratch – Diff between revs 74 and 76

Subversion Repositories:
Rev:
Only display areas with differencesIgnore whitespace
Rev 74 Rev 76
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"> 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 semantic: true,
184 autogrow: true, 184 autogrow: true,
185 disabled: true 185 disabled: true
186 }).on('tbwchange', () => { 186 }).on('tbwchange', () => {
187 // 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.
188 $('#URL').val(''); 188 $('#URL').val('');
189 // Reschedule saving of the file. 189 // Reschedule saving of the file.
190 window.clearTimeout(autoSaveTimeoutID); 190 window.clearTimeout(autoSaveTimeoutID);
191 autoSaveTimeoutID = window.setTimeout(saveTextFile, 250); 191 autoSaveTimeoutID = window.setTimeout(saveTextFile, 250);
192 }); 192 });
193 193
194 // Retrieve the contents of the shared file. 194 // Retrieve the contents of the shared file.
195 $('#trumbowyg').trumbowyg('disable'); 195 $('#trumbowyg').trumbowyg('disable');
196 $.post('text.php', 196 $.post('text.php',
197 { 197 {
198 timestamp: window.performance.now(), 198 timestamp: window.performance.now(),
199 fingerprint: result, 199 fingerprint: result,
200 action: 'LOAD' 200 action: 'LOAD'
201 }).done((data) => {; 201 }).done((data) => {;
202 $('#trumbowyg') 202 $('#trumbowyg')
203 .trumbowyg('html', data); 203 .trumbowyg('html', data);
204 $('#trumbowyg').trumbowyg('enable'); 204 $('#trumbowyg').trumbowyg('enable');
205 $('#trumbowyg').show(); 205 $('#trumbowyg').show();
206 }).fail(() => { 206 }).fail(() => {
207 $('#trumbowyg').trumbowyg('enable'); 207 $('#trumbowyg').trumbowyg('enable');
208 $('#trumbowyg').show(); 208 $('#trumbowyg').show();
209 }); 209 });
210 210
211 $('#save').click(() => { 211 $('#save').click(() => {
212 $('#editor').trumbowyg('disable'); 212 $('#editor').trumbowyg('disable');
213 var formData = new FormData(); 213 var formData = new FormData();
214 formData.append('file', new Blob( 214 formData.append('file', new Blob(
215 [ 215 [
216 $('#trumbowyg').trumbowyg('html') 216 $('#trumbowyg').trumbowyg('html')
217 ] 217 ]
218 ), 218 ),
219 '.html' 219 '.html'
220 ); 220 );
221 221
222 $.ajax({ 222 $.ajax({
223 url: 'file.php', 223 url: 'file.php',
224 type: 'POST', 224 type: 'POST',
225 data: formData, 225 data: formData,
226 // cache: false // FF 226 // cache: false // FF
227 processData: false, 227 processData: false,
228 contentType: false 228 contentType: false
229 }).done((data) => { 229 }).done((data) => {
230 $('#URL').val(data); 230 $('#URL')
-   231 .val(
-   232 location.protocol
-   233 .concat("//")
-   234 .concat(window.location.hostname)
-   235 .concat("/")
-   236 .concat(data)
-   237 );
231 $('#trumbowyg').trumbowyg('enable'); 238 $('#trumbowyg').trumbowyg('enable');
232 }).fail(() => { 239 }).fail(() => {
233 $('#trumbowyg').trumbowyg('enable'); 240 $('#trumbowyg').trumbowyg('enable');
234 }); 241 });
235 }); 242 });
236 243
237 // When the button is clicked, navigate to the fingerprint. 244 // When the button is clicked, navigate to the fingerprint.
238 $('#go').click(() => { 245 $('#go').click(() => {
239 nick = $('#nick').val(); 246 nick = $('#nick').val();
240 if(!nick || nick.length != 32) 247 if(!nick || nick.length != 32)
241 return; 248 return;
242 Cookies.set('nick', nick, { path: '' }); 249 Cookies.set('nick', nick, { path: '' });
243 result = nick; 250 result = nick;
244 251
245 // Retrieve the contents of the shared file. 252 // Retrieve the contents of the shared file.
246 $('#editor').trumbowyg('disable'); 253 $('#editor').trumbowyg('disable');
247 $.post('text.php', 254 $.post('text.php',
248 { 255 {
249 timestamp: window.performance.now(), 256 timestamp: window.performance.now(),
250 fingerprint: nick, 257 fingerprint: nick,
251 action: 'LOAD' 258 action: 'LOAD'
252 }).done((data) => {; 259 }).done((data) => {;
253 $('#trumbowyg') 260 $('#trumbowyg')
254 .trumbowyg('html', data); 261 .trumbowyg('html', data);
255 $('#trumbowyg').trumbowyg('enable'); 262 $('#trumbowyg').trumbowyg('enable');
256 $('#trumbowyg').show(); 263 $('#trumbowyg').show();
257 264
258 if(fingerprint == nick) 265 if(fingerprint == nick)
259 $('#home-icon').addClass("text-success").removeClass("text-danger"); 266 $('#home-icon').addClass("text-success").removeClass("text-danger");
260 else 267 else
261 $('#home-icon').addClass("text-danger").removeClass("text-success"); 268 $('#home-icon').addClass("text-danger").removeClass("text-success");
262 269
263 }).fail(() => { 270 }).fail(() => {
264 $('#trumbowyg').trumbowyg('enable'); 271 $('#trumbowyg').trumbowyg('enable');
265 $('#trumbowyg').show(); 272 $('#trumbowyg').show();
266 }); 273 });
267 }); 274 });
268 275
269 // When the form is submitted, naigate to the fingerprint. 276 // When the form is submitted, naigate to the fingerprint.
270 $('#nick-form').submit((e) => { 277 $('#nick-form').submit((e) => {
271 e.preventDefault(); 278 e.preventDefault();
272 279
273 nick = $('#nick').val(); 280 nick = $('#nick').val();
274 if(!nick || nick.length != 32) 281 if(!nick || nick.length != 32)
275 return; 282 return;
276 Cookies.set('nick', nick, { path: '' }); 283 Cookies.set('nick', nick, { path: '' });
277 result = nick; 284 result = nick;
278 285
279 // Retrieve the contents of the shared file. 286 // Retrieve the contents of the shared file.
280 $('#editor').trumbowyg('disable'); 287 $('#editor').trumbowyg('disable');
281 $.post('text.php', 288 $.post('text.php',
282 { 289 {
283 timestamp: window.performance.now(), 290 timestamp: window.performance.now(),
284 fingerprint: nick, 291 fingerprint: nick,
285 action: 'LOAD' 292 action: 'LOAD'
286 }).done((data) => {; 293 }).done((data) => {;
287 $('#trumbowyg') 294 $('#trumbowyg')
288 .trumbowyg('html', data); 295 .trumbowyg('html', data);
289 $('#trumbowyg').trumbowyg('enable'); 296 $('#trumbowyg').trumbowyg('enable');
290 $('#trumbowyg').show(); 297 $('#trumbowyg').show();
291 298
292 if(fingerprint == nick) 299 if(fingerprint == nick)
293 $('#home-icon').addClass("text-success").removeClass("text-danger"); 300 $('#home-icon').addClass("text-success").removeClass("text-danger");
294 else 301 else
295 $('#home-icon').addClass("text-danger").removeClass("text-success"); 302 $('#home-icon').addClass("text-danger").removeClass("text-success");
296 303
297 }).fail(() => { 304 }).fail(() => {
298 $('#trumbowyg').trumbowyg('enable'); 305 $('#trumbowyg').trumbowyg('enable');
299 $('#trumbowyg').show(); 306 $('#trumbowyg').show();
300 }); 307 });
301 }); 308 });
302 309
303 // While the nick is changing, navigate to the changed fingerprint. 310 // While the nick is changing, navigate to the changed fingerprint.
304 $("#nick").on('input', () => { 311 $("#nick").on('input', () => {
305 nick = $('#nick').val(); 312 nick = $('#nick').val();
306 if(!nick || nick.length != 32) 313 if(!nick || nick.length != 32)
307 return; 314 return;
308 Cookies.set('nick', nick, { path: '' }); 315 Cookies.set('nick', nick, { path: '' });
309 result = nick; 316 result = nick;
310 317
311 // Retrieve the contents of the shared file. 318 // Retrieve the contents of the shared file.
312 $('#editor').trumbowyg('disable'); 319 $('#editor').trumbowyg('disable');
313 $.post('text.php', 320 $.post('text.php',
314 { 321 {
315 timestamp: window.performance.now(), 322 timestamp: window.performance.now(),
316 fingerprint: nick, 323 fingerprint: nick,
317 action: 'LOAD' 324 action: 'LOAD'
318 }).done((data) => {; 325 }).done((data) => {;
319 $('#trumbowyg') 326 $('#trumbowyg')
320 .trumbowyg('html', data); 327 .trumbowyg('html', data);
321 $('#trumbowyg').trumbowyg('enable'); 328 $('#trumbowyg').trumbowyg('enable');
322 $('#trumbowyg').show(); 329 $('#trumbowyg').show();
323 330
324 if(fingerprint == nick) 331 if(fingerprint == nick)
325 $('#home-icon').addClass("text-success").removeClass("text-danger"); 332 $('#home-icon').addClass("text-success").removeClass("text-danger");
326 else 333 else
327 $('#home-icon').addClass("text-danger").removeClass("text-success"); 334 $('#home-icon').addClass("text-danger").removeClass("text-success");
328 }).fail(() => { 335 }).fail(() => {
329 $('#trumbowyg').trumbowyg('enable'); 336 $('#trumbowyg').trumbowyg('enable');
330 $('#trumbowyg').show(); 337 $('#trumbowyg').show();
331 }); 338 });
332 }); 339 });
333 340
334 // When the reset button is pressed, navigate to the fingerprint. 341 // When the reset button is pressed, navigate to the fingerprint.
335 $('#reset').click(() => { 342 $('#reset').click(() => {
336 Cookies.set('nick', fingerprint, { path: '' }); 343 Cookies.set('nick', fingerprint, { path: '' });
337 $('#nick').val(fingerprint); 344 $('#nick').val(fingerprint);
338 result = fingerprint; 345 result = fingerprint;
339 nick = fingerprint; 346 nick = fingerprint;
340 347
341 // Retrieve the contents of the shared file. 348 // Retrieve the contents of the shared file.
342 $('#editor').trumbowyg('disable'); 349 $('#editor').trumbowyg('disable');
343 $.post('text.php', 350 $.post('text.php',
344 { 351 {
345 timestamp: window.performance.now(), 352 timestamp: window.performance.now(),
346 fingerprint: fingerprint, 353 fingerprint: fingerprint,
347 action: 'LOAD' 354 action: 'LOAD'
348 }).done((data) => {; 355 }).done((data) => {;
349 $('#trumbowyg') 356 $('#trumbowyg')
350 .trumbowyg('html', data); 357 .trumbowyg('html', data);
351 $('#trumbowyg').trumbowyg('enable'); 358 $('#trumbowyg').trumbowyg('enable');
352 $('#trumbowyg').show(); 359 $('#trumbowyg').show();
353 if(fingerprint == nick) 360 if(fingerprint == nick)
354 $('#home-icon').addClass("text-success").removeClass("text-danger"); 361 $('#home-icon').addClass("text-success").removeClass("text-danger");
355 else 362 else
356 $('#home-icon').addClass("text-danger").removeClass("text-success"); 363 $('#home-icon').addClass("text-danger").removeClass("text-success");
357 }).fail(() => { 364 }).fail(() => {
358 $('#trumbowyg').trumbowyg('enable'); 365 $('#trumbowyg').trumbowyg('enable');
359 $('#trumbowyg').show(); 366 $('#trumbowyg').show();
360 }); 367 });
361 }); 368 });
362 }); 369 });
363 }); 370 });
364 </script> 371 </script>
365 <!-- Jumbotron parallax effect --> 372 <!-- Jumbotron parallax effect -->
366 <script> 373 <script>
367 var jumboHeight = $('.jumbotron').outerHeight(); 374 var jumboHeight = $('.jumbotron').outerHeight();
368 function parallax(){ 375 function parallax(){
369 var scrolled = $(window).scrollTop(); 376 var scrolled = $(window).scrollTop();
370 $('.paralax-background').css('height', (jumboHeight-scrolled) + 'px'); 377 $('.paralax-background').css('height', (jumboHeight-scrolled) + 'px');
371 } 378 }
372   379  
373 $(window).scroll(function(e){ 380 $(window).scroll(function(e){
374 parallax(); 381 parallax();
375 }); 382 });
376 </script> 383 </script>
377 </body> 384 </body>
378 </html> 385 </html>
379   386