Skip to content

Commit

Permalink
Исправление ошибок для версии 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitriitux committed Nov 19, 2018
1 parent 5865527 commit c56e28c
Show file tree
Hide file tree
Showing 6 changed files with 132 additions and 34 deletions.
2 changes: 1 addition & 1 deletion elements/tmpl/upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<?php $id = rand(11111, 99999)?>
<div class="drop-area">
<form class="my-form">
<form class="form-upload">
<input type="hidden" class="pathElem" name="path">
<p><?= \Joomla\CMS\Language\Text::_("PLG_RADICAL_MULTI_FIELD_FIELD_IMPORT_MODAL_UPLOAD_DROP") ?></p>
<label class="button" for="fileElem-<?= $id ?>"><?= \Joomla\CMS\Language\Text::_("PLG_RADICAL_MULTI_FIELD_FIELD_IMPORT_MODAL_UPLOAD_SELECT") ?></label>
Expand Down
66 changes: 65 additions & 1 deletion media/core/css/tree.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -32,6 +46,8 @@
}
.av-modal-actions button {
margin-right: 5px;
padding: 2px 10px;
font-size: 12px;
}
.av-modal-actions .search {
display: inline-block;
Expand Down Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion media/core/css/upload.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
.drop-area.highlight {
border-color: #d8d7d8;
}
.drop-area .my-form {
.drop-area .form-upload {
margin-bottom: 10px;
text-align: center;
}
Expand Down
30 changes: 27 additions & 3 deletions media/core/js/import.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 'Нет';
Expand All @@ -52,16 +53,30 @@ 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');
}

});


jQuery('.modal-import-file').on('click', '.av-folderlist-tree', 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');
Expand Down Expand Up @@ -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);

});
Expand Down Expand Up @@ -414,6 +432,7 @@ jQuery(function(){
countFiles--;

if(countFiles === 0) {
modal.removeClass('modal-speed-upload');
progressBar.style.display = "none";
}

Expand All @@ -429,6 +448,7 @@ jQuery(function(){
countFiles--;

if(countFiles === 0) {
modal.removeClass('modal-speed-upload');
progressBar.style.display = "none";
}

Expand Down Expand Up @@ -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";

Expand All @@ -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";

Expand All @@ -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({
Expand Down Expand Up @@ -550,7 +574,7 @@ jQuery(function(){
});
});

jQuery(modalName).modal('toggle');
jQuery(modalName).modal('hide');

return false;
});
Expand Down
36 changes: 26 additions & 10 deletions media/core/js/subform-repetable-cards.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}

Expand All @@ -47,32 +46,49 @@ 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');
}
}
}


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) {
Expand Down
30 changes: 12 additions & 18 deletions radicalmultifield.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit c56e28c

Please sign in to comment.