Merge pull request #1287 from PrivateBin/bootstrap5

Bootstrap 5 template
This commit is contained in:
El RIDO 2024-05-05 09:27:53 +02:00 committed by GitHub
commit 1722d8056b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
57 changed files with 917 additions and 193 deletions

View File

@ -3,11 +3,13 @@
## 1.7.2 (not yet released)
* ADDED: Allow use of `shortenviayourls` in query parameters (#1267)
* ADDED: Input sanitation to some not yet filtered query and server parameters
* ADDED: Optional Bootstrap CSS 5.3.3 based template, use configuration `template = "bootstrap5"` to switch to it (#728)
* CHANGED: "Send" button now labeled "Create" (#946)
* CHANGED: drop some PHP < 5.6 fallbacks, minimum version is PHP 7.3 as of release 1.6.0
* CHANGED: Drop some PHP < 5.6 fallbacks, minimum version is PHP 7.3 as of release 1.6.0
* CHANGED: Set `lang` cookie with lax `SameSite` property
* CHANGED: Upgrading libraries to: DOMpurify 3.1.2 (#1299)
* FIXED: Add cache control headers also to API calls (#1263)
* FIXED: Shortened paste URL does not appear in email (#606)
* CHANGED: Upgrading libraries to: DOMpurify 3.1.2 (#1299)
## 1.7.1 (2024-02-11)
* FIXED: zlib 1.3.1 wasm file reference

View File

@ -351,6 +351,7 @@ Copyright © 2016 Nils Adermann, Jordi Boggiano
Copyright © 2016 Lars Jung (https://larsjung.de)
Copyright © 2018 base-x contributors
Copyright © 2014-2018 The Bitcoin Core developers
Copyright © 2019-2024 The Bootstrap Authors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -88,8 +88,10 @@ languageselection = false
; scripts or run your site behind certain DDoS-protection services.
; Check the documentation at https://content-security-policy.com/
; Notes:
; - If you use a bootstrap theme, you can remove the allow-popups from the
; - If you use any bootstrap theme, you can remove the allow-popups from the
; sandbox restrictions.
; - If you use the bootstrap5 theme, you must change default-src to 'self' to
; enable display of the svg icons
; - By default this disallows to load images from third-party servers, e.g. when
; they are embedded in pastes. If you wish to allow that, you can adjust the
; policy here. See https://github.com/PrivateBin/PrivateBin/wiki/FAQ#why-does-not-it-load-embedded-images

View File

@ -1,7 +1,7 @@
/**
* PrivateBin
*
* a zero-knowledge paste bin
* Cascading style sheets for bootstrap template.
*
* @link https://github.com/PrivateBin/PrivateBin
* @copyright 2012 Sébastien SAUVAGE (sebsauvage.net)
@ -9,6 +9,8 @@
* @version 1.7.1
*/
@import url("../common.css");
body {
padding: 0 0 30px;
}
@ -68,48 +70,6 @@ body.loading {
margin-right: 8px;
}
#attachmentPreview img {
max-width: 100%;
height: auto;
margin-bottom: 20px;
}
#attachmentPreview .pdfPreview {
width: 100%;
height: 100vh;
margin-bottom: 20px;
}
#dropzone {
text-align: center;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1000;
opacity: 0.6;
background-color: #99ccff;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: center;
background-size: 25vh;
outline: 2px dashed #228bff;
outline-offset: -50px;
}
.dragAndDropFile{
color: #777;
font-size: 1em;
display: inline;
white-space: normal;
}
#deletelink {
float: right;
margin-left: 5px;
}
#qrcodemodalClose {
float: right;
}
@ -145,22 +105,12 @@ body.loading {
margin-bottom: 10px;
}
#filewrap {
transition: background-color 0.75s ease-out;
}
.comment {
border-left: 1px solid #ccc;
padding: 5px 0 5px 10px;
white-space: pre-wrap;
transition: background-color 0.75s ease-out;
}
.highlight {
background-color: #ffdd86;
transition: background-color 0.2s ease-in;
}
footer h4 {
margin-top: 0;
}

5
css/bootstrap5/bootstrap-5.3.3.css vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,69 @@
/**
* PrivateBin
*
* Cascading style sheets for bootstrap 5 template.
*
* @link https://github.com/PrivateBin/PrivateBin
* @copyright 2012 Sébastien SAUVAGE (sebsauvage.net)
* @license https://www.opensource.org/licenses/zlib-license.php The zlib/libpng License
* @version 1.7.1
*/
@import url("../common.css");
.hidden {
display: none !important;
}
#qrcodemodalClose {
float: right;
}
#qrcode-display {
width: 200px;
height: 200px;
margin: auto;
}
#pastelink {
display: inline;
}
#pastelink > a {
word-wrap: break-word;
}
#preview {
margin-bottom: 10px;
}
#message, .replymessage {
font-family: monospace;
resize: vertical;
}
#nickname {
margin: 5px 0;
}
#comments, #comments button {
margin-bottom: 10px;
}
.comment {
border-left: 1px solid #ccc;
padding: 5px 0 5px 10px;
transition: background-color 0.75s ease-out;
}
li.L0, li.L1, li.L2, li.L3, li.L5, li.L6, li.L7, li.L8 {
list-style-type: decimal !important;
}
.text-right button {
float: right;
}
html[dir="rtl"] #deletelink, html[dir="rtl"] #qrcodemodalClose {
float: left;
}

65
css/common.css Normal file
View File

@ -0,0 +1,65 @@
/**
* PrivateBin
*
* Common cascading style sheets for all templates.
*
* @link https://github.com/PrivateBin/PrivateBin
* @copyright 2012 Sébastien SAUVAGE (sebsauvage.net)
* @license https://www.opensource.org/licenses/zlib-license.php The zlib/libpng License
* @version 1.7.1
*/
#attachmentPreview img {
max-width: 100%;
height: auto;
margin-bottom: 20px;
}
#attachmentPreview .pdfPreview {
width: 100%;
height: 100vh;
margin-bottom: 20px;
}
#dropzone {
text-align: center;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1000;
opacity: 0.6;
background-color: #9cf;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: center;
background-size: 25vh;
outline: 2px dashed #28f;
outline-offset: -50px;
}
.dragAndDropFile {
color: #777;
font-size: 1em;
display: inline;
white-space: normal;
}
#filewrap {
transition: background-color 0.75s ease-out;
}
.highlight {
background-color: #fd8;
transition: background-color 0.2s ease-in;
}
#deletelink {
float: right;
margin-left: 5px;
}
.commentdata {
white-space: pre-wrap;
}

View File

@ -1,7 +1,7 @@
/**
* PrivateBin
*
* CSS file only loaded when no JavaScript available.
* Cascading style sheet only loaded when JavaScript is not available.
*
* @link https://github.com/PrivateBin/PrivateBin
* @copyright 2012 Sébastien SAUVAGE (sebsauvage.net)
@ -9,7 +9,6 @@
* @version 1.7.1
*/
/* When there is no script at all other */
.noscript-hide {
display: none;
}

View File

