diff --git a/Build/types/TYPO3/index.d.ts b/Build/types/TYPO3/index.d.ts index e32b36809255..880ba925ffbf 100644 --- a/Build/types/TYPO3/index.d.ts +++ b/Build/types/TYPO3/index.d.ts @@ -10,6 +10,7 @@ declare namespace TYPO3 { export let InfoWindow: any; export let Notification: any; export let Popover: any; + export let Severity: any; export let ShortcutMenu: any; export let Storage: any; export let Utility: any; diff --git a/typo3/sysext/backend/Resources/Private/TypeScript/Severity.ts b/typo3/sysext/backend/Resources/Private/TypeScript/Severity.ts index d675498bc772..fc45c69439dc 100644 --- a/typo3/sysext/backend/Resources/Private/TypeScript/Severity.ts +++ b/typo3/sysext/backend/Resources/Private/TypeScript/Severity.ts @@ -80,7 +80,11 @@ try { if (!severityObject) { severityObject = Severity; + + // attach to global frame + if (typeof TYPO3 !== 'undefined') { + TYPO3.Severity = severityObject; + } } -TYPO3.Storage = severityObject; export = severityObject; diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/Severity.js b/typo3/sysext/backend/Resources/Public/JavaScript/Severity.js index a03e3d7b0fe2..2e92483c2a47 100644 --- a/typo3/sysext/backend/Resources/Public/JavaScript/Severity.js +++ b/typo3/sysext/backend/Resources/Public/JavaScript/Severity.js @@ -10,4 +10,4 @@ * * The TYPO3 project - inspiring people to share! */ -define(["require","exports","./Enum/Severity"],function(a,b,c){"use strict";var d,e=function(){function a(){}return a.getCssClass=function(a){var b;switch(a){case c.SeverityEnum.notice:b="notice";break;case c.SeverityEnum.ok:b="success";break;case c.SeverityEnum.warning:b="warning";break;case c.SeverityEnum.error:b="danger";break;case c.SeverityEnum.info:default:b="info"}return b},a.notice=c.SeverityEnum.notice,a.info=c.SeverityEnum.info,a.ok=c.SeverityEnum.ok,a.warning=c.SeverityEnum.warning,a.error=c.SeverityEnum.error,a}();try{window.opener&&window.opener.TYPO3&&window.opener.TYPO3.Severity&&(d=window.opener.TYPO3.Severity),parent&&parent.window.TYPO3&&parent.window.TYPO3.Severity&&(d=parent.window.TYPO3.Severity),top&&top.TYPO3&&top.TYPO3.Severity&&(d=top.TYPO3.Severity)}catch(a){}return d||(d=e),TYPO3.Storage=d,d}); \ No newline at end of file +define(["require","exports","./Enum/Severity"],function(a,b,c){"use strict";var d,e=function(){function a(){}return a.getCssClass=function(a){var b;switch(a){case c.SeverityEnum.notice:b="notice";break;case c.SeverityEnum.ok:b="success";break;case c.SeverityEnum.warning:b="warning";break;case c.SeverityEnum.error:b="danger";break;case c.SeverityEnum.info:default:b="info"}return b},a.notice=c.SeverityEnum.notice,a.info=c.SeverityEnum.info,a.ok=c.SeverityEnum.ok,a.warning=c.SeverityEnum.warning,a.error=c.SeverityEnum.error,a}();try{window.opener&&window.opener.TYPO3&&window.opener.TYPO3.Severity&&(d=window.opener.TYPO3.Severity),parent&&parent.window.TYPO3&&parent.window.TYPO3.Severity&&(d=parent.window.TYPO3.Severity),top&&top.TYPO3&&top.TYPO3.Severity&&(d=top.TYPO3.Severity)}catch(a){}return d||(d=e,"undefined"!=typeof TYPO3&&(TYPO3.Severity=d)),d}); \ No newline at end of file