diff --git a/elements/tmpl/upload.php b/elements/tmpl/upload.php index b4710dc..7024378 100644 --- a/elements/tmpl/upload.php +++ b/elements/tmpl/upload.php @@ -2,7 +2,7 @@
-
+

diff --git a/media/core/css/tree.css b/media/core/css/tree.css index 481713b..c775437 100644 --- a/media/core/css/tree.css +++ b/media/core/css/tree.css @@ -3,13 +3,27 @@ } .modal.modal-import-file { + position: fixed; width: 50%; - left: 65%; + max-height: 100%; + left: 50%; + margin-left: -25%; } + .modal.modal-import-file .modal-body { overflow: hidden; } +@media screen and (max-width: 1500px){ + + .modal.modal-import-file { + width: 70%; + left: 70%; + margin-left: -35%; + } + +} + .av-modal { position: relative; padding: 5px 0 20px 20px; @@ -32,6 +46,8 @@ } .av-modal-actions button { margin-right: 5px; + padding: 2px 10px; + font-size: 12px; } .av-modal-actions .search { display: inline-block; @@ -495,3 +511,51 @@ border-radius: 0; font: inherit; } + +.modal-import-file .modal-footer button { + padding: 7px 13px; + font-size: 13px; +} + +.modal-speed-upload { + display: block !important; + top: 5% !important; + left: 0 !important; + position: relative !important; + margin: 0 !important; + margin-top: 10px; + z-index: 1 !important; + opacity: 1 !important; + border: none !important; + box-shadow: none !important; + background: transparent; +} + +.modal-speed-upload .modal-header, +.modal-speed-upload .field-wrapper, +.modal-speed-upload .field-list-files .list, +.modal-speed-upload .modal-footer { + display: none; +} + +.modal-speed-upload .field-list-files { + width: 100% !important; + padding-left: 0 !important; +} + +.modal-speed-upload .drop-area { + padding-left: 0 !important; + margin-bottom: 15px !important; + border: none !important; + box-shadow: none !important; +} + +.modal-speed-upload .drop-area input, +.modal-speed-upload .drop-area label, +.modal-speed-upload .drop-area p { + display: none; +} + +.modal-speed-upload .drop-area progress{ + display: block; +} diff --git a/media/core/css/upload.css b/media/core/css/upload.css index 0eefe52..834da10 100644 --- a/media/core/css/upload.css +++ b/media/core/css/upload.css @@ -9,7 +9,7 @@ .drop-area.highlight { border-color: #d8d7d8; } -.drop-area .my-form { +.drop-area .form-upload { margin-bottom: 10px; text-align: center; } diff --git a/media/core/js/import.js b/media/core/js/import.js index d8f0364..13c6dae 100644 --- a/media/core/js/import.js +++ b/media/core/js/import.js @@ -29,6 +29,7 @@ jQuery(function(){ let progressBar; let uploadI = []; let speedUpload = false; + let speedUploadComplete = false; vex.defaultOptions.className = 'vex-theme-plain'; vex.dialog.buttons.YES.text = 'Ок'; vex.dialog.buttons.NO.text = 'Нет'; @@ -52,9 +53,22 @@ jQuery(function(){ inputPath = document.querySelector(modalName + " .pathElem"); inputFile = document.querySelector(modalName + " .fileElem"); errorsWrap = document.querySelector(modalName + " .upload-errors"); - speedUpload = false; reloadListfullpath(); openDirectoryAndActive(active, 'root'); + modal.removeClass('modal-speed-upload'); + progressBar.style.display = "none"; + + if(speedUpload) { + //окно не показываем + speedUpload = false; + speedUploadComplete = false; + modal.hide(); + modal.addClass('modal-speed-upload'); + return false; + } else { + modal.removeClass('modal-speed-upload'); + } + }); @@ -62,6 +76,7 @@ jQuery(function(){ jQuery(this).parent().toggleClass('open'); }); + jQuery('.modal-import-file').on('click', '.av-folderlist-label', function() { let modal = jQuery(this).closest('.modal-import-file'); let listfiles = modal.find('.field-list-files .list'); @@ -104,10 +119,13 @@ jQuery(function(){ } setTimeout(function () { - if(speedUpload) { + + if(speedUploadComplete && modal.hasClass('modal-speed-upload')) { speedUpload = false; + speedUploadComplete = false; jQuery(modalName + ' .button-import-start').click(); } + }, 200); }); @@ -414,6 +432,7 @@ jQuery(function(){ countFiles--; if(countFiles === 0) { + modal.removeClass('modal-speed-upload'); progressBar.style.display = "none"; } @@ -429,6 +448,7 @@ jQuery(function(){ countFiles--; if(countFiles === 0) { + modal.removeClass('modal-speed-upload'); progressBar.style.display = "none"; } @@ -465,6 +485,7 @@ jQuery(function(){ uploadI.push((i + 1)); if(countFiles === uploadI.length) { + speedUploadComplete = true; active.find('.av-folderlist-label[path="' + inputPath.value + '"]').click(); progressBar.style.display = "none"; @@ -481,6 +502,7 @@ jQuery(function(){ uploadI.push((i + 1)); if(countFiles === uploadI.length) { + speedUploadComplete = true; active.find('.av-folderlist-label[path="' + inputPath.value + '"]').click(); progressBar.style.display = "none"; @@ -503,6 +525,8 @@ jQuery(function(){ jQuery('.button-import-start').on('click', function () { + modal.removeClass('modal-speed-upload'); + if(activeLists.length === 0) { vex.dialog.alert({ @@ -550,7 +574,7 @@ jQuery(function(){ }); }); - jQuery(modalName).modal('toggle'); + jQuery(modalName).modal('hide'); return false; }); diff --git a/media/core/js/subform-repetable-cards.js b/media/core/js/subform-repetable-cards.js index a309760..d51671b 100644 --- a/media/core/js/subform-repetable-cards.js +++ b/media/core/js/subform-repetable-cards.js @@ -20,7 +20,6 @@ jQuery(document).ready(function(){ function generateTile(el, i) { if(i === null || i === undefined) { - console.log(jQuery(el).attr('data-i')); i = parseInt(jQuery(el).attr('data-i')); } @@ -47,8 +46,9 @@ jQuery(document).ready(function(){ image = '/' + image; } - tile.find('.subform-card-tile-background').css('background', 'linear-gradient(0deg,rgba(0,0,0,0.6),rgba(0,0,0,0.7)),url(' + image + ') no-repeat 0 0 fixed'); + tile.find('.subform-card-tile-background').css('background', 'linear-gradient(0deg,rgba(0,0,0,0.6),rgba(0,0,0,0.7)),url(' + image + ') no-repeat 50% 50%'); tile.find('.subform-card-tile-background').css('color', '#fff'); + tile.find('.subform-card-tile-background').css('background-size', 'auto'); } } } @@ -56,23 +56,39 @@ jQuery(document).ready(function(){ jQuery('body').on('mousemove', '.subform-card-tile-background', function (e) { - console.log(e.pageX); + let x = parseFloat(jQuery(this).attr('data-x')); + let y = parseFloat(jQuery(this).attr('data-y')); + let oldX = parseFloat(jQuery(this).attr('data-oldX')); + let oldY = parseFloat(jQuery(this).attr('data-oldY')); - let x = jQuery(this).attr('data-x'); - let y = jQuery(this).attr('data-y'); + if(x === undefined || isNaN(x)) { + x = 50; + } + + if(y === undefined || isNaN(y)) { + y = 50; + } - if(x === undefined) { - x = 0; + if(oldX === undefined || isNaN(oldX)) { + oldX = e.pageX; } - if(y === undefined) { - y = 0; + if(oldY === undefined || isNaN(oldY)) { + oldY = e.pageY; } + x = x + ((e.pageX - oldX)/5); + y = y + ((e.pageY - oldY)/5); + + oldX = e.pageX; + oldY = e.pageY; + jQuery(this).attr('data-x', x); jQuery(this).attr('data-y', y); + jQuery(this).attr('data-oldX', oldX); + jQuery(this).attr('data-oldY', oldY); - jQuery(this).css('background-position', x + 'px ' + y + 'px'); + jQuery(this).css('background-position', x + '% ' + y + '%'); }); jQuery('body').on('click', '.subform-card-tile', function (e) { diff --git a/radicalmultifield.php b/radicalmultifield.php index 220dbeb..c00a1d2 100644 --- a/radicalmultifield.php +++ b/radicalmultifield.php @@ -108,30 +108,24 @@ public function onCustomFieldsGetTypes() $types[] = $data; - if(file_exists(JPATH_ROOT . '/plugins/radicalmultifield')) - { - - $directories = Folder::folders(JPATH_ROOT . '/plugins/radicalmultifield'); - if(count($directories) > 0) - { - - foreach ($directories as $directory) - { - Factory::getLanguage()->load('plg_radicalmultifield_' . $directory, JPATH_ROOT . '/plugins/radicalmultifield/' . $directory, null, true); + PluginHelper::importPlugin('radicalmultifield'); + $radicalmultifieldPlugins = PluginHelper::getPlugin('radicalmultifield'); + $language = Factory::getLanguage(); - $types[] = [ - 'type' => 'radicalmultifield_' . $directory, - 'label' => 'Radical MultiField ' . Text::_('PLG_RADICALMULTIFIELD_PLUGIN_NAME_' . mb_strtoupper($directory)), - 'path' => JPATH_ROOT . '/plugins/radicalmultifield/' . $directory, - ]; - - } + foreach ($radicalmultifieldPlugins as $radicalmultifieldPlugin) + { + $language->load('plg_radicalmultifield_' . $radicalmultifieldPlugin->name, JPATH_ROOT . '/plugins/radicalmultifield/' . $radicalmultifieldPlugin->name, $language->getTag(), true); - } + $types[] = [ + 'type' => 'radicalmultifield_' . $radicalmultifieldPlugin->name, + 'label' => 'Radical MultiField ' . Text::_('PLG_RADICALMULTIFIELD_PLUGIN_NAME_' . mb_strtoupper($radicalmultifieldPlugin->name)), + 'path' => JPATH_ROOT . '/plugins/radicalmultifield/' . $radicalmultifieldPlugin->name, + ]; } + // Add to cache and return the data $types_cache[ $this->_type . $this->_name ] = $types;