Просмотр исходного кода

Merge pull request #1475 from Ribas160/copy_to_clipboard_btn

Copy paste to clipboard button added. Copy paste to clipboard shortcu…
El RIDO 1 год назад
Родитель
Сommit
c7d085a51f
46 измененных файлов с 484 добавлено и 46 удалено
  1. 1 0
      CHANGELOG.md
  2. 1 0
      CREDITS.md
  3. 28 0
      css/bootstrap/privatebin.css
  4. 41 0
      css/bootstrap5/privatebin.css
  5. 1 0
      css/privatebin.css
  6. 5 1
      i18n/ar.json
  7. 5 1
      i18n/bg.json
  8. 5 1
      i18n/ca.json
  9. 5 1
      i18n/co.json
  10. 5 1
      i18n/cs.json
  11. 5 1
      i18n/de.json
  12. 5 1
      i18n/el.json
  13. 5 1
      i18n/en.json
  14. 5 1
      i18n/es.json
  15. 5 1
      i18n/et.json
  16. 5 1
      i18n/fi.json
  17. 5 1
      i18n/fr.json
  18. 5 1
      i18n/he.json
  19. 5 1
      i18n/hi.json
  20. 5 1
      i18n/hu.json
  21. 5 1
      i18n/id.json
  22. 5 1
      i18n/it.json
  23. 5 1
      i18n/ja.json
  24. 5 1
      i18n/jbo.json
  25. 5 1
      i18n/ko.json
  26. 5 1
      i18n/ku.json
  27. 5 1
      i18n/la.json
  28. 5 1
      i18n/lt.json
  29. 5 1
      i18n/nl.json
  30. 5 1
      i18n/no.json
  31. 5 1
      i18n/oc.json
  32. 5 1
      i18n/pl.json
  33. 5 1
      i18n/pt.json
  34. 5 1
      i18n/ro.json
  35. 5 1
      i18n/ru.json
  36. 5 1
      i18n/sk.json
  37. 5 1
      i18n/sl.json
  38. 5 1
      i18n/sv.json
  39. 5 1
      i18n/th.json
  40. 5 1
      i18n/tr.json
  41. 5 1
      i18n/uk.json
  42. 5 1
      i18n/zh.json
  43. 210 8
      js/privatebin.js
  44. 1 1
      lib/Configuration.php
  45. 8 0
      tpl/bootstrap.php
  46. 8 0
      tpl/bootstrap5.php

+ 1 - 0
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)

+ 1 - 0
CREDITS.md

@@ -33,6 +33,7 @@
 * Mounir Idrassi & J. Mozdzen - secure YOURLS integration
 * Felipe Nakandakari - enabled AWS SDK to use default credential provider chain in the S3 Storage backend
 * Aaron Sherber - cache control headers for API calls & use of `shortenviayourls` in query parameters
+* Mikhail Romanov - copying to clipboard
 
 ## Translations
 * Hexalyse - French

+ 28 - 0
css/bootstrap/privatebin.css

@@ -138,3 +138,31 @@ html[dir="rtl"] #language {
 html[dir="rtl"] #deletelink, html[dir="rtl"] #qrcodemodalClose {
 	float: left;
 }
+
+#prettyprint {
+	padding-right: 30px;
+}
+
+#prettyMessageCopyBtn {
+	position: absolute;
+	top: 8px;
+	right: 25px;
+	left: auto;
+	padding: 0;
+	background: none;
+	border: none;
+	z-index: 1;
+}
+
+html[dir="rtl"] #prettyMessageCopyBtn {
+	left: 25px;
+	right: auto;
+}
+
+#copySuccessIcon {
+	display: none;
+}
+
+#copyShortcutHint {
+	margin-bottom: 5px;
+}

+ 41 - 0
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;
 }
@@ -39,3 +48,35 @@ li.L0, li.L1, li.L2, li.L3, li.L4, li.L5, li.L6, li.L7, li.L8, li.L9 {
 html[dir="rtl"] #deletelink, html[dir="rtl"] #qrcodemodalClose {
 	float: left;
 }