@ -1,7 +1,7 @@
/**
* PrivateBin
*
* Main CSS file.
* Cascading style sheets for page template.
*
* @link https://github.com/PrivateBin/PrivateBin
* @copyright 2012 Sébastien SAUVAGE (sebsauvage.net)
@ -9,6 +9,8 @@
* @version 1.7.1
*/
@import url("common.css");
/* CSS Reset from YUI 3.4.1 (build 4118) - Copyright 2011 Yahoo! Inc. All rights reserved.
Licensed under the BSD License. - http://yuilibrary.com/license/ */
html{color:#000;background:#fff}body,div,dl,dt,dd,ul,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0}table{border-collapse:collapse;border-spacing:0}fieldset,img{border:0}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal}ol,ul{list-style:none}caption,th{text-align:left}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal}q:before,q:after{content:''}abbr,acronym{border:0;font-variant:normal}sup{vertical-align:text-top}sub{vertical-align:text-bottom}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit}input,textarea,select{font-size:100%;}legend{color:#000}
@ -105,42 +107,6 @@ h3.title {
resize: vertical;
}
#attachmentPreview img {
max-width: 100%;
height: auto;
}
#attachmentPreview .pdfPreview {
width: 100%;
height: 100vh;
margin-bottom: 20px;
}
#dropzone {
text-align: center;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1000;
opacity: 0.6;
background-color: #99ccff;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: center;
background-size: 25vh;
outline: 2px dashed #228bff;
outline-offset: -50px;
}
.dragAndDropFile{
color: #777;
font-size: 1em;
display: inline;
white-space: normal;
}
#status {
clear: both;
padding: 5px 10px;
@ -160,8 +126,6 @@ h3.title {
#pasteresult button { margin-left: 11px; }
#deletelink { float: right; }
#toolbar, #status { margin-bottom: 5px; }
#copyhint { color: #666; font-size: 0.85em }
@ -430,15 +394,6 @@ h4.title {
.commentdate { color: #bfcede; }
#filewrap {
transition: background-color 0.75s ease-out;
}
.highlight {
background-color: #ffdd86;
transition: background-color 0.2s ease-in;
}
img.vizhash {
width: 16px;
height: 16px;

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "خطأ في الاتصال بـ YOURLS. ربما تكون هناك مشكلة في التضبيط، مثل \"apiurl\" أو \"التوقيع\" الخاطئ أو المفقود.",
"Error parsing YOURLS response.": "خطأ في تحليل استجابة YOURLS.",
"This secret message can only be displayed once. Would you like to see it now?": "لا يمكن عرض اللصق احرقه بعد قراءته إلا مرة واحدة عند تحميله. هل تريد فتحه الآن؟",
"Yes, see it": "نعم، حمله"
"Yes, see it": "نعم، حمله",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".",
"Error parsing YOURLS response.": "Error parsing YOURLS response.",
"This secret message can only be displayed once. Would you like to see it now?": "This secret message can only be displayed once. Would you like to see it now?",
"Yes, see it": "Yes, see it"
"Yes, see it": "Yes, see it",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".",
"Error parsing YOURLS response.": "Error parsing YOURLS response.",
"This secret message can only be displayed once. Would you like to see it now?": "This secret message can only be displayed once. Would you like to see it now?",
"Yes, see it": "Yes, see it"
"Yes, see it": "Yes, see it",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "Sbagliu à a chjama di YOURLS. Seria forse una cunfigurazione gattiva, tale una \"apiurl\" o \"signature\" falsa o assente.",
"Error parsing YOURLS response.": "Sbagliu durante lanalisa di a risposta di YOURLS.",
"This secret message can only be displayed once. Would you like to see it now?": "Stu messaghju secretu pò esse affissatu solu una volta. Vulete fighjallu subitu ?",
"Yes, see it": "Iè, fighjallu"
"Yes, see it": "Iè, fighjallu",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".",
"Error parsing YOURLS response.": "Error parsing YOURLS response.",
"This secret message can only be displayed once. Would you like to see it now?": "This secret message can only be displayed once. Would you like to see it now?",
"Yes, see it": "Yes, see it"
"Yes, see it": "Yes, see it",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "Fehler beim Aufruf von YOURLS. Wahrscheinlich ein Konfigurationsproblem, wie eine falsche oder fehlende \"apiurl\" oder \"signature\".",
"Error parsing YOURLS response.": "Fehler beim Verarbeiten der YOURLS-Antwort.",
"This secret message can only be displayed once. Would you like to see it now?": "Texte des \"Einmal\"-Typs können nach dem Öffnen nur einmal angezeigt werden. Möchtest Du ihn jetzt einsehen?",
"Yes, see it": "Ja, jetzt einsehen"
"Yes, see it": "Ja, jetzt einsehen",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".",
"Error parsing YOURLS response.": "Error parsing YOURLS response.",
"This secret message can only be displayed once. Would you like to see it now?": "This secret message can only be displayed once. Would you like to see it now?",
"Yes, see it": "Yes, see it"
"Yes, see it": "Yes, see it",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".",
"Error parsing YOURLS response.": "Error parsing YOURLS response.",
"This secret message can only be displayed once. Would you like to see it now?": "This secret message can only be displayed once. Would you like to see it now?",
"Yes, see it": "Yes, see it"
"Yes, see it": "Yes, see it",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".",
"Error parsing YOURLS response.": "Error parsing YOURLS response.",
"This secret message can only be displayed once. Would you like to see it now?": "This secret message can only be displayed once. Would you like to see it now?",
"Yes, see it": "Yes, see it"
"Yes, see it": "Yes, see it",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "Viga YOURLS-i kutsumisel. Tõenäoliselt konfiguratsiooniprobleem, näiteks vale või puuduv \"apiurl\" või \"signature\".",
"Error parsing YOURLS response.": "Viga YOURLS vastuse parsimisel.",
"This secret message can only be displayed once. Would you like to see it now?": "This secret message can only be displayed once. Would you like to see it now?",
"Yes, see it": "Yes, see it"
"Yes, see it": "Yes, see it",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "Virhe kutsuttaessa YOURLS. Luultavasti asetusongelma kuten väärä tai puuttuuva \"apiurl\" tai \"signature\".",
"Error parsing YOURLS response.": "Virhe jäsennettäessä YOURLS-vastausta.",
"This secret message can only be displayed once. Would you like to see it now?": "This secret message can only be displayed once. Would you like to see it now?",
"Yes, see it": "Yes, see it"
"Yes, see it": "Yes, see it",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "Erreur lors de l'appel de YOURLS. Peut-être un problème de configuration, comme \"apiurl\" ou \"signature\" manquant.",
"Error parsing YOURLS response.": "Erreur d'analyse de la réponse YOURLS.",
"This secret message can only be displayed once. Would you like to see it now?": "Les pastes de type \"Effacer après la lecture\" ne peuvent être affichés qu'une seule fois. Voulez-vous le voir maintenant ?",
"Yes, see it": "Oui, voyez le"
"Yes, see it": "Oui, voyez le",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".",
"Error parsing YOURLS response.": "Error parsing YOURLS response.",
"This secret message can only be displayed once. Would you like to see it now?": "This secret message can only be displayed once. Would you like to see it now?",
"Yes, see it": "Yes, see it"
"Yes, see it": "Yes, see it",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".",
"Error parsing YOURLS response.": "Error parsing YOURLS response.",
"This secret message can only be displayed once. Would you like to see it now?": "This secret message can only be displayed once. Would you like to see it now?",
"Yes, see it": "Yes, see it"
"Yes, see it": "Yes, see it",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".",
"Error parsing YOURLS response.": "Error parsing YOURLS response.",
"This secret message can only be displayed once. Would you like to see it now?": "This secret message can only be displayed once. Would you like to see it now?",
"Yes, see it": "Yes, see it"
"Yes, see it": "Yes, see it",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".",
"Error parsing YOURLS response.": "Error parsing YOURLS response.",
"This secret message can only be displayed once. Would you like to see it now?": "This secret message can only be displayed once. Would you like to see it now?",
"Yes, see it": "Yes, see it"
"Yes, see it": "Yes, see it",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "Errore nella chiamata a YOURLS. Probabilmente un problema di configurazione, come un \"apiurl\" o una \"signature\" sbagliati o mancanti.",
"Error parsing YOURLS response.": "Errore nell'analizzare la risposta YOURLS.",
"This secret message can only be displayed once. Would you like to see it now?": "Questo messaggio di tipo Distruggi-dopo-lettura può essere visualizzato solo una volta. Vuoi vederlo ora?",
"Yes, see it": "Sì, visualizzalo"
"Yes, see it": "Sì, visualizzalo",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "YOURLSの呼び出し中にエラーが発生しました。\"apiurl\"または\"signature\"等の設定に問題がある可能性があります。",
"Error parsing YOURLS response.": "YOURLSレスポンスの解析中にエラーが発生しました。",
"This secret message can only be displayed once. Would you like to see it now?": "This secret message can only be displayed once. Would you like to see it now?",
"Yes, see it": "Yes, see it"
"Yes, see it": "Yes, see it",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".",
"Error parsing YOURLS response.": "Error parsing YOURLS response.",
"This secret message can only be displayed once. Would you like to see it now?": "This secret message can only be displayed once. Would you like to see it now?",
"Yes, see it": "Yes, see it"
"Yes, see it": "Yes, see it",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".",
"Error parsing YOURLS response.": "Error parsing YOURLS response.",
"This secret message can only be displayed once. Would you like to see it now?": "This secret message can only be displayed once. Would you like to see it now?",
"Yes, see it": "Yes, see it"
"Yes, see it": "Yes, see it",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".",
"Error parsing YOURLS response.": "Error parsing YOURLS response.",
"This secret message can only be displayed once. Would you like to see it now?": "This secret message can only be displayed once. Would you like to see it now?",
"Yes, see it": "Yes, see it"
"Yes, see it": "Yes, see it",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "Klaida iškviečiant YOURLS. Tikriausiai, konfigūracijos klaida, pavyzdžiui, neteisingi „apiurl“ ar „signature“, arba jų nėra.",
"Error parsing YOURLS response.": "Klaida nagrinėjant YOURLS atsaką.",
"This secret message can only be displayed once. Would you like to see it now?": "This secret message can only be displayed once. Would you like to see it now?",
"Yes, see it": "Yes, see it"
"Yes, see it": "Yes, see it",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "Foutmelding ophalen YOURLS. Waarschijnlijk een configuratiefout, zoals een verkeerde of missende \"apiurl\" of \"signature\".",
"Error parsing YOURLS response.": "Foutmelding bij parsen van YOURLS respons.",
"This secret message can only be displayed once. Would you like to see it now?": "Brand na het lezen van de plagen kan slechts eenmaal worden weergegeven wanneer deze worden geladen. Wilt u het nu zien?",
"Yes, see it": "Ja, zie het"
"Yes, see it": "Ja, zie het",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "Feil ved å ringe YOURLS. Sannsynligvis et konfigurasjonsproblem, som feil eller mangler, \"apiurl\" eller \"signatur\".",
"Error parsing YOURLS response.": "Feil ved analyse av YOURLS svar.",
"This secret message can only be displayed once. Would you like to see it now?": "Brenne etter lesing av pasta kan kun vises når den lastes inn. Vil du se den nå?",
"Yes, see it": "Ja, se det"
"Yes, see it": "Ja, se det",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "Error en cridant YOURLS. Es probablament un problèma de configuracion, quicòm coma « apirul » o « signature » marrit o absent.",
"Error parsing YOURLS response.": "Error d'analisi de la responsa YOURLS.",
"This secret message can only be displayed once. Would you like to see it now?": "This secret message can only be displayed once. Would you like to see it now?",
"Yes, see it": "Yes, see it"
"Yes, see it": "Yes, see it",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".",
"Error parsing YOURLS response.": "Error parsing YOURLS response.",
"This secret message can only be displayed once. Would you like to see it now?": "This secret message can only be displayed once. Would you like to see it now?",
"Yes, see it": "Yes, see it"
"Yes, see it": "Yes, see it",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".",
"Error parsing YOURLS response.": "Error parsing YOURLS response.",
"This secret message can only be displayed once. Would you like to see it now?": "This secret message can only be displayed once. Would you like to see it now?",
"Yes, see it": "Yes, see it"
"Yes, see it": "Yes, see it",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "Eroare la apelarea YOURLS. Probabil o problemă de configurare, cum ar fi \"apiurl\" sau \"signature\" greșite sau lipsă.",
"Error parsing YOURLS response.": "Eroare la analizarea răspunsului YOURLS.",
"This secret message can only be displayed once. Would you like to see it now?": "Paste-urile care se șterg după citire pot fi afișate numai o dată după încărcare. Doriți să o vedeți acum?",
"Yes, see it": "Da, vezi"
"Yes, see it": "Da, vezi",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "Ошибка обращения к YOURLS. Возможно в конфигурации допущена ошибка, например неверный или отсутствующий параметр \"apiurl\" или \"signature\".",
"Error parsing YOURLS response.": "Ошибка разбора ответа от YOURLS.",
"This secret message can only be displayed once. Would you like to see it now?": "Записи, удаляемые после прочтения, могут быть отображены после загрузки только один раз. Вы хотите открыть её сейчас?",
"Yes, see it": "Да, загрузить"
"Yes, see it": "Да, загрузить",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".",
"Error parsing YOURLS response.": "Error parsing YOURLS response.",
"This secret message can only be displayed once. Would you like to see it now?": "This secret message can only be displayed once. Would you like to see it now?",
"Yes, see it": "Yes, see it"
"Yes, see it": "Yes, see it",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".",
"Error parsing YOURLS response.": "Error parsing YOURLS response.",
"This secret message can only be displayed once. Would you like to see it now?": "This secret message can only be displayed once. Would you like to see it now?",
"Yes, see it": "Yes, see it"
"Yes, see it": "Yes, see it",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".",
"Error parsing YOURLS response.": "Error parsing YOURLS response.",
"This secret message can only be displayed once. Would you like to see it now?": "This secret message can only be displayed once. Would you like to see it now?",
"Yes, see it": "Yes, see it"
"Yes, see it": "Yes, see it",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "เกิดข้อผิดพลาดในการเรียก YOURLS อาจเป็นปัญหามาจากการกำหนดค่า เช่น \"apiurl\" หรือ \"signature\" ไม่ถูกต้องหรือขาดหายไป",
"Error parsing YOURLS response.": "เกิดข้อผิดพลาดในการแยกวิเคราะห์การตอบสนองของ YOURLS",
"This secret message can only be displayed once. Would you like to see it now?": "This secret message can only be displayed once. Would you like to see it now?",
"Yes, see it": "Yes, see it"
"Yes, see it": "Yes, see it",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".",
"Error parsing YOURLS response.": "Error parsing YOURLS response.",
"This secret message can only be displayed once. Would you like to see it now?": "This secret message can only be displayed once. Would you like to see it now?",
"Yes, see it": "Evet, görüyorum"
"Yes, see it": "Evet, görüyorum",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "Помилка виклику YOURLS. Ймовірно проблема з конфігурацією, наприклад \"apiurl\" чи \"signature\".",
"Error parsing YOURLS response.": "Помилка розбору відповіді YOURLS.",
"This secret message can only be displayed once. Would you like to see it now?": "Спалити після вставки читання можна вивести лише один раз під час завантаження. Відкрити його зараз?",
"Yes, see it": "Так, завантажити"
"Yes, see it": "Так, завантажити",
"Dark Mode": "Dark Mode"
}

View File

@ -216,5 +216,6 @@
"Error calling YOURLS. Probably a configuration issue, like wrong or missing \"apiurl\" or \"signature\".": "调用 YOURLS 时出错。可能是配置问题例如“apiurl”或“signature”错误或缺失。",
"Error parsing YOURLS response.": "解析 YOURLS 响应时出错。",
"This secret message can only be displayed once. Would you like to see it now?": "读取粘贴后只能在加载时显示一次。您想现在打开吗?",
"Yes, see it": "是的,加载它"
"Yes, see it": "是的,加载它",
"Dark Mode": "Dark Mode"
}

1
img/bootstrap-icons.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 9.1 KiB

6
js/bootstrap-5.3.3.js vendored Normal file

File diff suppressed because one or more lines are too long

81
js/dark-mode-switch.js Normal file
View File

@ -0,0 +1,81 @@
/*!
* Color mode toggler for Bootstrap's docs (https://getbootstrap.com/)
* Copyright 2011-2024 The Bootstrap Authors
* Licensed under the Creative Commons Attribution 3.0 Unported License.
* Modified to work with a simpler checkbox toggle & support prettify CSS themes
*/
(() => {
'use strict'
const getStoredTheme = () => localStorage.getItem('theme')
const setStoredTheme = theme => localStorage.setItem('theme', theme)
const getPreferredTheme = () => window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'
const getStoredPreferredTheme = () => {
const storedTheme = getStoredTheme()
if (storedTheme) {
return storedTheme
}
return getPreferredTheme()
}
const delStoredPrettifyTheme = () => localStorage.removeItem('themePrettify')
const getStoredPrettifyTheme = () => localStorage.getItem('themePrettify')
const setStoredPrettifyTheme = theme => localStorage.setItem('themePrettify', theme)
const getPrettifyThemeLink = () => {
for (const sheet of document.getElementsByTagName('link')) {
if (sheet.rel === 'stylesheet' && sheet.href.includes('css/prettify/') && !sheet.href.includes('css/prettify/prettify.css')) {
return sheet
}
}
return null
}
const setTheme = theme => {
const preferredTheme = theme === 'auto' ? getPreferredTheme() : theme
document.documentElement.setAttribute('data-bs-theme', preferredTheme)
const sheetPrettify = getPrettifyThemeLink()
if (sheetPrettify) {
sheetPrettify.remove()
}
const link = document.createElement('link')
link.rel = 'stylesheet'
if (preferredTheme === 'dark') {
link.href = 'css/prettify/sons-of-obsidian.css'
document.head.appendChild(link)
} else {
const themePrettify = getStoredPrettifyTheme()
if (themePrettify) {
link.href = themePrettify
document.head.appendChild(link)
}
}
}
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
const storedTheme = getStoredTheme()
if (storedTheme !== 'light' && storedTheme !== 'dark') {
setTheme(getStoredPreferredTheme())
}
})
window.addEventListener('DOMContentLoaded', () => {
const sheetPrettify = getPrettifyThemeLink()
if (sheetPrettify) {
setStoredPrettifyTheme(sheetPrettify.href)
} else {
delStoredPrettifyTheme()
}
setTheme(getStoredPreferredTheme())
const toggle = document.querySelector('#bd-theme')
toggle.checked = getStoredTheme() === 'dark'
toggle.addEventListener('change', (event) => {
const theme = event.currentTarget.checked ? 'dark' : 'light'
setStoredTheme(theme)
setTheme(theme)
event.currentTarget.focus()
})
})
})()

