- trash icon added to bootstrap-icons.svg

- made delete link a separate button
- unit tests updated
This commit is contained in:
ribas160 2025-01-04 22:27:09 +02:00
parent 52cd7b3590
commit 7b57d7b289
6 changed files with 24 additions and 14 deletions

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

@ -2120,8 +2120,8 @@ jQuery.PrivateBin = (function($, RawDeflate) {
$pasteUrl.click(pasteLinkClick);
// delete link
$('#deletelink').html('<a href="' + deleteUrl + '"></a>');
I18n._($('#deletelink a').first(), 'Delete data');
$('#deletelink').attr('href', deleteUrl);
I18n._($('#deletelink span').not('.glyphicon').first(), 'Delete data');
// enable shortener button
$shortenButton.removeClass('buttondisabled');

View File

@ -30,11 +30,11 @@ describe('PasteStatus', function () {
const expected1 = common.urlToString(url1).replace(/&(gt|lt)$/, '&$1a'),
expected2 = common.urlToString(url2).replace(/&(gt|lt)$/, '&$1a'),
clean = jsdom();
$('body').html('<div><div id="deletelink"></div><div id="pastelink"></div></div>');
$('body').html('<a href="#" id="deletelink"><span></span></a><div id="pastelink"></div>');
$.PrivateBin.PasteStatus.init();
$.PrivateBin.PasteStatus.createPasteNotification(expected1, expected2);
const result1 = $('#pasteurl')[0].href,
result2 = $('#deletelink a')[0].href;
result2 = $('#deletelink')[0].href;
clean();
return result1 === expected1 && result2 === expected2;
}

View File

@ -108,7 +108,7 @@ class Configuration
'js/kjua-0.9.0.js' => 'sha512-CVn7af+vTMBd9RjoS4QM5fpLFEOtBCoB0zPtaqIDC7sF4F8qgUSRFQQpIyEDGsr6yrjbuOLzdf20tkHHmpaqwQ==',
'js/legacy.js' => 'sha512-UxW/TOZKon83n6dk/09GsYKIyeO5LeBHokxyIq+r7KFS5KMBeIB/EM7NrkVYIezwZBaovnyNtY2d9tKFicRlXg==',
'js/prettify.js' => 'sha512-puO0Ogy++IoA2Pb9IjSxV1n4+kQkKXYAEUtVzfZpQepyDPyXk8hokiYDS7ybMogYlyyEIwMLpZqVhCkARQWLMg==',
'js/privatebin.js' => 'sha512-cCt3Slm10JXtPJhgmYdf1RKO7uWdz6U+k0bdPjTYfdO6WeWfruN9RkJE7tKmpgw8A35H4Xifmrr2KmyVOMbc3g==',
'js/privatebin.js' => 'sha512-vNl2M1Ev+317XYqNW5U0jDvqOLjdTe2jepqWfPEZus21sLPSqeeG9PxYUugLWf7rrzozoTl8weDDhwMczIyq6w==',
'js/purify-3.1.7.js' => 'sha512-LegvqULiMtOfboJZw9MpETN/b+xnLRXZI90gG7oIFHW+yAeHmKvRtEUbiMFx2WvUqQoL9XB3gwU+hWXUT0X+8A==',
'js/rawinflate-0.3.js' => 'sha512-g8uelGgJW9A/Z1tB6Izxab++oj5kdD7B4qC7DHwZkB6DGMXKyzx7v5mvap2HXueI2IIn08YlRYM56jwWdm2ucQ==',
'js/showdown-2.1.0.js' => 'sha512-WYXZgkTR0u/Y9SVIA4nTTOih0kXMEd8RRV6MLFdL6YU8ymhR528NLlYQt1nlJQbYz4EW+ZsS0fx1awhiQJme1Q==',

View File

@ -535,12 +535,17 @@ if ($HTTPWARNING) :
endif;
?>
<div id="pastesuccess" class="hidden">
<div class="nav nav-justified">
<button id="copyLink" type="button" class="btn btn-<?php echo $isDark ? 'warning' : 'default'; ?> navbar-btn">
<span class="glyphicon glyphicon-duplicate" aria-hidden="true"></span> <?php echo I18n::_('Copy link') ?>
</button>
<a href="#" id="deletelink" class="btn btn-<?php echo $isDark ? 'warning' : 'default'; ?> navbar-btn">
<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
<span></span>
</a>
</div>
<div role="alert" class="alert alert-success">
<span class="glyphicon glyphicon-ok" aria-hidden="true"></span>
<div id="deletelink"></div>
<div id="pastelink"></div>
</div>
<?php

View File

@ -400,12 +400,17 @@ if ($HTTPWARNING) :
endif;
?>
<div id="pastesuccess" class="hidden">
<button id="copyLink" type="button" class="btn btn-secondary flex-fill mb-2">
<div class="nav justify-content-between mb-2">
<button id="copyLink" type="button" class="btn btn-secondary">
<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#copy" /></svg> <?php echo I18n::_('Copy link') ?>
</button>
<a href="#" id="deletelink" class="btn btn-secondary">
<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#trash" /></svg>
<span></span>
</a>
</div>
<div role="alert" class="alert alert-success">
<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#check" /></svg>
<div id="deletelink"></div>
<div id="pastelink"></div>
</div>
<?php