Blame view

js/app/controllers/UploadModule.js 1.12 KB
16035364   Benjamin Renard   First commit
1
2
3
4
5
6
/** 
 * Project   : AMDA-NG
 * Name      : UploadModule.js
 * @class    amdaDesktop.UploadModule
 * @extends  amdaDesktop.AmdaModule
 * @brief    Upload Module controller definition 
1340621c   Elena.Budnik   error msg when up...
7
 * @author   Elena 
16035364   Benjamin Renard   First commit
8
9
10
11
12
13
 */

Ext.define('amdaDesktop.UploadModule', {
	extend: 'amdaDesktop.AmdaModule',
	
	requires: [
1340621c   Elena.Budnik   error msg when up...
14
15
16
		'amdaUI.UploadUI' 
	],
	
16035364   Benjamin Renard   First commit
17
	contentId : 'uploadUI',	
16035364   Benjamin Renard   First commit
18
     
1340621c   Elena.Budnik   error msg when up...
19
20
21
22
	/**
	* @cfg {String} window definitions
	* @required
	*/
73625886   Elena.Budnik   added auto, manua...
23
24
	width: 330, 
	height: 520,
1340621c   Elena.Budnik   error msg when up...
25
	uiType : 'panelTabUpload',
16035364   Benjamin Renard   First commit
26
27
28
29
	helpTitle : 'Help on Upload Module',
	helpFile : 'uploadHelp',
	
	init : function() {	
1340621c   Elena.Budnik   error msg when up...
30
31
32
33
34
		this.launcher = {
				text    : this.title,
				iconCls : this.icon,
				handler : this.createWindow,
				scope   : this
16035364   Benjamin Renard   First commit
35
		};
1340621c   Elena.Budnik   error msg when up...
36
	},
16035364   Benjamin Renard   First commit
37
	
1340621c   Elena.Budnik   error msg when up...
38
39
	uploadNotification : function(url,format){
		var me = this;
8e283c24   Benjamin Renard   Fix uploadNotific...
40
41
42
		var desktop = myDesktopApp.getDesktop();
		var win = desktop.getWindow(me.id);
		if (!win) {
8e283c24   Benjamin Renard   Fix uploadNotific...
43
44
45
46
			this.createWindow(function (o)
			{
				win = desktop.getWindow(me.id);
				if (win){
f60f0bd9   Benjamin Renard   Fix upload from s...
47
48
49
					win.items.items[0].forceUpload(url,format, function() {
						win.close();
					});
8e283c24   Benjamin Renard   Fix uploadNotific...
50
				}
8e283c24   Benjamin Renard   Fix uploadNotific...
51
52
53
			});
		}
		else {
f60f0bd9   Benjamin Renard   Fix upload from s...
54
55
56
			win.items.items[0].forceUpload(url,format,function() {
				win.close();
			});
8e283c24   Benjamin Renard   Fix uploadNotific...
57
		}
1340621c   Elena.Budnik   error msg when up...
58
	}	
8e283c24   Benjamin Renard   Fix uploadNotific...
59
});