Skip to content

Commit

Permalink
[TASK] styleguide: Minor JS and template related updates
Browse files Browse the repository at this point in the history
  • Loading branch information
lolli42 authored Oct 31, 2023
1 parent 2402823 commit 56d5129
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 25 deletions.
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
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
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="tx-styleguide-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 typo3/sysext/styleguide/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();
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
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

0 comments on commit 56d5129

Please sign in to comment.