瀏覽代碼

Merge pull request #1564 from Ribas160/file_name_and_size_on_download_page

Show file name and size on download page
El RIDO 1 年之前
父節點
當前提交
389b215b2f
共有 42 個文件被更改,包括 354 次插入3 次删除
  1. 1 0
      CHANGELOG.md
  2. 1 1
      CREDITS.md
  3. 8 0
      i18n/ar.json
  4. 8 0
      i18n/bg.json
  5. 8 0
      i18n/ca.json
  6. 8 0
      i18n/co.json
  7. 8 0
      i18n/cs.json
  8. 8 0
      i18n/de.json
  9. 8 0
      i18n/el.json
  10. 8 0
      i18n/en.json
  11. 8 0
      i18n/es.json
  12. 8 0
      i18n/et.json
  13. 8 0
      i18n/fi.json
  14. 8 0
      i18n/fr.json
  15. 8 0
      i18n/he.json
  16. 8 0
      i18n/hi.json
  17. 8 0
      i18n/hu.json
  18. 8 0
      i18n/id.json
  19. 8 0
      i18n/it.json
  20. 8 0
      i18n/ja.json
  21. 8 0
      i18n/jbo.json
  22. 8 0
      i18n/ko.json
  23. 8 0
      i18n/ku.json
  24. 8 0
      i18n/la.json
  25. 8 0
      i18n/lt.json
  26. 8 0
      i18n/nl.json
  27. 8 0
      i18n/no.json
  28. 8 0
      i18n/oc.json
  29. 8 0
      i18n/pl.json
  30. 8 0
      i18n/pt.json
  31. 8 0
      i18n/ro.json
  32. 8 0
      i18n/ru.json
  33. 8 0
      i18n/sk.json
  34. 8 0
      i18n/sl.json
  35. 8 0
      i18n/sv.json
  36. 8 0
      i18n/th.json
  37. 8 0
      i18n/tr.json
  38. 8 0
      i18n/uk.json
  39. 8 0
      i18n/zh.json
  40. 29 1
      js/privatebin.js
  41. 26 0
      js/test/Helper.js
  42. 1 1
      lib/Configuration.php

+ 1 - 0
CHANGELOG.md

