diff --git a/i18n/ar.json b/i18n/ar.json index cde4b990..5d79f439 100644 --- a/i18n/ar.json +++ b/i18n/ar.json @@ -226,5 +226,6 @@ "Copy link": "Copy link", "Link copied to clipboard": "Link copied to clipboard", "Paste text": "Paste text", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", + "Theme": "Theme" } diff --git a/i18n/bg.json b/i18n/bg.json index 8974c2d2..353427bc 100644 --- a/i18n/bg.json +++ b/i18n/bg.json @@ -226,5 +226,6 @@ "Copy link": "Copy link", "Link copied to clipboard": "Link copied to clipboard", "Paste text": "Paste text", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", + "Theme": "Theme" } diff --git a/i18n/ca.json b/i18n/ca.json index 732ca3e6..d178e417 100644 --- a/i18n/ca.json +++ b/i18n/ca.json @@ -226,5 +226,6 @@ "Copy link": "Copy link", "Link copied to clipboard": "Link copied to clipboard", "Paste text": "Paste text", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", + "Theme": "Theme" } diff --git a/i18n/co.json b/i18n/co.json index 91079ecc..bf38d835 100644 --- a/i18n/co.json +++ b/i18n/co.json @@ -226,5 +226,6 @@ "Copy link": "Cupià u liame", "Link copied to clipboard": "U liame hè statu cupiatu in u preme’papei", "Paste text": "Testu di l’appiccicu", - "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à)" + "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à)", + "Theme": "Theme" } diff --git a/i18n/cs.json b/i18n/cs.json index 88148d61..6a8db622 100644 --- a/i18n/cs.json +++ b/i18n/cs.json @@ -226,5 +226,6 @@ "Copy link": "Copy link", "Link copied to clipboard": "Link copied to clipboard", "Paste text": "Paste text", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", + "Theme": "Theme" } diff --git a/i18n/de.json b/i18n/de.json index fed65a13..d653a614 100644 --- a/i18n/de.json +++ b/i18n/de.json @@ -226,5 +226,6 @@ "Copy link": "Verknüpfung kopieren", "Link copied to clipboard": "Verknüpfung wurde in die Zwischenablage kopiert.", "Paste text": "Text", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulatortaste als Zeichen interpretieren (Umschalten durch Strg+m oder Esc)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulatortaste als Zeichen interpretieren (Umschalten durch Strg+m oder Esc)", + "Theme": "Theme" } diff --git a/i18n/el.json b/i18n/el.json index 9b08e8c6..57fbb2cd 100644 --- a/i18n/el.json +++ b/i18n/el.json @@ -226,5 +226,6 @@ "Copy link": "Copy link", "Link copied to clipboard": "Link copied to clipboard", "Paste text": "Paste text", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", + "Theme": "Theme" } diff --git a/i18n/en.json b/i18n/en.json index bf36c662..d1b2a46f 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -226,5 +226,6 @@ "Copy link": "Copy link", "Link copied to clipboard": "Link copied to clipboard", "Paste text": "Paste text", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", + "Theme": "Theme" } diff --git a/i18n/es.json b/i18n/es.json index e2cc926c..45c838bd 100644 --- a/i18n/es.json +++ b/i18n/es.json @@ -226,5 +226,6 @@ "Copy link": "Copy link", "Link copied to clipboard": "Link copied to clipboard", "Paste text": "Paste text", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", + "Theme": "Theme" } diff --git a/i18n/et.json b/i18n/et.json index 6e8a83fc..0282a2c2 100644 --- a/i18n/et.json +++ b/i18n/et.json @@ -226,5 +226,6 @@ "Copy link": "Copy link", "Link copied to clipboard": "Link copied to clipboard", "Paste text": "Paste text", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", + "Theme": "Theme" } diff --git a/i18n/fi.json b/i18n/fi.json index 446b9e82..cd8dae13 100644 --- a/i18n/fi.json +++ b/i18n/fi.json @@ -226,5 +226,6 @@ "Copy link": "Copy link", "Link copied to clipboard": "Link copied to clipboard", "Paste text": "Paste text", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", + "Theme": "Theme" } diff --git a/i18n/fr.json b/i18n/fr.json index 68064f20..faafdc29 100644 --- a/i18n/fr.json +++ b/i18n/fr.json @@ -226,5 +226,6 @@ "Copy link": "Copier le lien", "Link copied to clipboard": "Lien copié dans le presse-papier", "Paste text": "Texte du paste", - "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)" + "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)", + "Theme": "Theme" } diff --git a/i18n/he.json b/i18n/he.json index 9c28fcf0..550b2167 100644 --- a/i18n/he.json +++ b/i18n/he.json @@ -226,5 +226,6 @@ "Copy link": "Copy link", "Link copied to clipboard": "Link copied to clipboard", "Paste text": "Paste text", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", + "Theme": "Theme" } diff --git a/i18n/hi.json b/i18n/hi.json index bf36c662..d1b2a46f 100644 --- a/i18n/hi.json +++ b/i18n/hi.json @@ -226,5 +226,6 @@ "Copy link": "Copy link", "Link copied to clipboard": "Link copied to clipboard", "Paste text": "Paste text", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", + "Theme": "Theme" } diff --git a/i18n/hu.json b/i18n/hu.json index 462c64c7..711ffa73 100644 --- a/i18n/hu.json +++ b/i18n/hu.json @@ -226,5 +226,6 @@ "Copy link": "Copy link", "Link copied to clipboard": "Link copied to clipboard", "Paste text": "Paste text", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", + "Theme": "Theme" } diff --git a/i18n/id.json b/i18n/id.json index 1a483262..e0d16c1f 100644 --- a/i18n/id.json +++ b/i18n/id.json @@ -226,5 +226,6 @@ "Copy link": "Copy link", "Link copied to clipboard": "Link copied to clipboard", "Paste text": "Paste text", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", + "Theme": "Theme" } diff --git a/i18n/it.json b/i18n/it.json index f05d16d5..f358153e 100644 --- a/i18n/it.json +++ b/i18n/it.json @@ -226,5 +226,6 @@ "Copy link": "Copia il link", "Link copied to clipboard": "Link copied to clipboard", "Paste text": "Testo del messaggio", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", + "Theme": "Theme" } diff --git a/i18n/ja.json b/i18n/ja.json index 42dcba2d..f4cc44fc 100644 --- a/i18n/ja.json +++ b/i18n/ja.json @@ -226,5 +226,6 @@ "Copy link": "Copy link", "Link copied to clipboard": "Link copied to clipboard", "Paste text": "Paste text", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", + "Theme": "Theme" } diff --git a/i18n/jbo.json b/i18n/jbo.json index 9503a47d..9935a6c0 100644 --- a/i18n/jbo.json +++ b/i18n/jbo.json @@ -226,5 +226,6 @@ "Copy link": "Copy link", "Link copied to clipboard": "Link copied to clipboard", "Paste text": "Paste text", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", + "Theme": "Theme" } diff --git a/i18n/ko.json b/i18n/ko.json index bf36c662..d1b2a46f 100644 --- a/i18n/ko.json +++ b/i18n/ko.json @@ -226,5 +226,6 @@ "Copy link": "Copy link", "Link copied to clipboard": "Link copied to clipboard", "Paste text": "Paste text", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", + "Theme": "Theme" } diff --git a/i18n/ku.json b/i18n/ku.json index c3dc506f..5b98497e 100644 --- a/i18n/ku.json +++ b/i18n/ku.json @@ -226,5 +226,6 @@ "Copy link": "Copy link", "Link copied to clipboard": "Link copied to clipboard", "Paste text": "Paste text", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", + "Theme": "Theme" } diff --git a/i18n/la.json b/i18n/la.json index 7e1888be..97eb2f96 100644 --- a/i18n/la.json +++ b/i18n/la.json @@ -226,5 +226,6 @@ "Copy link": "Copy link", "Link copied to clipboard": "Link copied to clipboard", "Paste text": "Paste text", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", + "Theme": "Theme" } diff --git a/i18n/lt.json b/i18n/lt.json index 5de37956..e68669ca 100644 --- a/i18n/lt.json +++ b/i18n/lt.json @@ -226,5 +226,6 @@ "Copy link": "Copy link", "Link copied to clipboard": "Link copied to clipboard", "Paste text": "Paste text", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", + "Theme": "Theme" } diff --git a/i18n/nl.json b/i18n/nl.json index 7b15afc5..13da44a8 100644 --- a/i18n/nl.json +++ b/i18n/nl.json @@ -226,5 +226,6 @@ "Copy link": "Kopieer link", "Link copied to clipboard": "Link gekopieerd naar klembord", "Paste text": "Tekst plakken", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulatortoets dient als teken (gebruik Ctrl+m of Esc om te schakelen)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulatortoets dient als teken (gebruik Ctrl+m of Esc om te schakelen)", + "Theme": "Theme" } diff --git a/i18n/no.json b/i18n/no.json index 36b3cf88..eb866d85 100644 --- a/i18n/no.json +++ b/i18n/no.json @@ -226,5 +226,6 @@ "Copy link": "Copy link", "Link copied to clipboard": "Link copied to clipboard", "Paste text": "Paste text", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", + "Theme": "Theme" } diff --git a/i18n/oc.json b/i18n/oc.json index 669bbcf6..6b3c567f 100644 --- a/i18n/oc.json +++ b/i18n/oc.json @@ -226,5 +226,6 @@ "Copy link": "Copy link", "Link copied to clipboard": "Link copied to clipboard", "Paste text": "Paste text", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", + "Theme": "Theme" } diff --git a/i18n/pl.json b/i18n/pl.json index fb5dc73b..b4d24da3 100644 --- a/i18n/pl.json +++ b/i18n/pl.json @@ -226,5 +226,6 @@ "Copy link": "Copy link", "Link copied to clipboard": "Link copied to clipboard", "Paste text": "Paste text", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", + "Theme": "Theme" } diff --git a/i18n/pt.json b/i18n/pt.json index b24d5066..19e7e6c7 100644 --- a/i18n/pt.json +++ b/i18n/pt.json @@ -226,5 +226,6 @@ "Copy link": "Copy link", "Link copied to clipboard": "Link copied to clipboard", "Paste text": "Paste text", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", + "Theme": "Theme" } diff --git a/i18n/ro.json b/i18n/ro.json index 396b1f41..4708ac19 100644 --- a/i18n/ro.json +++ b/i18n/ro.json @@ -226,5 +226,6 @@ "Copy link": "Copy link", "Link copied to clipboard": "Link copied to clipboard", "Paste text": "Paste text", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", + "Theme": "Theme" } diff --git a/i18n/ru.json b/i18n/ru.json index 6eede6d7..ef681b45 100644 --- a/i18n/ru.json +++ b/i18n/ru.json @@ -226,5 +226,6 @@ "Copy link": "Скопировать ссылку", "Link copied to clipboard": "Ссылка скопирована в буфер обмена", "Paste text": "Paste text", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", + "Theme": "Тема" } diff --git a/i18n/sk.json b/i18n/sk.json index 3853cc31..9dc57c1a 100644 --- a/i18n/sk.json +++ b/i18n/sk.json @@ -226,5 +226,6 @@ "Copy link": "Copy link", "Link copied to clipboard": "Link copied to clipboard", "Paste text": "Paste text", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", + "Theme": "Theme" } diff --git a/i18n/sl.json b/i18n/sl.json index 578c47fa..571c2356 100644 --- a/i18n/sl.json +++ b/i18n/sl.json @@ -226,5 +226,6 @@ "Copy link": "Copy link", "Link copied to clipboard": "Link copied to clipboard", "Paste text": "Paste text", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", + "Theme": "Theme" } diff --git a/i18n/sv.json b/i18n/sv.json index 8f6dfad1..3e2be511 100644 --- a/i18n/sv.json +++ b/i18n/sv.json @@ -226,5 +226,6 @@ "Copy link": "Copy link", "Link copied to clipboard": "Link copied to clipboard", "Paste text": "Paste text", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", + "Theme": "Theme" } diff --git a/i18n/th.json b/i18n/th.json index 48e60707..e2a58cdd 100644 --- a/i18n/th.json +++ b/i18n/th.json @@ -226,5 +226,6 @@ "Copy link": "Copy link", "Link copied to clipboard": "Link copied to clipboard", "Paste text": "Paste text", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", + "Theme": "Theme" } diff --git a/i18n/tr.json b/i18n/tr.json index c0db56ae..8eb47712 100644 --- a/i18n/tr.json +++ b/i18n/tr.json @@ -226,5 +226,6 @@ "Copy link": "Copy link", "Link copied to clipboard": "Link copied to clipboard", "Paste text": "Paste text", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", + "Theme": "Theme" } diff --git a/i18n/uk.json b/i18n/uk.json index 68cb73aa..1110c23f 100644 --- a/i18n/uk.json +++ b/i18n/uk.json @@ -226,5 +226,6 @@ "Copy link": "Copy link", "Link copied to clipboard": "Link copied to clipboard", "Paste text": "Paste text", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)", + "Theme": "Theme" } diff --git a/i18n/zh.json b/i18n/zh.json index be9cc3a3..26574216 100644 --- a/i18n/zh.json +++ b/i18n/zh.json @@ -226,5 +226,6 @@ "Copy link": "复制链接", "Link copied to clipboard": "链接已复制到剪贴板", "Paste text": "粘贴文本", - "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tab 键可作为字符(按 Ctrl+mEsc 切换开关)" + "Tabulator key serves as character (Hit Ctrl+m or Esc to toggle)": "Tab 键可作为字符(按 Ctrl+mEsc 切换开关)", + "Theme": "Theme" } diff --git a/js/privatebin.js b/js/privatebin.js index b67de8ad..8dcff38a 100644 --- a/js/privatebin.js +++ b/js/privatebin.js @@ -3933,7 +3933,18 @@ jQuery.PrivateBin = (function($, RawDeflate) { */ function setLanguage(event) { - document.cookie = 'lang=' + $(event.target).data('lang') + '; SameSite=Lax; Secure'; + let lang = $(event.target).data('lang') || event.target.value; + + document.cookie = 'lang=' + lang + '; SameSite=Lax; Secure'; + window.location.reload(); + event.preventDefault(); + } + + function setTemplate(event) + { + let template = $(event.target).data('template') || event.target.value; + + document.cookie = 'template=' + template + '; SameSite=Lax; Secure'; window.location.reload(); event.preventDefault(); } @@ -4625,7 +4636,12 @@ jQuery.PrivateBin = (function($, RawDeflate) { // bootstrap template drop down $('#language ul.dropdown-menu li a').click(setLanguage); // page template drop down - $('#language select option').click(setLanguage); + $('#language select').change(setLanguage); + + // bootstrap template drop down + $('#template ul.dropdown-menu li a').click(setTemplate); + // page template drop down + $('#template select').change(setTemplate); // bind events $burnAfterReading.change(changeBurnAfterReading); diff --git a/lib/Configuration.php b/lib/Configuration.php index f22d6048..2849d32a 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -45,7 +45,8 @@ class Configuration 'defaultformatter' => 'plaintext', 'syntaxhighlightingtheme' => '', 'sizelimit' => 10485760, - 'template' => 'bootstrap', + 'templateselection' => false, + 'templatedefault' => 'bootstrap', 'info' => 'More information on the project page.', 'notice' => '', 'languageselection' => false, @@ -108,7 +109,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-POa+8KNXFFwJFsqp7r9APmR5Rc1w2l363y+OScSzLCySrHN7UhOOgt1VH/o8mVddFvvUozj3FZVmdkTxRlrS5g==', + 'js/privatebin.js' => 'sha512-YDgd0cFfFHP/DLHQH2CWkGMjdFC5YjwDuWSoEsc1gU4h5sRd+T88mPYva1cdoviKEoty6F8pDe3E6chcMEzRag==', 'js/purify-3.2.4.js' => 'sha512-Mu9BqoHURMeycg6AgqTpokUv9guq88pajfaFqz53fx1OxohyROkydXPLEIbdKCQ7EdDs9hgcrYeZ9zTiPQQ4CA==', 'js/rawinflate-0.3.js' => 'sha512-g8uelGgJW9A/Z1tB6Izxab++oj5kdD7B4qC7DHwZkB6DGMXKyzx7v5mvap2HXueI2IIn08YlRYM56jwWdm2ucQ==', 'js/showdown-2.1.0.js' => 'sha512-WYXZgkTR0u/Y9SVIA4nTTOih0kXMEd8RRV6MLFdL6YU8ymhR528NLlYQt1nlJQbYz4EW+ZsS0fx1awhiQJme1Q==', diff --git a/lib/Controller.php b/lib/Controller.php index 7b49ae8b..1df117a4 100644 --- a/lib/Controller.php +++ b/lib/Controller.php @@ -179,7 +179,14 @@ class Controller $this->_request = new Request; $this->_urlBase = $this->_request->getRequestUri(); - // set default language + $this->_setDefaultLanguage(); + $this->_setDefaultTemplate(); + } + + private function _setDefaultLanguage() + { + $this->_conf = new Configuration; + $lang = $this->_conf->getKey('languagedefault'); I18n::setLanguageFallback($lang); // force default language, if language selection is disabled and a default is set @@ -189,6 +196,20 @@ class Controller } } + + private function _setDefaultTemplate() + { + $this->_conf = new Configuration; + + $template = $this->_conf->getKey('templatedefault'); + TemplateSwitcher::setTemplateFallback($template); + // force default template, if template selection is disabled and a default is set + if (!$this->_conf->getKey('languageselection') && strlen($template) == 2) { + $_COOKIE['template'] = $template; + setcookie('template', $template, array('SameSite' => 'Lax', 'Secure' => true)); + } + } + /** * Turn off browser caching * @@ -400,6 +421,13 @@ class Controller setcookie('lang', $languageselection, array('SameSite' => 'Lax', 'Secure' => true)); } + // set template cookie if that functionality was enabled + $templateselection = ''; + if ($this->_conf->getKey('templateselection')) { + $templateselection = TemplateSwitcher::getTemplate(); + setcookie('template', $templateselection, array('SameSite' => 'Lax', 'Secure' => true)); + } + // strip policies that are unsupported in meta tag $metacspheader = str_replace( array( @@ -438,6 +466,8 @@ class Controller $page->assign('ZEROBINCOMPATIBILITY', $this->_conf->getKey('zerobincompatibility')); $page->assign('LANGUAGESELECTION', $languageselection); $page->assign('LANGUAGES', I18n::getLanguageLabels(I18n::getAvailableLanguages())); + $page->assign('TEMPLATESELECTION', $templateselection); + $page->assign('TEMPLATES', TemplateSwitcher::getAvailableTemplates()); $page->assign('EXPIRE', $expire); $page->assign('EXPIREDEFAULT', $this->_conf->getKey('default', 'expire')); $page->assign('URLSHORTENER', $this->_conf->getKey('urlshortener')); @@ -447,7 +477,7 @@ class Controller $page->assign('HTTPSLINK', 'https://' . $this->_request->getHost() . $this->_request->getRequestUri()); $page->assign('COMPRESSION', $this->_conf->getKey('compression')); $page->assign('SRI', $this->_conf->getSection('sri')); - $page->draw($this->_conf->getKey('template')); + $page->draw(TemplateSwitcher::getTemplate()); } /** diff --git a/lib/TemplateSwitcher.php b/lib/TemplateSwitcher.php new file mode 100644 index 00000000..f2f063d5 --- /dev/null +++ b/lib/TemplateSwitcher.php @@ -0,0 +1,117 @@ + + + + diff --git a/tpl/bootstrap5.php b/tpl/bootstrap5.php index 8d1a6e17..3ec956b6 100644 --- a/tpl/bootstrap5.php +++ b/tpl/bootstrap5.php @@ -323,6 +323,30 @@ if (!empty($LANGUAGESELECTION)) : + + + diff --git a/tpl/page.php b/tpl/page.php index f9a82167..74f61dc6 100644 --- a/tpl/page.php +++ b/tpl/page.php @@ -222,6 +222,27 @@ if (!empty($LANGUAGESELECTION)): + +
: + +
+ assertEquals($defaultTemplateFallback, TemplateSwitcher::getTemplate(), "Default template fallback"); + + TemplateSwitcher::setTemplateFallback($wrongTemplateFallback); + $this->assertEquals($defaultTemplateFallback, TemplateSwitcher::getTemplate(), "Wrong template fallback"); + + TemplateSwitcher::setTemplateFallback($customTemplateFallback); + $this->assertEquals($customTemplateFallback, TemplateSwitcher::getTemplate(), "Custom template fallback"); + } + + + public function testGetTemplate() + { + $defaultTemplateFallback = "bootstrap"; + $customTemplate = "bootstrap-dark"; + $customWrongTemplate = "bootstrap-wrong"; + + TemplateSwitcher::setTemplateFallback($defaultTemplateFallback); + + $_COOKIE['template'] = $customWrongTemplate; + $this->assertEquals($defaultTemplateFallback, TemplateSwitcher::getTemplate(), "Custom wrong template"); + + $_COOKIE['template'] = $customTemplate; + $this->assertEquals($customTemplate, TemplateSwitcher::getTemplate(), "Custom template"); + } + + + public function testGetAvailableTemplates() + { + $this->assertNotEmpty(TemplateSwitcher::getAvailableTemplates(), "Available templates"); + } + + + public function testIsTemplateAvailable() + { + $existingTemplate = "bootstrap"; + $nonExistentTemplate = "bootstrap-wrong"; + + $this->assertTrue(TemplateSwitcher::isTemplateAvailable($existingTemplate), "Existing template"); + $this->assertFalse(TemplateSwitcher::isTemplateAvailable($nonExistentTemplate), "Non-existent template"); + } +}