mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-08-06 13:34:27 -04:00
- window.confirm fallbacks for page template removed
- page template removed from configuration-test-generator
This commit is contained in:
parent
3d3d80c60b
commit
692e7af196
4 changed files with 47 additions and 86 deletions
|
@ -164,14 +164,14 @@ new ConfigurationTestGenerator(array(
|
|||
),
|
||||
'main/template' => array(
|
||||
array(
|
||||
'setting' => 'page',
|
||||
'setting' => 'bootstrap5',
|
||||
'tests' => array(
|
||||
array(
|
||||
'type' => 'MatchesRegularExpression',
|
||||
'args' => array(
|
||||
'#<link[^>]+type="text/css"[^>]+rel="stylesheet"[^>]+href="css/privatebin\.css\\?\d[\d\.]+\d+"[^>]*/>#',
|
||||
'#<link[^>]+type="text/css"[^>]+rel="stylesheet"[^>]+href="css/bootstrap5/privatebin\.css\\?\d[\d\.]+\d+"[^>]*/>#',
|
||||
'$content',
|
||||
'outputs "page" stylesheet correctly',
|
||||
'outputs "bootstrap5" stylesheet correctly',
|
||||
),
|
||||
), array(
|
||||
'type' => 'DoesNotMatchRegularExpression',
|
||||
|
@ -189,9 +189,9 @@ new ConfigurationTestGenerator(array(
|
|||
array(
|
||||
'type' => 'DoesNotMatchRegularExpression',
|
||||
'args' => array(
|
||||
'#<link[^>]+type="text/css"[^>]+rel="stylesheet"[^>]+href="css/privatebin\.css\\?\d[\d\.]+\d+"[^>]*/>#',
|
||||
'#<link[^>]+type="text/css"[^>]+rel="stylesheet"[^>]+href="css/bootstrap5/privatebin\.css\\?\d[\d\.]+\d+"[^>]*/>#',
|
||||
'$content',
|
||||
'removes "page" stylesheet correctly',
|
||||
'removes "bootstrap5" stylesheet correctly',
|
||||
),
|
||||
), array(
|
||||
'type' => 'MatchesRegularExpression',
|
||||
|
|
|
@ -2319,27 +2319,20 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|||
me.requestLoadConfirmation = function()
|
||||
{
|
||||
const $loadconfirmmodal = $('#loadconfirmmodal');
|
||||
if ($loadconfirmmodal.length > 0) {
|
||||
|
||||
const $loadconfirmOpenNow = $loadconfirmmodal.find('#loadconfirm-open-now');
|
||||
$loadconfirmOpenNow.off('click.loadPaste');
|
||||
$loadconfirmOpenNow.on('click.loadPaste', PasteDecrypter.run);
|
||||
|
||||
const $loadconfirmClose = $loadconfirmmodal.find('.close');
|
||||
$loadconfirmClose.off('click.close');
|
||||
$loadconfirmClose.on('click.close', Controller.newPaste);
|
||||
|
||||
if (typeof bootstrap !== 'undefined' && bootstrap.Tooltip.VERSION) {
|
||||
(new bootstrap.Modal($loadconfirmmodal[0])).show();
|
||||
} else {
|
||||
$loadconfirmmodal.modal('show');
|
||||
}
|
||||
} else {
|
||||
if (window.confirm(
|
||||
I18n._('This secret message can only be displayed once. Would you like to see it now?')
|
||||
)) {
|
||||
PasteDecrypter.run();
|
||||
} else {
|
||||
Controller.newPaste();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2360,15 +2353,6 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|||
return;
|
||||
}
|
||||
|
||||
// fallback to old method for page template
|
||||
password = prompt(I18n._('Please enter the password for this paste:'), '');
|
||||
if (password === null) {
|
||||
throw 'password prompt canceled';
|
||||
}
|
||||
if (password.length === 0) {
|
||||
// recurse…
|
||||
return me.requestPassword();
|
||||
}
|
||||
PasteDecrypter.run();
|
||||
};
|
||||
|
||||
|
@ -4193,7 +4177,6 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|||
expirationDateRoundedToSecond.setUTCSeconds(0);
|
||||
|
||||
const $emailconfirmmodal = $('#emailconfirmmodal');
|
||||
if ($emailconfirmmodal.length > 0) {
|
||||
if (expirationDate !== null) {
|
||||
const $emailconfirmTimezoneCurrent = $emailconfirmmodal.find('#emailconfirm-timezone-current');
|
||||
const $emailconfirmTimezoneUtc = $emailconfirmmodal.find('#emailconfirm-timezone-utc');
|
||||
|
@ -4231,22 +4214,6 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|||
} else {
|
||||
triggerEmailSend(templateEmailBody(null, isBurnafterreading));
|
||||
}
|
||||
} else {
|
||||
let emailBody = '';
|
||||
if (expirationDate !== null) {
|
||||
const expirationDateString = window.confirm(
|
||||
I18n._('Recipient may become aware of your timezone, convert time to UTC?')
|
||||
) ? expirationDateRoundedToSecond.toLocaleString(
|
||||
undefined,
|
||||
// we don't use Date.prototype.toUTCString() because we would like to avoid GMT
|
||||
{ timeZone: 'UTC', dateStyle: 'long', timeStyle: 'long' }
|
||||
) : expirationDateRoundedToSecond.toLocaleString();
|
||||
emailBody = templateEmailBody(expirationDateString, isBurnafterreading);
|
||||
} else {
|
||||
emailBody = templateEmailBody(null, isBurnafterreading);
|
||||
}
|
||||
triggerEmailSend(emailBody);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -4728,13 +4695,9 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|||
|
||||
// bootstrap template drop down
|
||||
$('#language ul.dropdown-menu li a').click(setLanguage);
|
||||
// page template drop down
|
||||
$('#language select').change(setLanguage);
|
||||
|
||||
// bootstrap template drop down
|
||||
$('#template ul.dropdown-menu li a').click(setTemplate);
|
||||
// page template drop down
|
||||
$('#template select').change(setTemplate);
|
||||
|
||||
// bind events
|
||||
$burnAfterReading.change(changeBurnAfterReading);
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
require('../common');
|
||||
|
||||
describe('Prompt', function () {
|
||||
// TODO: this does not test the prompt() fallback, since that isn't available
|
||||
// in nodejs -> replace the prompt in the "page" template with a modal
|
||||
describe('requestPassword & getPassword', function () {
|
||||
this.timeout(30000);
|
||||
|
||||
|
|
|
@ -118,7 +118,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-i0l0rh+NCY8Oeg9SxzQREHin6egXJ6sdIC84RTEsBpBNhYGObv8QEdRng1dMERZmw4olVeXx2ZCkusTyT1G+SA==',
|
||||
'js/privatebin.js' => 'sha512-lP3oQM8eZ6HNCUUZC2HvmNTO3RRNw7WPCCWbVVr0e9DHvgprYr6tYtDYzmWdpD6rzjHOgekHhFMO8LIO9ufyug==',
|
||||
'js/purify-3.2.6.js' => 'sha512-zqwL4OoBLFx89QPewkz4Lz5CSA2ktU+f31fuECkF0iK3Id5qd3Zpq5dMby8KwHjIEpsUgOqwF58cnmcaNem0EA==',
|
||||
'js/rawinflate-0.3.js' => 'sha512-g8uelGgJW9A/Z1tB6Izxab++oj5kdD7B4qC7DHwZkB6DGMXKyzx7v5mvap2HXueI2IIn08YlRYM56jwWdm2ucQ==',
|
||||
'js/showdown-2.1.0.js' => 'sha512-WYXZgkTR0u/Y9SVIA4nTTOih0kXMEd8RRV6MLFdL6YU8ymhR528NLlYQt1nlJQbYz4EW+ZsS0fx1awhiQJme1Q==',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue