|
@@ -2257,7 +2257,11 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|
|
password = $passwordDecrypt.val();
|
|
password = $passwordDecrypt.val();
|
|
|
|
|
|
|
|
// hide modal
|
|
// hide modal
|
|
|
- $passwordModal.modal('hide');
|
|
|
|
|
|
|
+ if (typeof bootstrap !== 'undefined' && bootstrap.Tooltip.VERSION) {
|
|
|
|
|
+ (new bootstrap.Modal($passwordModal[0])).hide();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $passwordModal.modal('hide');
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
PasteDecrypter.run();
|
|
PasteDecrypter.run();
|
|
|
}
|
|
}
|
|
@@ -2278,7 +2282,11 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|
|
const $loadconfirmClose = $loadconfirmmodal.find('.close');
|
|
const $loadconfirmClose = $loadconfirmmodal.find('.close');
|
|
|
$loadconfirmClose.off('click.close');
|
|
$loadconfirmClose.off('click.close');
|
|
|
$loadconfirmClose.on('click.close', Controller.newPaste);
|
|
$loadconfirmClose.on('click.close', Controller.newPaste);
|
|
|
- $loadconfirmmodal.modal('show');
|
|
|
|
|
|
|
+ if (typeof bootstrap !== 'undefined' && bootstrap.Tooltip.VERSION) {
|
|
|
|
|
+ (new bootstrap.Modal($loadconfirmmodal[0])).show();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $loadconfirmmodal.modal('show');
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
if (window.confirm(
|
|
if (window.confirm(
|
|
|
I18n._('This secret message can only be displayed once. Would you like to see it now?')
|
|
I18n._('This secret message can only be displayed once. Would you like to see it now?')
|
|
@@ -2300,11 +2308,18 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|
|
{
|
|
{
|
|
|
// show new bootstrap method (if available)
|
|
// show new bootstrap method (if available)
|
|
|
if ($passwordModal.length !== 0) {
|
|
if ($passwordModal.length !== 0) {
|
|
|
- $passwordModal.modal({
|
|
|
|
|
- backdrop: 'static',
|
|
|
|
|
- keyboard: false
|
|
|
|
|
- });
|
|
|
|
|
- $passwordModal.modal('show');
|
|
|
|
|
|
|
+ if (typeof bootstrap !== 'undefined' && bootstrap.Tooltip.VERSION) {
|
|
|
|
|
+ (new bootstrap.Modal($passwordModal[0]), {
|
|
|
|
|
+ backdrop: 'static',
|
|
|
|
|
+ keyboard: false
|
|
|
|
|
+ }).show();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $passwordModal.modal({
|
|
|
|
|
+ backdrop: 'static',
|
|
|
|
|
+ keyboard: false
|
|
|
|
|
+ });
|
|
|
|
|
+ $passwordModal.modal('show');
|
|
|
|
|
+ }
|
|
|
// focus password input
|
|
// focus password input
|
|
|
$passwordDecrypt.focus();
|
|
$passwordDecrypt.focus();
|
|
|
// then re-focus it, when modal causes it to loose focus again
|
|
// then re-focus it, when modal causes it to loose focus again
|
|
@@ -2393,6 +2408,8 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|
|
$messageEditParent,
|
|
$messageEditParent,
|
|
|
$messagePreview,
|
|
$messagePreview,
|
|
|
$messagePreviewParent,
|
|
$messagePreviewParent,
|
|
|
|
|
+ $messageTab,
|
|
|
|
|
+ $messageTabParent,
|
|
|
$message,
|
|
$message,
|
|
|
isPreview = false,
|
|
isPreview = false,
|
|
|
isTabSupported = true;
|
|
isTabSupported = true;
|
|
@@ -2410,7 +2427,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|
|
// support disabling tab support using [Esc] and [Ctrl]+[m]
|
|
// support disabling tab support using [Esc] and [Ctrl]+[m]
|
|
|
if (event.key === 'Escape' || (event.ctrlKey && event.key === 'm')) {
|
|
if (event.key === 'Escape' || (event.ctrlKey && event.key === 'm')) {
|
|
|
toggleTabSupport();
|
|
toggleTabSupport();
|
|
|
- document.getElementById('message-tab').checked = isTabSupported;
|
|
|
|
|
|
|
+ $messageTab[0].checked = isTabSupported;
|
|
|
event.preventDefault();
|
|
event.preventDefault();
|
|
|
}
|
|
}
|
|
|
// tab was pressed
|
|
// tab was pressed
|
|
@@ -2462,6 +2479,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|
|
|
|
|
|
|
// reshow input
|
|
// reshow input
|
|
|
$message.removeClass('hidden');
|
|
$message.removeClass('hidden');
|
|
|
|
|
+ $messageTabParent.removeClass('hidden');
|
|
|
|
|
|
|
|
me.focusInput();
|
|
me.focusInput();
|
|
|
|
|
|
|
@@ -2494,6 +2512,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|
|
|
|
|
|
|
// hide input as now preview is shown
|
|
// hide input as now preview is shown
|
|
|
$message.addClass('hidden');
|
|
$message.addClass('hidden');
|
|
|
|
|
+ $messageTabParent.addClass('hidden');
|
|
|
|
|
|
|
|
// show preview
|
|
// show preview
|
|
|
PasteViewer.setText($message.val());
|
|
PasteViewer.setText($message.val());
|
|
@@ -2552,6 +2571,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|
|
me.show = function()
|
|
me.show = function()
|
|
|
{
|
|
{
|
|
|
$message.removeClass('hidden');
|
|
$message.removeClass('hidden');
|
|
|
|
|
+ $messageTabParent.removeClass('hidden');
|
|
|
$editorTabs.removeClass('hidden');
|
|
$editorTabs.removeClass('hidden');
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -2564,6 +2584,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|
|
me.hide = function()
|
|
me.hide = function()
|
|
|
{
|
|
{
|
|
|
$message.addClass('hidden');
|
|
$message.addClass('hidden');
|
|
|
|
|
+ $messageTabParent.addClass('hidden');
|
|
|
$editorTabs.addClass('hidden');
|
|
$editorTabs.addClass('hidden');
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -2603,7 +2624,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * init status manager
|
|
|
|
|
|
|
+ * init editor
|
|
|
*
|
|
*
|
|
|
* preloads jQuery elements
|
|
* preloads jQuery elements
|
|
|
*
|
|
*
|
|
@@ -2614,10 +2635,12 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|
|
{
|
|
{
|
|
|
$editorTabs = $('#editorTabs');
|
|
$editorTabs = $('#editorTabs');
|
|
|
$message = $('#message');
|
|
$message = $('#message');
|
|
|
|
|
+ $messageTab = $('#messagetab');
|
|
|
|
|
+ $messageTabParent = $messageTab.parent();
|
|
|
|
|
|
|
|
// bind events
|
|
// bind events
|
|
|
$message.keydown(supportTabs);
|
|
$message.keydown(supportTabs);
|
|
|
- $('#message-tab').change(toggleTabSupport);
|
|
|
|
|
|
|
+ $messageTab.change(toggleTabSupport);
|
|
|
|
|
|
|
|
// bind click events to tab switchers (a), and save parents (li)
|
|
// bind click events to tab switchers (a), and save parents (li)
|
|
|
$messageEdit = $('#messageedit').click(viewEditor);
|
|
$messageEdit = $('#messageedit').click(viewEditor);
|
|
@@ -2638,7 +2661,8 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|
|
const PasteViewer = (function () {
|
|
const PasteViewer = (function () {
|
|
|
const me = {};
|
|
const me = {};
|
|
|
|
|
|
|
|
- let $placeholder,
|
|
|
|
|
|
|
+ let $messageTabParent,
|
|
|
|
|
+ $placeholder,
|
|
|
$prettyMessage,
|
|
$prettyMessage,
|
|
|
$prettyPrint,
|
|
$prettyPrint,
|
|
|
$plainText,
|
|
$plainText,
|
|
@@ -2718,6 +2742,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|
|
}
|
|
}
|
|
|
// otherwise hide the placeholder
|
|
// otherwise hide the placeholder
|
|
|
$placeholder.addClass('hidden');
|
|
$placeholder.addClass('hidden');
|
|
|
|
|
+ $messageTabParent.addClass('hidden');
|
|
|
|
|
|
|
|
if (format === 'markdown') {
|
|
if (format === 'markdown') {
|
|
|
$plainText.removeClass('hidden');
|
|
$plainText.removeClass('hidden');
|
|
@@ -2856,6 +2881,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|
|
*/
|
|
*/
|
|
|
me.init = function()
|
|
me.init = function()
|
|
|
{
|
|
{
|
|
|
|
|
+ $messageTabParent = $('#messagetab').parent();
|
|
|
$placeholder = $('#placeholder');
|
|
$placeholder = $('#placeholder');
|
|
|
$plainText = $('#plaintext');
|
|
$plainText = $('#plaintext');
|
|
|
$prettyMessage = $('#prettymessage');
|
|
$prettyMessage = $('#prettymessage');
|
|
@@ -3960,8 +3986,8 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|
|
});
|
|
});
|
|
|
$('#qrcode-display').html(qrCanvas);
|
|
$('#qrcode-display').html(qrCanvas);
|
|
|
// only necessary for bootstrap 5, other templates won't have this
|
|
// only necessary for bootstrap 5, other templates won't have this
|
|
|
- if (bootstrap.Tooltip.VERSION) {
|
|
|
|
|
- $('#qrcodemodal').modal('show');
|
|
|
|
|
|
|
+ if (typeof bootstrap !== 'undefined' && bootstrap.Tooltip.VERSION) {
|
|
|
|
|
+ (new bootstrap.Modal('#qrcodemodal')).show();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -4054,7 +4080,11 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|
|
$emailconfirmTimezoneCurrent.off('click.sendEmailCurrentTimezone');
|
|
$emailconfirmTimezoneCurrent.off('click.sendEmailCurrentTimezone');
|
|
|
$emailconfirmTimezoneCurrent.on('click.sendEmailCurrentTimezone', () => {
|
|
$emailconfirmTimezoneCurrent.on('click.sendEmailCurrentTimezone', () => {
|
|
|
const emailBody = templateEmailBody(expirationDateRoundedToSecond.toLocaleString(), isBurnafterreading);
|
|
const emailBody = templateEmailBody(expirationDateRoundedToSecond.toLocaleString(), isBurnafterreading);
|
|
|
- $emailconfirmmodal.modal('hide');
|
|
|
|
|
|
|
+ if (typeof bootstrap !== 'undefined' && bootstrap.Tooltip.VERSION) {
|
|
|
|
|
+ (new bootstrap.Modal($emailconfirmmodal[0])).hide();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $emailconfirmmodal.modal('hide');
|
|
|
|
|
+ }
|
|
|
triggerEmailSend(emailBody);
|
|
triggerEmailSend(emailBody);
|
|
|
});
|
|
});
|
|
|
$emailconfirmTimezoneUtc.off('click.sendEmailUtcTimezone');
|
|
$emailconfirmTimezoneUtc.off('click.sendEmailUtcTimezone');
|
|
@@ -4064,10 +4094,18 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|
|
// we don't use Date.prototype.toUTCString() because we would like to avoid GMT
|
|
// we don't use Date.prototype.toUTCString() because we would like to avoid GMT
|
|
|
{ timeZone: 'UTC', dateStyle: 'long', timeStyle: 'long' }
|
|
{ timeZone: 'UTC', dateStyle: 'long', timeStyle: 'long' }
|
|
|
), isBurnafterreading);
|
|
), isBurnafterreading);
|
|
|
- $emailconfirmmodal.modal('hide');
|
|
|
|
|
|
|
+ if (typeof bootstrap !== 'undefined' && bootstrap.Tooltip.VERSION) {
|
|
|
|
|
+ (new bootstrap.Modal($emailconfirmmodal[0])).hide();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $emailconfirmmodal.modal('hide');
|
|
|
|
|
+ }
|
|
|
triggerEmailSend(emailBody);
|
|
triggerEmailSend(emailBody);
|
|
|
});
|
|
});
|
|
|
- $emailconfirmmodal.modal('show');
|
|
|
|
|
|
|
+ if (typeof bootstrap !== 'undefined' && bootstrap.Tooltip.VERSION) {
|
|
|
|
|
+ (new bootstrap.Modal($emailconfirmmodal[0])).show();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $emailconfirmmodal.modal('show');
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
triggerEmailSend(templateEmailBody(null, isBurnafterreading));
|
|
triggerEmailSend(templateEmailBody(null, isBurnafterreading));
|
|
|
}
|
|
}
|