/text.html/text.html |
@@ -179,10 +179,13 @@ |
var autoSaveTimeoutID; |
|
function saveTextFile() { |
$.get('session.php').then((token) => { |
$.post('text.php', { |
data: $('#trumbowyg').trumbowyg('html'), |
token: token, |
fingerprint: result, |
action: 'SAVE' |
action: 'SAVE', |
token: token |
}).done((data) => { |
|
// Visual feedback for a successful save. |
@@ -206,6 +209,7 @@ |
window.clearTimeout(autoSaveTimeoutID); |
autoSaveTimeoutID = window.setTimeout(saveTextFile, 250); |
}); |
}); |
} |
|
// Load the editor. |
@@ -224,11 +228,13 @@ |
|
// Retrieve the contents of the shared file. |
$('#trumbowyg').trumbowyg('disable'); |
$.get('session.php').then((token) => { |
$.post('text.php', |
{ |
timestamp: window.performance.now(), |
fingerprint: result, |
action: 'LOAD' |
action: 'LOAD', |
token: token |
}).done((data) => {; |
$('#trumbowyg') |
.trumbowyg('html', data); |
@@ -238,6 +244,7 @@ |
$('#trumbowyg').trumbowyg('enable'); |
$('#trumbowyg').show(); |
}); |
}); |
|
$('#save').click(() => { |
$('#editor').trumbowyg('disable'); |
@@ -249,10 +256,11 @@ |
), |
'.html' |
); |
|
$.get('session.php').then((token) => { |
formData.append('token', token); |
$.ajax({ |
url: 'file.php', |
type: 'POST', |
//type: 'POST', |
data: formData, |
// cache: false // FF |
processData: false, |
@@ -274,6 +282,7 @@ |
$('#trumbowyg').trumbowyg('enable'); |
}); |
}); |
}); |
|
// When the button is clicked, navigate to the fingerprint. |
$('#go').click(() => { |
@@ -285,11 +294,13 @@ |
|
// Retrieve the contents of the shared file. |
$('#editor').trumbowyg('disable'); |
$.get('session.php').then((token) => { |
$.post('text.php', |
{ |
timestamp: window.performance.now(), |
fingerprint: nick, |
action: 'LOAD' |
action: 'LOAD', |
token: token |
}).done((data) => {; |
$('#trumbowyg') |
.trumbowyg('html', data); |
@@ -306,6 +317,7 @@ |
$('#trumbowyg').show(); |
}); |
}); |
}); |
|
// When the form is submitted, naigate to the fingerprint. |
$('#nick-form').submit((e) => { |
@@ -319,11 +331,13 @@ |
|
// Retrieve the contents of the shared file. |
$('#editor').trumbowyg('disable'); |
$.get('session.php').then((token) => { |
$.post('text.php', |
{ |
timestamp: window.performance.now(), |
fingerprint: nick, |
action: 'LOAD' |
action: 'LOAD', |
token: token |
}).done((data) => {; |
$('#trumbowyg') |
.trumbowyg('html', data); |
@@ -340,6 +354,7 @@ |
$('#trumbowyg').show(); |
}); |
}); |
}); |
|
// While the nick is changing, navigate to the changed fingerprint. |
$("#nick").on('input', () => { |
@@ -351,11 +366,13 @@ |
|
// Retrieve the contents of the shared file. |
$('#editor').trumbowyg('disable'); |
$.get('session.php').then((token) => { |
$.post('text.php', |
{ |
timestamp: window.performance.now(), |
fingerprint: nick, |
action: 'LOAD' |
action: 'LOAD', |
token: token |
}).done((data) => {; |
$('#trumbowyg') |
.trumbowyg('html', data); |
@@ -371,6 +388,7 @@ |
$('#trumbowyg').show(); |
}); |
}); |
}); |
|
// When the reset button is pressed, navigate to the fingerprint. |
$('#reset').click(() => { |
@@ -381,11 +399,13 @@ |
|
// Retrieve the contents of the shared file. |
$('#editor').trumbowyg('disable'); |
$.get('session.php').then((token) => { |
$.post('text.php', |
{ |
timestamp: window.performance.now(), |
fingerprint: fingerprint, |
action: 'LOAD' |
action: 'LOAD', |
token: token |
}).done((data) => {; |
$('#trumbowyg') |
.trumbowyg('html', data); |
@@ -401,6 +421,7 @@ |
}); |
}); |
}); |
}); |
|
// Scroll to the panel. |
$('html, body').animate({ |