This commit is contained in:
harshasiddartha 2026-01-22 13:25:19 +00:00 committed by GitHub
commit 753597331b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 14 additions and 8 deletions

View file

@ -2762,9 +2762,13 @@ jQuery.PrivateBin = (function($) {
if (format === 'markdown') {
$plainText.removeClass('hidden');
// Show copy button for markdown format
$('#prettyMessageCopyBtn').removeClass('hidden');
$prettyMessage.addClass('hidden');
} else {
$plainText.addClass('hidden');
// Show copy button for non-markdown formats
$('#prettyMessageCopyBtn').removeClass('hidden');
$prettyMessage.removeClass('hidden');
}
}
@ -2881,6 +2885,8 @@ jQuery.PrivateBin = (function($) {
$plainText.addClass('hidden');
$prettyMessage.addClass('hidden');
// Also hide the copy button when hiding the view
$('#prettyMessageCopyBtn').addClass('hidden');
$placeholder.addClass('hidden');
AttachmentViewer.hideAttachmentPreview();

View file

@ -622,11 +622,11 @@ endif;
<div id="placeholder" class="col-md-12 hidden"><?php echo I18n::_('+++ no document text +++'); ?></div>
<div id="attachmentPreview" class="col-md-12 text-center hidden"></div>
<h5 id="copyShortcutHint" class="col-md-12"><small id="copyShortcutHintText"></small></h5>
<button id="prettyMessageCopyBtn" class="col-md-12 hidden">
<span id="copyIcon" class="glyphicon glyphicon-duplicate" aria-hidden="true"></span>
<span id="copySuccessIcon" class="glyphicon glyphicon-ok text-success" aria-hidden="true"></span>
</button>
<div id="prettymessage" class="col-md-12 hidden">
<button id="prettyMessageCopyBtn">
<span id="copyIcon" class="glyphicon glyphicon-duplicate" aria-hidden="true"></span>
<span id="copySuccessIcon" class="glyphicon glyphicon-ok text-success" aria-hidden="true"></span>
</button>
<pre id="prettyprint" class="col-md-12 prettyprint linenums:1"></pre>
</div>
<div id="plaintext" class="col-md-12 hidden"></div>

View file

@ -480,11 +480,11 @@ endif;
<div id="placeholder" class="col-md-12 hidden"><?php echo I18n::_('+++ no document text +++'); ?></div>
<div id="attachmentPreview" class="col-md-12 text-center hidden"></div>
<h6 id="copyShortcutHint" class="col-md-12"><small id="copyShortcutHintText"></small></h6>
<button type="button" id="prettyMessageCopyBtn" class="text-secondary opacity-05-1-hover col-md-12 hidden">
<svg id="copyIcon" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#copy" /></svg>
<svg id="copySuccessIcon" class="text-success" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#check" /></svg>
</button>
<div id="prettymessage" class="card col-md-12 hidden">
<button type="button" id="prettyMessageCopyBtn" class="text-secondary opacity-05-1-hover">
<svg id="copyIcon" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#copy" /></svg>
<svg id="copySuccessIcon" class="text-success" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#check" /></svg>
</button>
<pre id="prettyprint" class="card-body col-md-12 prettyprint linenums:1"></pre>
</div>
<div id="plaintext" class="col-md-12 hidden"></div>