scratch

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 53  →  ?path2? @ 54
/text.html
@@ -151,25 +151,30 @@
else
$('#home-icon').addClass("text-danger");
// Load the editor.
$('#trumbowyg').trumbowyg({
autogrow: true,
disabled: true
}).on('tbwchange', () => {
$('#editor').trumbowyg('disable');
function saveTextFile() {
$.post('text.php', {
data: $('#trumbowyg').trumbowyg('html'),
fingerprint: result,
action: 'SAVE',
timeout: 0
}).done((data) => {
$('#trumbowyg').trumbowyg('enable');
}).fail(() => {
$('#trumbowyg').trumbowyg('enable');
});
}
var autoSaveTimeoutID = window.setTimeout(saveTextFile, 250);
// Load the editor.
$('#trumbowyg').trumbowyg({
autogrow: true,
disabled: true
}).on('tbwchange', () => {
// Clear the value of the URL box because the URL will have changed.
$('#URL').val('');
// Reschedule saving of the file.
window.clearTimeout(autoSaveTimeoutID);
autoSaveTimeoutID = window.setTimeout(saveTextFile, 250);
});
// Retrieve the contents of the shared file.
$('#trumbowyg').trumbowyg('disable');
$.post('text.php',
{
timestamp: window.performance.now(),
@@ -187,7 +192,6 @@
$('#save').click(() => {
$('#editor').trumbowyg('disable');
var formData = new FormData();
formData.append('file', new Blob(
[
@@ -221,6 +225,7 @@
result = nick;
// Retrieve the contents of the shared file.
$('#editor').trumbowyg('disable');
$.post('text.php',
{
timestamp: window.performance.now(),
@@ -254,6 +259,7 @@
result = nick;
// Retrieve the contents of the shared file.
$('#editor').trumbowyg('disable');
$.post('text.php',
{
timestamp: window.performance.now(),
@@ -285,6 +291,7 @@
result = nick;
// Retrieve the contents of the shared file.
$('#editor').trumbowyg('disable');
$.post('text.php',
{
timestamp: window.performance.now(),
@@ -314,6 +321,7 @@
nick = fingerprint;
// Retrieve the contents of the shared file.
$('#editor').trumbowyg('disable');
$.post('text.php',
{
timestamp: window.performance.now(),