Skip to content
This repository has been archived by the owner on May 4, 2021. It is now read-only.

add a custom CSS file for the BE-styles!? #40

Open
wants to merge 3 commits into
base: 9-0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Configuration/TypoScript/DataProcessing/setup.typoscript
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ lib.gridelements.defaultGridSetup {
}
}

plugin.tx_gridelements_pi1 >
tt_content.gridelements_pi1 >
tt_content.gridelements_pi1 < lib.gridelements.defaultGridSetup

tt_content.gridelements_view < tt_content.gridelements_pi1
Expand Down
2 changes: 0 additions & 2 deletions Configuration/TypoScript/setup.typoscript
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ lib.gridelements.defaultGridSetup {
# or tx_gridelements_view_child_123 (123 is the UID of the child)
}

plugin.tx_gridelements_pi1 >
tt_content.gridelements_pi1 >
tt_content.gridelements_pi1 = COA
tt_content.gridelements_pi1 {
#10 =< lib.stdheader
Expand Down
196 changes: 99 additions & 97 deletions Resources/Public/JavaScript/GridElementsDragInWizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,119 +18,121 @@

define(['jquery', 'TYPO3/CMS/Gridelements/GridElementsDragDrop', 'jquery-ui/draggable', 'jquery-ui/droppable'], function ($, DragDrop) {

var DragInWizard = {
wizardUrl: '',
wizardIdentifier: 'new-element-drag-in-wizard'
};
var DragInWizard = {
wizardUrl: '',
wizardIdentifier: 'new-element-drag-in-wizard'
};

/**
* initializes Drag+Drop for all content elements on the page
*/
DragInWizard.initialize = function () {
if ($('.t3js-module-body').length && $('.t3js-page-new-ce a').first()) {
DragInWizard.getWizardUrl();
if (DragInWizard.wizardUrl !== '') {
DragInWizard.createToggleIcon();
}
}
};
/**
* initializes Drag+Drop for all content elements on the page
*/
DragInWizard.initialize = function () {
if ($('.t3js-module-body').length && $('.t3js-page-new-ce a').first()) {
DragInWizard.getWizardUrl();
if (DragInWizard.wizardUrl !== '') {
DragInWizard.createToggleIcon();
}
}
};

/**
* get the URL for the new element wizard the correct module token
*/
DragInWizard.getWizardUrl = function () {
var $newCeLink = $('.t3js-toggle-new-content-element-wizard').first();
var originalWizardUrl = $newCeLink.data('url').split('\&', 4);
if (typeof originalWizardUrl !== 'undefined') {
DragInWizard.wizardUrl = originalWizardUrl[0] + '&' + originalWizardUrl[1] + '&' + originalWizardUrl[2];
}
};
/**
* get the URL for the new element wizard the correct module token
*/
DragInWizard.getWizardUrl = function () {
var $newCeLink = $('.t3js-toggle-new-content-element-wizard').first();
if (typeof $newCeLink.data('url') !== 'undefined') {
var originalWizardUrl = $newCeLink.data('url').split('\&', 4);
}
if (typeof originalWizardUrl !== 'undefined') {
DragInWizard.wizardUrl = originalWizardUrl[0] + '&' + originalWizardUrl[1] + '&' + originalWizardUrl[2];
}
};

/**
* create a new icon to make toggling the drag in wizard possible
*/
DragInWizard.createToggleIcon = function () {
var lastIcon = $('.module-docheader-bar-column-left .btn-group .icon').last().parent();
var addNewIcon = $('.t3js-toggle-new-content-element-wizard').first();
var newIcon = addNewIcon.clone().attr('class', 'btn btn-default btn-sm t3js-toggle-new-content-element-wizard').insertAfter(lastIcon);
newIcon.contents().filter(function () {
return (this.nodeType === 3);
}).remove();
newIcon.attr('title', 'Toggle Drag In Wizard');
newIcon.click(function () {
top.dragInWizardActive = !top.dragInWizardActive;
DragInWizard.toggleWizard();
$(this).blur();
return false;
});
if (top.dragInWizardActive) {
DragInWizard.toggleWizard();
}
};
/**
* create a new icon to make toggling the drag in wizard possible
*/
DragInWizard.createToggleIcon = function () {
var lastIcon = $('.module-docheader-bar-column-left .btn-group .icon').last().parent();
var addNewIcon = $('.t3js-toggle-new-content-element-wizard').first();
var newIcon = addNewIcon.clone().attr('class', 'btn btn-default btn-sm t3js-toggle-new-content-element-wizard').insertAfter(lastIcon);
newIcon.contents().filter(function () {
return (this.nodeType === 3);
}).remove();
newIcon.attr('title', 'Toggle Drag In Wizard');
newIcon.click(function () {
top.dragInWizardActive = !top.dragInWizardActive;
DragInWizard.toggleWizard();
$(this).blur();
return false;
});
if (top.dragInWizardActive) {
DragInWizard.toggleWizard();
}
};

/**
* load and/or activate the new item wizard on click
*/
DragInWizard.toggleWizard = function () {
var $wizard = $('#' + DragInWizard.wizardIdentifier);
if ($wizard.length) {
if (!$wizard.hasClass('active')) {
$wizard.show();
$wizard.addClass('active');
} else {
/**
* load and/or activate the new item wizard on click
*/
DragInWizard.toggleWizard = function () {
var $wizard = $('#' + DragInWizard.wizardIdentifier);
if ($wizard.length) {
if (!$wizard.hasClass('active')) {
$wizard.show();
$wizard.addClass('active');
} else {
$wizard.removeClass('active');
setTimeout(function() {
setTimeout(function () {
$wizard.hide();
}, 800);
}
} else {
$wizard = $('<div id="' + DragInWizard.wizardIdentifier + '"></div>');
$('.t3js-module-docheader').append($wizard);
$wizard.load(DragInWizard.wizardUrl + ' #new-content-element-wizard-carousel div[role=\'tabpanel\']:first', function () {
DragInWizard.makeItemsDraggable();
DragInWizard.rearrangeItems();
});
}
} else {
$wizard = $('<div id="' + DragInWizard.wizardIdentifier + '"></div>');
$('.t3js-module-docheader').append($wizard);
$wizard.load(DragInWizard.wizardUrl + ' #new-content-element-wizard-carousel div[role=\'tabpanel\']:first', function () {
DragInWizard.makeItemsDraggable();
DragInWizard.rearrangeItems();
});
if (!$wizard.hasClass('active')) {
$wizard.show();
$wizard.addClass('active');
} else {
$wizard.removeClass('active');
setTimeout(function() {
setTimeout(function () {
$wizard.hide();
}, 800);
}
}
};
}
};

/**
* make wizard items draggable so they can be dragged into content columns
*/
DragInWizard.makeItemsDraggable = function () {
$('#' + DragInWizard.wizardIdentifier + ' .panel-body .media').attr('language-uid', 0).find('.media-left img').addClass('t3js-page-ce-draghandle').parent().addClass('t3-page-ce-dragitem t3-page-ce-header-draggable').closest('.media').addClass('t3js-page-ce t3js-page-ce-draggable');
DragDrop.default.initialize();
};
/**
* make wizard items draggable so they can be dragged into content columns
*/
DragInWizard.makeItemsDraggable = function () {
$('#' + DragInWizard.wizardIdentifier + ' .panel-body .media').attr('language-uid', 0).find('.media-left img').addClass('t3js-page-ce-draghandle').parent().addClass('t3-page-ce-dragitem t3-page-ce-header-draggable').closest('.media').addClass('t3js-page-ce t3js-page-ce-draggable');
DragDrop.default.initialize();
};

/**
* rearrange wizard items, so only icons will remain as the draggable part
*/
DragInWizard.rearrangeItems = function () {
var panel = $('#' + DragInWizard.wizardIdentifier + ' .t3js-tabs');
$('#' + DragInWizard.wizardIdentifier + ' .media').each(function () {
$(this).find('.media-left').addClass('t3-ctype-identifier');
var description = $(this).find('.media-body');
description = description.appendTo($(this).parent()).hide();
$(this).find('.media-left').on('mouseenter', function () {
description.show()
}).on('mouseleave', function () {
description.hide()
});
});
var descriptionWidth = panel.width() - 50;
var description = $('#' + DragInWizard.wizardIdentifier + ' .media-body');
description.width(descriptionWidth);
$('#' + DragInWizard.wizardIdentifier + ' .media-left input').parent().remove();
};
/**
* rearrange wizard items, so only icons will remain as the draggable part
*/
DragInWizard.rearrangeItems = function () {
var panel = $('#' + DragInWizard.wizardIdentifier + ' .t3js-tabs');
$('#' + DragInWizard.wizardIdentifier + ' .media').each(function () {
$(this).find('.media-left').addClass('t3-ctype-identifier');
var description = $(this).find('.media-body');
description = description.appendTo($(this).parent()).hide();
$(this).find('.media-left').on('mouseenter', function () {
description.show()
}).on('mouseleave', function () {
description.hide()
});
});
var descriptionWidth = panel.width() - 50;
var description = $('#' + DragInWizard.wizardIdentifier + ' .media-body');
description.width(descriptionWidth);
$('#' + DragInWizard.wizardIdentifier + ' .media-left input').parent().remove();
};

$(DragInWizard.initialize);
return DragInWizard;
$(DragInWizard.initialize);
return DragInWizard;
});
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "gridelementsteam/gridelements",
"description": "This extension integrates the grid layout concept also to regular content elements - the grid elements. It offers a lot of new features like advanced drag & drop or real references, that improve the usability of the page and list module to speed up the daily work with the backend.",
"type": "typo3-cms-extension",
"version": "9.0.0-dev",
"version": "9.1.0-dev",
"prefer-stable": true,
"minimum-stability": "dev",
"keywords": ["TYPO3 CMS", "Grids", "Gridelements"],
Expand All @@ -12,10 +12,10 @@
"issues": "https://forge.typo3.org/projects/extension-gridelements2/issues"
},
"require": {
"typo3/cms-core": "^9.3 || dev-master",
"typo3/cms-backend": "^9.3 || dev-master",
"typo3/cms-recordlist": "^9.3 || dev-master",
"typo3/cms-frontend": "^9.3 || dev-master"
"typo3/cms-core": "^9.5 || dev-master",
"typo3/cms-backend": "^9.5 || dev-master",
"typo3/cms-recordlist": "^9.5 || dev-master",
"typo3/cms-frontend": "^9.5 || dev-master"
},
"conflict": {
"templavoila": "*",
Expand Down
10 changes: 5 additions & 5 deletions ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
'description' => 'This extension integrates the grid layout concept also to regular content elements - the grid elements.
It offers a lot of new features like advanced drag & drop or real references, that improve the usability of the page and list module to speed up the daily work with the backend.',
'category' => 'be',
'version' => '9.0.0-dev',
'version' => '9.1.0-dev',
'priority' => 'bottom',
'module' => '',
'state' => 'beta',
Expand All @@ -26,10 +26,10 @@
'author_company' => '',
'constraints' => [
'depends' => [
'typo3' => '9.3.0-9.99.99',
'backend' => '9.3.0-9.99.99',
'recordlist' => '9.3.0-9.99.99',
'frontend' => '9.3.0-9.99.99'
'typo3' => '9.5.0-9.99.99',
'backend' => '9.5.0-9.99.99',
'recordlist' => '9.5.0-9.99.99',
'frontend' => '9.5.0-9.99.99'
],
'conflicts' => [
'templavoila' => '',
Expand Down
8 changes: 0 additions & 8 deletions ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,5 @@
options.saveDocNew.tx_gridelements_backend_layout=1
');

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43(
$_EXTKEY,
'Classes/Plugin/Gridelements.php',
'_pi1',
'CType',
1
);

$signalSlotDispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class);
$signalSlotDispatcher->connect(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::class, 'tcaIsBeingBuilt', \GridElementsTeam\Gridelements\Slots\ExtTablesInclusionPostProcessing::class, 'processData');