mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2024-10-01 01:26:10 -04:00
Merge pull request #1322 from PrivateBin/bootstrap-expiration-time
expiration time selection fix for bootstrap template
This commit is contained in:
commit
b080fd5e39
@ -1,6 +1,7 @@
|
||||
# PrivateBin version history
|
||||
|
||||
## 1.7.3 (not yet released)
|
||||
* FIXED: Selected expiration not being applied, when using bootstrap template (#1309)
|
||||
|
||||
## 1.7.2 (2024-05-05)
|
||||
* ADDED: Allow use of `shortenviayourls` in query parameters (#1267)
|
||||
|
@ -4371,7 +4371,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
||||
*/
|
||||
me.getExpiration = function()
|
||||
{
|
||||
return Model.getExpirationDefault() || pasteExpiration;
|
||||
return pasteExpiration;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -4554,6 +4554,10 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
||||
// bootstrap template drop downs
|
||||
$('ul.dropdown-menu li a', $('#expiration').parent()).click(updateExpiration);
|
||||
$('ul.dropdown-menu li a', $('#formatter').parent()).click(updateFormat);
|
||||
// bootstrap5 & page drop downs
|
||||
$('#pasteExpiration').on('change', function() {
|
||||
pasteExpiration = Model.getExpirationDefault();
|
||||
});
|
||||
$('#pasteFormatter').on('change', function() {
|
||||
PasteViewer.setFormat(Model.getFormatDefault());
|
||||
});
|
||||
@ -4565,7 +4569,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
||||
// get default values from template or fall back to set value
|
||||
burnAfterReadingDefault = me.getBurnAfterReading();
|
||||
openDiscussionDefault = me.getOpenDiscussion();
|
||||
pasteExpiration = Model.getExpirationDefault() || pasteExpiration;
|
||||
pasteExpiration = Model.getExpirationDefault();
|
||||
|
||||
createButtonsDisplayed = false;
|
||||
viewButtonsDisplayed = false;
|
||||
|
@ -456,8 +456,14 @@ describe('TopNav', function () {
|
||||
it(
|
||||
'returns the currently selected expiration date',
|
||||
function () {
|
||||
$('body').html(
|
||||
'<select id="pasteExpiration" name="pasteExpiration">' +
|
||||
'<option value="1day">1 day</option>' +
|
||||
'<option value="never">Never</option></select>'
|
||||
);
|
||||
$.PrivateBin.TopNav.init();
|
||||
assert.ok($.PrivateBin.TopNav.getExpiration() === null);
|
||||
assert.ok($.PrivateBin.TopNav.getExpiration() === '1day');
|
||||
cleanup();
|
||||
}
|
||||
);
|
||||
});
|
||||
|
@ -73,7 +73,7 @@ endif;
|
||||
?>
|
||||
<script type="text/javascript" data-cfasync="false" src="js/purify-3.1.2.js" integrity="sha512-voYCOVXik5/jcT+McTiptsB00iB0NWQrhBmSwSEfj0IH3UDphU8w12JV8w1y+m8FRaozbzW4efHSEWKZpOA+JQ==" crossorigin="anonymous"></script>
|
||||
<script type="text/javascript" data-cfasync="false" src="js/legacy.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-LYos+qXHIRqFf5ZPNphvtTB0cgzHUizu2wwcOwcwz/VIpRv9lpcBgPYz4uq6jx0INwCAj6Fbnl5HoKiLufS2jg==" crossorigin="anonymous"></script>
|
||||
<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-QnwyZIEFZg8uvFAsnXbeHTNarA4hPhGcMv8RTAIS4cOgR6oh0ofxjY3OdiGzccArf6VeFFKjqkFo94CrcUXkxQ==" crossorigin="anonymous"></script>
|
||||
<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-gVZBjRO45BZ7OeSspLHUVNmNF98wdxk3zebL5KUV/3Ty607YkD6CZw1ORqKpAGvKrKFp/jcaWV5uwpCqfoQGlw==" crossorigin="anonymous"></script>
|
||||
<!-- icon -->
|
||||
<link rel="apple-touch-icon" href="<?php echo I18n::encode($BASEPATH); ?>img/apple-touch-icon.png" sizes="180x180" />
|
||||
<link rel="icon" type="image/png" href="img/favicon-32x32.png" sizes="32x32" />
|
||||
|
@ -57,7 +57,7 @@ endif;
|
||||
?>
|
||||
<script type="text/javascript" data-cfasync="false" src="js/purify-3.1.2.js" integrity="sha512-voYCOVXik5/jcT+McTiptsB00iB0NWQrhBmSwSEfj0IH3UDphU8w12JV8w1y+m8FRaozbzW4efHSEWKZpOA+JQ==" crossorigin="anonymous"></script>
|
||||
<script type="text/javascript" data-cfasync="false" src="js/legacy.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-LYos+qXHIRqFf5ZPNphvtTB0cgzHUizu2wwcOwcwz/VIpRv9lpcBgPYz4uq6jx0INwCAj6Fbnl5HoKiLufS2jg==" crossorigin="anonymous"></script>
|
||||
<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-QnwyZIEFZg8uvFAsnXbeHTNarA4hPhGcMv8RTAIS4cOgR6oh0ofxjY3OdiGzccArf6VeFFKjqkFo94CrcUXkxQ==" crossorigin="anonymous"></script>
|
||||
<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-gVZBjRO45BZ7OeSspLHUVNmNF98wdxk3zebL5KUV/3Ty607YkD6CZw1ORqKpAGvKrKFp/jcaWV5uwpCqfoQGlw==" crossorigin="anonymous"></script>
|
||||
<!-- icon -->
|
||||
<link rel="apple-touch-icon" href="<?php echo I18n::encode($BASEPATH); ?>img/apple-touch-icon.png" sizes="180x180" />
|
||||
<link rel="icon" type="image/png" href="img/favicon-32x32.png" sizes="32x32" />
|
||||
|
@ -51,7 +51,7 @@ endif;
|
||||
?>
|
||||
<script type="text/javascript" data-cfasync="false" src="js/purify-3.1.2.js" integrity="sha512-voYCOVXik5/jcT+McTiptsB00iB0NWQrhBmSwSEfj0IH3UDphU8w12JV8w1y+m8FRaozbzW4efHSEWKZpOA+JQ==" crossorigin="anonymous"></script>
|
||||
<script type="text/javascript" data-cfasync="false" src="js/legacy.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-LYos+qXHIRqFf5ZPNphvtTB0cgzHUizu2wwcOwcwz/VIpRv9lpcBgPYz4uq6jx0INwCAj6Fbnl5HoKiLufS2jg==" crossorigin="anonymous"></script>
|
||||
<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-QnwyZIEFZg8uvFAsnXbeHTNarA4hPhGcMv8RTAIS4cOgR6oh0ofxjY3OdiGzccArf6VeFFKjqkFo94CrcUXkxQ==" crossorigin="anonymous"></script>
|
||||
<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-gVZBjRO45BZ7OeSspLHUVNmNF98wdxk3zebL5KUV/3Ty607YkD6CZw1ORqKpAGvKrKFp/jcaWV5uwpCqfoQGlw==" crossorigin="anonymous"></script>
|
||||
<!-- icon -->
|
||||
<link rel="apple-touch-icon" href="img/apple-touch-icon.png?<?php echo rawurlencode($VERSION); ?>" sizes="180x180" />
|
||||
<link rel="icon" type="image/png" href="img/favicon-32x32.png?<?php echo rawurlencode($VERSION); ?>" sizes="32x32" />
|
||||
|
Loading…
Reference in New Issue
Block a user