View File

@ -2305,6 +2305,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
backdrop: 'static',
keyboard: false
});
$passwordModal.modal('show');
// focus password input
$passwordDecrypt.focus();
// then re-focus it, when modal causes it to loose focus again
@ -2390,7 +2391,9 @@ jQuery.PrivateBin = (function($, RawDeflate) {
let $editorTabs,
$messageEdit,
$messageEditParent,
$messagePreview,
$messagePreviewParent,
$message,
isPreview = false;
@ -2431,10 +2434,12 @@ jQuery.PrivateBin = (function($, RawDeflate) {
{
// toggle buttons
$messageEdit.addClass('active');
$messageEditParent.addClass('active');
$messagePreview.removeClass('active');
$messagePreviewParent.removeClass('active');
$('#messageedit').attr('aria-selected','true');
$('#messagepreview').attr('aria-selected','false');
$messageEdit.attr('aria-selected','true');
$messagePreview.attr('aria-selected','false');
PasteViewer.hide();
@ -2463,10 +2468,12 @@ jQuery.PrivateBin = (function($, RawDeflate) {
{
// toggle buttons
$messageEdit.removeClass('active');
$messageEditParent.removeClass('active');
$messagePreview.addClass('active');
$messagePreviewParent.addClass('active');
$('#messageedit').attr('aria-selected','false');
$('#messagepreview').attr('aria-selected','true');
$messageEdit.attr('aria-selected','false');
$messagePreview.attr('aria-selected','true');
// hide input as now preview is shown
$message.addClass('hidden');
@ -2594,10 +2601,11 @@ jQuery.PrivateBin = (function($, RawDeflate) {
// bind events
$message.keydown(supportTabs);
// bind click events to tab switchers (a), but save parent of them
// (li)
$messageEdit = $('#messageedit').click(viewEditor).parent();
$messagePreview = $('#messagepreview').click(viewPreview).parent();
// bind click events to tab switchers (a), and save parents (li)
$messageEdit = $('#messageedit').click(viewEditor);
$messageEditParent = $messageEdit.parent();
$messagePreview = $('#messagepreview').click(viewPreview);
$messagePreviewParent = $messagePreview.parent();
};
return me;
@ -2693,15 +2701,12 @@ jQuery.PrivateBin = (function($, RawDeflate) {
// otherwise hide the placeholder
$placeholder.addClass('hidden');
switch (format) {
case 'markdown':
$plainText.removeClass('hidden');
$prettyMessage.addClass('hidden');
break;
default:
$plainText.addClass('hidden');
$prettyMessage.removeClass('hidden');
break;
if (format === 'markdown') {
$plainText.removeClass('hidden');
$prettyMessage.addClass('hidden');
} else {
$plainText.addClass('hidden');
$prettyMessage.removeClass('hidden');
}
}
@ -2726,6 +2731,12 @@ jQuery.PrivateBin = (function($, RawDeflate) {
format = newFormat;
isChanged = true;
// update preview
if (Editor.isPreview()) {
PasteViewer.run();
}
};
/**
@ -3712,11 +3723,6 @@ jQuery.PrivateBin = (function($, RawDeflate) {
$('#pasteFormatterDisplay').text($target.text());
PasteViewer.setFormat(newFormat);
// update preview
if (Editor.isPreview()) {
PasteViewer.run();
}
event.preventDefault();
}
@ -3849,7 +3855,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
*/
function setLanguage(event)
{
document.cookie = 'lang=' + $(event.target).data('lang') + ';secure';
document.cookie = 'lang=' + $(event.target).data('lang') + '; SameSite=Lax; Secure';
UiHelper.reloadHome();
event.preventDefault();
}
@ -3921,6 +3927,10 @@ jQuery.PrivateBin = (function($, RawDeflate) {
text: window.location.href
});
$('#qrcode-display').html(qrCanvas);
// only necessary for bootstrap 5, other templates won't have this
if (bootstrap.Tooltip.VERSION) {
$('#qrcodemodal').modal('show');
}
}
/**
@ -4360,7 +4370,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
*/
me.getExpiration = function()
{
return pasteExpiration;
return Model.getExpirationDefault() || pasteExpiration;
};
/**
@ -4543,6 +4553,9 @@ 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);
$('#pasteFormatter').on('change', function() {
PasteViewer.setFormat(Model.getFormatDefault());
});
// initiate default state of checkboxes
changeBurnAfterReading();

View File

@ -240,7 +240,7 @@ class Configuration
// ensure the basepath ends in a slash, if one is set
if (
strlen($this->_configuration['main']['basepath']) &&
!empty($this->_configuration['main']['basepath']) &&
substr_compare($this->_configuration['main']['basepath'], '/', -1) !== 0
) {
$this->_configuration['main']['basepath'] .= '/';

View File

@ -178,7 +178,7 @@ class Controller
// force default language, if language selection is disabled and a default is set
if (!$this->_conf->getKey('languageselection') && strlen($lang) == 2) {
$_COOKIE['lang'] = $lang;
setcookie('lang', $lang, 0, '', '', true);
setcookie('lang', $lang, array('SameSite' => 'Lax', 'Secure' => true));
}
}
@ -320,10 +320,10 @@ class Controller
$this->_error = $e->getMessage();
}
if ($this->_request->isJsonApiCall()) {
if (strlen($this->_error)) {
$this->_return_message(1, $this->_error);
} else {
if (empty($this->_error)) {
$this->_return_message(0, $dataid);
} else {
$this->_return_message(1, $this->_error);
}
}
}
@ -389,7 +389,7 @@ class Controller
$languageselection = '';
if ($this->_conf->getKey('languageselection')) {
$languageselection = I18n::getLanguage();
setcookie('lang', $languageselection, 0, '', '', true);
setcookie('lang', $languageselection, array('SameSite' => 'Lax', 'Secure' => true));
}
// strip policies that are unsupported in meta tag

View File

@ -56,7 +56,7 @@ class ServerSalt extends AbstractPersistence
*/
public static function get()
{
if (strlen(self::$_salt)) {
if (!empty(self::$_salt)) {
return self::$_salt;
}

View File

@ -50,7 +50,7 @@ class View
*/
public function draw($template)
{
$file = substr($template, 0, 9) === 'bootstrap' ? 'bootstrap' : $template;
$file = substr($template, 0, 10) === 'bootstrap-' ? 'bootstrap' : $template;
$path = PATH . 'tpl' . DIRECTORY_SEPARATOR . $file . '.php';
if (!file_exists($path)) {
throw new Exception('Template ' . $template . ' not found!', 80);

View File

@ -34,7 +34,7 @@ if ($SYNTAXHIGHLIGHTING) :
?>
<link type="text/css" rel="stylesheet" href="css/prettify/prettify.css?<?php echo rawurlencode($VERSION); ?>" />
<?php
if (strlen($SYNTAXHIGHLIGHTINGTHEME)) :
if (!empty($SYNTAXHIGHLIGHTINGTHEME)) :
?>
<link type="text/css" rel="stylesheet" href="css/prettify/<?php echo rawurlencode($SYNTAXHIGHLIGHTINGTHEME); ?>.css?<?php echo rawurlencode($VERSION); ?>" />
<?php
@ -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-I0F8qtFtaBvVvTThlXa63q0fLptZHP+hg9SbUqZ/qpimAPvHYGFfRj06aqEvECByNgKlQOWab3p8NQ2waDZ+fQ==" crossorigin="anonymous"></script>
<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-hqatct2X1I7GZZFAvbnaWU+QPz+cIhBQIxhXtR50aq+pTfhvUljqzqoLi4Yli6P+GIV6IFlm5Yf/uvdEvSjMcA==" 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" />
@ -437,7 +437,7 @@ endif;
</ul>
<ul class="nav navbar-nav pull-right">
<?php
if (strlen($LANGUAGESELECTION)) :
if (!empty($LANGUAGESELECTION)) :
?>
<li id="language" class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="glyphicon glyphicon-flag" aria-hidden="true"></span> <?php echo $LANGUAGES[$LANGUAGESELECTION][0]; ?> <span class="caret"></span></a>
@ -468,7 +468,7 @@ endif;
<main>
<section class="container">
<?php
if (strlen($NOTICE)) :
if (!empty($NOTICE)) :
?>
<div role="alert" class="alert alert-info">
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
@ -485,7 +485,7 @@ if ($FILEUPLOAD) :
?>
<div id="attachment" role="alert" class="hidden alert alert-info">
<span class="glyphicon glyphicon-download-alt" aria-hidden="true"></span>
<a class="alert-link"><?php echo I18n::_('Download attachment'), PHP_EOL; ?></a>
<a class="alert-link"><?php echo I18n::_('Download attachment'); ?></a>
</div>
<?php
endif;
@ -517,12 +517,12 @@ if ($HTTPWARNING) :
?>
<div id="httpnotice" role="alert" class="hidden alert alert-danger">
<span class="glyphicon glyphicon-alert" aria-hidden="true"></span>
<?php echo I18n::_('This website is using an insecure connection! Please only use it for testing.'), PHP_EOL; ?><br />
<?php echo I18n::_('This website is using an insecure connection! Please only use it for testing.'); ?><br />
<span class="small"><?php echo I18n::_('For more information <a href="%s">see this FAQ entry</a>.', 'https://github.com/PrivateBin/PrivateBin/wiki/FAQ#why-does-it-show-me-an-error-about-an-insecure-connection'); ?></span>
</div>
<div id="insecurecontextnotice" role="alert" class="hidden alert alert-danger">
<span class="glyphicon glyphicon-alert" aria-hidden="true"></span>
<?php echo I18n::_('Your browser may require an HTTPS connection to support the WebCrypto API. Try <a href="%s">switching to HTTPS</a>.', $HTTPSLINK); ?>
<?php echo I18n::_('Your browser may require an HTTPS connection to support the WebCrypto API. Try <a href="%s">switching to HTTPS</a>.', $HTTPSLINK), PHP_EOL; ?>
</div>
<?php
endif;
@ -534,7 +534,7 @@ endif;
<div id="pastelink"></div>
</div>
<?php
if (strlen($URLSHORTENER)) :
if (!empty($URLSHORTENER)) :
?>
<p>
<button id="shortenbutton" data-shortener="<?php echo I18n::encode($URLSHORTENER); ?>" type="button" class="btn btn-<?php echo $isDark ? 'warning' : 'primary'; ?> btn-block">
@ -613,9 +613,25 @@ if ($DISCUSSION) :
?>
<div id="serverdata" class="hidden" aria-hidden="true">
<div id="templates">
<article id="commenttemplate" class="comment"><div class="commentmeta"><span class="nickname">name</span><span class="commentdate">0000-00-00</span></div><div class="commentdata">c</div><button class="btn btn-default btn-sm"><?php echo I18n::_('Reply'); ?></button></article>
<p id="commenttailtemplate" class="comment"><button class="btn btn-default btn-sm"><?php echo I18n::_('Add comment'); ?></button></p>
<div id="replytemplate" class="reply hidden"><input type="text" id="nickname" class="form-control" title="<?php echo I18n::_('Optional nickname…'); ?>" placeholder="<?php echo I18n::_('Optional nickname…'); ?>" /><textarea id="replymessage" class="replymessage form-control" cols="80" rows="7"></textarea><br /><div id="replystatus" role="alert" class="statusmessage hidden alert"><span class="glyphicon" aria-hidden="true"></span> </div><button id="replybutton" class="btn btn-default btn-sm"><?php echo I18n::_('Post comment'); ?></button></div>
<article id="commenttemplate" class="comment">
<div class="commentmeta">
<span class="nickname">name</span>
<span class="commentdate">0000-00-00</span>
</div>
<div class="commentdata">c</div>
<button class="btn btn-default btn-sm"><?php echo I18n::_('Reply'); ?></button>
</article>
<p id="commenttailtemplate" class="comment">
<button class="btn btn-default btn-sm"><?php echo I18n::_('Add comment'); ?></button>
</p>
<div id="replytemplate" class="reply hidden">
<input type="text" id="nickname" class="form-control" title="<?php echo I18n::_('Optional nickname…'); ?>" placeholder="<?php echo I18n::_('Optional nickname…'); ?>" />
<textarea id="replymessage" class="replymessage form-control" cols="80" rows="7"></textarea><br />
<div id="replystatus" role="alert" class="statusmessage hidden alert">
<span class="glyphicon" aria-hidden="true"></span>
</div>
<button id="replybutton" class="btn btn-default btn-sm"><?php echo I18n::_('Post comment'); ?></button>
</div>
</div>
</div>
<?php

502
tpl/bootstrap5.php Normal file
View File

@ -0,0 +1,502 @@
<?php
use PrivateBin\I18n;
?><!DOCTYPE html>
<html lang="<?php echo I18n::getLanguage(); ?>"<?php echo I18n::isRtl() ? ' dir="rtl"' : ''; ?>>
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Security-Policy" content="<?php echo I18n::encode($CSPHEADER); ?>">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="noindex" />
<meta name="google" content="notranslate">
<title><?php echo I18n::_($NAME); ?></title>
<link type="text/css" rel="stylesheet" href="css/bootstrap5/bootstrap<?php echo I18n::isRtl() ? '.rtl' : ''; ?>-5.3.3.css" />
<link type="text/css" rel="stylesheet" href="css/bootstrap5/privatebin.css?<?php echo rawurlencode($VERSION); ?>" />
<?php
if ($SYNTAXHIGHLIGHTING) :
?>
<link type="text/css" rel="stylesheet" href="css/prettify/prettify.css?<?php echo rawurlencode($VERSION); ?>" />
<?php
if (!empty($SYNTAXHIGHLIGHTINGTHEME)) :
?>
<link type="text/css" rel="stylesheet" href="css/prettify/<?php echo rawurlencode($SYNTAXHIGHLIGHTINGTHEME); ?>.css?<?php echo rawurlencode($VERSION); ?>" />
<?php
endif;
endif;
?>
<noscript><link type="text/css" rel="stylesheet" href="css/noscript.css" /></noscript>
<script type="text/javascript" data-cfasync="false" src="js/jquery-3.7.0.js" integrity="sha512-3gJwYpMe3QewGELv8k/BX9vcqhryRdzRMxVfq6ngyWXwo03GFEzjsUm8Q7RZcHPHksttq7/GFoxjCVUjkjvPdw==" crossorigin="anonymous"></script>
<?php
if ($QRCODE) :
?>
<script async type="text/javascript" data-cfasync="false" src="js/kjua-0.9.0.js" integrity="sha512-CVn7af+vTMBd9RjoS4QM5fpLFEOtBCoB0zPtaqIDC7sF4F8qgUSRFQQpIyEDGsr6yrjbuOLzdf20tkHHmpaqwQ==" crossorigin="anonymous"></script>
<?php
endif;
if ($ZEROBINCOMPATIBILITY) :
?>
<script type="text/javascript" data-cfasync="false" src="js/base64-1.7.js" integrity="sha512-JdwsSP3GyHR+jaCkns9CL9NTt4JUJqm/BsODGmYhBcj5EAPKcHYh+OiMfyHbcDLECe17TL0hjXADFkusAqiYgA==" crossorigin="anonymous"></script>
<?php
endif;
?>
<script type="text/javascript" data-cfasync="false" src="js/zlib-1.3.1.js" integrity="sha512-Z90oppVx/mn0DG2k9airjFVQuliELlXLeT3SRiO6MLiUSbhGlAq+UFwmYbG4i9mwW87dkG8fgJPapGwnUq7Osg==" crossorigin="anonymous"></script>
<script type="text/javascript" data-cfasync="false" src="js/base-x-4.0.0.js" integrity="sha512-nNPg5IGCwwrveZ8cA/yMGr5HiRS5Ps2H+s0J/mKTPjCPWUgFGGw7M5nqdnPD3VsRwCVysUh3Y8OWjeSKGkEQJQ==" crossorigin="anonymous"></script>
<script type="text/javascript" data-cfasync="false" src="js/rawinflate-0.3.js" integrity="sha512-g8uelGgJW9A/Z1tB6Izxab++oj5kdD7B4qC7DHwZkB6DGMXKyzx7v5mvap2HXueI2IIn08YlRYM56jwWdm2ucQ==" crossorigin="anonymous"></script>
<script type="text/javascript" data-cfasync="false" src="js/bootstrap-5.3.3.js" integrity="sha512-in2rcOpLTdJ7/pw5qjF4LWHFRtgoBDxXCy49H4YGOcVdGiPaQucGIbOqxt1JvmpvOpq3J/C7VTa0FlioakB2gQ==" crossorigin="anonymous"></script>
<script type="text/javascript" data-cfasync="false" src="js/dark-mode-switch.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-xdW325H1OW06oUf/Lc4ccJXOUW41tU08iyXVOiVL3SbTufQtKVWi1/cQPrWZ3FagPTNL2CwDMqZsHNmXruHnHg==" crossorigin="anonymous"></script>
<?php
if ($SYNTAXHIGHLIGHTING) :
?>
<script type="text/javascript" data-cfasync="false" src="js/prettify.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-puO0Ogy++IoA2Pb9IjSxV1n4+kQkKXYAEUtVzfZpQepyDPyXk8hokiYDS7ybMogYlyyEIwMLpZqVhCkARQWLMg==" crossorigin="anonymous"></script>
<?php
endif;
if ($MARKDOWN) :
?>
<script type="text/javascript" data-cfasync="false" src="js/showdown-2.1.0.js" integrity="sha512-WYXZgkTR0u/Y9SVIA4nTTOih0kXMEd8RRV6MLFdL6YU8ymhR528NLlYQt1nlJQbYz4EW+ZsS0fx1awhiQJme1Q==" crossorigin="anonymous"></script>
<?php
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-hqatct2X1I7GZZFAvbnaWU+QPz+cIhBQIxhXtR50aq+pTfhvUljqzqoLi4Yli6P+GIV6IFlm5Yf/uvdEvSjMcA==" 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" />
<link rel="icon" type="image/png" href="img/favicon-16x16.png" sizes="16x16" />
<link rel="manifest" href="manifest.json?<?php echo rawurlencode($VERSION); ?>" />
<link rel="mask-icon" href="img/safari-pinned-tab.svg" color="#ffcc00" />
<link rel="shortcut icon" href="img/favicon.ico">
<meta name="msapplication-config" content="browserconfig.xml">
<meta name="theme-color" content="#ffe57e" />
<!-- Twitter/social media cards -->
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="<?php echo I18n::_('Encrypted note on %s', I18n::_($NAME)) ?>" />
<meta name="twitter:description" content="<?php echo I18n::_('Visit this link to see the note. Giving the URL to anyone allows them to access the note, too.') ?>" />
<meta name="twitter:image" content="<?php echo I18n::encode($BASEPATH); ?>img/apple-touch-icon.png" />
<meta property="og:title" content="<?php echo I18n::_($NAME); ?>" />
<meta property="og:site_name" content="<?php echo I18n::_($NAME); ?>" />
<meta property="og:description" content="<?php echo I18n::_('Visit this link to see the note. Giving the URL to anyone allows them to access the note, too.') ?>" />
<meta property="og:image" content="<?php echo I18n::encode($BASEPATH); ?>img/apple-touch-icon.png" />
<meta property="og:image:type" content="image/png" />
<meta property="og:image:width" content="180" />
<meta property="og:image:height" content="180" />
</head>
<body role="document" data-compression="<?php echo rawurlencode($COMPRESSION); ?>">
<div id="passwordmodal" tabindex="-1" class="modal fade" role="dialog" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body">
<form id="passwordform" role="form">
<div class="mb-3">
<label for="passworddecrypt"><svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#eye" /></svg> <?php echo I18n::_('Please enter the password for this paste:') ?></label>
<input id="passworddecrypt" type="password" class="form-control" placeholder="<?php echo I18n::_('Enter password') ?>" required="required">
</div>
<button type="submit" class="btn btn-success btn-block"><svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#power" /></svg> <?php echo I18n::_('Decrypt') ?></button>
</form>
</div>
</div>
</div>
</div>
<div id="loadconfirmmodal" tabindex="-1" class="modal fade" role="dialog" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><?php echo I18n::_('This secret message can only be displayed once. Would you like to see it now?') ?></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="<?php echo I18n::_('Close') ?>"></button>
</div>
<div class="modal-body text-center">
<button id="loadconfirm-open-now" type="button" class="btn btn-success" data-dismiss="modal"><svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#cloud-download" /></svg> <?php echo I18n::_('Yes, see it') ?></button>
</div>
</div>
</div>
</div>
<?php
if ($QRCODE) :
?>
<div id="qrcodemodal" tabindex="-1" class="modal fade" role="dialog" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><?php echo I18n::_('QR code') ?></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="<?php echo I18n::_('Close') ?>"></button>
</div>
<div class="modal-body">
<div class="mx-auto" id="qrcode-display"></div>
</div>
</div>
</div>
</div>
<?php
endif;
if ($EMAIL) :
?>
<div id="emailconfirmmodal" tabindex="-1" class="modal fade" role="dialog" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><?php echo I18n::_('Recipient may become aware of your timezone, convert time to UTC?') ?></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="<?php echo I18n::_('Close') ?>"></button>
</div>
<div class="modal-body row">
<div class="col-xs-12 col-md-6">
<button id="emailconfirm-timezone-current" type="button" class="btn btn-danger"><svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#clock" /></svg> <?php echo I18n::_('Use Current Timezone') ?></button>
</div>
<div class="col-xs-12 col-md-6 text-right">
<button id="emailconfirm-timezone-utc" type="button" class="btn btn-success"><svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#globe" /></svg> <?php echo I18n::_('Convert To UTC') ?></button>
</div>
</div>
</div>
</div>
</div>
<?php
endif;
?>
<nav class="navbar navbar-expand-lg bg-body-tertiary">
<div class="container-fluid">
<a class="reloadlink navbar-brand" href="">
<img alt="<?php echo I18n::_($NAME); ?>" src="img/icon.svg" height="38" />
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="<?php echo I18n::_('Toggle navigation'); ?>">
<span class="navbar-toggler-icon"></span>
</button>
<div id="navbar" class="collapse navbar-collapse">
<ul class="navbar-nav me-auto">
<li id="loadingindicator" class="navbar-text hidden me-auto">
<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#clock" /></svg>
<?php echo I18n::_('Loading…'), PHP_EOL; ?>
</li>
<li class="nav-item me-2">
<button id="retrybutton" type="button" class="reloadlink hidden btn btn-primary">
<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#repeat" /></svg> <?php echo I18n::_('Retry'), PHP_EOL; ?>
</button>
</li>
<li class="nav-item">
<button id="newbutton" type="button" class="hidden btn btn-secondary me-2">
<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#file-earmark" /></svg> <?php echo I18n::_('New'), PHP_EOL; ?>
</button>
<button id="clonebutton" type="button" class="hidden btn btn-secondary me-2">
<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#copy" /></svg> <?php echo I18n::_('Clone'), PHP_EOL; ?>
</button>
<button id="rawtextbutton" type="button" class="hidden btn btn-secondary me-2">
<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#filetype-txt" /></svg> <?php echo I18n::_('Raw text'), PHP_EOL; ?>
</button>
<button id="downloadtextbutton" type="button" class="hidden btn btn-secondary me-2">
<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#download" /></svg> <?php echo I18n::_('Save paste'), PHP_EOL; ?>
</button>
<?php
if ($EMAIL) :
?>
<button id="emaillink" type="button" class="hidden btn btn-secondary me-2">
<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#envelope" /></svg> <?php echo I18n::_('Email'), PHP_EOL; ?>
</button>
<?php
endif;
if ($QRCODE) :
?>
<button id="qrcodelink" type="button" data-toggle="modal" data-target="#qrcodemodal" class="hidden btn btn-secondary me-2">
<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#qr-code" /></svg> <?php echo I18n::_('QR code'), PHP_EOL; ?>
</button>
<?php
endif;
?>
</li>
<li id="expiration" class="nav-item me-2 d-flex hidden">
<label for="pasteExpiration" class="form-label my-auto me-1"><?php echo I18n::_('Expires'); ?>:</label>
<select id="pasteExpiration" name="pasteExpiration" class="form-select">
<?php
foreach ($EXPIRE as $key => $value) :
?>
<option value="<?php echo $key; ?>"<?php
if ($key == $EXPIREDEFAULT) :
?> selected="selected"<?php
endif;
?>><?php echo $value; ?></option>
<?php
endforeach;
?>
</select>
</li>
<li class="nav-item me-2">
<div id="burnafterreadingoption" class="navbar-text form-check hidden">
<input class="form-check-input" type="checkbox" id="burnafterreading" name="burnafterreading"<?php
if ($BURNAFTERREADINGSELECTED) :
?> checked="checked"<?php
endif;
?> />
<label class="form-check-label" for="burnafterreading">
<?php echo I18n::_('Burn after reading'), PHP_EOL; ?>
</label>
</div>
</li>
<?php
if ($DISCUSSION) :
?>
<li class="nav-item me-2">
<div id="opendiscussionoption" class="navbar-text form-check hidden">
<input class="form-check-input" type="checkbox" id="opendiscussion" name="opendiscussion"<?php
if ($OPENDISCUSSION) :
?> checked="checked"<?php
endif;
?> />
<label class="form-check-label" for="opendiscussion">
<?php echo I18n::_('Open discussion'), PHP_EOL; ?>
</label>
</div>
</li>
<?php
endif;
if ($PASSWORD) :
?>
<li class="nav-item me-2">
<div id="password" class="navbar-form hidden">
<input type="password" id="passwordinput" placeholder="<?php echo I18n::_('Password (recommended)'); ?>" class="form-control" size="23" />
</div>
</li>
<?php
endif;
if ($FILEUPLOAD) :
?>
<li id="attach" class="nav-item hidden dropdown me-2">
<a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown" role="button" aria-expanded="false"><?php echo I18n::_('Attach a file'); ?></a>
<ul class="dropdown-menu">
<li id="filewrap">
<div>
<input type="file" id="file" name="file" class="form-control" />
</div>
<div id="dragAndDropFileName" class="dragAndDropFile"><?php echo I18n::_('alternatively drag & drop a file or paste an image from the clipboard'); ?></div>
</li>
<li id="customattachment" class="hidden"></li>
<li>
<a id="fileremovebutton" href="#" class="dropdown-item">
<?php echo I18n::_('Remove attachment'), PHP_EOL; ?>
</a>
</li>
</ul>
</li>
<?php
endif;
?>
<li id="formatter" class="nav-item me-2 d-flex hidden">
<label for="pasteFormatter" class="form-label my-auto me-1"><?php echo I18n::_('Format'); ?>:</label>
<select id="pasteFormatter" name="pasteFormatter" class="form-select">
<?php
foreach ($FORMATTER as $key => $value) :
?>
<option value="<?php echo $key; ?>"<?php
if ($key == $FORMATTERDEFAULT) :
?> selected="selected"<?php
endif;
?>><?php echo $value; ?></option>
<?php
endforeach;
?>
</select>
</li>
</ul>
<ul class="navbar-nav">
<li class="nav-item">
<div class="form-check form-switch navbar-text">
<input id="bd-theme" type="checkbox" class="form-check-input">
<label for="bd-theme" class="form-check-label"><?php echo I18n::_('Dark Mode'); ?></label>
</div>
</li>
<?php
if (!empty($LANGUAGESELECTION)) :
?>
<li id="language" class="nav-item dropdown ms-2">
<a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown" role="button" aria-expanded="false">
<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#flag" /></svg> <?php echo $LANGUAGES[$LANGUAGESELECTION][0], PHP_EOL; ?>
</a>
<ul class="dropdown-menu dropdown-menu-end" role="menu">
<?php
foreach ($LANGUAGES as $key => $value) :
?>
<li>
<a href="#" class="dropdown-item" data-lang="<?php echo $key; ?>">
<?php echo $value[0]; ?> (<?php echo $value[1]; ?>)
</a>
</li>
<?php
endforeach;
?>
</ul>
</li>
<?php
endif;
?>
</ul>
</div>
</div>
</nav>
<main>
<section class="container mt-2">
<?php
if (!empty($NOTICE)) :
?>
<div role="alert" class="alert alert-info">
<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#info-circle" /></svg>
<?php echo I18n::encode($NOTICE), PHP_EOL; ?>
</div>
<?php
endif;
?>
<div id="remainingtime" role="alert" class="hidden alert alert-info">
<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#fire" /></svg>
</div>
<?php
if ($FILEUPLOAD) :
?>
<div id="attachment" role="alert" class="hidden alert alert-info">
<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#download" /></svg>
<a class="alert-link"><?php echo I18n::_('Download attachment'); ?></a>
</div>
<?php
endif;
?>
<div id="status" role="alert" class="alert alert-info<?php echo empty($STATUS) ? ' hidden' : '' ?>">
<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#info-circle" /></svg>
<?php echo I18n::encode($STATUS), PHP_EOL; ?>
</div>
<div id="errormessage" role="alert" class="<?php echo empty($ERROR) ? 'hidden' : '' ?> alert alert-danger">
<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#exclamation-triangle" /></svg>
<?php echo I18n::encode($ERROR), PHP_EOL; ?>
</div>
<noscript>
<div id="noscript" role="alert" class="alert alert-warning">
<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#exclamation-circle" /></svg>
<?php echo I18n::_('JavaScript is required for %s to work. Sorry for the inconvenience.', I18n::_($NAME)), PHP_EOL; ?>
</div>
</noscript>
<div id="oldnotice" role="alert" class="hidden alert alert-danger">
<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#exclamation-triangle" /></svg>
<?php echo I18n::_('%s requires a modern browser to work.', I18n::_($NAME)), PHP_EOL; ?>
<a href="https://www.mozilla.org/firefox/">Firefox</a>,
<a href="https://www.opera.com/">Opera</a>,
<a href="https://www.google.com/chrome">Chrome</a><br />
<span class="small"><?php echo I18n::_('For more information <a href="%s">see this FAQ entry</a>.', 'https://github.com/PrivateBin/PrivateBin/wiki/FAQ#why-does-it-show-me-the-error-privatebin-requires-a-modern-browser-to-work'); ?></span>
</div>
<?php
if ($HTTPWARNING) :
?>
<div id="httpnotice" role="alert" class="hidden alert alert-danger">
<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#exclamation-triangle" /></svg>
<?php echo I18n::_('This website is using an insecure connection! Please only use it for testing.'); ?><br />
<span class="small"><?php echo I18n::_('For more information <a href="%s">see this FAQ entry</a>.', 'https://github.com/PrivateBin/PrivateBin/wiki/FAQ#why-does-it-show-me-an-error-about-an-insecure-connection'); ?></span>
</div>
<div id="insecurecontextnotice" role="alert" class="hidden alert alert-danger">
<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#exclamation-triangle" /></svg>
<?php echo I18n::_('Your browser may require an HTTPS connection to support the WebCrypto API. Try <a href="%s">switching to HTTPS</a>.', $HTTPSLINK), PHP_EOL; ?>
</div>
<?php
endif;
?>
<div id="pastesuccess" class="hidden">
<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
if (!empty($URLSHORTENER)) :
?>
<p>
<button id="shortenbutton" data-shortener="<?php echo I18n::encode($URLSHORTENER); ?>" type="button" class="btn btn-primary btn-block">
<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#send" /></svg> <?php echo I18n::_('Shorten URL'), PHP_EOL; ?>
</button>
</p>
<div role="alert" class="alert alert-danger">
<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#exclamation-circle" /></svg>
<?php echo I18n::_('URL shortener may expose your decrypt key in URL.'), PHP_EOL; ?>
</div>
<?php
endif;
?>
</div>
<ul id="editorTabs" class="nav nav-tabs hidden">
<li role="presentation" class="nav-item me-1"><a class="nav-link active" role="tab" id="messageedit" href="#"><?php echo I18n::_('Editor'); ?></a></li>
<li role="presentation" class="nav-item me-1"><a class="nav-link" role="tab" id="messagepreview" href="#"><?php echo I18n::_('Preview'); ?></a></li>
<li role="presentation" class="nav-item ms-auto">
<button id="sendbutton" type="button" class="hidden btn btn-primary">
<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#cloud-upload" /></svg> <?php echo I18n::_('Create'), PHP_EOL; ?>
</button>
</li>
</ul>
</section>
<section class="container">
<article class="row">
<div id="placeholder" class="col-md-12 hidden"><?php echo I18n::_('+++ no paste text +++'); ?></div>
<div id="attachmentPreview" class="col-md-12 text-center hidden"></div>
<div id="prettymessage" class="col-md-12 hidden">
<pre id="prettyprint" class="col-md-12 prettyprint linenums:1"></pre>
</div>
<div id="plaintext" class="col-md-12 hidden"></div>
<p class="col-md-12"><textarea id="message" name="message" cols="80" rows="25" class="form-control hidden"></textarea></p>
</article>
</section>
<section class="container">
<div id="discussion" class="hidden">
<h4><?php echo I18n::_('Discussion'); ?></h4>
<div id="commentcontainer"></div>
</div>
</section>
<section class="container">
<div id="noscript" role="alert" class="alert alert-info noscript-hide">
<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#exclamation-circle" /></svg>
<?php echo I18n::_('Loading…'); ?><br />
<span class="small"><?php echo I18n::_('In case this message never disappears please have a look at <a href="%s">this FAQ for information to troubleshoot</a>.', 'https://github.com/PrivateBin/PrivateBin/wiki/FAQ#why-does-the-loading-message-not-go-away'); ?></span>
</div>
</section>
<footer class="container">
<div class="row">
<h4 class="col-md-5 col-xs-8"><?php echo I18n::_($NAME); ?> <small>- <?php echo I18n::_('Because ignorance is bliss'); ?></small></h4>
<p class="col-md-1 col-xs-4 text-center"><?php echo $VERSION; ?></p>
<p id="aboutbox" class="col-md-6 col-xs-12">
<?php echo sprintf(
I18n::_('%s is a minimalist, open source online pastebin where the server has zero knowledge of pasted data. Data is encrypted/decrypted %sin the browser%s using 256 bits AES.',
I18n::_($NAME),
'%s', '%s'
),
'<i>', '</i>'), ' ', $INFO, PHP_EOL;
?>
</p>
</div>
</footer>
</main>
<?php
if ($DISCUSSION) :
?>
<div id="serverdata" class="hidden" aria-hidden="true">
<div id="templates">
<article id="commenttemplate" class="comment">
<div class="commentmeta">
<span class="nickname">name</span>
<span class="commentdate">0000-00-00</span>
</div>
<div class="commentdata">c</div>
<button class="btn btn-secondary btn-sm"><?php echo I18n::_('Reply'); ?></button>
</article>
<p id="commenttailtemplate" class="comment">
<button class="btn btn-secondary btn-sm"><?php echo I18n::_('Add comment'); ?></button>
</p>
<div id="replytemplate" class="reply hidden">
<input type="text" id="nickname" class="form-control" title="<?php echo I18n::_('Optional nickname…'); ?>" placeholder="<?php echo I18n::_('Optional nickname…'); ?>" />
<textarea id="replymessage" class="replymessage form-control" cols="80" rows="7"></textarea><br />
<div id="replystatus" role="alert" class="statusmessage hidden alert">
<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#info-circle" /></svg>
</div>
<button id="replybutton" class="btn btn-secondary btn-sm"><?php echo I18n::_('Post comment'); ?></button>
</div>
</div>
</div>
<?php
endif;
?>
<?php
if ($FILEUPLOAD) :
?>
<div id="dropzone" class="hidden" tabindex="-1" aria-hidden="true"></div>
<?php
endif;
?>
</body>
</html>

View File

@ -14,7 +14,7 @@ if ($SYNTAXHIGHLIGHTING):
?>
<link type="text/css" rel="stylesheet" href="css/prettify/prettify.css?<?php echo rawurlencode($VERSION); ?>" />
<?php
if (strlen($SYNTAXHIGHLIGHTINGTHEME)):
if (!empty($SYNTAXHIGHLIGHTINGTHEME)):
?>
<link type="text/css" rel="stylesheet" href="css/prettify/<?php echo rawurlencode($SYNTAXHIGHLIGHTINGTHEME); ?>.css?<?php echo rawurlencode($VERSION); ?>" />
<?php
@ -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-I0F8qtFtaBvVvTThlXa63q0fLptZHP+hg9SbUqZ/qpimAPvHYGFfRj06aqEvECByNgKlQOWab3p8NQ2waDZ+fQ==" crossorigin="anonymous"></script>
<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-hqatct2X1I7GZZFAvbnaWU+QPz+cIhBQIxhXtR50aq+pTfhvUljqzqoLi4Yli6P+GIV6IFlm5Yf/uvdEvSjMcA==" 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" />
@ -86,7 +86,7 @@ endif;
?>
<br />
<?php
if (strlen($NOTICE)):
if (!empty($NOTICE)):
?>
<span class="blink"></span> <?php echo I18n::encode($NOTICE);
endif;
@ -203,7 +203,7 @@ endforeach;
</select>
</div>
<?php
if (strlen($LANGUAGESELECTION)):
if (!empty($LANGUAGESELECTION)):
?>
<div id="language" class="button">
<select name="lang">
@ -234,7 +234,7 @@ endif;
<div id="deletelink"></div>
<div id="pastelink"></div>
<?php
if (strlen($URLSHORTENER)):
if (!empty($URLSHORTENER)):
?>
<button id="shortenbutton" data-shortener="<?php echo I18n::encode($URLSHORTENER); ?>"><img src="img/icon_shorten.png" width="13" height="15" /><?php echo I18n::_('Shorten URL'); ?></button>
<?php
@ -277,9 +277,25 @@ if ($DISCUSSION):
?>
<div id="serverdata" class="hidden" aria-hidden="true">
<div id="templates">
<article id="commenttemplate" class="comment"><div class="commentmeta"><span class="nickname">name</span><span class="commentdate">0000-00-00</span></div><div class="commentdata">c</div><button class="btn btn-default btn-sm"><?php echo I18n::_('Reply'); ?></button></article>
<div id="commenttailtemplate" class="comment"><button class="btn btn-default btn-sm"><?php echo I18n::_('Add comment'); ?></button></div>
<div id="replytemplate" class="reply hidden"><input type="text" id="nickname" class="form-control" title="<?php echo I18n::_('Optional nickname…'); ?>" placeholder="<?php echo I18n::_('Optional nickname…'); ?>" /><textarea id="replymessage" class="replymessage form-control" cols="80" rows="7"></textarea><br /><div id="replystatus" role="alert" class="statusmessage hidden alert"><span class="glyphicon" aria-hidden="true"></span> </div><button id="replybutton" class="btn btn-default btn-sm"><?php echo I18n::_('Post comment'); ?></button></div>
<article id="commenttemplate" class="comment">
<div class="commentmeta">
<span class="nickname">name</span>
<span class="commentdate">0000-00-00</span>
</div>
<div class="commentdata">c</div>
<button class="btn btn-default btn-sm"><?php echo I18n::_('Reply'); ?></button>
</article>
<div id="commenttailtemplate" class="comment">
<button class="btn btn-default btn-sm"><?php echo I18n::_('Add comment'); ?></button>
</div>
<div id="replytemplate" class="reply hidden">
<input type="text" id="nickname" class="form-control" title="<?php echo I18n::_('Optional nickname…'); ?>" placeholder="<?php echo I18n::_('Optional nickname…'); ?>" />
<textarea id="replymessage" class="replymessage form-control" cols="80" rows="7"></textarea><br />
<div id="replystatus" role="alert" class="statusmessage hidden alert">
<span class="glyphicon" aria-hidden="true"></span>
</div>
<button id="replybutton" class="btn btn-default btn-sm"><?php echo I18n::_('Post comment'); ?></button>
</div>
</div>
</div>
<?php