Skip to content

Commit

Permalink
Версия 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitriitux committed Jun 1, 2019
1 parent 978debb commit 27094bb
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ COM_QUANTUMMANAGER_FIELDS_QUANTUMVIEWFILES_BUTTON_TABLE="Table"
COM_QUANTUMMANAGER_FIELDS_QUANTUMVIEWFILES_BUTTON_GRID="Grid"
COM_QUANTUMMANAGER_FIELDS_QUANTUMVIEWFILES_DIRECTORY_NAME="Enter the directory name"
COM_QUANTUMMANAGER_FIELDS_QUANTUMVIEWFILES_CHANGE_GRID_VIEWS="Click again to switch the grid to another"
COM_QUANTUMMANAGER_FIELDS_QUANTUMVIEWFILES_FILTER_NAME="Search by name"

COM_QUANTUMMANAGER_FIELDS_QUANTUMTREECATALOGS_CONFIRM_DELETE="Delete folder?"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ COM_QUANTUMMANAGER_FIELDS_QUANTUMVIEWFILES_BUTTON_TABLE="Table"
COM_QUANTUMMANAGER_FIELDS_QUANTUMVIEWFILES_BUTTON_GRID="Grid"
COM_QUANTUMMANAGER_FIELDS_QUANTUMVIEWFILES_DIRECTORY_NAME="Enter the directory name"
COM_QUANTUMMANAGER_FIELDS_QUANTUMVIEWFILES_CHANGE_GRID_VIEWS="Click again to switch the grid to another"
COM_QUANTUMMANAGER_FIELDS_QUANTUMVIEWFILES_FILTER_NAME="Search by name"

COM_QUANTUMMANAGER_FIELDS_QUANTUMTREECATALOGS_CONFIRM_DELETE="Delete folder?"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ COM_QUANTUMMANAGER_FIELDS_QUANTUMVIEWFILES_BUTTON_TABLE="Таблицей"
COM_QUANTUMMANAGER_FIELDS_QUANTUMVIEWFILES_BUTTON_GRID="Сеткой"
COM_QUANTUMMANAGER_FIELDS_QUANTUMVIEWFILES_DIRECTORY_NAME="Введите название директории"
COM_QUANTUMMANAGER_FIELDS_QUANTUMVIEWFILES_CHANGE_GRID_VIEWS="Нажмите еще раз, чтобы переключить сетку на другую"
COM_QUANTUMMANAGER_FIELDS_QUANTUMVIEWFILES_FILTER_NAME="Поиск по названию"

COM_QUANTUMMANAGER_FIELDS_QUANTUMTREECATALOGS_CONFIRM_DELETE="Удалить папку?"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ COM_QUANTUMMANAGER_FIELDS_QUANTUMVIEWFILES_BUTTON_TABLE="Таблицей"
COM_QUANTUMMANAGER_FIELDS_QUANTUMVIEWFILES_BUTTON_GRID="Сеткой"
COM_QUANTUMMANAGER_FIELDS_QUANTUMVIEWFILES_DIRECTORY_NAME="Введите название директории"
COM_QUANTUMMANAGER_FIELDS_QUANTUMVIEWFILES_CHANGE_GRID_VIEWS="Нажмите еще раз, чтобы переключить сетку на другую"
COM_QUANTUMMANAGER_FIELDS_QUANTUMVIEWFILES_FILTER_NAME="Поиск по названию"

COM_QUANTUMMANAGER_FIELDS_QUANTUMTREECATALOGS_CONFIRM_DELETE="Удалить папку?"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@
defined('JPATH_PLATFORM') or die;
use Joomla\CMS\Language\Text;
extract($displayData);
$id = rand(111111, 999999);
?>

