";
+ if(formFields[fm.data.scope] !== undefined) {
+ fields = formFields[fm.data.scope]['fieldsform'];
+ titleScope = formFields[fm.data.scope]['title'];
+ } else {
+ fields = {};
+ titleScope = QuantumwindowLang.defaultScope;
+ }
+
+ html = "
";
- for(let i in fields) {
- html += '';
+ if(Object.keys(fields).length > 0) {
+ for(let i in fields) {
+ html += '';
+ }
+ } else {
+ html += '';
}
+
+
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