cf5288ce51eb574239541858fe4a1577c8394b6b
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!
15 * Module: TYPO3/CMS/Backend/Severity
16 * Severity for the TYPO3 backend
22 // fetch from opening window
23 if (window
.opener
&& window
.opener
.TYPO3
&& window
.opener
.TYPO3
.Severity
) {
24 return window
.opener
.TYPO3
.Severity
;
28 if (parent
&& parent
.window
.TYPO3
&& parent
.window
.TYPO3
.Severity
) {
29 return parent
.window
.TYPO3
.Severity
;
32 // fetch object from outer frame
33 if (top
&& top
.TYPO3
&& top
.TYPO3
.Severity
) {
34 return top
.TYPO3
.Severity
;
37 // This only happens if the opener, parent or top is some other url (eg a local file)
38 // which loaded the current window. Then the browser's cross domain policy jumps in
39 // and raises an exception.
40 // For this case we are safe and we can create our global object below.
46 * @type {{notice: number, information: number, info: number, ok: number, warning: number, error: number}}
47 * @exports TYPO3/CMS/Backend/Severity
58 * Gets the CSS class for the severity
60 * @param {Number} severity
63 Severity
.getCssClass = function(severity
) {
67 severityClass
= 'notice';
70 severityClass
= 'success';
72 case Severity
.warning
:
73 severityClass
= 'warning';
76 severityClass
= 'danger';
80 severityClass
= 'info';
85 // attach to global frame
86 if (typeof TYPO3
!== 'undefined') {
87 TYPO3
.Severity
= Severity
;