<div class="quantummanager-module quantumviewfiles-module" data-type="Quantumviewfiles" data-options="directory:<?php echo $displayData['directory'] ?>;onlyfiles:<?php echo $displayData['onlyfiles'] ?> ">
<div class="breadcumbs"></div>
<div class="filters">
<div>
<input type="text" name="search">
<div class="filter-search">
<label for="filter-search-<?php echo $id ?>" class="uk-form-icon uk-icon" href="#" uk-icon="icon: pencil">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" data-svg="search"><circle fill="none" stroke="#000" stroke-width="1.1" cx="9" cy="9" r="7"></circle><path fill="none" stroke="#000" stroke-width="1.1" d="M14,14 L18,18 L14,14 Z"></path></svg> </label>
<input id="filter-search-<?php echo $id ?>" type="text" name="search" placeholder="<?php echo Text::_('COM_QUANTUMMANAGER_FIELDS_QUANTUMVIEWFILES_FILTER_NAME'); ?>">
</div>
</div>
<div class="view"></div>
Expand Down
3 changes: 2 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
- картинки переведены на lazyload
- если нет превью для картинок, то при загрузке они сгенерируются на лету в lazyoad
- добавлена файлам метаинформация
- добавлена поиск по имени для файлов и каталогов текущей директории
- добавлен поиск по имени для файлов и каталогов текущей директории
- Немного доработана сетка просмотра файлов и каталогов (высота меняется от кол-во колонок)
- в cropperJS модуле убран выход за пределы изображения
- в cropperJS модуле добавлен тултип, который позволяет понять какие размеры у изображений
- в cropperJS модуле удалена вертикальная прокрутка
Empty file.
47 changes: 44 additions & 3 deletions media/com_quantummanager/css/quantumviewfiles.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
}
.quantumviewfiles-module .filters {
display: flex;
margin-top: 8px;
margin-bottom: 8px;
width: 100%;
height: auto;
Expand All @@ -32,11 +33,51 @@
.quantumviewfiles-module .filters > div:last-child {
margin-right: 0;
}
.quantumviewfiles-module .filters > div input {
.quantumviewfiles-module .filters .filter-search {
display: inline-block;
position: relative;
max-width: 100%;
vertical-align: middle;
}
.quantumviewfiles-module .filters .filter-search .uk-form-icon {
position: absolute;
top: 0;
bottom: 0;
left: 0;
width: 25px;
height: 28px;
margin: 0;
display: inline-flex;
justify-content: center;
align-items: center;
color: #999;
}
.quantumviewfiles-module .filters .filter-search .uk-icon>* {
transform: translate(0, 0);
}
.quantumviewfiles-module .filters .filter-search svg {
max-width: 100%;
height: auto;
box-sizing: border-box;
width: 16px;
height: 16px;
}
.quantumviewfiles-module .filters .filter-search input {
padding: 0 10px;
padding-left: 25px;
height: 25px;
margin: 0;
height: 14px;
line-height: 14px;
width: 200px;
vertical-align: middle;
display: inline-block;
max-width: 100%;
background: #fff;
color: #666;
border: 1px solid #e5e5e5;
transition: .2s ease-in-out;
transition-property: color,background-color,border;
}

}
.quantumviewfiles-module .breadcumbs {
margin-top: 0;
Expand Down
46 changes: 21 additions & 25 deletions media/com_quantummanager/js/quantumcropperjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,30 @@

window.Quantumcropperjs = function(Filemanager, QuantumCropperjsElement, options) {

let self = this;
this.options = options;
this.cropperjs = '';
this.buttons = '';
this.pathFile = '';
this.file = '';
this.nameFile = '';
this.ImageWidthValue = QuantumCropperjsElement.querySelector('.image-width-value');
this.ImageHeightValue = QuantumCropperjsElement.querySelector('.image-height-value');
this.CropWidthValue = QuantumCropperjsElement.querySelector('.crop-width-value');
this.CropHeightValue = QuantumCropperjsElement.querySelector('.crop-height-value');
this.defaultCropperJSOptions = {
responsive: false,
viewMode: 1,
background: true,
ready: function(event) {
self.ImageWidthValue.innerHTML = Math.round(this.width) + ' px';
self.ImageHeightValue.innerHTML = Math.round(this.height) + ' px';
},
crop: function(event) {
self.CropWidthValue.innerHTML = Math.round(event.detail.width) + ' px';
self.CropHeightValue.innerHTML = Math.round(event.detail.height) + ' px';
}
};

this.init = function () {
let self = this;
Expand All @@ -26,10 +44,6 @@ window.Quantumcropperjs = function(Filemanager, QuantumCropperjsElement, options
let fileSource;
let exs;
let name;
let ImageWidthValue = QuantumCropperjsElement.querySelector('.image-width-value');
let ImageHeightValue = QuantumCropperjsElement.querySelector('.image-height-value');
let CropWidthValue = QuantumCropperjsElement.querySelector('.crop-width-value');
let CropHeightValue = QuantumCropperjsElement.querySelector('.crop-height-value');

if(self.file === '') {
fileSource = self.nameFile;
Expand All @@ -49,21 +63,7 @@ window.Quantumcropperjs = function(Filemanager, QuantumCropperjsElement, options
image.setAttribute('src', '/' + Filemanager.data.path + '/' + fileSource + '?' + QuantumUtils.randomInteger(111111, 999999));
editor.innerHTML = '';
editor.append(image);
self.cropperjs = new Cropper(
image,
{
responsive: false,
viewMode: 1,
background: true,
ready: function(event) {
ImageWidthValue.innerHTML = Math.round(this.width) + ' px';
ImageHeightValue.innerHTML = Math.round(this.height) + ' px';
},
crop: function(event) {
CropWidthValue.innerHTML = Math.round(event.detail.width) + ' px';
CropHeightValue.innerHTML = Math.round(event.detail.height) + ' px';
}
});
self.cropperjs = new Cropper(image, self.defaultCropperJSOptions);
QuantumCropperjsElement.classList.add('active');
QuantumCropperjsElement.querySelector('.quantumcropperjs-name-file').value = name;
QuantumCropperjsElement.querySelector('.quantumcropperjs-name-exs').value = exs;
Expand Down Expand Up @@ -233,8 +233,6 @@ window.Quantumcropperjs = function(Filemanager, QuantumCropperjsElement, options
let isRadio;
let image = QuantumCropperjsElement.querySelector('.editor img');

console.log(self);

if (!self.cropperjs) {
return;
}
Expand All @@ -246,21 +244,19 @@ window.Quantumcropperjs = function(Filemanager, QuantumCropperjsElement, options
isCheckbox = target.type === 'checkbox';
isRadio = target.type === 'radio';

options = self.defaultCropperJSOptions;

if (isCheckbox || isRadio) {
if (isCheckbox) {
options[target.name] = target.checked;
cropBoxData = cropper.getCropBoxData();
canvasData = cropper.getCanvasData();

options.ready = function () {
console.log('ready');
cropper.setCropBoxData(cropBoxData).setCanvasData(canvasData);
};
} else {
options[target.name] = target.value;
options.ready = function () {
console.log('ready');
};
}
self.cropperjs.destroy();
self.cropperjs = new Cropper(image, options);
Expand Down
7 changes: 4 additions & 3 deletions media/com_quantummanager/js/quantumviewfiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -587,19 +587,20 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) {
}

if(find) {
if(fm.Quantumtoolbar !== undefined) {
if(fm.Quantumtoolbar !== undefined && fm.Quantumtoolbar.buttonsList['viewfilesDelete'] !== undefined) {
fm.Quantumtoolbar.buttonsList['viewfilesDelete'].classList.remove('btn-hide');
}
} else {
if(fm.Quantumtoolbar !== undefined) {
if(fm.Quantumtoolbar !== undefined && fm.Quantumtoolbar.buttonsList['viewfilesDelete'] !== undefined) {
fm.Quantumtoolbar.buttonsList['viewfilesDelete'].classList.add('btn-hide');
}
}
});

Filemanager.events.add(this, 'updatePath', function (fm, el) {
//вырубаем кнопки для выделенного
if(fm.Quantumtoolbar !== undefined) {

if(fm.Quantumtoolbar !== undefined && fm.Quantumtoolbar.buttonsList['viewfilesDelete'] !== undefined) {
fm.Quantumtoolbar.buttonsList['viewfilesDelete'].classList.add('btn-hide');
}

Expand Down

0 comments on commit 27094bb

Please sign in to comment.