diff --git a/CHANGELOG.md b/CHANGELOG.md index d96eabb1..ae2d426d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 1.7.6 (not yet released) * CHANGED: Switched to WASM streaming and replace unsafe-eval with wasm-unsafe-eval CSP declaration (#1464), requires webserver to have `application/wasm` MIME type configured. * CHANGED: Upgrading libraries to: cloud-storage 1.44.0, aws-sdk-php 3.331.0 +* ADDED: Ability to copy the paste by clicking the copy icon button or using the keyboard shortcut ctrl+c/cmd+c (#1390) ## 1.7.5 (2024-11-16) * ADDED: Allow non persistent SQL connections, if configured (#1394) diff --git a/css/bootstrap/privatebin.css b/css/bootstrap/privatebin.css index 5f47f6e6..ab2fdebc 100644 --- a/css/bootstrap/privatebin.css +++ b/css/bootstrap/privatebin.css @@ -143,34 +143,23 @@ html[dir="rtl"] #deletelink, html[dir="rtl"] #qrcodemodalClose { padding-right: 30px; } -#prettymessageCopyBtn { +#prettyMessageCopyBtn { position: absolute; - top: 5px; - right: 20px; - width: 25px; - height: 25px; + top: 8px; + right: 25px; + left: auto; padding: 0; background: none; border: none; z-index: 1; } -#prettymessageCopyBtn svg { - width: 100%; -} - -#copyIcon { - fill: rgb(145, 152, 161); - opacity: 0.4; - transition: all 0.3s ease; -} - -#copyIcon:hover { - opacity: 1; +html[dir="rtl"] #prettyMessageCopyBtn { + left: 25px; + right: auto; } #copySuccessIcon { - fill: rgb(63, 185, 80); display: none; } diff --git a/css/bootstrap5/privatebin.css b/css/bootstrap5/privatebin.css index 38bc3fdb..b633dbff 100644 --- a/css/bootstrap5/privatebin.css +++ b/css/bootstrap5/privatebin.css @@ -14,6 +14,15 @@ display: none !important; } +.opacity-05-1-hover { + opacity: 0.5; + transition: all 0.15s ease; +} + +.opacity-05-1-hover:hover { + opacity: 1; +} + .dropdown-menu { --bs-dropdown-min-width: 23rem; } @@ -44,33 +53,30 @@ html[dir="rtl"] #deletelink, html[dir="rtl"] #qrcodemodalClose { padding-right: 30px; } -#prettymessageCopyBtn { +#prettyMessageCopyBtn { position: absolute; - top: 5px; - right: 5px; - width: 25px; - height: 25px; + top: 8px; + right: 8px; + left: auto; + width: 20px; + height: 20px; padding: 0; background: none; border: none; z-index: 1; } -#prettymessageCopyBtn svg { +html[dir="rtl"] #prettyMessageCopyBtn { + left: 8px; + right: auto; +} + +#prettyMessageCopyBtn svg { width: 100%; -} - -#copyIcon { - fill: rgb(145, 152, 161); - opacity: 0.4; - transition: all 0.3s ease; -} - -#copyIcon:hover { - opacity: 1; + height: 100%; + vertical-align: baseline; } #copySuccessIcon { - fill: rgb(63, 185, 80); display: none; } diff --git a/i18n/ar.json b/i18n/ar.json index 4e4e91ba..56b3b8c6 100644 --- a/i18n/ar.json +++ b/i18n/ar.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.", "Start over": "Start over", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/bg.json b/i18n/bg.json index d0e1bcda..e8cf177f 100644 --- a/i18n/bg.json +++ b/i18n/bg.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.", "Start over": "Start over", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/ca.json b/i18n/ca.json index 26a48446..65159327 100644 --- a/i18n/ca.json +++ b/i18n/ca.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.", "Start over": "Start over", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/co.json b/i18n/co.json index 496a92e1..f5a7e9c0 100644 --- a/i18n/co.json +++ b/i18n/co.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Sbagliu durante a scumpressione di l’appiccicu, perchè u vostru navigatore ùn accetteghja micca WebAssembly. Ci vole à impiegà un altru navigatore per affissà st’appiccicu.", "Start over": "Principià torna", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/cs.json b/i18n/cs.json index f51c6c9f..de42249a 100644 --- a/i18n/cs.json +++ b/i18n/cs.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Chyba při dekomprimování příspěvku, váš prohlížeč nepodporuje WebAssembly. Pro zobrazení tohoto příspěvku prosím použijte jiný prohlížeč.", "Start over": "Start over", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/de.json b/i18n/de.json index c918baf0..d250e788 100644 --- a/i18n/de.json +++ b/i18n/de.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Fehler beim Dekomprimieren des Textes. Dein Browser unterstützt WebAssembly nicht. Bitte verwende einen anderen Browser, um diesen Text anzuzeigen.", "Start over": "Neuen Text erstellen", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/el.json b/i18n/el.json index f64e8d63..f88b702e 100644 --- a/i18n/el.json +++ b/i18n/el.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Σφάλμα αποσυμπίεσης της επικόλλησης, ο περιηγητής σας δεν υποστηρίζει WebAssembly. Παρακαλούμε χρησιμοποιήστε έναν άλλο περιηγητή για να δείτε αυτή την επικόλληση.", "Start over": "Start over", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/en.json b/i18n/en.json index 040a15b7..28f2efbc 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.", "Start over": "Start over", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/es.json b/i18n/es.json index 3b312f43..a7e4206b 100644 --- a/i18n/es.json +++ b/i18n/es.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.", "Start over": "Start over", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/et.json b/i18n/et.json index 9183e7a2..45d868db 100644 --- a/i18n/et.json +++ b/i18n/et.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.", "Start over": "Start over", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/fi.json b/i18n/fi.json index 1452ea08..fa8de23f 100644 --- a/i18n/fi.json +++ b/i18n/fi.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.", "Start over": "Start over", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/fr.json b/i18n/fr.json index a87e453f..99f1d730 100644 --- a/i18n/fr.json +++ b/i18n/fr.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Erreur lors de la décompression du paste, votre navigateur ne supporte pas WebAssembly. Veuillez utiliser un autre navigateur pour voir ce paste.", "Start over": "Recommencer", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/he.json b/i18n/he.json index 77ed3e1d..eed6897b 100644 --- a/i18n/he.json +++ b/i18n/he.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.", "Start over": "Start over", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/hi.json b/i18n/hi.json index 040a15b7..28f2efbc 100644 --- a/i18n/hi.json +++ b/i18n/hi.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.", "Start over": "Start over", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/hu.json b/i18n/hu.json index 97e1fc44..c756a989 100644 --- a/i18n/hu.json +++ b/i18n/hu.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.", "Start over": "Start over", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/id.json b/i18n/id.json index 32e274c0..e05f5fd0 100644 --- a/i18n/id.json +++ b/i18n/id.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.", "Start over": "Start over", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/it.json b/i18n/it.json index 3e9f8162..a6c97ffc 100644 --- a/i18n/it.json +++ b/i18n/it.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Errore nella decompressione dell messaggio, il tuo browser non supporta WebAssembly. Utilizza un altro browser per visualizzare questo messaggio.", "Start over": "Ricominciare", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/ja.json b/i18n/ja.json index d8c7ae01..f1e5d911 100644 --- a/i18n/ja.json +++ b/i18n/ja.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.", "Start over": "Start over", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/jbo.json b/i18n/jbo.json index dc992536..1524be0e 100644 --- a/i18n/jbo.json +++ b/i18n/jbo.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.", "Start over": "Start over", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/ko.json b/i18n/ko.json index 040a15b7..28f2efbc 100644 --- a/i18n/ko.json +++ b/i18n/ko.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.", "Start over": "Start over", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/ku.json b/i18n/ku.json index f56f4b8a..71958f36 100644 --- a/i18n/ku.json +++ b/i18n/ku.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.", "Start over": "Start over", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/la.json b/i18n/la.json index e17f7c57..9e522e1d 100644 --- a/i18n/la.json +++ b/i18n/la.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.", "Start over": "Start over", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/lt.json b/i18n/lt.json index 41a07bbc..81cd6154 100644 --- a/i18n/lt.json +++ b/i18n/lt.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Klaida išglaudinant įdėjimą, jūsų naršyklė nepalaiko WebAssembly. Norėdami peržiūrėti šį įdėjimą, naudokite kitą naršyklę.", "Start over": "Start over", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/nl.json b/i18n/nl.json index a6aaa3e4..8d391029 100644 --- a/i18n/nl.json +++ b/i18n/nl.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Fout bij het decomprimeren van de notitie, uw browser ondersteunt WebAssembly niet. Gebruik een andere browser om deze notitie te bekijken.", "Start over": "Start over", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/no.json b/i18n/no.json index b793472f..4935887c 100644 --- a/i18n/no.json +++ b/i18n/no.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.", "Start over": "Start over", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/oc.json b/i18n/oc.json index 4226a4ea..8bb3618b 100644 --- a/i18n/oc.json +++ b/i18n/oc.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Error al moment de descompresar l'empegatge, vòstre navegador pren pas en carga WebAssembly. Mercés d'utilizar un autre navigador per visualizar aquesta pega.", "Start over": "Start over", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/pl.json b/i18n/pl.json index 7707a09c..5c2e38e8 100644 --- a/i18n/pl.json +++ b/i18n/pl.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Błąd dekompresowania wklejenia przez brak obsługi WebAssembly przez przeglądarkę. Użyj innej przeglądarki, aby zobaczyć to wklejenie.", "Start over": "Start over", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/pt.json b/i18n/pt.json index 95b7f5ee..c84f7cde 100644 --- a/i18n/pt.json +++ b/i18n/pt.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.", "Start over": "Start over", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/ro.json b/i18n/ro.json index 801019a6..aafa33e0 100644 --- a/i18n/ro.json +++ b/i18n/ro.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Eroare la deschiderea paste-ului, browserul dvs. nu acceptă WebAssembly. Vă rugăm să utilizați un alt browser pentru a vedea acest paste.", "Start over": "Start over", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/ru.json b/i18n/ru.json index 3439835a..5b538bc8 100644 --- a/i18n/ru.json +++ b/i18n/ru.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.", "Start over": "Start over", "Paste copied to clipboard": "Запись скопирована в буфер обмена", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "Чтобы скопировать запись нажмите на кнопку скопирования или используйте комбинацию клавиш Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "Чтобы скопировать запись нажмите на кнопку копирования или используйте комбинацию клавиш Ctrl+c/Cmd+c" } diff --git a/i18n/sk.json b/i18n/sk.json index 0441ce78..9136397d 100644 --- a/i18n/sk.json +++ b/i18n/sk.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.", "Start over": "Start over", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/sl.json b/i18n/sl.json index 1318735e..84205b49 100644 --- a/i18n/sl.json +++ b/i18n/sl.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.", "Start over": "Start over", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/sv.json b/i18n/sv.json index a35c712c..94b10e3c 100644 --- a/i18n/sv.json +++ b/i18n/sv.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.", "Start over": "Start over", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/th.json b/i18n/th.json index 21229b43..0dad59dc 100644 --- a/i18n/th.json +++ b/i18n/th.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "ไม่สามารถอ่านข้อมูลที่คุณได้ฝากโค้ดไว้ เบราว์เซอร์ของคุณไม่รองรับ WebAssembly กรุณาลองเปลี่ยนใช้เบราว์เซอร์ตัวอื่นเพื่อดูการฝากโค้ดนี้อีกครั้ง", "Start over": "เริ่มใหม่", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/tr.json b/i18n/tr.json index 70d7545c..f06be075 100644 --- a/i18n/tr.json +++ b/i18n/tr.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Yazı açılırken hata oluştu, tarayıcınız WebAssembly'i desteklemiyor. Lütfen bu yazıyı görüntülemek için başka bir tarayıcı kullanın.", "Start over": "Baştan başla", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/uk.json b/i18n/uk.json index 82ba56eb..b4eb3d69 100644 --- a/i18n/uk.json +++ b/i18n/uk.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Помилка при розпакуванні допису, бо ваш браузер не підтримує WebAssembly. Будь ласка, відкрийте в іншому браузері для перегляду цього допису.", "Start over": "Почати знову", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/i18n/zh.json b/i18n/zh.json index f3433912..73b6bc8f 100644 --- a/i18n/zh.json +++ b/i18n/zh.json @@ -222,5 +222,5 @@ "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "解压粘贴时出错,您的浏览器不支持 WebAssembly。请使用其他浏览器查看此粘贴。", "Start over": "重新开始", "Paste copied to clipboard": "Paste copied to clipboard", - "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" + "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c": "To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c" } diff --git a/img/content-copy-icon.svg b/img/content-copy-icon.svg deleted file mode 100644 index 77b63083..00000000 --- a/img/content-copy-icon.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/js/privatebin.js b/js/privatebin.js index a4627647..74e37def 100644 --- a/js/privatebin.js +++ b/js/privatebin.js @@ -757,14 +757,14 @@ jQuery.PrivateBin = (function($, RawDeflate) { args[0] = translations[messageId]; } - // messageID may contain links, but should be from a trusted source (code or translation JSON files) - let containsLinks = args[0].indexOf(' 0) may never contain HTML as they may come from untrusted parties - if ((containsLinks ? i > 1 : i > 0) || !containsLinks) { + if ((containsHtml ? i > 1 : i > 0) || !containsHtml) { args[i] = Helper.htmlEntities(args[i]); } } @@ -772,11 +772,11 @@ jQuery.PrivateBin = (function($, RawDeflate) { // format string let output = Helper.sprintf.apply(this, args); - if (containsLinks) { + if (containsHtml) { // only allow tags/attributes we actually use in translations output = DOMPurify.sanitize( output, { - ALLOWED_TAGS: ['a', 'i', 'span'], + ALLOWED_TAGS: ['a', 'i', 'span', 'kbd'], ALLOWED_ATTR: ['href', 'id'] } ); @@ -784,7 +784,7 @@ jQuery.PrivateBin = (function($, RawDeflate) { // if $element is given, insert translation if ($element !== null) { - if (containsLinks) { + if (containsHtml) { $element.html(output); } else { // text node takes care of entity encoding @@ -914,6 +914,25 @@ jQuery.PrivateBin = (function($, RawDeflate) { translations = mockTranslations || {}; }; + /** + * Check if string contains valid HTML code + * + * @name I18n.isStringContainsHtml + * @function + * @private + * @param {string} messageId + * @returns {boolean} + */ + function isStringContainsHtml(messageId) { + // An integer which specifies the type of the node. An Element node like

or

. + const elementNodeType = 1; + + const div = document.createElement('div'); + div.innerHTML = messageId; + + return Array.from(div.childNodes).some(node => node.nodeType === elementNodeType); + } + return me; })(); @@ -3768,7 +3787,7 @@ jQuery.PrivateBin = (function($, RawDeflate) { /** * Clear the password input in the top navigation - * + * * @name TopNav.clearPasswordInput * @function */ @@ -5371,21 +5390,21 @@ jQuery.PrivateBin = (function($, RawDeflate) { })(); /** - * + * * @name CopyToClipboard * @class */ const CopyToClipboard = (function () { const me = {}; - let copyButton = $("#prettymessageCopyBtn"), - copyIcon = $("#copyIcon"), - successIcon = $("#copySuccessIcon"), - shortcutHint = $("#copyShortcutHintText"); + let copyButton = $('#prettyMessageCopyBtn'), + copyIcon = $('#copyIcon'), + successIcon = $('#copySuccessIcon'), + shortcutHint = $('#copyShortcutHintText'); /** * Handle copy to clipboard button click - * + * * @name CopyToClipboard.handleCopyButtonClick * @private * @function @@ -5399,7 +5418,7 @@ jQuery.PrivateBin = (function($, RawDeflate) { /** * Handle CTRL+C/CMD+C keyboard shortcut - * + * * @name CopyToClipboard.handleKeyboardShortcut * @private * @function @@ -5411,31 +5430,31 @@ jQuery.PrivateBin = (function($, RawDeflate) { saveToClipboard(text); } }); - } + }; /** * Check if user selected some text on the page to copy it - * + * * @name CopyToClipboard.isUserSelectedTextToCopy * @private * @function * @returns {boolean} */ function isUserSelectedTextToCopy() { - let text = ""; - + let text = ''; + if (window.getSelection) { text = window.getSelection().toString(); - } else if (document.selection && document.selection.type != "Control") { + } else if (document.selection && document.selection.type != 'Control') { text = document.selection.createRange().text; } - + return text.length > 0; - } + }; /** * Save text to the clipboard - * + * * @name CopyToClipboard.saveToClipboard * @private * @param {string} text @@ -5449,55 +5468,65 @@ jQuery.PrivateBin = (function($, RawDeflate) { /** * Show alert message after text copy - * + * * @name CopyToClipboard.showAlertMessage * @private * @function */ function showAlertMessage() { - Alert.showStatus("Paste copied to clipboard"); - } + Alert.showStatus(I18n._('Paste copied to clipboard')); + }; /** * Toogle success icon after copy - * + * * @name CopyToClipboard.toggleSuccessIcon * @private * @function */ function toggleSuccessIcon() { - $(copyIcon).css("display", "none"); - $(successIcon).css("display", "block"); + $(copyIcon).css('display', 'none'); + $(successIcon).css('display', 'block'); setTimeout(function() { - $(copyIcon).css("display", "block"); - $(successIcon).css("display", "none"); + $(copyIcon).css('display', 'block'); + $(successIcon).css('display', 'none'); }, 1000); }; /** * Show keyboard shortcut hint - * + * * @name CopyToClipboard.showKeyboardShortcutHint * @function */ me.showKeyboardShortcutHint = function () { I18n._( shortcutHint, - 'To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c' + 'To copy paste press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c' ); - } + }; + + /** + * Hide keyboard shortcut hint + * + * @name CopyToClipboard.showKeyboardShortcutHint + * @function + */ + me.hideKeyboardShortcutHint = function () { + $(shortcutHint).html(''); + }; /** * Initialize - * + * * @name CopyToClipboard.init * @function */ me.init = function() { handleCopyButtonClick(); handleKeyboardShortcut(); - } + }; return me; })(); @@ -5523,6 +5552,7 @@ jQuery.PrivateBin = (function($, RawDeflate) { { PasteStatus.hideMessages(); Alert.hideMessages(); + CopyToClipboard.hideKeyboardShortcutHint(); }; /** diff --git a/lib/Configuration.php b/lib/Configuration.php index ec753793..a262e8fe 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -108,7 +108,7 @@ class Configuration 'js/kjua-0.9.0.js' => 'sha512-CVn7af+vTMBd9RjoS4QM5fpLFEOtBCoB0zPtaqIDC7sF4F8qgUSRFQQpIyEDGsr6yrjbuOLzdf20tkHHmpaqwQ==', 'js/legacy.js' => 'sha512-UxW/TOZKon83n6dk/09GsYKIyeO5LeBHokxyIq+r7KFS5KMBeIB/EM7NrkVYIezwZBaovnyNtY2d9tKFicRlXg==', 'js/prettify.js' => 'sha512-puO0Ogy++IoA2Pb9IjSxV1n4+kQkKXYAEUtVzfZpQepyDPyXk8hokiYDS7ybMogYlyyEIwMLpZqVhCkARQWLMg==', - 'js/privatebin.js' => 'sha512-l9FxMcY99yenozSdmWgraPIfGd0TMdAMs3TBRZCKHrBECJqiYS385wfLdN8D3ffpa0HZHvgjRyk2Txs0r+v6FQ==', + 'js/privatebin.js' => 'sha512-4ZwwNQ6GWRx90JqxNJ5SI7qN9A75r1f5vWUd3+GUXEkXvNmygjDGR/unOvKRgGZxXYhW5N42ytNx7CXes0MX/Q==', 'js/purify-3.1.7.js' => 'sha512-LegvqULiMtOfboJZw9MpETN/b+xnLRXZI90gG7oIFHW+yAeHmKvRtEUbiMFx2WvUqQoL9XB3gwU+hWXUT0X+8A==', 'js/rawinflate-0.3.js' => 'sha512-g8uelGgJW9A/Z1tB6Izxab++oj5kdD7B4qC7DHwZkB6DGMXKyzx7v5mvap2HXueI2IIn08YlRYM56jwWdm2ucQ==', 'js/showdown-2.1.0.js' => 'sha512-WYXZgkTR0u/Y9SVIA4nTTOih0kXMEd8RRV6MLFdL6YU8ymhR528NLlYQt1nlJQbYz4EW+ZsS0fx1awhiQJme1Q==', diff --git a/tpl/bootstrap.php b/tpl/bootstrap.php index e9777a0a..d0a4aa45 100644 --- a/tpl/bootstrap.php +++ b/tpl/bootstrap.php @@ -581,13 +581,9 @@ endif;
diff --git a/tpl/bootstrap5.php b/tpl/bootstrap5.php index ddd9d6ce..fb45ffd7 100644 --- a/tpl/bootstrap5.php +++ b/tpl/bootstrap5.php @@ -437,9 +437,9 @@ endif;