From 5bbe713b9cb1a75f4d999fb14d7369e61cb1773e Mon Sep 17 00:00:00 2001 From: Ribas160 Date: Fri, 15 May 2026 13:28:34 +0300 Subject: [PATCH] fix: move copy to clipboard button outside of prettymessage block --- css/bootstrap/privatebin.css | 20 -------------- css/bootstrap5/privatebin.css | 28 ------------------- i18n/ar.json | 3 +- i18n/bg.json | 3 +- i18n/ca.json | 3 +- i18n/co.json | 3 +- i18n/cs.json | 3 +- i18n/de.json | 3 +- i18n/el.json | 3 +- i18n/en.json | 3 +- i18n/es.json | 3 +- i18n/et.json | 3 +- i18n/fa.json | 3 +- i18n/fi.json | 3 +- i18n/fr.json | 3 +- i18n/he.json | 3 +- i18n/hi.json | 3 +- i18n/hu.json | 3 +- i18n/id.json | 3 +- i18n/it.json | 3 +- i18n/ja.json | 3 +- i18n/jbo.json | 3 +- i18n/ko.json | 3 +- i18n/ku.json | 3 +- i18n/la.json | 3 +- i18n/lt.json | 3 +- i18n/nl.json | 3 +- i18n/no.json | 3 +- i18n/oc.json | 3 +- i18n/pl.json | 3 +- i18n/pt.json | 3 +- i18n/ro.json | 3 +- i18n/ru.json | 3 +- i18n/sk.json | 3 +- i18n/sl.json | 3 +- i18n/sv.json | 3 +- i18n/th.json | 3 +- i18n/tr.json | 3 +- i18n/uk.json | 3 +- i18n/zh.json | 3 +- js/privatebin.js | 35 ++++------------------- js/test/CopyToClipboard.js | 52 ++++++++++++++++++----------------- lib/Configuration.php | 2 +- tpl/bootstrap.php | 15 ++++++---- tpl/bootstrap5.php | 11 ++++---- 45 files changed, 125 insertions(+), 152 deletions(-) diff --git a/css/bootstrap/privatebin.css b/css/bootstrap/privatebin.css index e45655b9..38bd0fab 100644 --- a/css/bootstrap/privatebin.css +++ b/css/bootstrap/privatebin.css @@ -143,26 +143,6 @@ html[dir="rtl"] #deletelink, html[dir="rtl"] #qrcodemodalClose { 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; } diff --git a/css/bootstrap5/privatebin.css b/css/bootstrap5/privatebin.css index 29481963..50871a76 100644 --- a/css/bootstrap5/privatebin.css +++ b/css/bootstrap5/privatebin.css @@ -57,34 +57,6 @@ html[dir="rtl"] #deletelink, html[dir="rtl"] #qrcodemodalClose { 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; -} - #sendbutton svg { transform: translateY(1.5px); } diff --git a/i18n/ar.json b/i18n/ar.json index 34dcb6ec..677b5d23 100644 --- a/i18n/ar.json +++ b/i18n/ar.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "مفتاح التبويب يعمل كشخصية (انقر Ctrl+m أو Esc للتبديل)", "Show password": "Show password", "Hide password": "Hide password", - "Theme": "السمة" + "Theme": "السمة", + "Copy": "Copy" } diff --git a/i18n/bg.json b/i18n/bg.json index 3f3cc2b3..86a3c98b 100644 --- a/i18n/bg.json +++ b/i18n/bg.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", "Show password": "Show password", "Hide password": "Hide password", - "Theme": "Theme" + "Theme": "Theme", + "Copy": "Copy" } diff --git a/i18n/ca.json b/i18n/ca.json index 2c8ef463..f51c3b61 100644 --- a/i18n/ca.json +++ b/i18n/ca.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", "Show password": "Show password", "Hide password": "Hide password", - "Theme": "Theme" + "Theme": "Theme", + "Copy": "Copy" } diff --git a/i18n/co.json b/i18n/co.json index 5ceea497..cea29475 100644 --- a/i18n/co.json +++ b/i18n/co.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "U tastu di tabulazione ghjova cum’è un caratteru (Appughjate nant’à Ctrl+m o Scapp per scambià)", "Show password": "Affissà a parolla d’intesa", "Hide password": "Piattà a parolla d’intesa", - "Theme": "Tema" + "Theme": "Tema", + "Copy": "Copy" } diff --git a/i18n/cs.json b/i18n/cs.json index d8a12de4..f53d1c51 100644 --- a/i18n/cs.json +++ b/i18n/cs.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulátor funguje jako znak (pro přepnutí stiskněte Ctrl+m nebo Esc)", "Show password": "Show password", "Hide password": "Hide password", - "Theme": "Vzhled" + "Theme": "Vzhled", + "Copy": "Copy" } diff --git a/i18n/de.json b/i18n/de.json index 690f9fd8..bb8645b1 100644 --- a/i18n/de.json +++ b/i18n/de.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulatortaste als Zeichen interpretieren (Umschalten durch Strg+m oder Esc)", "Show password": "Passwort anzeigen", "Hide password": "Passwort verbergen", - "Theme": "Design" + "Theme": "Design", + "Copy": "Copy" } diff --git a/i18n/el.json b/i18n/el.json index a87c2b19..8593b766 100644 --- a/i18n/el.json +++ b/i18n/el.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", "Show password": "Show password", "Hide password": "Hide password", - "Theme": "Theme" + "Theme": "Theme", + "Copy": "Copy" } diff --git a/i18n/en.json b/i18n/en.json index 0ccb0422..5a219fa7 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", "Show password": "Show password", "Hide password": "Hide password", - "Theme": "Theme" + "Theme": "Theme", + "Copy": "Copy" } diff --git a/i18n/es.json b/i18n/es.json index 6a335ab5..f3c2b063 100644 --- a/i18n/es.json +++ b/i18n/es.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "La tecla de tabulación funciona como carácter (presione Ctrl+m o Esc para alternar)", "Show password": "Mostrar contraseña", "Hide password": "Ocultar contraseña", - "Theme": "Tema" + "Theme": "Tema", + "Copy": "Copy" } diff --git a/i18n/et.json b/i18n/et.json index 60a23a29..1150848c 100644 --- a/i18n/et.json +++ b/i18n/et.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", "Show password": "Show password", "Hide password": "Hide password", - "Theme": "Teema" + "Theme": "Teema", + "Copy": "Copy" } diff --git a/i18n/fa.json b/i18n/fa.json index 088c8a00..d5ca1a2b 100644 --- a/i18n/fa.json +++ b/i18n/fa.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "کلید Tab به‌عنوان کاراکتر عمل می‌کند (برای تغییر وضعیت Ctrl+m یا Esc را فشار دهید)", "Show password": "نمایش رمز عبور", "Hide password": "مخفی‌کردن رمز عبور", - "Theme": "تم" + "Theme": "تم", + "Copy": "Copy" } diff --git a/i18n/fi.json b/i18n/fi.json index 304c64ab..a54120cb 100644 --- a/i18n/fi.json +++ b/i18n/fi.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulaattori toimii merkkinä (Paina Ctrl+m tai Esc vaihtaaksesi)", "Show password": "Näytä salasana", "Hide password": "Piilota salasana", - "Theme": "Teema" + "Theme": "Teema", + "Copy": "Copy" } diff --git a/i18n/fr.json b/i18n/fr.json index 1cfc35b1..0aa72553 100644 --- a/i18n/fr.json +++ b/i18n/fr.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "La touche de tabulation sert de caractère (Presser Ctrl+m ou Esc pour basculer)", "Show password": "Afficher le mot de passe", "Hide password": "Cacher le mot de passe", - "Theme": "Thème" + "Theme": "Thème", + "Copy": "Copy" } diff --git a/i18n/he.json b/i18n/he.json index 36c30770..d84f9649 100644 --- a/i18n/he.json +++ b/i18n/he.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "משטח ה-tab פועל כמקש תו (לחץ על Ctrl+m או Esc להחלפה)", "Show password": "Show password", "Hide password": "Hide password", - "Theme": "נושא" + "Theme": "נושא", + "Copy": "העתק" } diff --git a/i18n/hi.json b/i18n/hi.json index 0ccb0422..5a219fa7 100644 --- a/i18n/hi.json +++ b/i18n/hi.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", "Show password": "Show password", "Hide password": "Hide password", - "Theme": "Theme" + "Theme": "Theme", + "Copy": "Copy" } diff --git a/i18n/hu.json b/i18n/hu.json index 203d4cf0..bc02cda7 100644 --- a/i18n/hu.json +++ b/i18n/hu.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "A tabulátor karakternek használható (nyomd le a Ctrl+m vagy az Esc to billentyűket ennek megszüntetéséhez).", "Show password": "Jelszó megjelenítése", "Hide password": "Jelszó elrejtése", - "Theme": "Téma" + "Theme": "Téma", + "Copy": "Copy" } diff --git a/i18n/id.json b/i18n/id.json index 5f77d582..b3b7bee1 100644 --- a/i18n/id.json +++ b/i18n/id.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", "Show password": "Show password", "Hide password": "Hide password", - "Theme": "Theme" + "Theme": "Theme", + "Copy": "Copy" } diff --git a/i18n/it.json b/i18n/it.json index 72b5d86c..bdae5fe2 100644 --- a/i18n/it.json +++ b/i18n/it.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Il tasto Tabulatore serve come carattere (basta Ctrl+m o Esc per attivare/disattivare)", "Show password": "Mostra password", "Hide password": "Nascondi password", - "Theme": "Tema" + "Theme": "Tema", + "Copy": "Copy" } diff --git a/i18n/ja.json b/i18n/ja.json index c722f58e..49f12668 100644 --- a/i18n/ja.json +++ b/i18n/ja.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", "Show password": "Show password", "Hide password": "Hide password", - "Theme": "Theme" + "Theme": "Theme", + "Copy": "Copy" } diff --git a/i18n/jbo.json b/i18n/jbo.json index 56e78d32..892cfa79 100644 --- a/i18n/jbo.json +++ b/i18n/jbo.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", "Show password": "Show password", "Hide password": "Hide password", - "Theme": "jvinu" + "Theme": "jvinu", + "Copy": "Copy" } diff --git a/i18n/ko.json b/i18n/ko.json index 0ccb0422..5a219fa7 100644 --- a/i18n/ko.json +++ b/i18n/ko.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", "Show password": "Show password", "Hide password": "Hide password", - "Theme": "Theme" + "Theme": "Theme", + "Copy": "Copy" } diff --git a/i18n/ku.json b/i18n/ku.json index ff3b2042..1910597c 100644 --- a/i18n/ku.json +++ b/i18n/ku.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", "Show password": "Show password", "Hide password": "Hide password", - "Theme": "Theme" + "Theme": "Theme", + "Copy": "Copy" } diff --git a/i18n/la.json b/i18n/la.json index 91f8d7b4..9f2b0cd7 100644 --- a/i18n/la.json +++ b/i18n/la.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", "Show password": "Show password", "Hide password": "Hide password", - "Theme": "Theme" + "Theme": "Theme", + "Copy": "Copy" } diff --git a/i18n/lt.json b/i18n/lt.json index d2da30ab..11d1b2a7 100644 --- a/i18n/lt.json +++ b/i18n/lt.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabuliatoriaus klavišas tarnauja kaip simbolis (Paspauskite Ctrl+m arba Esc norėdami perjungti)", "Show password": "Rodyti slaptažodį", "Hide password": "Slėpti slaptažodį", - "Theme": "Apipavidalinimas" + "Theme": "Apipavidalinimas", + "Copy": "Copy" } diff --git a/i18n/nl.json b/i18n/nl.json index 2d532c6d..32505f3f 100644 --- a/i18n/nl.json +++ b/i18n/nl.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulatortoets dient als teken (gebruik Ctrl+m of Esc om te schakelen)", "Show password": "Toon wachtwoord", "Hide password": "Verberg wachtwoord", - "Theme": "Thema" + "Theme": "Thema", + "Copy": "Copy" } diff --git a/i18n/no.json b/i18n/no.json index 13046723..7de14244 100644 --- a/i18n/no.json +++ b/i18n/no.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", "Show password": "Show password", "Hide password": "Hide password", - "Theme": "Theme" + "Theme": "Theme", + "Copy": "Copy" } diff --git a/i18n/oc.json b/i18n/oc.json index d9a7adcc..659c580e 100644 --- a/i18n/oc.json +++ b/i18n/oc.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", "Show password": "Show password", "Hide password": "Hide password", - "Theme": "Theme" + "Theme": "Theme", + "Copy": "Copy" } diff --git a/i18n/pl.json b/i18n/pl.json index ec85e946..525723d9 100644 --- a/i18n/pl.json +++ b/i18n/pl.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Klawisz Tabulatora służy jako znak (użyj Ctrl+m lub Esc, aby przełączyć tryb)", "Show password": "Pokaż hasło", "Hide password": "Ukryj hasło", - "Theme": "Motyw" + "Theme": "Motyw", + "Copy": "Copy" } diff --git a/i18n/pt.json b/i18n/pt.json index 73c6812c..1358ab9c 100644 --- a/i18n/pt.json +++ b/i18n/pt.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", "Show password": "Show password", "Hide password": "Hide password", - "Theme": "Theme" + "Theme": "Theme", + "Copy": "Copy" } diff --git a/i18n/ro.json b/i18n/ro.json index c1751bd2..29dcaade 100644 --- a/i18n/ro.json +++ b/i18n/ro.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", "Show password": "Show password", "Hide password": "Hide password", - "Theme": "Theme" + "Theme": "Theme", + "Copy": "Copy" } diff --git a/i18n/ru.json b/i18n/ru.json index bef5a3dd..80ec5218 100644 --- a/i18n/ru.json +++ b/i18n/ru.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", "Show password": "Show password", "Hide password": "Hide password", - "Theme": "Тема" + "Theme": "Тема", + "Copy": "Скопировать" } diff --git a/i18n/sk.json b/i18n/sk.json index 0007e12a..add09426 100644 --- a/i18n/sk.json +++ b/i18n/sk.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", "Show password": "Show password", "Hide password": "Hide password", - "Theme": "Theme" + "Theme": "Theme", + "Copy": "Copy" } diff --git a/i18n/sl.json b/i18n/sl.json index 0d7d25ea..acd8d1be 100644 --- a/i18n/sl.json +++ b/i18n/sl.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulatorska tipka služi kot znak (za preklop pritisnite Ctrl+m ali Esc)", "Show password": "Pokaži geslo", "Hide password": "Skrij geslo", - "Theme": "Tema" + "Theme": "Tema", + "Copy": "Copy" } diff --git a/i18n/sv.json b/i18n/sv.json index 553632ec..668df87d 100644 --- a/i18n/sv.json +++ b/i18n/sv.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabb-tangenten fungerar som tecken (Tryck Ctrl+m eller Esc för att växla)", "Show password": "Visa lösenord", "Hide password": "Dölj lösenord", - "Theme": "Tema" + "Theme": "Tema", + "Copy": "Copy" } diff --git a/i18n/th.json b/i18n/th.json index 10e87c95..4a13f851 100644 --- a/i18n/th.json +++ b/i18n/th.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "ปุ่ม Tabulator ใช้เป็นอักขระ (กด Ctrl+m หรือ Esc เพื่อสลับ)", "Show password": "Show password", "Hide password": "Hide password", - "Theme": "ธีม" + "Theme": "ธีม", + "Copy": "Copy" } diff --git a/i18n/tr.json b/i18n/tr.json index ec0ccf95..d35ceaa8 100644 --- a/i18n/tr.json +++ b/i18n/tr.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", "Show password": "Show password", "Hide password": "Hide password", - "Theme": "Theme" + "Theme": "Theme", + "Copy": "Copy" } diff --git a/i18n/uk.json b/i18n/uk.json index 45ef2286..20d9bd86 100644 --- a/i18n/uk.json +++ b/i18n/uk.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Клавіша Tab вводить символ табуляції (перемикається клавішами Ctrl+m чи Esc)", "Show password": "Показати пароль", "Hide password": "Сховати пароль", - "Theme": "Тема" + "Theme": "Тема", + "Copy": "Copy" } diff --git a/i18n/zh.json b/i18n/zh.json index 7406fdb0..bc36c701 100644 --- a/i18n/zh.json +++ b/i18n/zh.json @@ -231,5 +231,6 @@ "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tab 键可作为字符(按 Ctrl+mEsc 切换开关)", "Show password": "显示密码", "Hide password": "隐藏密码", - "Theme": "主题" + "Theme": "主题", + "Copy": "Copy" } diff --git a/js/privatebin.js b/js/privatebin.js index 5d2047eb..69986f59 100644 --- a/js/privatebin.js +++ b/js/privatebin.js @@ -5526,8 +5526,6 @@ jQuery.PrivateBin = (function($) { let copyButton, copyLinkButton, - copyIcon, - successIcon, shortcutHint, url; @@ -5539,11 +5537,10 @@ jQuery.PrivateBin = (function($) { * @function */ function handleCopyButtonClick() { - $(copyButton).click(function() { + $(copyButton).click(function () { const text = PasteViewer.getText(); saveToClipboard(text); - toggleSuccessIcon(); showAlertMessage('Document copied to clipboard'); }); } @@ -5625,23 +5622,6 @@ jQuery.PrivateBin = (function($) { 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 * @@ -5649,10 +5629,7 @@ jQuery.PrivateBin = (function($) { * @function */ me.showKeyboardShortcutHint = function () { - I18n._( - shortcutHint, - 'To copy document press on the copy button or use the clipboard shortcut Ctrl+c/Cmd+c' - ); + $(shortcutHint).removeClass('hidden'); }; /** @@ -5662,7 +5639,7 @@ jQuery.PrivateBin = (function($) { * @function */ me.hideKeyboardShortcutHint = function () { - $(shortcutHint).html(''); + $(shortcutHint).addClass('hidden'); }; /** @@ -5683,11 +5660,9 @@ jQuery.PrivateBin = (function($) { * @function */ me.init = function() { - copyButton = $('#prettyMessageCopyBtn'); + copyButton = $('#copyShortcutHintBtn'); copyLinkButton = $('#copyLink'); - copyIcon = $('#copyIcon'); - successIcon = $('#copySuccessIcon'); - shortcutHint = $('#copyShortcutHintText'); + shortcutHint = $('#copyShortcutHint'); handleCopyButtonClick(); handleCopyLinkButtonClick(); diff --git a/js/test/CopyToClipboard.js b/js/test/CopyToClipboard.js index 0abfd53a..8050b722 100644 --- a/js/test/CopyToClipboard.js +++ b/js/test/CopyToClipboard.js @@ -13,12 +13,15 @@ describe('CopyToClipboard', function() { common.enableClipboard(); $('body').html( - '' + '
' + + '' + + '' + + '' ); $.PrivateBin.PasteViewer.init(); @@ -28,7 +31,7 @@ describe('CopyToClipboard', function() { $.PrivateBin.CopyToClipboard.init(); - $('#prettyMessageCopyBtn').trigger('click'); + $('#copyShortcutHintBtn').trigger('click'); const savedToClipboardText = await navigator.clipboard.readText(); @@ -50,12 +53,15 @@ describe('CopyToClipboard', function() { common.enableClipboard(); $('body').html( - '
+++ no document text ' + - '+++
' + '
' + + '' + + '' + + '' ); $.PrivateBin.PasteViewer.init(); @@ -100,39 +106,35 @@ describe('CopyToClipboard', function() { describe('Keyboard shortcut hint', function () { - jsc.property('Show hint', - 'nestring', - function (text) { + jsc.property('Show hint', function () { var clean = jsdom(); - $('body').html(''); + $('body').html(''); $.PrivateBin.CopyToClipboard.init(); $.PrivateBin.CopyToClipboard.showKeyboardShortcutHint(); - const keyboardShortcutHint = $('#copyShortcutHintText').text(); + const hasHidden = $('#copyShortcutHint').hasClass('hidden'); clean(); - return keyboardShortcutHint.length > 0; + return !hasHidden; } ); - jsc.property('Hide hint', - 'nestring', - function (text) { + jsc.property('Hide hint', function () { var clean = jsdom(); - $('body').html('' + text + ''); + $('body').html('
'); $.PrivateBin.CopyToClipboard.init(); $.PrivateBin.CopyToClipboard.hideKeyboardShortcutHint(); - const keyboardShortcutHint = $('#copyShortcutHintText').text(); + const hasHidden = $('#copyShortcutHint').hasClass('hidden'); clean(); - return keyboardShortcutHint.length === 0; + return hasHidden; } ); }); diff --git a/lib/Configuration.php b/lib/Configuration.php index d15829a7..e758e90f 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -122,7 +122,7 @@ class Configuration 'js/kjua-0.10.0.js' => 'sha512-BYj4xggowR7QD150VLSTRlzH62YPfhpIM+b/1EUEr7RQpdWAGKulxWnOvjFx1FUlba4m6ihpNYuQab51H6XlYg==', 'js/legacy.js' => 'sha512-RQEo1hxpNc37i+jz/D9/JiAZhG8GFx3+SNxjYnI7jUgirDIqrCSj6QPAAZeaidditcWzsJ3jxfEj5lVm7ZwTRQ==', 'js/prettify.js' => 'sha512-puO0Ogy++IoA2Pb9IjSxV1n4+kQkKXYAEUtVzfZpQepyDPyXk8hokiYDS7ybMogYlyyEIwMLpZqVhCkARQWLMg==', - 'js/privatebin.js' => 'sha512-kRRgq+R3dUScoqqjTQo+re+T+FrsaukqMO7qSMen2fq0Rcgz2S0GnR52sqKukbDDKRr/dDba01WWPccduYr+Jg==', + 'js/privatebin.js' => 'sha512-sAsV518Wu3dHcu1LmidhCeB4XLcHXB4epTbyOrOSAlqp1pG4Pl1zJucgtyfg5bBxaXj1LMACGYX6CxLgLvZqjg==', 'js/purify-3.4.1.js' => 'sha512-280a/Vb6fVFsYaeRrkuDp4EDmdYlt2XS+dlDEO/U9qljPrAraA2bIzHTNmP+9dpwPDDwTML+RS+h5iaagPwTzA==', 'js/showdown-2.1.0.js' => 'sha512-WYXZgkTR0u/Y9SVIA4nTTOih0kXMEd8RRV6MLFdL6YU8ymhR528NLlYQt1nlJQbYz4EW+ZsS0fx1awhiQJme1Q==', 'js/zlib-1.3.2.js' => 'sha512-RAhJgxg9siMIA8ky4c10Rc2zUgnK80olHB8Tt1IOYWY4Eh1WmrviQkDn+sgBlb38ZHq3tzufGC41kP360gmosQ==', diff --git a/tpl/bootstrap.php b/tpl/bootstrap.php index 315dbd0c..9ae95236 100644 --- a/tpl/bootstrap.php +++ b/tpl/bootstrap.php @@ -622,12 +622,17 @@ endif;
-
+ diff --git a/tpl/bootstrap5.php b/tpl/bootstrap5.php index 8c491213..ef63c1ac 100644 --- a/tpl/bootstrap5.php +++ b/tpl/bootstrap5.php @@ -480,12 +480,13 @@ endif;
-
+