Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] Minor JS and template related updates #465

Merged
merged 1 commit into from
Oct 31, 2023
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
1 change: 1 addition & 0 deletions Resources/Private/Templates/Backend/Cards.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<html
xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
xmlns:core="http://typo3.org/ns/TYPO3/CMS/Core/ViewHelpers"
xmlns:sg="http://typo3.org/ns/TYPO3/CMS/Styleguide/ViewHelpers"
data-namespace-typo3-fluid="true"
>
Expand Down
1 change: 0 additions & 1 deletion Resources/Private/Templates/Backend/FlashMessages.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<html
xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
xmlns:sg="http://typo3.org/ns/TYPO3/CMS/Styleguide/ViewHelpers"
data-namespace-typo3-fluid="true"
>

Expand Down
7 changes: 1 addition & 6 deletions Resources/Private/Templates/Backend/Index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<html
xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
xmlns:sg="http://typo3.org/ns/TYPO3/CMS/Styleguide/ViewHelpers"
xmlns:core="http://typo3.org/ns/TYPO3/CMS/Core/ViewHelpers"
data-namespace-typo3-fluid="true"
>

Expand All @@ -13,11 +13,6 @@
</div>
<div id="container-content">
<h1><f:translate key="LLL:EXT:styleguide/Resources/Private/Language/locallang.xlf:backendStyleguide" /></h1>
<p>Presents supported styles for TYPO3 backend modules.</p>

<h2>Styleguide examples</h2>

<p>For information on supported styles and example code, see the link tree on the left.</p>

<h2>Example page trees</h2>

Expand Down
10 changes: 3 additions & 7 deletions Resources/Public/JavaScript/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,11 @@ import DateTimePicker from '@typo3/backend/date-time-picker.js';
class Filter {
constructor() {
DocumentService.ready().then(() => {
this.initializeDateTimePickers();
document.querySelectorAll('.t3js-datetimepicker')?.forEach((element) => {
DateTimePicker.initialize(element);
})
});
}

initializeDateTimePickers() {
document.querySelectorAll('.t3js-datetimepicker')?.forEach((element) => {
DateTimePicker.initialize(element);
})
}
}

export default new Filter();
9 changes: 0 additions & 9 deletions Resources/Public/JavaScript/processing-indicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
* The TYPO3 project - inspiring people to share!
*/

/**
* Javascript functions regarding the TCA module
*/
import NProgress from 'nprogress';
import Icons from '@typo3/backend/icons.js';
import Notification from '@typo3/backend/notification.js';
Expand All @@ -27,29 +24,24 @@ Icons.getIcon('spinner-circle', Icons.sizes.small).then(function(spinner) {
e.preventDefault();
let originalIcon = button.querySelector('span').outerHTML;
let disabledButton = button.parentNode.querySelector('button.disabled');

e.target.querySelector('span').outerHTML = spinner;
NProgress.start();
itemProcessing++
e.target.classList.add('disabled');

// Trigger generate action
fetch(url).then((response) => {
if(response.status !== 200) {
return Promise.reject({message: 'Error ' + response.status + ' ' + response.statusText});
}

return response.json();
})
.then((json) => {
itemProcessing--
Notification.showMessage(json.title, json.body, json.status, 5);

// Hide nprogress only if all items done loading/processing
if(itemProcessing === 0) {
NProgress.done();
}

// Set button states
e.target.querySelector('.t3js-icon').outerHTML = originalIcon;
disabledButton.classList.remove('disabled');
Expand All @@ -58,7 +50,6 @@ Icons.getIcon('spinner-circle', Icons.sizes.small).then(function(spinner) {
}).catch((error) => {
// Action failed, reset to its original state
NProgress.done();

e.target.querySelector('.t3js-icon').outerHTML = originalIcon;
e.target.classList.remove('disabled');
Notification.error('', error.message, 5);
Expand Down
3 changes: 1 addition & 2 deletions Resources/Public/JavaScript/render-notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import ImmediateAction from '@typo3/backend/action-button/immediate-action.js';
import DeferredAction from '@typo3/backend/action-button/deferred-action.js';

/**
* Action used when an operation execution time is unkown.
* Action used when an operation execution time is unknown.
*/
class RenderNotifications {
constructor() {
Expand Down Expand Up @@ -44,7 +44,6 @@ class RenderNotifications {
if (!includeActions) {
return [];
}

return [
{
label: 'Immediate action',
Expand Down