Subversion Repositories Applications.papyrus

Rev

Rev 1322 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1322 Rev 1471
Line 8... Line 8...
8
dojo.require("dojo.widget.TreeSelector");
8
dojo.require("dojo.widget.TreeSelector");
9
dojo.require("dojo.widget.TreeLoadingController");
9
dojo.require("dojo.widget.TreeLoadingController");
10
dojo.require("dojo.event.*");
10
dojo.require("dojo.event.*");
11
dojo.require("dojo.io.*");
11
dojo.require("dojo.io.*");
Line 12... Line -...
12
 
-
 
13
 
12
 
Line 14... Line 13...
14
function treeSelectFired() {
13
function treeSelectFired() {
15
 
14
 
16
    // une reference vers treeSelector et vers le noeud selectionne
15
    // une reference vers treeSelector et vers le noeud selectionne
Line 21... Line 20...
21
	var isFolder = treeNode['isFolder'];
20
	var isFolder = treeNode['isFolder'];
Line 22... Line 21...
22
 
21
 
23
	// Si non on dirige vers le document
22
	// Si non on dirige vers le document
24
	if ( !isFolder) {
23
	if ( !isFolder) {
25
		var link = treeNode['link'];
24
		var link = treeNode['link'];
-
 
25
	    document.location.href= link;
-
 
26
	} else {
-
 
27
		var repertoire = dojo.widget.manager.getWidgetById('treeController');
26
	    document.location.href= 'client/projet/fichiers/'+link;
28
		repertoire.expand(treeNode);
27
	}
29
	}
Line 28... Line 30...
28
}
30
}
29
 
31
 
30
function init() {
32
function init() {
Line 31... Line 33...
31
    // une reference vers treeSelector
33
    // une reference vers treeSelector
32
    var treeSelector = dojo.widget.manager.getWidgetById('treeSelector');
34
    var treeSelector = dojo.widget.manager.getWidgetById('treeSelector');
Line -... Line 35...
-
 
35
 
-
 
36
    // on connecte le select event a la fonction treeSelectFired()
-
 
37
    dojo.event.connect(treeSelector,'select','treeSelectFired');
-
 
38
    
-
 
39
    var rootNode = dojo.widget.manager.getWidgetById('rootNode');
-
 
40
    var loadingController = dojo.widget.manager.getWidgetById('treeController');
-
 
41
    
-
 
42
	// L appel ci-dessous permet de charger les donnees du noeud racine
33
 
43
	loadingController.loadRemote(rootNode);
34
    // on connecte le select event a la fonction treeSelectFired() -->
44
	
35
    dojo.event.connect(treeSelector,'select','treeSelectFired');
45
	// On ouvre le noeud racine
Line 36... Line -...
36
    
-
 
37
    //ajout d'un listener à la suppression d'un noeud
46
	rootNode.expand();    
Line 38... Line 47...
38
	dojo.event.topic.subscribe("nodeRemoved", ioDeplaceFichier) ;
47
    //ajout d'un listener a la suppression d'un noeud
39
}
48
	dojo.event.topic.subscribe("nodeRemoved", ioDeplaceFichier) ;
Line 50... Line 59...
50
		error : function (type, errObj) { alert ('erreur'); },
59
		error : function (type, errObj) { alert ('erreur'); },
51
		load : function (type, data, evt) {}
60
		load : function (type, data, evt) {}
52
	};
61
	};
53
	//var treeLoadingController = dojo.widget.manager.getWidgetById('treeController');
62
	//var treeLoadingController = dojo.widget.manager.getWidgetById('treeController');
54
	dojo.io.bind (arguments) ;
63
	dojo.io.bind (arguments) ;
55
	/*
-
 
56
	alert (message.child.title +" enlevé de "+ message.oldParent.title + 
-
 
57
			" dans l'arbre " + message.oldTree.widgetId + " " + arguments.url +
-
 
58
			"\n " + treeLoadingController.getRPCUrl(''));
-
 
59
	*/
-
 
60
}
64
}
61
dojo.addOnLoad(init);
65
dojo.addOnLoad(init);
62
66