Skip to content

Commit

Permalink
Версия 1.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitriitux committed Jun 29, 2019
1 parent f13af53 commit 95ede62
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ protected function getLayoutData()
'directory' => $this->directory,
'onlyfiles' => $this->onlyfiles,
'metafile' => $this->metafile,
'hash' => md5(QuantummanagerHelper::preparePath($this->directory)),
'cssClass' => $this->cssClass,
]
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
$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'] ?>;metafile:<?php echo $displayData['metafile'] ?>">
<div class="quantummanager-module quantumviewfiles-module" data-type="Quantumviewfiles" data-options="hash:<?php echo $displayData['hash'] ?>;directory:<?php echo $displayData['directory'] ?>;onlyfiles:<?php echo $displayData['onlyfiles'] ?>;metafile:<?php echo $displayData['metafile'] ?>">
<div class="quantumviewfiles-module-heading">
<div class="breadcumbs"></div>
<div class="filter-search">
Expand Down
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
1.1.2
- убрана ошибка при запоминании каталога и его открытия
- метатеги закрываются, если файл больше не выделен
- после загрузки файла, если включены метатеги, то сразу показывается теги загруженного файла

1.1
- убрана папка com_quantummanager из images (это папка кеша менеджера)
- в cropperjs модуле PX переведены в нижний регистр
Expand Down
22 changes: 17 additions & 5 deletions media/com_quantummanager/css/quantumviewfiles.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,21 @@

.quantumviewfiles-module {
position: relative;
/*height: 80%;*/
display: flex;
flex-wrap: wrap;
-webkit-flex-wrap: wrap;
flex-direction: column;
-webkit-flex-direction: column;
flex: 1 1 auto;
-webkit-flex: 1 1 auto;
}
.quantumviewfiles-module .quantumviewfiles-module-heading {
display: flex;
margin-top: 5px;
margin-bottom: 10px;
}
.quantumviewfiles-module .filters {
display: flex;
display: none;
margin-top: 8px;
margin-bottom: 8px;
width: 100%;
Expand Down Expand Up @@ -62,7 +64,6 @@
}
.quantumviewfiles-module .filter-search svg {
max-width: 100%;
height: auto;
box-sizing: border-box;
width: 16px;
height: 16px;
Expand Down Expand Up @@ -189,17 +190,18 @@
transition: display 0.2s ease;
}
.quantumviewfiles-module .view-wrap {
flex: 2;
width: 100%;
display: flex;
flex: 1 1 auto;
-webkit-flex: 1 1 auto;
}
.quantumviewfiles-module .view {
position: relative;
height: 100%;
width: 100%;
}
.quantumviewfiles-module .meta-file ~ .view {
width: 80% ;
width: 80%;
}
.quantumviewfiles-module .meta-file {
position: relative;
Expand Down Expand Up @@ -259,6 +261,7 @@
}
.quantumviewfiles-module .field-list-files {
width: 100%;
height: 100%;
position: absolute;
top: 0;
bottom: 0;
Expand Down Expand Up @@ -632,4 +635,13 @@
object-fit: contain;
object-position: center;
}
}

@media screen and (max-width: 768px) {
.quantumviewfiles-module-heading {
flex-wrap: wrap;
}
.quantumviewfiles-module-heading > * {
width: 100%;
}
}
71 changes: 49 additions & 22 deletions media/com_quantummanager/js/quantumviewfiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) {
let self = this;
this.path = this.options.directory;
let openLastDir = localStorage.getItem('quantummanagerLastDir');
let openLastDirHash = localStorage.getItem('quantummanagerLastDirHash');
if(openLastDir !== null)
{
this.path = openLastDir;
if(openLastDirHash === this.options.hash) {
this.path = openLastDir;
}
}

this.loadDirectory();
Expand Down Expand Up @@ -186,8 +189,8 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) {
htmlfilesAndDirectories = "<div class='empty'><div>" + QuantumviewfilesLang.empty + "</div></div>";
}

