diff --git a/administrator/components/com_quantummanager/config.xml b/administrator/components/com_quantummanager/config.xml index ad22a4e..891e64b 100644 --- a/administrator/components/com_quantummanager/config.xml +++ b/administrator/components/com_quantummanager/config.xml @@ -3,10 +3,16 @@
- + + - * @copyright Copyright © 2019 Delo Design & NorrNext. All rights reserved. - * @license GNU General Public License version 3 or later; see license.txt - * @link https://www.norrnext.com - */ - -defined('_JEXEC') or die; - -use Joomla\CMS\Filter\OutputFilter; -use Joomla\CMS\HTML\HTMLHelper; -use Joomla\CMS\Language\Text; -use Joomla\CMS\Factory; -use Joomla\CMS\Layout\FileLayout; -use Joomla\CMS\Uri\Uri; - -/** - * Class JFormFieldQuantumtoolbar - */ -class JFormFieldQuantumconfigdescription extends JFormField -{ - - /** - * @var string - * @since version - */ - public $type = 'QuantumconfigDescription'; - - public function getLabel() - { - return ''; - } - - - /** - * - * @return string - * - * @since version - */ - public function getInput() - { - - HTMLHelper::_('stylesheet', 'com_quantummanager/configfields.css', [ - 'version' => filemtime(__FILE__), - 'relative' => true - ]); - - $fromText = $this->getAttribute('fromText', ''); - - $html = "
" . Text::_($fromText) . "
"; - - return $html; - } - - -} \ No newline at end of file diff --git a/administrator/components/com_quantummanager/helpers/image.php b/administrator/components/com_quantummanager/helpers/image.php index c002f18..a1ab19a 100644 --- a/administrator/components/com_quantummanager/helpers/image.php +++ b/administrator/components/com_quantummanager/helpers/image.php @@ -93,8 +93,6 @@ public function resizeWatermark($file) $logoHeight = imagesy($logo); $imageWidth = imagesx($fileString); $imageHeight = imagesy($fileString); - $imageX = $padding; - $imageY = $padding; if((int)$this->paramsComponent->get('overlaypercent', 0)) { @@ -129,7 +127,7 @@ public function resizeWatermark($file) } $watermark = $manager->make($logo); - $image->insert($watermark, $position); + $image->insert($watermark, $position, $padding, $padding); $image->save($file); diff --git a/administrator/components/com_quantummanager/language/en-GB/en-GB.com_quantummanager.ini b/administrator/components/com_quantummanager/language/en-GB/en-GB.com_quantummanager.ini index dcaf526..89868d6 100644 --- a/administrator/components/com_quantummanager/language/en-GB/en-GB.com_quantummanager.ini +++ b/administrator/components/com_quantummanager/language/en-GB/en-GB.com_quantummanager.ini @@ -13,12 +13,15 @@ COM_QUANTUMMANAGER_EMPTY_MIMETYPE="Unknown mime type" COM_QUANTUMMANAGER_CONFIG_GENERAL="Global settings" COM_QUANTUMMANAGER_CONFIG_GENERAL_DESC="Here are global settings for entire file manager" +COM_QUANTUMMANAGER_CONFIG_GENERAL_DOCS_LABEL="Documentation" +COM_QUANTUMMANAGER_CONFIG_GENERAL_DOCS_DESC="If you have difficulties with configuring the file manager, you can read the documentation on the following URL: https://www.norrnext.com/docs/joomla-extensions/quantum-manager
Support | Product page | Reviews on the JED" COM_QUANTUMMANAGER_CONFIG_GENERAL_SCOPES_LABEL="Default scopes" COM_QUANTUMMANAGER_CONFIG_GENERAL_SCOPES_NAME_LABEL="Name scope" COM_QUANTUMMANAGER_CONFIG_GENERAL_SCOPES_ENABLE_LABEL="Enable scope" COM_QUANTUMMANAGER_CONFIG_GENERAL_SCOPES_PATH_LABEL="Folder" COM_QUANTUMMANAGER_CONFIG_GENERAL_SCOPES_CUSTOM_LABEL="Custom scopes" COM_QUANTUMMANAGER_CONFIG_GENERAL_PATH_LABEL="Default folder" +COM_QUANTUMMANAGER_CONFIG_GENERAL_PATH_VARIABLES_LABEL="Path variables" COM_QUANTUMMANAGER_CONFIG_GENERAL_PATH_DESC="Enter the path to files for this field.
Available varables:
{user_id} - ID of current user
{year} - current year
{month} - curreny month
{day} - current day
{hours} - current hour
{minutes} - hours
{second} - seconds
{unix} - UNIX time in seconds

