2 * This file is part of the TYPO3 CMS project.
4 * It is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU General Public License, either version 2
6 * of the License, or any later version.
8 * For the full copyright and license information, please read the
9 * LICENSE.txt file that was distributed with this source code.
11 * The TYPO3 project - inspiring people to share!
23 * Module: TYPO3/CMS/Backend/Severity
24 * Severity for the TYPO3 backend
27 public static notice: number = SeverityEnum.notice;
28 public static info: number = SeverityEnum.info;
29 public static ok: number = SeverityEnum.ok;
30 public static warning: number = SeverityEnum.warning;
31 public static error: number = SeverityEnum.error;
34 * Gets the CSS class for the severity
36 * @param {SeverityEnum} severity
39 public static getCssClass(severity: SeverityEnum): string {
40 let severityClass: string;
43 case SeverityEnum.notice:
44 severityClass = 'notice';
47 severityClass = 'success';
49 case SeverityEnum.warning:
50 severityClass = 'warning';
52 case SeverityEnum.error:
53 severityClass = 'danger';
55 case SeverityEnum.info:
57 severityClass = 'info';
66 // fetch from opening window
67 if (window.opener && window.opener.TYPO3 && window.opener.TYPO3.Severity) {
68 severityObject = window.opener.TYPO3.Severity;
72 if (parent && parent.window.TYPO3 && parent.window.TYPO3.Severity) {
73 severityObject = parent.window.TYPO3.Severity;
76 // fetch object from outer frame
77 if (top && top.TYPO3 && top.TYPO3.Severity) {
78 severityObject = top.TYPO3.Severity;
81 // This only happens if the opener, parent or top is some other url (eg a local file)
82 // which loaded the current window. Then the browser's cross domain policy jumps in
83 // and raises an exception.
84 // For this case we are safe and we can create our global object below.
87 if (!severityObject) {
88 severityObject = Severity;
91 TYPO3.Storage = severityObject;
92 export = severityObject;