From 11308dc1de7a73479f9cd442698d0a50218aa85c Mon Sep 17 00:00:00 2001 From: fomichev Date: Wed, 26 Mar 2025 13:16:24 +0300 Subject: [PATCH] =?utf8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BB=20=D0=BD=D0=B0?= =?utf8?q?=D0=B4=D0=BF=D0=B8=D1=81=D1=8C=20=D0=B8=20=D1=81=D0=BC=D0=B5?= =?utf8?q?=D0=BD=D0=B8=D0=BB=20=D0=BD=D0=B0=20=D1=86=D0=B5=D0=BB=D0=B5?= =?utf8?q?=D0=B2=D1=83=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/views/bouquet/_form.php | 6 ++++-- erp24/web/js/bouquet/bouquet.js | 28 ++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/erp24/views/bouquet/_form.php b/erp24/views/bouquet/_form.php index 9531f347..50d121d0 100644 --- a/erp24/views/bouquet/_form.php +++ b/erp24/views/bouquet/_form.php @@ -187,7 +187,8 @@ $form = ActiveForm::begin([ ['type' => 'video', 'filetype' => 'video/mp4'] ] : [], 'maxFileSize' => 100000, - 'dropZoneTitle' => 'Выберите видеофайл', + 'dropZoneTitle' => 'Выберите видеофайл (поддержииваемый формат: mkv, mov, avi, mp4, + максимальный размер: 100 МБ)', 'browseOnZoneClick' => true, 'fileActionSettings' => [ 'showZoom' => false, @@ -223,7 +224,8 @@ $form = ActiveForm::begin([ ['type' => 'video', 'filetype' => 'video/mp4'] ] : [], 'maxFileSize' => 100000, - 'dropZoneTitle' => 'Выберите видеофайл', + 'dropZoneTitle' => 'Выберите видеофайл (поддержииваемый формат: mkv, mov, avi, mp4, + максимальный размер: 100 МБ)', 'browseOnZoneClick' => true, 'fileActionSettings' => [ 'showZoom' => false, diff --git a/erp24/web/js/bouquet/bouquet.js b/erp24/web/js/bouquet/bouquet.js index 4d74d0ac..b7f901db 100644 --- a/erp24/web/js/bouquet/bouquet.js +++ b/erp24/web/js/bouquet/bouquet.js @@ -6,8 +6,36 @@ document.addEventListener('DOMContentLoaded', function () { this.play(); }); }); + console.log('check'); + function cleanDropZoneText(selector) { + const dropZone = document.querySelector(selector); + if (dropZone && dropZone.innerHTML.includes('(Или щёлкните, чтобы выбрать файл)')) { + dropZone.innerHTML = dropZone.innerHTML.replace('(Или щёлкните, чтобы выбрать файл)', ''); + return true; + } + return false; + } + + function observeAndClean(selector) { + if (cleanDropZoneText(selector)) { + return; + } + const observer = new MutationObserver((mutations, obs) => { + if (cleanDropZoneText(selector)) { + obs.disconnect(); + } + }); + + observer.observe(document.body, { + childList: true, + subtree: true + }); + } + observeAndClean('.field-video-file-upload .file-drop-zone-title'); + observeAndClean('.field-presentation-file-upload .file-drop-zone-title'); }); + $(document).ready(function () { if (window.location.pathname.includes('/bouquet/view')) { $('.year-picker, .month-picker').on('change', function () { -- 2.39.5