Skip to content
Merged
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: 1 addition & 1 deletion Build/JavaScript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ build v13
build patch file

git format-patch 12.4 --stdout > js-12.patch
git format-patch 13.1 --stdout > js-13.patch
git format-patch 13.4 --stdout > js-13.patch

build with docker

Expand Down
51 changes: 26 additions & 25 deletions Build/JavaScript/js-13.patch
Original file line number Diff line number Diff line change
@@ -1,81 +1,82 @@
From 2fb0e5b5b10878b804d9845bb7baa186b140396f Mon Sep 17 00:00:00 2001
From 1319af7e465beab4a929b18deb55e98e3b886a0d Mon Sep 17 00:00:00 2001
From: Achim Fritz <af@achimfritz.de>
Date: Mon, 14 Oct 2024 14:35:21 +0200
Subject: [PATCH] [PATCH] js-13-main
Date: Mon, 10 Mar 2025 16:12:13 +0100
Subject: [PATCH] [PATH] js-13-main

Change-Id: I1b3ee3edd8fe045185268f6b17f98b150f342001
Change-Id: I32adb943a879c3ee5b1dbdc8677daefee99919db
---
.../backend/layout-module/drag-drop.ts | 32 +++++++++++++------
.../TypeScript/backend/layout-module/paste.ts | 23 ++++++++-----
2 files changed, 37 insertions(+), 18 deletions(-)
.../backend/layout-module/drag-drop.ts | 34 +++++++++++++------
1 file changed, 23 insertions(+), 11 deletions(-)

diff --git a/Build/Sources/TypeScript/backend/layout-module/drag-drop.ts b/Build/Sources/TypeScript/backend/layout-module/drag-drop.ts
index f14320f9dea..56ab0a01fc4 100644
index cb0de0d57d2..e821f8a3e89 100644
--- a/Build/Sources/TypeScript/backend/layout-module/drag-drop.ts
+++ b/Build/Sources/TypeScript/backend/layout-module/drag-drop.ts
@@ -15,20 +15,20 @@
@@ -15,21 +15,21 @@
* Module: @typo3/backend/layout-module/drag-drop
* this JS code does the drag+drop logic for the Layout module (Web => Page)
*/
-import DocumentService from '@typo3/core/document-service';
-import DataHandler from '../ajax-data-handler';
-import Icons from '../icons';
-import ResponseInterface from '../ajax-data-handler/response-interface';
-import RegularEvent from '@typo3/core/event/regular-event';
-import { DataTransferTypes } from '@typo3/backend/enum/data-transfer-types';
-import type { DragDropThumbnail, DragTooltipMetadata } from '@typo3/backend/drag-tooltip';
-import BroadcastService from '@typo3/backend/broadcast-service';
-import { BroadcastMessage } from '@typo3/backend/broadcast-message';
-import type ResponseInterface from '../ajax-data-handler/response-interface';
-import type { DragDropThumbnail, DragTooltipMetadata } from '@typo3/backend/drag-tooltip';
-import DragDropUtility from '@typo3/backend/utility/drag-drop-utility';
+import DocumentService from '@typo3/core/document-service.js';
+import DataHandler from '@typo3/backend/ajax-data-handler.js';
+import Icons from '@typo3/backend/icons.js';
+import ResponseInterface from '@typo3/backend/ajax-data-handler/response-interface.js';
+import RegularEvent from '@typo3/core/event/regular-event.js';
+import { DataTransferTypes } from '@typo3/backend/enum/data-transfer-types.js';
+import type { DragDropThumbnail, DragTooltipMetadata } from '@typo3/backend/drag-tooltip.js';
+import BroadcastService from '@typo3/backend/broadcast-service.js';
+import { BroadcastMessage } from '@typo3/backend/broadcast-message.js';

+import type ResponseInterface from '@typo3/backend/ajax-data-handler/response-interface.js';
+import type { DragDropThumbnail, DragTooltipMetadata } from '@typo3/backend/drag-tooltip.js';
+import DragDropUtility from '@typo3/backend/utility/drag-drop-utility.js';

interface Parameters {
cmd?: { [key: string]: { [key: string]: any } };
data?: { [key: string]: { [key: string]: any } };
- CB?: { paste: string, update: { colPos: number | boolean, sys_language_uid: number } };
+ CB?: { paste: string, update: { colPos: number | boolean, sys_language_uid: number , txContainerParent: number } };
}

