Skip to content

Commit 485192a

Browse files
committed
FEATURE: Support Neos 8 JS Api
Resolves: #84
1 parent 6100636 commit 485192a

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

Resources/Private/JavaScript/index.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ import { RedirectProvider, IntlProvider } from './providers';
88
import '../Styles/styles.scss';
99

1010
window.onload = async (): Promise<void> => {
11-
while (!window.Typo3Neos || !window.Typo3Neos.I18n || !window.Typo3Neos.I18n.initialized) {
12-
await new Promise(resolve => setTimeout(resolve, 50));
11+
let NeosAPI = window.Typo3Neos || window.NeosCMS;
12+
13+
while (!NeosAPI || !NeosAPI.I18n || !NeosAPI.I18n.initialized) {
14+
NeosAPI = window.NeosCMS || window.Typo3Neos;
15+
await new Promise((resolve) => setTimeout(resolve, 50));
1316
}
1417

1518
const redirectsList: HTMLElement = document.getElementById('redirects-list-app');
@@ -38,7 +41,7 @@ window.onload = async (): Promise<void> => {
3841
initialStatusCodeFilter = -1;
3942
}
4043

41-
const { I18n, Notification } = window.Typo3Neos;
44+
const { I18n, Notification } = NeosAPI;
4245

4346
/**
4447
* @param id

Resources/Private/JavaScript/typings/global.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,8 @@ interface Window {
1616
I18n: NeosI18n;
1717
Notification: NeosNotification;
1818
};
19+
NeosCMS: {
20+
I18n: NeosI18n;
21+
Notification: NeosNotification;
22+
};
1923
}

Resources/Public/Assets/main.bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Resources/Public/Assets/main.bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)