Blame view

js/app/controllers/AboutModule.js 2.52 KB
16035364   Benjamin Renard   First commit
1
2
3
4
5
6
7
8
9
/** 
 * Project  : AMDA-NG4
 * Name     : AboutModule.js
 * @class   amdaDesktop.AboutModule 
 * @extends amdaDesktop.AmdaModule
 * @brief   About Module controller definition
 * This Module describe new functionalities of AMDA-NG4
 * @author  CDA
 * @version $Id: AboutModule.js 2397 2014-06-03 10:21:28Z elena $
16035364   Benjamin Renard   First commit
10
11
 */

d95e8421   Elena.Budnik   ws transfer : ini...
12
13
14
15
16
Ext.define('amdaDesktop.AboutModule', 
{
	extend: 'amdaDesktop.AmdaModule',
	contentId : 'infoUI',
	file : 'releaseNotes.' + AMDAVERSION,
16035364   Benjamin Renard   First commit
17

d95e8421   Elena.Budnik   ws transfer : ini...
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
	createWindow : function(file, title, specialInfo)
	{             
		var desktop = myDesktopApp.getDesktop();            
		var win = desktop.getWindow(this.id);
		var theTitle = title ? title : this.title;
		
		if (!AMDAVERSION) this.file = 'about';
		
		var theFile = file ? file : this.file;
		if (!win) {	     
			win = desktop.createWindow({
				id: this.id,
				title: theTitle,
				file : theFile,
				width: 650,
				height: 570,
				autoScroll : true,
				minimizable: false,
				maximizable: false,
				bodyStyle: 'background:#ffffee; padding:15px 15px 15px 15px;',
				bodyCls : 'infoWindow',
				loader : {
							url : helpDir + theFile,
							loadMask : false,
							autoLoad : true // important			 
				},	            
				iconCls: this.icon,
				animCollapse:false,
				constrainHeader:true
			}); 
16035364   Benjamin Renard   First commit
48
                
d95e8421   Elena.Budnik   ws transfer : ini...
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
			if (specialInfo) {                    
					win.add({ xtype: 'toolbar',                               
								items: [  { 
									text: 'AMDA\'s ABCs',
									scope  : this,
									handler: function() {  
										myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.help.id, true, function (module) {
										module.createWindow();
										}); 
									}
								},'-',
								'->', '-', 
								{
									text: 'Stop showing this window on next login',
									scope  : this,
									handler: function() {                                              
										AmdaAction.deleteSpecialInfo(win.file);
										Ext.MessageBox.show({title:'Warning', 
											msg: 'OK. Close the window right now?',
											width: 300,   
											buttons: Ext.MessageBox.OKCANCEL, 
											fn : function(btn) {
												if (btn == 'cancel') return;
												win.close();
											},
											icon: Ext.MessageBox.WARNING,
											scope : this
									});  
								}
							}
						]});                      
			}
cdf22cdd   Elena.Budnik   message window co...
81

d95e8421   Elena.Budnik   ws transfer : ini...
82
83
84
85
86
87
88
89
90
91
92
93
94
			win.show();
		}
		else if (win.file === theFile) {
				win.toFront();
		}
		else {	      
				win.loader.url = helpDir + theFile;
				win.loader.load();
				win.setTitle(theTitle);
				win.file = theFile;
				win.toFront();
		}
	}
16035364   Benjamin Renard   First commit
95
});