Feature: #66047 - Introduce JavaScript notification API
See forge#66047
Description
The Flashmessages API has been moved from TYPO3.
to top.
in TYPO3 CMS 7.0.
Now we introduce the new JavaScript Notification API and remove the refactoring of the FlashMessage API which was made for TYPO3 CMS 7.0.
The compatibility layer for TYPO3.FlashMessage has changed to use the new Notification API and will be removed with TYPO3 v9 as before.
The new Notification API works similar to old Flashmessages, you can use it from the Top-Frame, where is it loaded one time for the complete backend.
Please look at the examples section in this document for more details.
Migration
The affected 3rd party extensions must be modified to use top.
instead of top.
.
Examples:
- Old and new syntax in general
// Old and deprecated:
top.TYPO3.Flashmessages.display(TYPO3.Severity.notice)
// New and the only correct way:
top.TYPO3.Notification.notice(title, message)
- Notice notification
// duration is optional, default is 5 seconds
top.TYPO3.Notification.notice(title, message, duration)
- Info notification
// duration is optional, default is 5 seconds
top.TYPO3.Notification.info(title, message, duration)
- Success notification
// duration is optional, default is 5 seconds
top.TYPO3.Notification.success(title, message, duration)
- Warning notification
// duration is optional, default is 5 seconds
top.TYPO3.Notification.warning(title, message, duration)
- Error notification
// duration is optional, default is 0 seconds which means sticky!
top.TYPO3.Notification.error(title, message, duration)