AboutModule.js
3.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
48
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/**
* 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 $
*/
Ext.define('amdaDesktop.AboutModule',
{
extend: 'amdaDesktop.AmdaModule',
contentId : 'infoUI',
file : 'releaseNotes.' + AMDAVERSION,
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
});
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
});
}
}
]});
}
if (isMigration && isOldWS) {
win.on({
show : function(){
Ext.Msg.show({
title:'Welcome on new AMDA',
msg: 'It is your first visit of the new version of AMDA.<br/>'+
'Do you want to copy here your workspace from the old AMDA ?',
buttons: Ext.Msg.YESNO,
icon: Ext.Msg.QUESTION,
fn : function (btn) {
if (btn == 'yes') {
loadMask.show();
AmdaAction.convertWS(function(res,e){
var explorerModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.explorer.id);
explorerModule.filtersStore.reload();
loadMask.hide();
if (res.success == true) {
myDesktopApp.infoMsg('<b>Your Wokspace has been copied</b><br/><br/> ' +
'<b>Note : </b><br/><br> Plot Requests have not been copied - too many modifs!<br/>' +
'Derived params made from Remote params have not been copied<br/><br/>' + res.msg);
}
else {
myDesktopApp.errorMsg(res.error);
}
});
}
}
});
}
});
}
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();
}
}
});