+
+#prettyprint {
+	padding-right: 30px;
+}
+
+#prettyMessageCopyBtn {
+	position: absolute;
+	top: 8px;
+	right: 8px;
+	left: auto;
+	width: 20px;
+	height: 20px;
+	padding: 0;
+	background: none;
+	border: none;
+	z-index: 1;
+}
+
+html[dir="rtl"] #prettyMessageCopyBtn {
+	left: 8px;
+	right: auto;
+}
+
+#prettyMessageCopyBtn svg {
+	width: 100%;
+	height: 100%;
+	vertical-align: baseline;
+}
+
+#copySuccessIcon {
+	display: none;
+}

+ 1 - 0
css/privatebin.css

@@ -86,6 +86,7 @@ h3.title {
 #aboutbox a { color: #94a3b4; }
 
 #message, #cleartext, #prettymessage, #attachment, .replymessage {
+	position: relative;
 	clear: both;
 	color: #000;
 	background-color: #fff;

+ 5 - 1
i18n/ar.json

@@ -220,5 +220,9 @@
     "Dark Mode": "الوضع الداكن",
     "Error compressing paste, due to missing WebAssembly support.": "Error compressing paste, due to missing WebAssembly support.",
     "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"
+    "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/bg.json

@@ -220,5 +220,9 @@
     "Dark Mode": "Dark Mode",
     "Error compressing paste, due to missing WebAssembly support.": "Error compressing paste, due to missing WebAssembly support.",
     "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"
+    "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/ca.json

@@ -220,5 +220,9 @@
     "Dark Mode": "Dark Mode",
     "Error compressing paste, due to missing WebAssembly support.": "Error de compressió de la nota, no hi ha suport de WebAssembly.",
     "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"
+    "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/co.json

@@ -220,5 +220,9 @@
     "Dark Mode": "Modu scuru",
     "Error compressing paste, due to missing WebAssembly support.": "Sbagliu durante a cumpressione di l’appiccicu, perchè WebAssembly ùn hè micca accettatu.",
     "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"
+    "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/cs.json

@@ -220,5 +220,9 @@
     "Dark Mode": "Tmavý režim",
     "Error compressing paste, due to missing WebAssembly support.": "Chyba při komprimování příspěvku kvůli chybějící podpoře WebAssembly.",
     "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"
+    "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/de.json

@@ -220,5 +220,9 @@
     "Dark Mode": "Nachtmodus",
     "Error compressing paste, due to missing WebAssembly support.": "Fehler beim Komprimieren des Textes, da WebAssembly-Unterstützung fehlt.",
     "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"
+    "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/el.json

@@ -220,5 +220,9 @@
     "Dark Mode": "Σκοτεινό Θέμα",
     "Error compressing paste, due to missing WebAssembly support.": "Σφάλμα συμπίεσης επικόλλησης, λόγω έλλειψης υποστήριξης WebAssembly.",
     "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Σφάλμα αποσυμπίεσης της επικόλλησης, ο περιηγητής σας δεν υποστηρίζει WebAssembly. Παρακαλούμε χρησιμοποιήστε έναν άλλο περιηγητή για να δείτε αυτή την επικόλληση.",
-    "Start over": "Start over"
+    "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/en.json

@@ -220,5 +220,9 @@
     "Dark Mode": "Dark Mode",
     "Error compressing paste, due to missing WebAssembly support.": "Error compressing paste, due to missing WebAssembly support.",
     "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"
+    "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/es.json

@@ -220,5 +220,9 @@
     "Dark Mode": "Modo nocturno",
     "Error compressing paste, due to missing WebAssembly support.": "Error compressing paste, due to missing WebAssembly support.",
     "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"
+    "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/et.json

@@ -220,5 +220,9 @@
     "Dark Mode": "Tume režiim",
     "Error compressing paste, due to missing WebAssembly support.": "Error compressing paste, due to missing WebAssembly support.",
     "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"
+    "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/fi.json

@@ -220,5 +220,9 @@
     "Dark Mode": "Tumma tila",
     "Error compressing paste, due to missing WebAssembly support.": "Error compressing paste, due to missing WebAssembly support.",
     "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"
+    "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/fr.json

@@ -220,5 +220,9 @@
     "Dark Mode": "Mode Sombre",
     "Error compressing paste, due to missing WebAssembly support.": "Erreur lors de la compression du paste, en raison du support de WebAssembly manquant.",
     "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"
+    "Start over": "Recommencer",
+    "Paste copied to clipboard": "Paste copied to clipboard",
+    "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/he.json

@@ -220,5 +220,9 @@
     "Dark Mode": "Dark Mode",
     "Error compressing paste, due to missing WebAssembly support.": "Error compressing paste, due to missing WebAssembly support.",
     "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"
+    "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/hi.json

@@ -220,5 +220,9 @@
     "Dark Mode": "Dark Mode",
     "Error compressing paste, due to missing WebAssembly support.": "Error compressing paste, due to missing WebAssembly support.",
     "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"
+    "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/hu.json

@@ -220,5 +220,9 @@
     "Dark Mode": "Sötét mód",
     "Error compressing paste, due to missing WebAssembly support.": "Error compressing paste, due to missing WebAssembly support.",
     "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"
+    "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/id.json

@@ -220,5 +220,9 @@
     "Dark Mode": "Mode Gelap",
     "Error compressing paste, due to missing WebAssembly support.": "Error compressing paste, due to missing WebAssembly support.",
     "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"
+    "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/it.json

@@ -220,5 +220,9 @@
     "Dark Mode": "Tema Scuro",
     "Error compressing paste, due to missing WebAssembly support.": "Errore nella compressione dell messaggio, a causa del supporto WebAssembly mancante.",
     "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"
+    "Start over": "Ricominciare",
+    "Paste copied to clipboard": "Paste copied to clipboard",
+    "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/ja.json

@@ -220,5 +220,9 @@
     "Dark Mode": "ダークモード",
     "Error compressing paste, due to missing WebAssembly support.": "Error compressing paste, due to missing WebAssembly support.",
     "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"
+    "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/jbo.json

@@ -220,5 +220,9 @@
     "Dark Mode": "Dark Mode",
     "Error compressing paste, due to missing WebAssembly support.": "Error compressing paste, due to missing WebAssembly support.",
     "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"
+    "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/ko.json

@@ -220,5 +220,9 @@
     "Dark Mode": "Dark Mode",
     "Error compressing paste, due to missing WebAssembly support.": "Error compressing paste, due to missing WebAssembly support.",
     "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"
+    "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/ku.json

@@ -220,5 +220,9 @@
     "Dark Mode": "جۆری ڕەش",
     "Error compressing paste, due to missing WebAssembly support.": "Error compressing paste, due to missing WebAssembly support.",
     "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"
+    "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/la.json

@@ -220,5 +220,9 @@
     "Dark Mode": "Dark Mode",
     "Error compressing paste, due to missing WebAssembly support.": "Error compressing paste, due to missing WebAssembly support.",
     "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"
+    "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/lt.json

@@ -220,5 +220,9 @@
     "Dark Mode": "Tamsi veiksena",
     "Error compressing paste, due to missing WebAssembly support.": "Klaida glaudinant įdėjimą, nes trūksta WebAssembly palaikymo.",
     "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"
+    "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/nl.json

@@ -220,5 +220,9 @@
     "Dark Mode": "Donkere modus",
     "Error compressing paste, due to missing WebAssembly support.": "Fout bij het comprimeren van notitie door ontbrekende ondersteuning voor WebAssembly.",
     "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"
+    "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/no.json

@@ -220,5 +220,9 @@
     "Dark Mode": "Mørk modus",
     "Error compressing paste, due to missing WebAssembly support.": "Error compressing paste, due to missing WebAssembly support.",
     "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"
+    "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/oc.json

@@ -220,5 +220,9 @@
     "Dark Mode": "Mòde escur",
     "Error compressing paste, due to missing WebAssembly support.": "Error al moment de la compression de l'empegatge, a causa de la manca de presa en carga de WebAssembly.",
     "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"
+    "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/pl.json

@@ -220,5 +220,9 @@
     "Dark Mode": "Ciemny motyw",
     "Error compressing paste, due to missing WebAssembly support.": "Błąd kompresowania wklejenia przez brak obsługi WebAssembly.",
     "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"
+    "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/pt.json

@@ -220,5 +220,9 @@
     "Dark Mode": "Modo Noturno",
     "Error compressing paste, due to missing WebAssembly support.": "Error compressing paste, due to missing WebAssembly support.",
     "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"
+    "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/ro.json

@@ -220,5 +220,9 @@
     "Dark Mode": "Mod întunecat",
     "Error compressing paste, due to missing WebAssembly support.": "Eroare la compresia paste-ului din cauza incompatibilității cu WebAssembly.",
     "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"
+    "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/ru.json

@@ -220,5 +220,9 @@
     "Dark Mode": "Тёмная",
     "Error compressing paste, due to missing WebAssembly support.": "Error compressing paste, due to missing WebAssembly support.",
     "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"
+    "Start over": "Start over",
+    "Paste copied to clipboard": "Запись скопирована в буфер обмена",
+    "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "Чтобы скопировать запись нажмите на кнопку копирования или используйте комбинацию клавиш <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Скопировать ссылку",
+    "Link copied to clipboard": "Ссылка скопирована в буфер обмена"
 }