Example of use:
images/{user_id}/{year}-{month}-{day}" COM_QUANTUMMANAGER_CONFIG_GENERAL_MAXSIZEFILENAME_LABEL="Maximum length of file or folder name" COM_QUANTUMMANAGER_CONFIG_GENERAL_MAXSIZE_LABEL="Maximum file size for uploading
in megabytes" @@ -130,7 +133,7 @@ COM_QUANTUMMANAGER_FIELDS_QUANTUMCROPPERJS_LABEL_RATIO="Ratio" COM_QUANTUMMANAGER_FIELDS_QUANTUMCROPPERJS_LABEL_SAVE_RATIO="Save ratio" COM_QUANTUMMANAGER_FIELDS_QUANTUMUNSPLASH_BUTTON="Search in Unsplash" -COM_QUANTUMMANAGER_FIELDS_QUANTUMUNSPLASH_NOTFOUND="Nothing found, try asking differently." +COM_QUANTUMMANAGER_FIELDS_QUANTUMUNSPLASH_NOTFOUND="Nothing found, try another search request." COM_QUANTUMMANAGER_FIELDS_QUANTUMUNSPLASH_BUTTON_LOAD="Load more" COM_QUANTUMMANAGER_FIELDS_QUANTUMUNSPLASH_SAVE="Save" COM_QUANTUMMANAGER_FIELDS_QUANTUMUNSPLASH_CLOSE="Close" @@ -168,8 +171,8 @@ COM_QUANTUMMANAGER_FILE_METAINFO_WIDTH="Width" COM_QUANTUMMANAGER_FILE_METAINFO_HEIGHT="Height" COM_QUANTUMMANAGER_FILE_METAINFO_MIMETYPE="MIME type" COM_QUANTUMMANAGER_FILE_METAINFO_SECTIONSFOUND="Section found" -COM_QUANTUMMANAGER_FILE_METAINFO_SHOW="View all metadata" -COM_QUANTUMMANAGER_FILE_METAINFO_HIDE="Hide metadata" +COM_QUANTUMMANAGER_FILE_METAINFO_SHOW="View all Metadata" +COM_QUANTUMMANAGER_FILE_METAINFO_HIDE="Hide Metadata" COM_QUANTUMMANAGER_FILE_METAINFO_SELECT_COUNT="Selected files" COM_QUANTUMMANAGER_FILE_METAINFO_SELECT_SIZE="File size" @@ -187,4 +190,4 @@ COM_QUANTUMMANAGER_HELP_COPYRIGHT_IMAGES="Actions, file types: I. Belov | https://www.norrnext.com/docs/joomla-extensions/quantum-manager
Поддержка | Страница продукта | Отзыв на JED" COM_QUANTUMMANAGER_CONFIG_GENERAL_SCOPES_LABEL="Стандартные области" COM_QUANTUMMANAGER_CONFIG_GENERAL_SCOPES_NAME_LABEL="Название области" COM_QUANTUMMANAGER_CONFIG_GENERAL_SCOPES_ENABLE_LABEL="Включить область" COM_QUANTUMMANAGER_CONFIG_GENERAL_SCOPES_PATH_LABEL="Папка" COM_QUANTUMMANAGER_CONFIG_GENERAL_SCOPES_CUSTOM_LABEL="Свои области" COM_QUANTUMMANAGER_CONFIG_GENERAL_PATH_LABEL="Папка по умолчанию" +COM_QUANTUMMANAGER_CONFIG_GENERAL_PATH_VARIABLES_LABEL="Переменные для путей" COM_QUANTUMMANAGER_CONFIG_GENERAL_PATH_DESC="Для полей путей областей доступны переменные:
{user_id} - ID текущего пользователя
{year} - текущий год
{month} - текущий месяц
{day} - текущий день
{hours} - текущий час
{minutes} - минуты
{second} - секунды
{unix} - время UNIX в секундах

