Aevann 2023-10-02 11:12:54 +03:00
parent f18efb26f6
commit f4a790edd8
2 changed files with 7 additions and 11 deletions

View File

@ -452,17 +452,12 @@ function insertText(input, text) {
let oldfiles = {};
let MAX_IMAGE_AUDIO_SIZE_MB
let MAX_IMAGE_AUDIO_SIZE_MB_PATRON
let MAX_VIDEO_SIZE_MB
let MAX_VIDEO_SIZE_MB_PATRON
if (document.getElementById("MAX_IMAGE_AUDIO_SIZE_MB")) {
MAX_IMAGE_AUDIO_SIZE_MB = parseInt(document.getElementById("MAX_IMAGE_AUDIO_SIZE_MB").value)
MAX_IMAGE_AUDIO_SIZE_MB_PATRON = parseInt(document.getElementById("MAX_IMAGE_AUDIO_SIZE_MB_PATRON").value)
MAX_VIDEO_SIZE_MB = parseInt(document.getElementById("MAX_VIDEO_SIZE_MB").value)
MAX_VIDEO_SIZE_MB_PATRON = parseInt(document.getElementById("MAX_VIDEO_SIZE_MB_PATRON").value)
}
const MAX_IMAGE_AUDIO_SIZE_MB = parseInt(document.getElementById("MAX_IMAGE_AUDIO_SIZE_MB").value)
const MAX_IMAGE_AUDIO_SIZE_MB_PATRON = parseInt(document.getElementById("MAX_IMAGE_AUDIO_SIZE_MB_PATRON").value)
const MAX_VIDEO_SIZE_MB = parseInt(document.getElementById("MAX_VIDEO_SIZE_MB").value)
const MAX_VIDEO_SIZE_MB_PATRON = parseInt(document.getElementById("MAX_VIDEO_SIZE_MB_PATRON").value)
const vpatron = parseInt(document.getElementById("vpatron").value)
let patron
if (location.host == 'rdrama.net') patron = 'paypig'
@ -490,7 +485,7 @@ function handle_files(input, newfiles) {
type = 'image/audio'
}
if (file.size > max_size * 1024 * 1024) {
if (file.size > max_size_patron * 1024 * 1024 || (!vpatron && file.size > max_size * 1024 * 1024)) {
const msg = `Max ${type} size is ${max_size} MB (${max_size_patron} MB for ${patron}s)`
showToast(false, msg);
input.value = null;

View File

@ -50,6 +50,7 @@
<input hidden id="MAX_IMAGE_AUDIO_SIZE_MB_PATRON" value="{{MAX_IMAGE_AUDIO_SIZE_MB_PATRON}}">
<input hidden id="MAX_VIDEO_SIZE_MB" value="{{MAX_VIDEO_SIZE_MB}}">
<input hidden id="MAX_VIDEO_SIZE_MB_PATRON" value="{{MAX_VIDEO_SIZE_MB_PATRON}}">
<input hidden id="vpatron" value="{{v.patron}}">
{% endif %}
<script src="{{'js/top.js' | asset}}"></script>