+ 5 - 1
i18n/sk.json

@@ -220,5 +220,9 @@
     "Dark Mode": "Tmavý Režim",
     "Error compressing paste, due to missing WebAssembly support.": "Error compressing paste, due to missing WebAssembly support.",
     "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"
+    "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/sl.json

@@ -220,5 +220,9 @@
     "Dark Mode": "Temni način",
     "Error compressing paste, due to missing WebAssembly support.": "Error compressing paste, due to missing WebAssembly support.",
     "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"
+    "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/sv.json

@@ -220,5 +220,9 @@
     "Dark Mode": "Mörkt Läge",
     "Error compressing paste, due to missing WebAssembly support.": "Error compressing paste, due to missing WebAssembly support.",
     "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"
+    "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/th.json

@@ -220,5 +220,9 @@
     "Dark Mode": "โหมดสีเข้ม",
     "Error compressing paste, due to missing WebAssembly support.": "ไม่สามารถบีบอัดข้อมูลที่คุณต้องการฝากโค้ดได้ เนื่องจากอุปกรณ์ของคุณขาดการรองรับ WebAssembly",
     "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/tr.json

@@ -220,5 +220,9 @@
     "Dark Mode": "Koyu Mod",
     "Error compressing paste, due to missing WebAssembly support.": "WebAssembly desteği eksik olduğundan yazı sıkıştırılamadı.",
     "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"