Пример использования:
images/{user_id}/{year}-{month}-{day}" COM_QUANTUMMANAGER_CONFIG_GENERAL_MAXSIZEFILENAME_LABEL="Максимальное кол-во символов в названии папок и файлов" COM_QUANTUMMANAGER_CONFIG_GENERAL_MAXSIZE_LABEL="Максимальный размер файла для загрузки
в мегабайтах" @@ -87,7 +90,7 @@ COM_QUANTUMMANAGER_FIELDS_QUANTUMVIEWFILES_EMPTY="Файлов нет." COM_QUANTUMMANAGER_FIELDS_QUANTUMVIEWFILES_BUTTON_BACK="Назад" COM_QUANTUMMANAGER_FIELDS_QUANTUMVIEWFILES_BUTTON_UP="Вверх" COM_QUANTUMMANAGER_FIELDS_QUANTUMVIEWFILES_BUTTON_UPLOAD="Загрузка" -COM_QUANTUMMANAGER_FIELDS_QUANTUMVIEWFILES_BUTTON_CREATE_DIRECTORY="Создать папку" +COM_QUANTUMMANAGER_FIELDS_QUANTUMVIEWFILES_BUTTON_CREATE_DIRECTORY="Создать" COM_QUANTUMMANAGER_FIELDS_QUANTUMVIEWFILES_BUTTON_WATERMARK="Водяной знак" COM_QUANTUMMANAGER_FIELDS_QUANTUMVIEWFILES_BUTTON_DELETE="Удалить" COM_QUANTUMMANAGER_FIELDS_QUANTUMVIEWFILES_BUTTON_EDIT="Редактировать" diff --git a/administrator/components/com_quantummanager/layouts/fields/quantumcropperjs.php b/administrator/components/com_quantummanager/layouts/fields/quantumcropperjs.php index 3b2d1ad..0dd4db2 100644 --- a/administrator/components/com_quantummanager/layouts/fields/quantumcropperjs.php +++ b/administrator/components/com_quantummanager/layouts/fields/quantumcropperjs.php @@ -54,29 +54,6 @@ -
- - -
- -
- - PX -
-
- -
- -
- - PX -
-
-
@@ -102,6 +79,7 @@
+
+ +
+ + +
+ +
+ +
+
+ +
+ +
+ + +
+
+
diff --git a/administrator/components/com_quantummanager/views/quantummanager/tmpl/content.php b/administrator/components/com_quantummanager/views/quantummanager/tmpl/content.php index 27242fc..48a21b9 100644 --- a/administrator/components/com_quantummanager/views/quantummanager/tmpl/content.php +++ b/administrator/components/com_quantummanager/views/quantummanager/tmpl/content.php @@ -33,8 +33,7 @@ HTMLHelper::_('jquery.framework'); HTMLHelper::_('script', 'com_quantummanager/modalcontent.js', [ - //'version' => filemtime(__FILE__), - 'version' => rand(111111, 999999), + 'version' => filemtime(__FILE__), 'relative' => true ]); @@ -46,7 +45,9 @@ JLoader::register('QuantummanagerHelper', JPATH_SITE . '/administrator/components/com_quantummanager/helpers/quantummanager.php'); JLoader::register('QuantummanagercontentHelper', JPATH_ROOT . '/plugins/editors-xtd/quantummanagercontent/helper.php'); + QuantummanagercontentHelper::loadLang(); $fieldsForContentPlugin = QuantummanagercontentHelper::getFieldsForScopes(); + $groups = Factory::getUser()->groups; try { @@ -125,6 +126,7 @@ catch (Exception $e) { echo $e->getMessage(); } + ?> @@ -139,7 +141,11 @@ 'buttonInsert': '', 'inputAlt': '', 'inputWidth': '', - 'inputHeight': '', + 'defaultScope': '', + 'defaultName': '', + 'defaultNameValue': '', + 'helpTemplate': '', + 'helpSettings': '', }; diff --git a/changelog.md b/changelog.md index d73b144..be957d3 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,4 @@ -1.2.1 +1.3 - [исправлено] ошибка показа метаинформации - [исправлено] ошибка запуска менеджера, если джумла в подпапке - [исправлено] ошибка что иногда не запускалось редактирование изображений @@ -10,11 +10,12 @@ - [исправлено] имена новых папок и загружаемых файлов по другому конвертируются, пример: "Привет Мир!" - получится "privet-mir" - [исправлено] переделано мультивыделение файлов, несколько выделяются областью, обычный клик это переключение файла - [исправлено] кеш превью картинок хранится теперь в папке cache и очищается при стандартной чистке кеша джумлы, папку "images/com_quantummanager" можно удалять, если такая имеется +- [новое] добавлен плагин кнопки для редактора, который позволит вставлять файлы по разным шаблонам в редактор материалов - [новое] появилась кнопка наложить водяной знак и добавлена новая настройка выбора установки знака - [новое] новая настройка, которая позволит ограничить названия файлов загрузке - [новое] в контекстное меню для папок добавлено: переименование, удаление - [новое] добавлены области, их можно настроить в настройках менеджера -- [новое] добавлена проверка на запись папки/файла +- [новое] добавлена проверка на запись папки/файла 1.2 - добавлена поддержка сервиса unsplash (фотостока) diff --git a/media/com_quantummanager/css/configfields.css b/media/com_quantummanager/css/configfields.css index 6e91e65..d18abac 100644 --- a/media/com_quantummanager/css/configfields.css +++ b/media/com_quantummanager/css/configfields.css @@ -1,3 +1,11 @@ +/** + * @package quantummanager + * @author Dmitry Tsymbal + * @copyright Copyright © 2019 Delo Design & NorrNext. All rights reserved. + * @license GNU General Public License version 3 or later; see license.txt + * @link https://www.norrnext.com + */ + .quantumconfig-quantumconfigpath-inputs { display: flex; align-items: center; diff --git a/media/com_quantummanager/css/contextual.css b/media/com_quantummanager/css/contextual.css index e6cbf6a..fa6ab4f 100644 --- a/media/com_quantummanager/css/contextual.css +++ b/media/com_quantummanager/css/contextual.css @@ -1,3 +1,11 @@ +/** + * @package quantummanager + * @author Dmitry Tsymbal + * @copyright Copyright © 2019 Delo Design & NorrNext. All rights reserved. + * @license GNU General Public License version 3 or later; see license.txt + * @link https://www.norrnext.com + */ + .contextualMenu { font-size: 13px; position: absolute; diff --git a/media/com_quantummanager/css/modal.css b/media/com_quantummanager/css/modal.css index 4239119..48333d4 100644 --- a/media/com_quantummanager/css/modal.css +++ b/media/com_quantummanager/css/modal.css @@ -19,6 +19,10 @@ body { height: 100% !important; } +#system-message-container { + padding: 0 !important; +} + .quantummanager { width: 100%; height: 100vh !important; @@ -48,6 +52,15 @@ body { padding: 10px 0; } +.modal-form-insert-footer { + display: block !important; + padding: 0 0 5px 0 !important; + text-align: center; + justify-content: center !important; + font-size: 12px; + line-height: 14px; +} + .modal-form-insert > div > input { display: inline-block; width: 29%; diff --git a/media/com_quantummanager/css/quantumcropperjs.css b/media/com_quantummanager/css/quantumcropperjs.css index a197681..76c19fb 100644 --- a/media/com_quantummanager/css/quantumcropperjs.css +++ b/media/com_quantummanager/css/quantumcropperjs.css @@ -220,6 +220,11 @@ justify-content: space-between; margin-top: 25px; } + +.input-width-height-wrap-bottom { + position: absolute; + bottom: 25px +} .quantumcropperjs-module .input-width-height-wrap > label { width: 100%; color: #cbcbcb; @@ -259,6 +264,16 @@ margin: 0; margin-right: 5px; } +.input-width-height-wrap-rows > div { + display: flex; + align-items: center; +} +.input-width-height-wrap-rows > div > label { + margin-right: 5px !important; +} +.input-width-height-wrap-rows > div label { + margin-bottom: 0 !important; +} .quantumcropperjs-module .button-wrap { margin-top: 35px; justify-content: center; diff --git a/media/com_quantummanager/css/quantumunsplash.css b/media/com_quantummanager/css/quantumunsplash.css index f0c64f5..1d0587d 100644 --- a/media/com_quantummanager/css/quantumunsplash.css +++ b/media/com_quantummanager/css/quantumunsplash.css @@ -251,7 +251,7 @@ } -@media screen and (max-width: 800px) { +@media screen and (max-width: 1425px) { .quantumunsplash-module .quantumunsplash-module-container .quantumunsplash-module-close { position: absolute; top: 8px; diff --git a/media/com_quantummanager/js/contentual.js b/media/com_quantummanager/js/contentual.js index 37c3607..67d905b 100644 --- a/media/com_quantummanager/js/contentual.js +++ b/media/com_quantummanager/js/contentual.js @@ -1,3 +1,11 @@ +/** + * @package quantummanager + * @author Dmitry Tsymbal + * @copyright Copyright © 2019 Delo Design & NorrNext. All rights reserved. + * @license GNU General Public License version 3 or later; see license.txt + * @link https://www.norrnext.com + */ + class Contextual { /** * Creates a new contextual menu diff --git a/media/com_quantummanager/js/modalcontent.js b/media/com_quantummanager/js/modalcontent.js index 9a6f6a5..ac98550 100644 --- a/media/com_quantummanager/js/modalcontent.js +++ b/media/com_quantummanager/js/modalcontent.js @@ -88,21 +88,34 @@ document.addEventListener('DOMContentLoaded', function () { oldForm.remove(); } - if(formFields[fm.data.scope] === undefined) { - return; - } - - let fields = formFields[fm.data.scope]; + let fields; + let titleScope = ''; let html = ''; let form = document.createElement('form'); form.setAttribute('class', 'modal-form-insert active'); - html = "
"; + if(formFields[fm.data.scope] !== undefined) { + fields = formFields[fm.data.scope]['fieldsform']; + titleScope = formFields[fm.data.scope]['title']; + } else { + fields = {}; + titleScope = QuantumwindowLang.defaultScope; + } + + html = ""; + html += ''; + form.innerHTML = html; fm.Quantumviewfiles.element.appendChild(form); @@ -120,20 +133,6 @@ document.addEventListener('DOMContentLoaded', function () { }); - QuantumEventsDispatcher.add('updatePath', function (fm) { - let form = fm.Quantumviewfiles.element.querySelector('.modal-form-insert'); - if(form !== null) { - form.classList.remove('active'); - } - }); - - QuantumEventsDispatcher.add('reloadPaths', function (fm) { - let form = fm.Quantumviewfiles.element.querySelector('.modal-form-insert'); - if(form !== null) { - form.classList.remove('active'); - } - }); - QuantumEventsDispatcher.add('uploadComplete', function (fm) { if(fm.Qantumupload.filesLists.length === 0) { diff --git a/media/com_quantummanager/js/modaleditor.js b/media/com_quantummanager/js/modaleditor.js index f387b19..eb0afe1 100644 --- a/media/com_quantummanager/js/modaleditor.js +++ b/media/com_quantummanager/js/modaleditor.js @@ -122,6 +122,12 @@ document.addEventListener('DOMContentLoaded', function () { if(file === undefined) { fm.Quantumtoolbar.buttonsList['insertFileEditor'].classList.add('btn-hide'); + + let form = fm.Quantumviewfiles.element.querySelector('.modal-form-insert'); + if(form !== null) { + form.classList.remove('active'); + } + return; } @@ -132,7 +138,7 @@ document.addEventListener('DOMContentLoaded', function () { if(form === null) { let html = document.createElement('div'); html.setAttribute('class', 'modal-form-insert'); - html.innerHTML = ''; + html.innerHTML = '
'; fm.Quantumviewfiles.element.appendChild(html); form = html; } @@ -152,6 +158,8 @@ document.addEventListener('DOMContentLoaded', function () { }); QuantumEventsDispatcher.add('updatePath', function (fm) { + fm.Quantumtoolbar.buttonsList['insertFileEditor'].classList.add('btn-hide'); + let form = fm.Quantumviewfiles.element.querySelector('.modal-form-insert'); if(form !== null) { form.classList.remove('active'); @@ -159,6 +167,8 @@ document.addEventListener('DOMContentLoaded', function () { }); QuantumEventsDispatcher.add('reloadPaths', function (fm) { + fm.Quantumtoolbar.buttonsList['insertFileEditor'].classList.add('btn-hide'); + let form = fm.Quantumviewfiles.element.querySelector('.modal-form-insert'); if(form !== null) { form.classList.remove('active'); @@ -178,14 +188,6 @@ document.addEventListener('DOMContentLoaded', function () { fm.Quantumtoolbar.buttonsList['insertFileEditor'].classList.remove('btn-hide'); }); - QuantumEventsDispatcher.add('reloadPaths', function (fm) { - fm.Quantumtoolbar.buttonsList['insertFileEditor'].classList.add('btn-hide'); - }); - - QuantumEventsDispatcher.add('updatePath', function (fm) { - fm.Quantumtoolbar.buttonsList['insertFileEditor'].classList.add('btn-hide'); - }); - function getUrlParameter(name) { name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]'); let regex = new RegExp('[\\?&]' + name + '=([^&#]*)'); diff --git a/media/com_quantummanager/js/quantumcropperjs.js b/media/com_quantummanager/js/quantumcropperjs.js index 5bce75d..2c36484 100644 --- a/media/com_quantummanager/js/quantumcropperjs.js +++ b/media/com_quantummanager/js/quantumcropperjs.js @@ -95,8 +95,8 @@ window.Quantumcropperjs = function(Filemanager, QuantumCropperjsElement, options self.changeCropperJS(); }, crop: function(event) { - self.CropWidthValue.value = Math.round(parseFloat(event.detail.width)); - self.CropHeightValue.value = Math.round(parseFloat(event.detail.height)); + self.CropWidthValue.innerHTML = Math.round(parseFloat(event.detail.width)); + self.CropHeightValue.innerHTML = Math.round(parseFloat(event.detail.height)); self.CropWidthValue.setAttribute('data-old', parseFloat(event.detail.width)); self.CropHeightValue.setAttribute('data-old', parseFloat(event.detail.height)); } @@ -154,12 +154,6 @@ window.Quantumcropperjs = function(Filemanager, QuantumCropperjsElement, options self.changeCropperJS(); }); - self.CropWidthValue.addEventListener('change', function () { - //let canvasCropData = self.cropperjs.getCropBoxData(); - //canvasCropData.width = parseInt(this.value); - //self.cropperjs.setCropBoxData(canvasCropData); - //console.log(this.value); - }); Filemanager.Quantumtoolbar.buttonAdd('cropperjsEdit', 'center', 'file-actions', 'btn-edit btn-hide hidden-label', QuantumviewfilesLang.buttonEdit, 'quantummanager-icon-edit', {}, function (ev) { self.startCropperjs(); diff --git a/media/com_quantummanager/js/quantumunsplash.js b/media/com_quantummanager/js/quantumunsplash.js index 0ed8808..102676f 100644 --- a/media/com_quantummanager/js/quantumunsplash.js +++ b/media/com_quantummanager/js/quantumunsplash.js @@ -1,10 +1,9 @@ /** * @package quantummanager - * - * @author Cymbal - * @copyright Copyright (C) 2019 "Delo Design". All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE.txt - * @link https://delo-design.ru + * @author Dmitry Tsymbal + * @copyright Copyright © 2019 Delo Design & NorrNext. All rights reserved. + * @license GNU General Public License version 3 or later; see license.txt + * @link https://www.norrnext.com */ window.Quantumunsplash = function(Filemanager, QuantumUnsplashElement, options) { diff --git a/media/com_quantummanager/js/quantumviewfiles.js b/media/com_quantummanager/js/quantumviewfiles.js index e93be6b..629d532 100644 --- a/media/com_quantummanager/js/quantumviewfiles.js +++ b/media/com_quantummanager/js/quantumviewfiles.js @@ -74,11 +74,16 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) { tip: '', icon: QuantumUtils.getFullUrl('/media/com_quantummanager/images/icons/action/rubbish-bin-delete-button.svg'), onClick: function() { - let directories = []; - directories.push(self.directoryContext.querySelector('.directory-name').innerHTML); - jQuery.get(QuantumUtils.getFullUrl("/administrator/index.php?option=com_quantummanager&task=quantumviewfiles.delete&path=" + encodeURIComponent(Filemanager.data.path) + '&scope=' + encodeURIComponent(Filemanager.data.scope) + '&list=' + encodeURIComponent(JSON.stringify(directories)))).done(function (response) { - Filemanager.events.trigger('reloadPaths', Filemanager); + let nameDirectory = self.directoryContext.querySelector('.directory-name').innerHTML; + + QuantumUtils.confirm(QuantumtreecatalogsLang.confirmDelete + ' ' + nameDirectory + '?', function (result) { + let directories = []; + directories.push(nameDirectory); + jQuery.get(QuantumUtils.getFullUrl("/administrator/index.php?option=com_quantummanager&task=quantumviewfiles.delete&path=" + encodeURIComponent(Filemanager.data.path) + '&scope=' + encodeURIComponent(Filemanager.data.scope) + '&list=' + encodeURIComponent(JSON.stringify(directories)))).done(function (response) { + Filemanager.events.trigger('reloadPaths', Filemanager); + }); }); + } }, ]; @@ -258,6 +263,7 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) { Filemanager.events.trigger('reloadPaths', Filemanager); }); + Filemanager.Quantumviewfiles.showMetaDirectory(true); Filemanager.Quantumtoolbar.buttonsList['viewfilesDelete'].classList.add('btn-hide'); Filemanager.Quantumtoolbar.trigger('buttonViewfilesDelete'); ev.preventDefault(); @@ -585,9 +591,6 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) { if (!ev.target.classList.contains('ds-selectable')) { self.dsP = new Promise((resolve, reject) => { self.ds.clearSelection(); - /*setTimeout(function () { - self.showMetaDirectory(); - }, 150);*/ resolve(); }); } @@ -642,11 +645,15 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) { }; this.getCountSelected = function () { - //return this.ds.getSelection().length; - return this.ds.getSelection().length; + + if(this.ds !== undefined) { + return this.ds.getSelection().length; + } + + return 0; }; - this.selectFile = function (element, qvf) { + this.selectFile = function (element, triggerFlag) { let self = this; let tmpInput = element.closest('.file-item').querySelector('.import-files-check-file'); tmpInput.checked = true; @@ -659,6 +666,11 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) { self.showMetaFile(element); } + if(triggerFlag !== null && triggerFlag === true) { + self.file = element; + self.trigger('clickFile', self); + } + }; this.unSelectFile = function (element, qvf) { @@ -677,8 +689,8 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) { } } else { - self.metaReset = true; - self.showMetaDirectory(); + //self.metaReset = true; + //self.showMetaDirectory(); } }; @@ -804,6 +816,10 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) { if(self.options.metafile === '1') { + if(!cacheReset && self.getCountSelected() >= 1) { + return; + } + if(cacheReset === null || cacheReset === undefined || cacheReset === false) { if(self.path === self.cacheMetaPath) { @@ -836,6 +852,7 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) { self.metaLoadDirCurrent = Filemanager.data.scope + '/' +self.path; jQuery.get(QuantumUtils.getFullUrl("/administrator/index.php?option=com_quantummanager&task=quantumviewfiles.getMetaFile&path=" + encodeURIComponent(self.path) + "&scope=" + encodeURIComponent(Filemanager.data.scope))).done(function (response) { + response = JSON.parse(response); if(response.global !== undefined || response.find !== undefined) { self.viewMeta.classList.remove('hidden'); @@ -866,25 +883,29 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) { } html += '
'; - self.viewMeta.querySelector('.meta-file-list').innerHTML = html; + self.cacheMeta = html; self.cacheMetaPath = self.path; self.metaLoadDirCurrent = ''; - let buttonToggleTags = self.viewMeta.querySelector('.show-all-tags'); - if(buttonToggleTags !== null) { - let metaFind = self.viewMeta.querySelector('.meta-find'); - buttonToggleTags.addEventListener('click', function () { - if(this.classList.contains('active')) { - this.classList.remove('active'); - this.innerHTML = QuantumviewfilesLang.metaFileShow; - metaFind.classList.add('meta-hidden'); - } else { - this.classList.add('active'); - this.innerHTML = QuantumviewfilesLang.metaFileHide; - metaFind.classList.remove('meta-hidden'); - } - }); + if(self.getCountSelected() === 0) { + self.viewMeta.querySelector('.meta-file-list').innerHTML = html; + let buttonToggleTags = self.viewMeta.querySelector('.show-all-tags'); + + if(buttonToggleTags !== null) { + let metaFind = self.viewMeta.querySelector('.meta-find'); + buttonToggleTags.addEventListener('click', function () { + if(this.classList.contains('active')) { + this.classList.remove('active'); + this.innerHTML = QuantumviewfilesLang.metaFileShow; + metaFind.classList.add('meta-hidden'); + } else { + this.classList.add('active'); + this.innerHTML = QuantumviewfilesLang.metaFileHide; + metaFind.classList.remove('meta-hidden'); + } + }); + } } } else { @@ -898,12 +919,13 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) { let self = this; if(self.options.metafile === '1') { + let filesAll = self.ds.getSelection(); let size = 0; let imgs = ''; let exsImage = ['jpg', 'png', 'svg', 'jpeg', 'gif']; - for (let i = filesAll.length - 1; i > 0; i--) { + for (let i = filesAll.length - 1; i >= 0; i--) { let input = filesAll[i].querySelector('.import-files-check-file'); if (input.checked) { let dataExs = filesAll[i].getAttribute('data-exs').toLocaleLowerCase(); @@ -928,6 +950,7 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) { self.viewMeta.classList.remove('hidden'); self.viewMeta.querySelector('.meta-file-list').innerHTML = html; + } }; @@ -1303,6 +1326,19 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) { }; Filemanager.events.add(this, 'clickFile', function (fm, el) { + let file = fm.Quantumviewfiles.file; + let exs = ''; + + if(file === undefined) { + + if(fm.Quantumtoolbar !== undefined && fm.Quantumtoolbar.buttonsList['viewfilesWatermark'] !== undefined) { + fm.Quantumtoolbar.buttonsList['viewfilesWatermark'].classList.add('btn-hide'); + } + + } else { + exs = file.getAttribute('data-exs').toLocaleLowerCase(); + } + let filesAll = el.element.querySelectorAll('.field-list-files .file-item'); let find = false; @@ -1312,11 +1348,13 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) { } } - if(find) { + if(['png', 'jpg', 'jpeg'].indexOf(exs) !== -1) { if(fm.Quantumtoolbar !== undefined && fm.Quantumtoolbar.buttonsList['viewfilesWatermark'] !== undefined) { fm.Quantumtoolbar.buttonsList['viewfilesWatermark'].classList.remove('btn-hide'); } + } + if(find) { if(fm.Quantumtoolbar !== undefined && fm.Quantumtoolbar.buttonsList['viewfilesDelete'] !== undefined) { fm.Quantumtoolbar.buttonsList['viewfilesDelete'].classList.remove('btn-hide'); } @@ -1430,13 +1468,18 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) { for(let i=0;i 1) { + self.showMetaCountFile(countSelected); + } + + if(countSelected) { fm.Quantumtoolbar.buttonsList['viewfilesDelete'].classList.remove('btn-hide'); } else { fm.Quantumtoolbar.buttonsList['viewfilesDelete'].classList.add('btn-hide'); diff --git a/quantummanager.xml b/quantummanager.xml index beacc61..6ca351b 100644 --- a/quantummanager.xml +++ b/quantummanager.xml @@ -7,7 +7,7 @@ https://www.norrnext.com Copyright © 2019 Delo Design & NorrNext. All rights reserved. GNU General Public License version 3 or later; see license.txt - 1.2 + 1.3 COM_QUANTUMMANAGER_XML_DESCRIPTION script.php