Bug #23564 » 0015745.patch

Administrator Admin, 2010-09-18 17:07

View differences:

typo3/js/notification.js (Revision 0)
1
/***************************************************************
2
*  Copyright notice
3
*
4
*  (c) 2010 Oliver Hader <oliver@typo3.org>
5
*  All rights reserved
6
*
7
*  This script is part of the TYPO3 project. The TYPO3 project is
8
*  free software; you can redistribute it and/or modify
9
*  it under the terms of the GNU General Public License as published by
10
*  the Free Software Foundation; either version 2 of the License, or
11
*  (at your option) any later version.
12
*
13
*  The GNU General Public License can be found at
14
*  http://www.gnu.org/copyleft/gpl.html.
15
*  A copy is found in the textfile GPL.txt and important notices to the license
16
*  from the author is found in LICENSE.txt distributed with these scripts.
17
*
18
*
19
*  This script is distributed in the hope that it will be useful,
20
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
21
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22
*  GNU General Public License for more details.
23
*
24
*  This copyright notice MUST APPEAR in all copies of the script!
25
***************************************************************/
26

  
27
Ext.onReady(function() {
28
	Ext.ux.TYPO3.window = Ext.extend(Ext.Window, {
29
		width: 450,
30
		autoHeight: true,
31
		closable: true,
32
		resizable: false,
33
		plain: true,
34
		border: false,
35
		modal: true,
36
		draggable: true,
37
		closeAction: 'close',
38
		id: 'defaultWindow',
39
		cls: 't3-window',
40
		title: '',
41
		html: '',
42
		buttons: [],
43

  
44
		constructor: function(config) {
45
			config = config || {};
46
			Ext.apply(this, config);
47
			Ext.ux.TYPO3.window.superclass.constructor.call(this, config);
48
		},
49
	});
50

  
51
	TYPO3.Window = {
52
		activeWindows: {},
53

  
54
		getWindow: function(configuration) {
55
			var identifier = configuration.identifier || configuration.id || '';
56

  
57
			if (!TYPO3.Window.hasActiveWindow(identifier)) {
58
				var window = new Ext.ux.TYPO3.window(configuration).show();
59
				TYPO3.Window.setActiveWindow(identifier, window);
60
				return window;
61
			}
62

  
63
			return false;
64
		},
65

  
66
		setActiveWindow: function(identifier, window) {
67
			if (Ext.isString(identifier) && identifier) {
68
				TYPO3.Window.activeWindows[identifier] = window;
69
			}
70
		},
71

  
72
		getActiveWindow: function(identifier) {
73
			if (TYPO3.Window.hasActiveWindow(identifier)) {
74
				return TYPO3.Window.activeWindows[identifier];
75
			}
76
		},
77

  
78
		hasActiveWindow: function(identifier) {
79
			return (identifier && Ext.isObject(TYPO3.Window.activeWindows[identifier]));
80
		},
81

  
82
		closeAllActiveWindows: function() {
83
			Ext.iterate(TYPO3.Window.activeWindows, function(key, window) {
84
				if (Ext.isObject(window)) {
85
					window.close();
86
				}
87
			});
88
		}
89
	};
90

  
91
	TYPO3.Dialog = {
92
		defaultDialogConfiguration: {
93
			title: '',
94
			msg: '',
95
			buttons: [],
96
			fn: Ext.emptyFn
97
		},
98

  
99
		informationDialogConfiguration: {
100
			buttons: Ext.MessageBox.OK,
101
			icon: Ext.MessageBox.INFO
102
		},
103

  
104
		questionDialogConfiguration: {
105
			buttons: Ext.MessageBox.YESNO,
106
			icon: Ext.MessageBox.QUESTION
107
		},
108

  
109
		warningDialogConfiguration: {
110
			buttons: Ext.MessageBox.OK,
111
			icon: Ext.MessageBox.WARNING
112
		},
113

  
114
		errorDialogConfiguration: {
115
			buttons: Ext.MessageBox.OK,
116
			icon: Ext.MessageBox.ERROR
117
		},
118

  
119
		getInformationDialog: function(configuration) {
120
			configuration = configuration || {};
121
			configuration = Ext.apply(
122
				TYPO3.Dialog.defaultDialogConfiguration,
123
				TYPO3.Dialog.informationDialogConfiguration,
124
				configuration
125
			);
126
			Ext.Msg.show(configuration);
127
		},
128

  
129
		getQuestionDialog: function(configuration) {
130
			configuration = configuration || {};
131
			configuration = Ext.apply(
132
				TYPO3.Dialog.defaultDialogConfiguration,
133
				TYPO3.Dialog.questionDialogConfiguration,
134
				configuration
135
			);
136
			Ext.Msg.show(configuration);
137
		},
138

  
139
		getWarningDialog: function(configuration) {
140
			configuration = configuration || {};
141
			configuration = Ext.apply(
142
				TYPO3.Dialog.defaultDialogConfiguration,
143
				TYPO3.Dialog.warningDialogConfiguration,
144
				configuration
145
			);
146
			Ext.Msg.show(configuration);
147
		},
148

  
149
		getErrorDialog: function(configuration) {
150
			configuration = configuration || {};
151
			configuration = Ext.apply(
152
				TYPO3.Dialog.defaultDialogConfiguration,
153
				TYPO3.Dialog.errorDialogConfiguration,
154
				configuration
155
			);
156
			Ext.Msg.show(configuration);
157
		}
158
	};
159
});
typo3/backend.php (Arbeitskopie)
131 131
			'../t3lib/js/extjs/ux/flashmessages.js',
132 132
			'../t3lib/js/extjs/ux/ext.ux.tabclosemenu.js',
133 133
			'js/backend.js',
134
			'js/notification.js',
134 135
			'js/loginrefresh.js',
135 136
			'js/extjs/debugPanel.js',
136 137
			'js/extjs/viewport.js',
(1-1/2)