+    "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/uk.json

@@ -220,5 +220,9 @@
     "Dark Mode": "Темний режим",
     "Error compressing paste, due to missing WebAssembly support.": "Помилка при стисканні допису, через відсутність підтримки WebAssembly сервера.",
     "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 5 - 1
i18n/zh.json

@@ -220,5 +220,9 @@
     "Dark Mode": "暗黑模式",
     "Error compressing paste, due to missing WebAssembly support.": "由于缺少 WebAssembly 支持,在压缩粘贴时出错。",
     "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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Copy link",
+    "Link copied to clipboard": "Link copied to clipboard"
 }

+ 210 - 8
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('<a') !== -1;
+            // messageID may contain HTML, but should be from a trusted source (code or translation JSON files)
+            let containsHtml = isStringContainsHtml(args[0]);
 
             // prevent double encoding, when we insert into a text node
-            if (containsLinks || $element === null) {
+            if (containsHtml || $element === null) {
                 for (let i = 0; i < args.length; ++i) {
                     // parameters (i > 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 <p> or <div>.
+            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
          */
@@ -4901,6 +4920,9 @@ jQuery.PrivateBin = (function($, RawDeflate) {
 
             TopNav.showViewButtons();
 
+            CopyToClipboard.setUrl(url);
+            CopyToClipboard.showKeyboardShortcutHint();
+
             // this cannot be grouped with showViewButtons due to remaining time calculation
             TopNav.showEmailButton();
 
@@ -5337,6 +5359,8 @@ jQuery.PrivateBin = (function($, RawDeflate) {
             // shows the remaining time (until) deletion
             PasteStatus.showRemainingTime(paste);
 
+            CopyToClipboard.showKeyboardShortcutHint();
+
             Promise.all(decryptionPromises)
                 .then(() => {
                     Alert.hideLoading();
@@ -5366,6 +5390,181 @@ jQuery.PrivateBin = (function($, RawDeflate) {
         return me;
     })();
 
+    /**
+     *
+     * @name CopyToClipboard
+     * @class
+     */
+    const CopyToClipboard = (function () {
+        const me = {};
+
+        let copyButton = $('#prettyMessageCopyBtn'),
+            copyLinkButton = $('#copyLink'),
+            copyIcon = $('#copyIcon'),
+            successIcon = $('#copySuccessIcon'),
+            shortcutHint = $('#copyShortcutHintText'),
+            url;
+
+        /**
+         * Handle copy to clipboard button click
+         *
+         * @name CopyToClipboard.handleCopyButtonClick
+         * @private
+         * @function
+         */
+        function handleCopyButtonClick() {
+            $(copyButton).click(function() {
+                const text = PasteViewer.getText();
+                saveToClipboard(text);
+
+                toggleSuccessIcon();
+                showAlertMessage('Paste copied to clipboard');
+            });
+        };
+
+        /**
+         * Handle copy link to clipboard button click
+         *
+         * @name CopyToClipboard.handleCopyLinkButtonClick
+         * @private
+         * @function
+         */
+        function handleCopyLinkButtonClick() {
+            $(copyLinkButton).click(function () {
+                saveToClipboard(url);
+
+                showAlertMessage('Link copied to clipboard');
+            });
+        }
+
+        /**
+         * Handle CTRL+C/CMD+C keyboard shortcut
+         *
+         * @name CopyToClipboard.handleKeyboardShortcut
+         * @private
+         * @function
+         */
+        function handleKeyboardShortcut() {
+            $(document).bind('copy', function () {
+                if (!isUserSelectedTextToCopy()) {
+                    const text = PasteViewer.getText();
+                    saveToClipboard(text);
+
+                    showAlertMessage('Paste copied to clipboard');
+                }
+            });
+        };
+
+        /**
+         * Check if user selected some text on the page to copy it
+         *
+         * @name CopyToClipboard.isUserSelectedTextToCopy
+         * @private
+         * @function
+         * @returns {boolean}
+         */
+        function isUserSelectedTextToCopy() {
+            let text = '';
+
+            if (window.getSelection) {
+                text = window.getSelection().toString();
+            } 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
+         * @function
+         */
+        function saveToClipboard(text) {
+            navigator.clipboard.writeText(text);
+        };
+
+        /**
+         * Show alert message after text copy
+         *
+         * @name CopyToClipboard.showAlertMessage
+         * @private
+         * @param {string} message
+         * @function
+         */
+        function showAlertMessage(message) {
+            Alert.showStatus(message);
+        };
+
+        /**
+         * Toogle success icon after copy
+         *
+         * @name CopyToClipboard.toggleSuccessIcon
+         * @private
+         * @function
+         */
+        function toggleSuccessIcon() {
+            $(copyIcon).css('display', 'none');
+            $(successIcon).css('display', 'block');
+
+            setTimeout(function() {
+                $(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 <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>'
+            );
+        };
+
+        /**
+         * Hide keyboard shortcut hint
+         *
+         * @name CopyToClipboard.showKeyboardShortcutHint
+         * @function
+         */
+        me.hideKeyboardShortcutHint = function () {
+            $(shortcutHint).html('');
+        };
+
+        /**
+         * Set paste url
+         *
+         * @name CopyToClipboard.setUrl
+         * @param {string} newUrl
+         * @function
+         */
+        me.setUrl = function (newUrl) {
+            url = newUrl;
+        };
+
+        /**
+         * Initialize
+         *
+         * @name CopyToClipboard.init
+         * @function
+         */
+        me.init = function() {
+            handleCopyButtonClick();
+            handleCopyLinkButtonClick();
+            handleKeyboardShortcut();
+        };
+
+        return me;
+    })();
+
     /**
      * (controller) main PrivateBin logic
      *
@@ -5387,6 +5586,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
         {
             PasteStatus.hideMessages();
             Alert.hideMessages();
+            CopyToClipboard.hideKeyboardShortcutHint();
         };
 
         /**
@@ -5612,6 +5812,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
             Prompt.init();
             TopNav.init();
             UiHelper.init();
+            CopyToClipboard.init();
 
             // check for legacy browsers before going any further
             if (!Legacy.Check.getInit()) {
@@ -5671,6 +5872,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
         ServerInteraction: ServerInteraction,
         PasteEncrypter: PasteEncrypter,
         PasteDecrypter: PasteDecrypter,
+        CopyToClipboard: CopyToClipboard,
         Controller: Controller
     };
 })(jQuery, RawDeflate);

+ 1 - 1
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-JUj/Sbl/bMHlIoIUT1U9e89JU33fDBxCxLSGxwwaeydBFXOBHyfdF7hwSIjgbPxb4d9CO7CSe4meouTIRMy8Vg==',
+            'js/privatebin.js'       => 'sha512-cCt3Slm10JXtPJhgmYdf1RKO7uWdz6U+k0bdPjTYfdO6WeWfruN9RkJE7tKmpgw8A35H4Xifmrr2KmyVOMbc3g==',
             '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==',

+ 8 - 0
tpl/bootstrap.php

@@ -535,6 +535,9 @@ if ($HTTPWARNING) :
 endif;
 ?>
 				<div id="pastesuccess" class="hidden">
+					<button id="copyLink" type="button" class="btn btn-<?php echo $isDark ? 'warning' : 'default'; ?> navbar-btn">
+						<span class="glyphicon glyphicon-duplicate" aria-hidden="true"></span> <?php echo I18n::_('Copy link') ?>
+					</button>
 					<div role="alert" class="alert alert-success">
 						<span class="glyphicon glyphicon-ok" aria-hidden="true"></span>
 						<div id="deletelink"></div>
@@ -579,7 +582,12 @@ endif;
 				<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>
+					<h5 id="copyShortcutHint" class="col-md-12"><small id="copyShortcutHintText"></small></h5>
 					<div id="prettymessage" class="col-md-12 hidden">
+						<button id="prettyMessageCopyBtn">
+							<span id="copyIcon" class="glyphicon glyphicon-duplicate" aria-hidden="true"></span>
+							<span id="copySuccessIcon" class="glyphicon glyphicon-ok text-success" aria-hidden="true"></span>
+						</button>
 						<pre id="prettyprint" class="col-md-12 prettyprint linenums:1"></pre>
 					</div>
 					<div id="plaintext" class="col-md-12 hidden"></div>

+ 8 - 0
tpl/bootstrap5.php

@@ -400,6 +400,9 @@ if ($HTTPWARNING) :
 endif;
 ?>
 				<div id="pastesuccess" class="hidden">
+					<button id="copyLink" type="button" class="btn btn-secondary flex-fill mb-2">
+						<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#copy" /></svg> <?php echo I18n::_('Copy link') ?>
+					</button>
 					<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>
@@ -435,7 +438,12 @@ endif;
 				<article>
 					<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>
+					<h6 id="copyShortcutHint" class="col-md-12"><small id="copyShortcutHintText"></small></h6>
 					<div id="prettymessage" class="card col-md-12 hidden">
+						<button type="button" id="prettyMessageCopyBtn" class="text-secondary opacity-05-1-hover">
+							<svg id="copyIcon" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#copy" /></svg>
+							<svg id="copySuccessIcon" class="text-success" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#check" /></svg>
+						</button>
 						<pre id="prettyprint" class="card-body col-md-12 prettyprint linenums:1"></pre>
 					</div>
 					<div id="plaintext" class="col-md-12 hidden"></div>