Skip to content

Commit

Permalink
[TASK] Remove unused feature "Elements on page" (#690)
Browse files Browse the repository at this point in the history
Resolves: #689
  • Loading branch information
webian authored Aug 4, 2023
1 parent c56ff78 commit 7c248c8
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 136 deletions.
25 changes: 0 additions & 25 deletions Classes/Hook/FrontendEditingInitializationHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ public function main(array $params, TypoScriptFrontendController $parentObject)
'currentTime' => GeneralUtility::makeInstance(Context::class)->getPropertyFromAspect('date', 'timestamp'),
'currentPage' => $this->typoScriptFrontendController->id,
'contentItems' => $availableContentElementTypes,
'contentElementsOnPage' => $this->getContentElementsOnPage((int)$this->typoScriptFrontendController->id),
'customRecords' => $this->getCustomRecords(),
'loadingIcon' => $this->iconFactory->getIcon('spinner-circle-dark', Icon::SIZE_LARGE)->render(),
'showHiddenItemsUrl' => $requestUrl . '&show_hidden_items=' . $this->showHiddenItems(),
Expand Down Expand Up @@ -472,30 +471,6 @@ protected function wizardItemsHook(array &$wizardItems, Typo3NewContentElementCo
}
}

/**
* Get the content elements on the page
*
* @param int $pageId The page id to fetch content elements from
* @return array
*/
protected function getContentElementsOnPage(int $pageId): array
{
if (!$this->typoScriptFrontendController->cObj instanceof ContentObjectRenderer) {
$this->typoScriptFrontendController->newCObj();
}
$contentElements = $this->typoScriptFrontendController->cObj->getRecords(
'tt_content',
[
'pidInList' => $pageId,
'orderBy' => 'sorting'
]
);
foreach ($contentElements as &$contentElement) {
$contentElement['_recordTitle'] = BackendUtility::getRecordTitle('tt_content', $contentElement);
}
return $contentElements;
}

/**
* Get custom records defined in TypoScript
*
Expand Down
6 changes: 0 additions & 6 deletions Resources/Private/Language/locallang.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,6 @@
<trans-unit id="right-bar.element-title">
<source>Drag and drop on page to create a new '%s' content element.</source>
</trans-unit>
<trans-unit id="right-bar.on-page.changed">
<source>Modified:</source>
</trans-unit>
<trans-unit id="right-bar.on-page.title">
<source>Elements on page</source>
</trans-unit>
<trans-unit id="right-bar.custom-record.title">
<source>Custom records</source>
</trans-unit>
Expand Down
41 changes: 0 additions & 41 deletions Resources/Private/Partials/ContentElementHierarchyTab.html

This file was deleted.

3 changes: 0 additions & 3 deletions Resources/Private/Partials/RightBar.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
<div class="elements">
<f:render partial="WizardElementTabs" arguments="{_all}"></f:render>
</div>
<div class="elements">
<f:render partial="ContentElementHierarchyTab" arguments="{_all}"></f:render>
</div>
<f:if condition="{customRecords}">
<div class="elements">
<f:render partial="CustomRecordTab" arguments="{_all}"></f:render>
Expand Down
1 change: 0 additions & 1 deletion Resources/Private/Sass/Partials/_elements.scss
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
}
}

.content-element-hierarchy-tab,
.custom-record-tab {
.accordion {
.element-action {
Expand Down
11 changes: 0 additions & 11 deletions Resources/Private/Sass/inline_editing.scss
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,6 @@
display: inline;
}

// colored frame when hovering content element in right-column list

&.indicate-element {
&:before,
&:after {
content: none !important;
}

outline: 1px solid $color-t3-primary;
}

&[draggable="true"]:hover {
cursor: pointer;
}
Expand Down
2 changes: 1 addition & 1 deletion Resources/Public/Css/frontend_editing.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Resources/Public/Css/inline_editing.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 0 additions & 47 deletions Resources/Public/JavaScript/FrontendEditing.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ define([
this.init();
};

// TimeoutId used in indicateCeStart()
var indicateCeScrollTimeoutId = null;

// Add default events and a function to add other events
FrontendEditing.events = events;
FrontendEditing.addEvent = function addEvent (key, value) {
Expand Down Expand Up @@ -563,50 +560,6 @@ define([
}
},

indicateCeStart: function (ev) {
log.debug('start indicate ce', ev.currentTarget);

var $iframe = F.iframe();
var uid = ev.currentTarget.dataset.uid;
$iframe.contents()
.find('#c' + uid)
.parent()
.addClass('indicate-element');
window.clearTimeout(indicateCeScrollTimeoutId);

indicateCeScrollTimeoutId = window.setTimeout(function scrollCe () {
log.info('scroll to Ce', uid);

var $iframe = F.iframe();
var offset = $iframe.contents()
.find('#c' + uid)
.parent()
.offset();

$iframe.contents()
.find('body, html')
.animate({
scrollTop: offset
? offset.top - scrollToIndicateCeOffsetTop
: offset
}, scrollToIndicateCeSpeed);
}, scrollToIndicateCeDelay);
},

indicateCeEnd: function (ev) {
log.debug('end indicate ce', ev.currentTarget);

var $iframe = F.iframe();
var uid = ev.currentTarget.dataset.uid;

$iframe.contents()
.find('#c' + uid)
.parent()
.removeClass('indicate-element');

window.clearTimeout(indicateCeScrollTimeoutId);
},

dropCr: function (ev) {
log.debug('drop cr', ev.currentTarget, ev.dataTransfer);

Expand Down

0 comments on commit 7c248c8

Please sign in to comment.