export type ContentElementDragDropData = {
@@ -175,6 +175,7 @@ class DragDrop {
@@ -153,6 +153,7 @@ class DragDrop {
}

const newColumn = this.getColumnPositionForElement(dropContainer);
+ const newTxContainerParent = this.getTxContainerParentPositionForElement(dropContainer);
const contentElementDragDropData = JSON.parse(event.dataTransfer.getData(DataTransferTypes.content)) as ContentElementDragDropData;

draggedElement = document.querySelector(`${Identifiers.content}[data-uid="${contentElementDragDropData.uid}"]`);
@@ -204,8 +205,10 @@ class DragDrop {
@@ -182,8 +183,10 @@ class DragDrop {
}

let colPos: number | boolean = 0;
+ let txContainerParent: number = 0;
if (targetPid !== 0) {
colPos = newColumn;
+ txContainerParent = newTxContainerParent;
}
const isCopyAction = (event.ctrlKey || dropContainer.classList.contains('t3js-paste-copy'));
const isCopyAction = (DragDropUtility.isCopyModifierFromEvent(event) || dropContainer.classList.contains('t3js-paste-copy'));
const datahandlerCommand = isCopyAction ? 'copy' : 'move';
@@ -218,6 +221,7 @@ class DragDrop {
@@ -196,6 +199,7 @@ class DragDrop {
update: {
colPos: colPos,
sys_language_uid: language,
+ tx_container_parent: txContainerParent,
},
}
}
@@ -307,6 +311,14 @@ class DragDrop {
@@ -285,6 +289,14 @@ class DragDrop {
return false;
}
+ protected getTxContainerParentPositionForElement (element: HTMLElement): number {

+ protected getTxContainerParentPositionForElement(element: HTMLElement): number {
+ const columnContainer = element.closest('[data-colpos]') as HTMLElement;
+ if (columnContainer !== null && columnContainer.dataset.txContainerParent !== undefined) {
+ return parseInt(columnContainer.dataset.txContainerParent, 10);
Expand Down
5 changes: 5 additions & 0 deletions Classes/Tca/ContainerConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ public function __construct(
'EXT:backend/Resources/Private/Partials/',
'EXT:container/Resources/Private/Partials11/',
];
} elseif ((GeneralUtility::makeInstance(Typo3Version::class))->getMajorVersion() === 12) {
$this->gridPartialPaths = [
'EXT:backend/Resources/Private/Partials/',
'EXT:container/Resources/Private/Partials12/',
];
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@
</f:else>
</f:if>
</div>
<div class="t3-page-ce-dropzone t3js-page-ce-dropzone-available"></div>
<div class="t3-page-ce-dropzone t3js-page-ce-dropzone-available" hidden></div>
</div>
</f:if>
2 changes: 1 addition & 1 deletion Resources/Private/Partials/PageLayout/Record.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@
</f:if>
</div>
</f:if>
<div class="t3-page-ce-dropzone t3js-page-ce-dropzone-available"></div>
<div class="t3-page-ce-dropzone t3js-page-ce-dropzone-available" hidden></div>
</div>
27 changes: 27 additions & 0 deletions Resources/Private/Partials12/PageLayout/Grid/Column.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<f:comment>
Styling requires the colpos to be set to the string 'unused'. To preserve type safety in the
controller, the string is only used in the template by setting the below "colpos" variable.
</f:comment>
<f:variable name="colpos" value="{f:if(condition: column.unused, then: 'unused', else: column.columnNumber)}"/>

<td valign="top" colspan="{column.colSpan}" rowspan="{column.rowSpan}"
data-colpos="{column.columnNumber}" data-tx-container-parent="{column.containerUid}" data-language-uid="{column.context.siteLanguage.languageId}"
class="t3js-page-lang-column-{column.context.siteLanguage.languageId} t3js-page-column t3-grid-cell t3-page-column t3-page-column-{colpos}
{f:if(condition: column.unassigned, then: 't3-grid-cell-unassigned')}
{f:if(condition: '!{column.active} && !{column.unused}', then: 't3-grid-cell-restricted')}
{f:if(condition: '!{column.active} && {hideRestrictedColumns} && !{column.unused}', then: 't3-grid-cell-hidden')}
t3-gridCell-width{column.colSpan}
t3-gridCell-height{column.rowSpan}">
<f:render partial="PageLayout/Grid/ColumnHeader" arguments="{_all}" />
<f:if condition="{column.active} || {column.unused}">
<div data-colpos="{column.columnNumber}" data-language-uid="{column.context.siteLanguage.languageId}"
data-tx-container-parent="{column.containerUid}"
class="t3js-sortable t3js-sortable-lang t3js-sortable-lang-{column.context.siteLanguage.languageId} t3-page-ce-wrapper
{f:if(condition: column.items, else: 't3-page-ce-empty')}">
<f:for each="{column.items}" as="item">
<f:render partial="PageLayout/Record" arguments="{_all}" />
</f:for>
</div>
</f:if>
<f:format.raw>{column.afterSectionMarkup}</f:format.raw>
</td>
45 changes: 45 additions & 0 deletions Resources/Private/Partials12/PageLayout/Grid/ColumnHeader.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<div class="t3-page-column-header">
<f:if condition="{column.active}">
<f:then>
<div class="t3-page-column-header-icons">
<f:if condition="{allowEditContent} && {column.editUrl}">
<a href="{column.editUrl}" title="{column.editLinkTitle}"><core:icon identifier="actions-document-open" /></a>
</f:if>
</div>
{column.title}
</f:then>
<f:else if="{column.unused}">
<f:translate key="LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:unusedColPos"/>
</f:else>
<f:else if="{column.unassigned}">
{column.titleUnassigned}
</f:else>
<f:else>
{column.titleInaccessible}
</f:else>
</f:if>
</div>
<f:format.raw>{column.beforeSectionMarkup}</f:format.raw>
<f:if condition="{allowEditContent} && {column.contentEditable} && {column.allowNewContent} && {column.active}">
<div class="t3-page-ce t3js-page-ce" data-page="{column.context.pageId}" id="{column.uniqueId}">
<div class="t3-page-ce-actions t3js-page-new-ce" id="colpos-{column.columnNumber}-page-{column.context.pageId}-{column.uniqueId}">
<f:if condition="{column.newContentElementWizardShouldBeSkipped}">
<f:then>
<a href="{column.newContentUrl}" title="{newContentTitle}" class="btn btn-default btn-sm">
<core:icon identifier="actions-add" />
<f:translate key="LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:createNewContent" />
</a>
</f:then>
<f:else>
<typo3-backend-new-content-element-wizard-button url="{column.newContentUrl}" subject="{newContentTitle}">
<button type="button" class="btn btn-default btn-sm">
<core:icon identifier="actions-add" />
<f:translate key="LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:createNewContent" />
</button>
</typo3-backend-new-content-element-wizard-button>
</f:else>
</f:if>
</div>
<div class="t3-page-ce-dropzone t3js-page-ce-dropzone-available"></div>
</div>
</f:if>
44 changes: 44 additions & 0 deletions Resources/Private/Partials12/PageLayout/Record.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{f:if(condition: '{item.disabled} && {item.context.drawingConfiguration.showHidden} == 0', then: 'display: none;') -> f:variable(name: 'style')}
<div class="t3-page-ce {item.wrapperClassName} t3js-page-ce t3js-page-ce-sortable"
id="element-tt_content-{item.record.uid}"
data-table="tt_content"
data-uid="{item.record.uid}"
data-language-uid="{item.record.sys_language_uid}"
data-move-element-url="{f:be.uri(route: 'move_element', parameters: '{uid: item.record.uid, originalPid: item.record.pid, expandPage: item.record.pid, returnUrl: context.returnUrl}')}"
style="{style}"
>
<div class="t3-page-ce-element t3-page-ce-dragitem t3js-page-ce-dragitem" id="{item.uniqueId}">
<f:render partial="PageLayout/Record/{item.record.CType}/Header" arguments="{_all}" optional="1">
<f:render partial="PageLayout/RecordDefault/Header" arguments="{_all}" />
</f:render>
<f:spaceless>
<div class="t3-page-ce-body">
<f:render partial="PageLayout/RecordDefault/Preview" arguments="{_all}" />
</div>
</f:spaceless>
<f:render partial="PageLayout/Record/{item.record.CType}/Footer" arguments="{_all}" optional="1">
<f:render partial="PageLayout/RecordDefault/Footer" arguments="{_all}" />
</f:render>
</div>
<f:if condition="{allowEditContent} && {item.column.contentEditable} && {item.column.allowNewContent} && {column.active}">
<div class="t3-page-ce-actions t3js-page-new-ce" id="colpos-{item.column.columnNumber}-page-{item.context.pageId}-{item.column.uniqueId}">
<f:if condition="{column.newContentElementWizardShouldBeSkipped}">
<f:then>
<a href="{item.newContentAfterUrl}" title="{f:translate(key: 'LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:newContentElement')}" class="btn btn-default btn-sm">
<core:icon identifier="actions-add" />
<f:translate key="LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:createNewContent" />
</a>
</f:then>
<f:else>
<typo3-backend-new-content-element-wizard-button url="{item.newContentAfterUrl}" subject="{f:translate(key: 'LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:newContentElement')}">
<button type="button" class="btn btn-default btn-sm">
<core:icon identifier="actions-add" />
<f:translate key="LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:createNewContent" />
</button>
</typo3-backend-new-content-element-wizard-button>
</f:else>
</f:if>
</div>
</f:if>
<div class="t3-page-ce-dropzone t3js-page-ce-dropzone-available"></div>
</div>
Loading
Loading