fix: The content format is not reset on create a new or clone document

This commit is contained in:
Ribas160 2025-12-14 09:08:48 +02:00
parent 5a067e893f
commit ed9b3d1aa0
No known key found for this signature in database
GPG key ID: ED4AE99DCA25A6BB
3 changed files with 11 additions and 2 deletions

View file

@ -6,6 +6,7 @@
* CHANGED: Refactored translation of exception messages
* FIXED: Some exceptions not getting translated
* FIXED: Attachment disappears after a "paste" in the message area (#1731)
* FIXED: The content format is not reset when creating a new document (#1707)
## 1.7.9 (2025-11-13)
* CHANGED: Upgrading libraries to: base-x 5.0.1, bootstrap 5.3.8, DOMpurify 3.2.7, ip-lib 1.21.0 & kjua 0.10.0

View file

@ -4632,7 +4632,11 @@ jQuery.PrivateBin = (function($) {
*/
me.setFormat = function(format)
{
$formatter.parent().find(`a[data-format="${format}"]`).click();
if (Helper.isBootstrap5()) {
$formatter.find(`select`).val(format);
} else {
$formatter.parent().find(`a[data-format="${format}"]`).click();
}
}
/**
@ -5792,6 +5796,10 @@ jQuery.PrivateBin = (function($) {
AttachmentViewer.removeAttachment();
TopNav.resetInput();
// reset format
PasteViewer.setFormat('plaintext');
TopNav.setFormat('plaintext');
TopNav.showCreateButtons();
// newPaste could be called when user is on document clone editing view

View file

@ -122,7 +122,7 @@ class Configuration
'js/kjua-0.10.0.js' => 'sha512-BYj4xggowR7QD150VLSTRlzH62YPfhpIM+b/1EUEr7RQpdWAGKulxWnOvjFx1FUlba4m6ihpNYuQab51H6XlYg==',
'js/legacy.js' => 'sha512-rGXYUpIqbFoHAgBXZ0UlJBdNAIMOC9EQ67MG0X46D5uRB8LvwzgKirbSQRGdYfk8I2jsUcm+tvHXYboUnC6DUg==',
'js/prettify.js' => 'sha512-puO0Ogy++IoA2Pb9IjSxV1n4+kQkKXYAEUtVzfZpQepyDPyXk8hokiYDS7ybMogYlyyEIwMLpZqVhCkARQWLMg==',
'js/privatebin.js' => 'sha512-WyXqnKduXRN1dClbnznN/GoOAhjpEzmtc4d3xrgoaMlFR/7YtfJtMvGIoLbX8S2Bx5GMhvbGOocRa28INaewcQ==',
'js/privatebin.js' => 'sha512-mU0j5BlLPSzNPlNDWtQP1oXiLLC4QqSOl1/zliMvoLsMbdWGECi6Vv0+VhidbXdxsweDdIsSU2OmigujtN2cYA==',
'js/purify-3.3.0.js' => 'sha512-lsHD5zxs4lu/NDzaaibe27Vd2t7Cy9JQ3qDHUvDfb4oZvKoWDNEhwUY+4bT3R68cGgpgCYp8U1x2ifeVxqurdQ==',
'js/showdown-2.1.0.js' => 'sha512-WYXZgkTR0u/Y9SVIA4nTTOih0kXMEd8RRV6MLFdL6YU8ymhR528NLlYQt1nlJQbYz4EW+ZsS0fx1awhiQJme1Q==',
'js/zlib-1.3.1-1.js' => 'sha512-5bU9IIP4PgBrOKLZvGWJD4kgfQrkTz8Z3Iqeu058mbQzW3mCumOU6M3UVbVZU9rrVoVwaW4cZK8U8h5xjF88eQ==',