@@ -2,6 +2,7 @@
 
 
 ## 1.7.7 (not yet released)
 ## 1.7.7 (not yet released)
 * ADDED: Switching templates using the web ui (#1501)
 * ADDED: Switching templates using the web ui (#1501)
+* ADDED: Show file name and size on download page (#603)
 * CHANGED: Passing large data structures by reference to reduce memory consumption (#858)
 * CHANGED: Passing large data structures by reference to reduce memory consumption (#858)
 * CHANGED: Removed use of ctype functions and polyfill library for ctype
 * CHANGED: Removed use of ctype functions and polyfill library for ctype
 * CHANGED: Upgrading libraries to: DOMpurify 3.2.6, ip-lib 1.20.0
 * CHANGED: Upgrading libraries to: DOMpurify 3.2.6, ip-lib 1.20.0

+ 1 - 1
CREDITS.md

@@ -5,6 +5,7 @@
 * Simon Rupf - current developer and maintainer
 * Simon Rupf - current developer and maintainer
 * rugk - security review, doc improvment, JS refactoring & various other stuff
 * rugk - security review, doc improvment, JS refactoring & various other stuff
 * R4SAS - python client, compression, blob URI to support larger attachments
 * R4SAS - python client, compression, blob URI to support larger attachments
+* Mikhail Romanov - UI improvements, theme switching, clipboard support, multi-file upload, bugfixes, code refactoring
 
 
 ## Past contributions
 ## Past contributions
 
 
@@ -33,7 +34,6 @@
 * Mounir Idrassi & J. Mozdzen - secure YOURLS integration
 * Mounir Idrassi & J. Mozdzen - secure YOURLS integration
 * Felipe Nakandakari - enabled AWS SDK to use default credential provider chain in the S3 Storage backend
 * 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
 * Aaron Sherber - cache control headers for API calls & use of `shortenviayourls` in query parameters
-* Mikhail Romanov - UI improvements, theme switching, clipboard support, multi-file upload, bugfixes, code refactoring
 
 
 ## Translations
 ## Translations
 * Hexalyse - French
 * Hexalyse - French

+ 8 - 0
i18n/ar.json

@@ -164,6 +164,14 @@
     "EiB": "إكسابايت",
     "EiB": "إكسابايت",
     "ZiB": "زيتابايت",
     "ZiB": "زيتابايت",
     "YiB": "يوتابايت",
     "YiB": "يوتابايت",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "التنسيق",
     "Format": "التنسيق",
     "Plain Text": "نص عادي",
     "Plain Text": "نص عادي",
     "Source Code": "كود مصدر",
     "Source Code": "كود مصدر",

+ 8 - 0
i18n/bg.json

@@ -164,6 +164,14 @@
     "EiB": "EiB",
     "EiB": "EiB",
     "ZiB": "ZiB",
     "ZiB": "ZiB",
     "YiB": "YiB",
     "YiB": "YiB",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "Формат",
     "Format": "Формат",
     "Plain Text": "Чист текст",
     "Plain Text": "Чист текст",
     "Source Code": "Изходен код",
     "Source Code": "Изходен код",

+ 8 - 0
i18n/ca.json

@@ -164,6 +164,14 @@
     "EiB": "EiB",
     "EiB": "EiB",
     "ZiB": "ZiB",
     "ZiB": "ZiB",
     "YiB": "YiB",
     "YiB": "YiB",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "Format",
     "Format": "Format",
     "Plain Text": "Text sense format",
     "Plain Text": "Text sense format",
     "Source Code": "Codi font",
     "Source Code": "Codi font",

+ 8 - 0
i18n/co.json

@@ -164,6 +164,14 @@
     "EiB": "Eo",
     "EiB": "Eo",
     "ZiB": "Zo",
     "ZiB": "Zo",
     "YiB": "Yo",
     "YiB": "Yo",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "Furmatu",
     "Format": "Furmatu",
     "Plain Text": "Testu in chjaru",
     "Plain Text": "Testu in chjaru",
     "Source Code": "Codice di fonte",
     "Source Code": "Codice di fonte",

+ 8 - 0
i18n/cs.json

@@ -164,6 +164,14 @@
     "EiB": "EiB",
     "EiB": "EiB",
     "ZiB": "ZiB",
     "ZiB": "ZiB",
     "YiB": "YiB",
     "YiB": "YiB",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "Formát",
     "Format": "Formát",
     "Plain Text": "Prostý text",
     "Plain Text": "Prostý text",
     "Source Code": "Zdrojový kód",
     "Source Code": "Zdrojový kód",

+ 8 - 0
i18n/de.json

@@ -164,6 +164,14 @@
     "EiB": "EiB",
     "EiB": "EiB",
     "ZiB": "ZiB",
     "ZiB": "ZiB",
     "YiB": "YiB",
     "YiB": "YiB",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "Format",
     "Format": "Format",
     "Plain Text": "Nur Text",
     "Plain Text": "Nur Text",
     "Source Code": "Quellcode",
     "Source Code": "Quellcode",

+ 8 - 0
i18n/el.json

@@ -164,6 +164,14 @@
     "EiB": "EiB",
     "EiB": "EiB",
     "ZiB": "ZiB",
     "ZiB": "ZiB",
     "YiB": "YiB",
     "YiB": "YiB",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "Μορφοποίηση",
     "Format": "Μορφοποίηση",
     "Plain Text": "Απλό κείμενο",
     "Plain Text": "Απλό κείμενο",
     "Source Code": "Πηγαίος Κώδικας",
     "Source Code": "Πηγαίος Κώδικας",

+ 8 - 0
i18n/en.json

@@ -164,6 +164,14 @@
     "EiB": "EiB",
     "EiB": "EiB",
     "ZiB": "ZiB",
     "ZiB": "ZiB",
     "YiB": "YiB",
     "YiB": "YiB",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "Format",
     "Format": "Format",
     "Plain Text": "Plain Text",
     "Plain Text": "Plain Text",
     "Source Code": "Source Code",
     "Source Code": "Source Code",

+ 8 - 0
i18n/es.json

@@ -164,6 +164,14 @@
     "EiB": "EiB",
     "EiB": "EiB",
     "ZiB": "ZiB",
     "ZiB": "ZiB",
     "YiB": "YiB",
     "YiB": "YiB",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "Formato",
     "Format": "Formato",
     "Plain Text": "Texto sin formato",
     "Plain Text": "Texto sin formato",
     "Source Code": "Código fuente",
     "Source Code": "Código fuente",

+ 8 - 0
i18n/et.json

@@ -164,6 +164,14 @@
     "EiB": "EiB",
     "EiB": "EiB",
     "ZiB": "ZiB",
     "ZiB": "ZiB",
     "YiB": "YiB",
     "YiB": "YiB",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "Formaat",
     "Format": "Formaat",
     "Plain Text": "Lihttekst",
     "Plain Text": "Lihttekst",
     "Source Code": "Lähtekood",
     "Source Code": "Lähtekood",

+ 8 - 0
i18n/fi.json

@@ -164,6 +164,14 @@
     "EiB": "EiB",
     "EiB": "EiB",
     "ZiB": "ZiB",
     "ZiB": "ZiB",
     "YiB": "YiB",
     "YiB": "YiB",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "Formaatti",
     "Format": "Formaatti",
     "Plain Text": "Perusteksti",
     "Plain Text": "Perusteksti",
     "Source Code": "Lähdekoodi",
     "Source Code": "Lähdekoodi",

+ 8 - 0
i18n/fr.json

@@ -164,6 +164,14 @@
     "EiB": "Eio",
     "EiB": "Eio",
     "ZiB": "Zio",
     "ZiB": "Zio",
     "YiB": "Yio",
     "YiB": "Yio",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "Format",
     "Format": "Format",
     "Plain Text": "Texte brut",
     "Plain Text": "Texte brut",
     "Source Code": "Code source",
     "Source Code": "Code source",

+ 8 - 0
i18n/he.json

@@ -164,6 +164,14 @@
     "EiB": "EiB",
     "EiB": "EiB",
     "ZiB": "ZiB",
     "ZiB": "ZiB",
     "YiB": "YiB",
     "YiB": "YiB",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "פורמט",
     "Format": "פורמט",
     "Plain Text": "טקסט פשוט",
     "Plain Text": "טקסט פשוט",
     "Source Code": "קוד מקור",
     "Source Code": "קוד מקור",

+ 8 - 0
i18n/hi.json

@@ -164,6 +164,14 @@
     "EiB": "EiB",
     "EiB": "EiB",
     "ZiB": "ZiB",
     "ZiB": "ZiB",
     "YiB": "YiB",
     "YiB": "YiB",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "Format",
     "Format": "Format",
     "Plain Text": "Plain Text",
     "Plain Text": "Plain Text",
     "Source Code": "Source Code",
     "Source Code": "Source Code",

+ 8 - 0
i18n/hu.json

@@ -164,6 +164,14 @@
     "EiB": "EiB",
     "EiB": "EiB",
     "ZiB": "ZiB",
     "ZiB": "ZiB",
     "YiB": "YiB",
     "YiB": "YiB",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "Formátum",
     "Format": "Formátum",
     "Plain Text": "Egyszerű szöveg",
     "Plain Text": "Egyszerű szöveg",
     "Source Code": "Forráskód",
     "Source Code": "Forráskód",

+ 8 - 0
i18n/id.json

@@ -164,6 +164,14 @@
     "EiB": "EiB",
     "EiB": "EiB",
     "ZiB": "ZiB",
     "ZiB": "ZiB",
     "YiB": "YiB",
     "YiB": "YiB",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "Format",
     "Format": "Format",
     "Plain Text": "Teks Biasa",
     "Plain Text": "Teks Biasa",
     "Source Code": "Kode Sumber",
     "Source Code": "Kode Sumber",

+ 8 - 0
i18n/it.json

@@ -164,6 +164,14 @@
     "EiB": "EiB",
     "EiB": "EiB",
     "ZiB": "ZiB",
     "ZiB": "ZiB",
     "YiB": "YiB",
     "YiB": "YiB",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "Formato",
     "Format": "Formato",
     "Plain Text": "Solo Testo",
     "Plain Text": "Solo Testo",
     "Source Code": "Codice Sorgente",
     "Source Code": "Codice Sorgente",

+ 8 - 0
i18n/ja.json

@@ -164,6 +164,14 @@
     "EiB": "EiB",
     "EiB": "EiB",
     "ZiB": "ZiB",
     "ZiB": "ZiB",
     "YiB": "YiB",
     "YiB": "YiB",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "形式",
     "Format": "形式",
     "Plain Text": "プレーンテキスト",
     "Plain Text": "プレーンテキスト",
     "Source Code": "ソースコード",
     "Source Code": "ソースコード",

+ 8 - 0
i18n/jbo.json

@@ -164,6 +164,14 @@
     "EiB": "EiB",
     "EiB": "EiB",
     "ZiB": "ZiB",
     "ZiB": "ZiB",
     "YiB": "YiB",
     "YiB": "YiB",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "Format",
     "Format": "Format",
     "Plain Text": "Plain Text",
     "Plain Text": "Plain Text",
     "Source Code": "Source Code",
     "Source Code": "Source Code",

+ 8 - 0
i18n/ko.json

@@ -164,6 +164,14 @@
     "EiB": "EiB",
     "EiB": "EiB",
     "ZiB": "ZiB",
     "ZiB": "ZiB",
     "YiB": "YiB",
     "YiB": "YiB",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "Format",
     "Format": "Format",
     "Plain Text": "Plain Text",
     "Plain Text": "Plain Text",
     "Source Code": "Source Code",
     "Source Code": "Source Code",

+ 8 - 0
i18n/ku.json

@@ -164,6 +164,14 @@
     "EiB": "EiB",
     "EiB": "EiB",
     "ZiB": "ZiB",
     "ZiB": "ZiB",
     "YiB": "YiB",
     "YiB": "YiB",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "Format",
     "Format": "Format",
     "Plain Text": "Plain Text",
     "Plain Text": "Plain Text",
     "Source Code": "Source Code",
     "Source Code": "Source Code",

+ 8 - 0
i18n/la.json

@@ -164,6 +164,14 @@
     "EiB": "EiB",
     "EiB": "EiB",
     "ZiB": "ZiB",
     "ZiB": "ZiB",
     "YiB": "YiB",
     "YiB": "YiB",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "Format",
     "Format": "Format",
     "Plain Text": "Plain Text",
     "Plain Text": "Plain Text",
     "Source Code": "Source Code",
     "Source Code": "Source Code",

+ 8 - 0
i18n/lt.json

@@ -164,6 +164,14 @@
     "EiB": "EiB",
     "EiB": "EiB",
     "ZiB": "ZiB",
     "ZiB": "ZiB",
     "YiB": "YiB",
     "YiB": "YiB",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "Formatas",
     "Format": "Formatas",
     "Plain Text": "Grynasis tekstas",
     "Plain Text": "Grynasis tekstas",
     "Source Code": "Pirminis kodas",
     "Source Code": "Pirminis kodas",

+ 8 - 0
i18n/nl.json

@@ -164,6 +164,14 @@
     "EiB": "EiB",
     "EiB": "EiB",
     "ZiB": "ZiB",
     "ZiB": "ZiB",
     "YiB": "YiB",
     "YiB": "YiB",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "Formaat",
     "Format": "Formaat",
     "Plain Text": "Platte tekst",
     "Plain Text": "Platte tekst",
     "Source Code": "Broncode",
     "Source Code": "Broncode",

+ 8 - 0
i18n/no.json

@@ -164,6 +164,14 @@
     "EiB": "EiB",
     "EiB": "EiB",
     "ZiB": "ZiB",
     "ZiB": "ZiB",
     "YiB": "YiB",
     "YiB": "YiB",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "Format",
     "Format": "Format",
     "Plain Text": "Ren Tekst",
     "Plain Text": "Ren Tekst",
     "Source Code": "Kildekode",
     "Source Code": "Kildekode",

+ 8 - 0
i18n/oc.json

@@ -164,6 +164,14 @@
     "EiB": "Eio",
     "EiB": "Eio",
     "ZiB": "Zio",
     "ZiB": "Zio",
     "YiB": "Yio",
     "YiB": "Yio",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "Format",
     "Format": "Format",
     "Plain Text": "Tèxte brut",
     "Plain Text": "Tèxte brut",
     "Source Code": "Còdi font",
     "Source Code": "Còdi font",

+ 8 - 0
i18n/pl.json

@@ -164,6 +164,14 @@
     "EiB": "EiB",
     "EiB": "EiB",
     "ZiB": "ZiB",
     "ZiB": "ZiB",
     "YiB": "YiB",
     "YiB": "YiB",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "Format",
     "Format": "Format",
     "Plain Text": "Czysty tekst",
     "Plain Text": "Czysty tekst",
     "Source Code": "Kod źródłowy",
     "Source Code": "Kod źródłowy",

+ 8 - 0
i18n/pt.json

@@ -164,6 +164,14 @@
     "EiB": "EiB",
     "EiB": "EiB",
     "ZiB": "ZiB",
     "ZiB": "ZiB",
     "YiB": "YiB",
     "YiB": "YiB",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "Formato",
     "Format": "Formato",
     "Plain Text": "Texto sem formato",
     "Plain Text": "Texto sem formato",
     "Source Code": "Código fonte",
     "Source Code": "Código fonte",

+ 8 - 0
i18n/ro.json

@@ -164,6 +164,14 @@
     "EiB": "EiB",
     "EiB": "EiB",
     "ZiB": "ZiB",
     "ZiB": "ZiB",
     "YiB": "YiB",
     "YiB": "YiB",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "Formatare",
     "Format": "Formatare",
     "Plain Text": "Text neformatat",
     "Plain Text": "Text neformatat",
     "Source Code": "Cod sursă",
     "Source Code": "Cod sursă",

+ 8 - 0
i18n/ru.json

@@ -164,6 +164,14 @@
     "EiB": "Эбайт",
     "EiB": "Эбайт",
     "ZiB": "Збайт",
     "ZiB": "Збайт",
     "YiB": "Йбайт",
     "YiB": "Йбайт",
+    "KB": "КБ",
+    "MB": "МБ",
+    "GB": "ГБ",
+    "TB": "ТБ",
+    "PB": "ПБ",
+    "EB": "ЭБ",
+    "ZB": "ЗБ",
+    "YB": "ЙБ",
     "Format": "Формат",
     "Format": "Формат",
     "Plain Text": "Обычный текст",
     "Plain Text": "Обычный текст",
     "Source Code": "Исходный код",
     "Source Code": "Исходный код",

+ 8 - 0
i18n/sk.json

@@ -164,6 +164,14 @@
     "EiB": "EiB",
     "EiB": "EiB",
     "ZiB": "ZiB",
     "ZiB": "ZiB",
     "YiB": "YiB",
     "YiB": "YiB",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "Formát",
     "Format": "Formát",
     "Plain Text": "Čistý text",
     "Plain Text": "Čistý text",
     "Source Code": "Zdrojový kód",
     "Source Code": "Zdrojový kód",

+ 8 - 0
i18n/sl.json

@@ -164,6 +164,14 @@
     "EiB": "EB",
     "EiB": "EB",
     "ZiB": "ZB",
     "ZiB": "ZB",
     "YiB": "YB",
     "YiB": "YB",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "Format",
     "Format": "Format",
     "Plain Text": "Surov tekst",
     "Plain Text": "Surov tekst",
     "Source Code": "Odprta koda",
     "Source Code": "Odprta koda",

+ 8 - 0
i18n/sv.json

@@ -164,6 +164,14 @@
     "EiB": "EiB",
     "EiB": "EiB",
     "ZiB": "ZiB",
     "ZiB": "ZiB",
     "YiB": "YiB",
     "YiB": "YiB",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "Format",
     "Format": "Format",
     "Plain Text": "Plain Text",
     "Plain Text": "Plain Text",
     "Source Code": "Source Code",
     "Source Code": "Source Code",

+ 8 - 0
i18n/th.json

@@ -164,6 +164,14 @@
     "EiB": "EiB",
     "EiB": "EiB",
     "ZiB": "ZiB",
     "ZiB": "ZiB",
     "YiB": "YiB",
     "YiB": "YiB",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "รูปแบบ",
     "Format": "รูปแบบ",
     "Plain Text": "ข้อความล้วน",
     "Plain Text": "ข้อความล้วน",
     "Source Code": "ซอร์สโค้ด",
     "Source Code": "ซอร์สโค้ด",

+ 8 - 0
i18n/tr.json

@@ -164,6 +164,14 @@
     "EiB": "EiB",
     "EiB": "EiB",
     "ZiB": "ZiB",
     "ZiB": "ZiB",
     "YiB": "YiB",
     "YiB": "YiB",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "Format",
     "Format": "Format",
     "Plain Text": "Düz Yazı",
     "Plain Text": "Düz Yazı",
     "Source Code": "Kaynak Kodu",
     "Source Code": "Kaynak Kodu",

+ 8 - 0
i18n/uk.json

@@ -164,6 +164,14 @@
     "EiB": "Ебайт",
     "EiB": "Ебайт",
     "ZiB": "Збайт",
     "ZiB": "Збайт",
     "YiB": "Йбайт",
     "YiB": "Йбайт",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "Формат",
     "Format": "Формат",
     "Plain Text": "Звичайний текст",
     "Plain Text": "Звичайний текст",
     "Source Code": "Вихідний код",
     "Source Code": "Вихідний код",

+ 8 - 0
i18n/zh.json

@@ -164,6 +164,14 @@
     "EiB": "EiB",
     "EiB": "EiB",
     "ZiB": "ZiB",
     "ZiB": "ZiB",
     "YiB": "YiB",
     "YiB": "YiB",
+    "KB": "KB",
+    "MB": "MB",
+    "GB": "GB",
+    "TB": "TB",
+    "PB": "PB",
+    "EB": "EB",
+    "ZB": "ZB",
+    "YB": "YB",
     "Format": "格式",
     "Format": "格式",
     "Plain Text": "纯文本",
     "Plain Text": "纯文本",
     "Source Code": "源代码",
     "Source Code": "源代码",

+ 29 - 1
js/privatebin.js

@@ -591,6 +591,32 @@ jQuery.PrivateBin = (function($, RawDeflate) {
             return expirationDate;
             return expirationDate;
         };
         };
 
 
+        /**
+         * Convert Bytes to KiB/MiB/GiB
+         *
+         * @name   Helper.formatBytes
+         * @function
+         *
+         * @param  {number} bytes
+         * @return {string}
+         */
+        me.formatBytes = function (bytes)
+        {
+            let result = '';
+            const kilobyte = 1024;
+            const decimalPoint = 2;
+            const sizes = [I18n._('B'), I18n._('KiB'), I18n._('MiB'), I18n._('GiB')];
+            const index = Math.floor(Math.log(bytes) / Math.log(kilobyte));
+
+            if (bytes > 0) {
+                result = parseFloat((bytes / Math.pow(kilobyte, index)).toFixed(decimalPoint)) + ' ' + sizes[index];
+            } else {
+                result = `0 ${I18n._('B')}`;
+            }
+
+            return result;
+        }
+
         /**
         /**
          * resets state, used for unit testing
          * resets state, used for unit testing
          *
          *
@@ -3000,7 +3026,9 @@ jQuery.PrivateBin = (function($, RawDeflate) {
 
 
             if (typeof fileName !== 'undefined') {
             if (typeof fileName !== 'undefined') {
                 attachmentLink.attr('download', fileName);
                 attachmentLink.attr('download', fileName);
-                template.append(fileName);
+
+                const fileSize = Helper.formatBytes(decodedData.length);
+                template.append(`(${fileName}, ${fileSize})`);
             }
             }
 
 
             // sanitize SVG preview
             // sanitize SVG preview

+ 26 - 0
js/test/Helper.js

@@ -290,5 +290,31 @@ describe('Helper', function () {
             }
             }
         );
         );
     });
     });
+
+    describe('formatBytes', function () {
+        jsc.property('returns 0 B for 0 bytes', function () {
+            return $.PrivateBin.Helper.formatBytes(0) === '0 B';
+        });
+
+        jsc.property('formats bytes < 1000 as B', function () {
+            return $.PrivateBin.Helper.formatBytes(500) === '500 B';
+        });
+
+        jsc.property('formats kibibytes correctly', function () {
+            return $.PrivateBin.Helper.formatBytes(1500) === '1.46 KiB';
+        });
+
+        jsc.property('formats mebibytes correctly', function () {
+            return $.PrivateBin.Helper.formatBytes(2 * 1000 * 1000) === '1.91 MiB';
+        });
+
+        jsc.property('formats gibibytes correctly', function () {
+            return $.PrivateBin.Helper.formatBytes(3.45 * 1000 * 1000 * 1000) === '3.21 GiB';
+        });
+
+        jsc.property('rounds to two decimal places', function () {
+            return $.PrivateBin.Helper.formatBytes(1234567) === '1.18 MiB';
+        });
+    });
 });
 });
 
 

+ 1 - 1
lib/Configuration.php

@@ -119,7 +119,7 @@ class Configuration
             'js/kjua-0.9.0.js'       => 'sha512-CVn7af+vTMBd9RjoS4QM5fpLFEOtBCoB0zPtaqIDC7sF4F8qgUSRFQQpIyEDGsr6yrjbuOLzdf20tkHHmpaqwQ==',
             'js/kjua-0.9.0.js'       => 'sha512-CVn7af+vTMBd9RjoS4QM5fpLFEOtBCoB0zPtaqIDC7sF4F8qgUSRFQQpIyEDGsr6yrjbuOLzdf20tkHHmpaqwQ==',
             'js/legacy.js'           => 'sha512-UxW/TOZKon83n6dk/09GsYKIyeO5LeBHokxyIq+r7KFS5KMBeIB/EM7NrkVYIezwZBaovnyNtY2d9tKFicRlXg==',
             'js/legacy.js'           => 'sha512-UxW/TOZKon83n6dk/09GsYKIyeO5LeBHokxyIq+r7KFS5KMBeIB/EM7NrkVYIezwZBaovnyNtY2d9tKFicRlXg==',
             'js/prettify.js'         => 'sha512-puO0Ogy++IoA2Pb9IjSxV1n4+kQkKXYAEUtVzfZpQepyDPyXk8hokiYDS7ybMogYlyyEIwMLpZqVhCkARQWLMg==',
             'js/prettify.js'         => 'sha512-puO0Ogy++IoA2Pb9IjSxV1n4+kQkKXYAEUtVzfZpQepyDPyXk8hokiYDS7ybMogYlyyEIwMLpZqVhCkARQWLMg==',
-            'js/privatebin.js'       => 'sha512-m6RrsOsz4RgIWXDzgRghQDx6aegFCpkpqURwhfXwE/rNWhe/1rPJaLR+FXII82iTWo0n9JCzSbqrDqkYVPI50w==',
+            'js/privatebin.js'       => 'sha512-zvJ6Feu2NvROB236BBxbP+8eYbUTJ5GCfhOJVL/RI6pJQpR3AS4ps0d1cVDqgUFW8wY0tiwE7JTE13gPWO3lHA==',
             'js/purify-3.2.6.js'     => 'sha512-zqwL4OoBLFx89QPewkz4Lz5CSA2ktU+f31fuECkF0iK3Id5qd3Zpq5dMby8KwHjIEpsUgOqwF58cnmcaNem0EA==',
             'js/purify-3.2.6.js'     => 'sha512-zqwL4OoBLFx89QPewkz4Lz5CSA2ktU+f31fuECkF0iK3Id5qd3Zpq5dMby8KwHjIEpsUgOqwF58cnmcaNem0EA==',
             'js/rawinflate-0.3.js'   => 'sha512-g8uelGgJW9A/Z1tB6Izxab++oj5kdD7B4qC7DHwZkB6DGMXKyzx7v5mvap2HXueI2IIn08YlRYM56jwWdm2ucQ==',
             'js/rawinflate-0.3.js'   => 'sha512-g8uelGgJW9A/Z1tB6Izxab++oj5kdD7B4qC7DHwZkB6DGMXKyzx7v5mvap2HXueI2IIn08YlRYM56jwWdm2ucQ==',
             'js/showdown-2.1.0.js'   => 'sha512-WYXZgkTR0u/Y9SVIA4nTTOih0kXMEd8RRV6MLFdL6YU8ymhR528NLlYQt1nlJQbYz4EW+ZsS0fx1awhiQJme1Q==',
             'js/showdown-2.1.0.js'   => 'sha512-WYXZgkTR0u/Y9SVIA4nTTOih0kXMEd8RRV6MLFdL6YU8ymhR528NLlYQt1nlJQbYz4EW+ZsS0fx1awhiQJme1Q==',