Merge pull request #43 from gavtroy/decrypt-enter-key

Autofocus inputs, handle Enter key after entering decryption password
This commit is contained in:
Mateusz Kaczanowski 2023-02-20 00:40:57 +01:00 committed by GitHub
commit 39758cab54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View file

@ -139,6 +139,15 @@ $(document).ready(function() {
$('#burn-dropdown-btn').text("Burn: " + this.innerHTML); $('#burn-dropdown-btn').text("Burn: " + this.innerHTML);
}); });
$('#password-modal').on('shown.bs.modal', function () {
$('#modal-password').trigger('focus');
})
$('#password-modal form').submit(function(event) {
event.preventDefault();
$('#decrypt-btn').click();
});
$('#decrypt-btn').click(function(event) { $('#decrypt-btn').click(function(event) {
var pass = $("#modal-password").val(); var pass = $("#modal-password").val();
var data = ""; var data = "";

View file

@ -254,7 +254,7 @@
{{#if is_editable}} {{#if is_editable}}
<div class="form-group"> <div class="form-group">
<textarea class="form-control" id="content-textarea" rows="25">{{pastebin_code}}</textarea> <textarea autofocus class="form-control" id="content-textarea" rows="25">{{pastebin_code}}</textarea>
</div> </div>
{{/if}} {{/if}}
{{#if is_created or is_clone}} {{#if is_created or is_clone}}