ViewfilesElement.querySelector('.view').innerHTML = '';
ViewfilesElement.querySelector('.view').innerHTML = htmlfilesAndDirectories;
ViewfilesElement.querySelector('.view-wrap .view').innerHTML = '';
ViewfilesElement.querySelector('.view-wrap .view').innerHTML = htmlfilesAndDirectories;
self.reloadTypeViewFiles(path);
self.listFiles = ViewfilesElement.querySelector('.field-list-files');

Expand Down Expand Up @@ -230,6 +233,7 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) {

if(localStorage !== undefined) {
localStorage.setItem('quantummanagerLastDir', Filemanager.data.path);
localStorage.setItem('quantummanagerLastDirHash', self.options.hash);
}

self.directory = this;
Expand Down Expand Up @@ -261,8 +265,36 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) {
qvf.file = element;
qvf.trigger('clickFile', element);

if(tmpInput.checked) {
self.showMetaFile(element);
} else {
self.hideMetaFile();
}

};

this.fileDblclick = function (element, qvf) {
qvf.trigger('dblclickFile', element);
};

this.preoloader = function () {
ViewfilesElement.querySelector('.view').innerHTML = "<div class=\"loader\">" + QuantumviewfilesLang.loading + "<span></span><span></span><span></span><span></span></div>";
};

this.hideMetaFile = function () {
let self = this;

if(self.options.metafile === '1') {
self.viewMeta.classList.add('hidden');
}

};

this.showMetaFile = function (element) {
let self = this;

if(self.options.metafile === '1') {
jQuery.get("/administrator/index.php?option=com_quantummanager&task=quantumviewfiles.getMetaFile&path=" + encodeURIComponent(qvf.path) + '&name=' + encodeURIComponent(element.getAttribute('data-file'))).done(function (response) {
jQuery.get("/administrator/index.php?option=com_quantummanager&task=quantumviewfiles.getMetaFile&path=" + encodeURIComponent(self.path) + '&name=' + encodeURIComponent(element.getAttribute('data-file'))).done(function (response) {
response = JSON.parse(response);
if(response.global !== undefined || response.find !== undefined) {
self.viewMeta.classList.remove('hidden');
Expand Down Expand Up @@ -294,15 +326,15 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) {
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(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');
}
});
}

Expand All @@ -311,15 +343,6 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) {
}
});
}

};

this.fileDblclick = function (element, qvf) {
qvf.trigger('dblclickFile', element);
};

this.preoloader = function () {
ViewfilesElement.querySelector('.view').innerHTML = "<div class=\"loader\">" + QuantumviewfilesLang.loading + "<span></span><span></span><span></span><span></span></div>";
};

this.searchByName = function (search) {
Expand Down Expand Up @@ -466,6 +489,7 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) {

if(localStorage !== undefined) {
localStorage.setItem('quantummanagerLastDir', fm.data.path);
localStorage.setItem('quantummanagerLastDirHash', self.options.hash);
}

self.trigger('updatePath');
Expand Down Expand Up @@ -758,14 +782,17 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) {

let filesAll = el.element.querySelectorAll('.field-list-files .file-item');
let find = false;
let element;

for(let i=0;i<filesAll.length;i++) {
if (filesAll[i].querySelector('input').checked) {
element = filesAll[i];
find = true;
}
}

if(find) {
fm.Quantumviewfiles.showMetaFile(element);
fm.Quantumtoolbar.buttonsList['viewfilesDelete'].classList.remove('btn-hide');
} else {
fm.Quantumtoolbar.buttonsList['viewfilesDelete'].classList.add('btn-hide');
Expand Down
2 changes: 1 addition & 1 deletion quantummanager.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<authorUrl>https://delo-design.ru</authorUrl>
<copyright>Copyright (C) 2019 "Delo Design". All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<version>1.1</version>
<version>1.1.2</version>
<description>COM_QUANTUMMANAGER_XML_DESCRIPTION</description>

<scriptfile>script.php</scriptfile>
Expand Down

0 comments on commit 95ede62

Please sign in to comment.