[BUGFIX] Fix broken ImageManipulation wizard
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Resources / Public / JavaScript / Severity.js
1 /*
2 * This file is part of the TYPO3 CMS project.
3 *
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.
7 *
8 * For the full copyright and license information, please read the
9 * LICENSE.txt file that was distributed with this source code.
10 *
11 * The TYPO3 project - inspiring people to share!
12 */
13
14 /**
15 * Module: TYPO3/CMS/Backend/Severity
16 * Severity for the TYPO3 backend
17 */
18 define(function () {
19 'use strict';
20
21 try {
22 // fetch from opening window
23 if (window.opener && window.opener.TYPO3 && window.opener.TYPO3.Severity) {
24 return window.opener.TYPO3.Severity;
25 }
26
27 // fetch from parent
28 if (parent && parent.window.TYPO3 && parent.window.TYPO3.Severity) {
29 return parent.window.TYPO3.Severity;
30 }
31
32 // fetch object from outer frame
33 if (top && top.TYPO3.Severity) {
34 return top.TYPO3.Severity;
35 }
36 } catch (e) {
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.
41 }
42
43 /**
44 * Severity object
45 *
46 * @type {{notice: number, information: number, info: number, ok: number, warning: number, error: number}}
47 * @exports TYPO3/CMS/Backend/Severity
48 */
49 var Severity = {
50 notice: -2,
51 // @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 9, use info instead of information
52 information: -1,
53 info: -1,
54 ok: 0,
55 warning: 1,
56 error: 2
57 };
58
59 // attach to global frame
60 TYPO3.Severity = Severity;
61
62 return Severity;
63 });