/quickload/text.html/text.html |
@@ -61,7 +61,7 @@ |
<div class="input-group"> |
<span class="input-group-btn"> |
<button id="save" class="btn btn-default" type="button" data-toggle="tooltip" data-placement="auto" title="Generate link."> |
<i class="glyphicon glyphicon-globe"></i> |
<i class="glyphicon glyphicon-share"></i> |
</button> |
</span> |
<input id="URL" type="text" class="form-control" readonly> |
@@ -80,7 +80,7 @@ |
</span> |
<span class="input-group-btn"> |
<button id="reset" class="btn btn-default" type="button" data-toggle="tooltip" data-placement="auto" title="Reset document."> |
<i class="glyphicon glyphicon-erase"></i> |
<i class="glyphicon glyphicon-home"></i> |
</button> |
</span> |
<input id="nick" type="text" class="form-control" pattern="^[A-Za-z0-9]{32}$" maxlength="32"> |
@@ -205,7 +205,7 @@ |
}); |
}); |
|
// When the user wants to assume a nickname. |
// When the button is clicked, navigate to the fingerprint. |
$('#go').click(() => { |
nick = $('#nick').val(); |
if(!nick || nick.length != 32) |
@@ -230,6 +230,7 @@ |
}); |
}); |
|
// When the form is submitted, naigate to the fingerprint. |
$('#nick-form').submit((e) => { |
e.preventDefault(); |
|
@@ -256,6 +257,32 @@ |
}); |
}); |
|
// While the nick is changing, navigate to the changed fingerprint. |
$("#nick").on('input', () => { |
nick = $('#nick').val(); |
if(!nick || nick.length != 32) |
return; |
Cookies.set('nick', nick, { path: '' }); |
result = nick; |
|
// Retrieve the contents of the shared file. |
$.post('share-text.php', |
{ |
timestamp: window.performance.now(), |
fingerprint: nick, |
action: 'LOAD' |
}).done((data) => {; |
$('#trumbowyg') |
.trumbowyg('html', data); |
$('#trumbowyg').trumbowyg('enable'); |
$('#trumbowyg').show(); |
}).fail(() => { |
$('#trumbowyg').trumbowyg('enable'); |
$('#trumbowyg').show(); |
}); |
}); |
|
// When the reset button is pressed, navigate to the fingerprint. |
$('#reset').click(() => { |
Cookies.set('nick', fingerprint, { path: '' }); |
$('#nick').val(fingerprint); |