Subversion Repositories Applications.papyrus

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1471 alexandre_ 1
/*vim: set expandtab tabstop=4 shiftwidth=4: */
2
// +------------------------------------------------------------------------------------------------------+
3
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
4
// +------------------------------------------------------------------------------------------------------+
5
// | This library is free software; you can redistribute it and/or                                        |
6
// | modify it under the terms of the GNU General Public                                                  |
7
// | License as published by the Free Software Foundation; either                                         |
8
// | version 2.1 of the License, or (at your option) any later version.                                   |
9
// |                                                                                                      |
10
// | This library is distributed in the hope that it will be useful,                                      |
11
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
12
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
13
// | General Public License for more details.                                                             |
14
// |                                                                                                      |
15
// | You should have received a copy of the GNU General Public                                            |
16
// | License along with this library; if not, write to the Free Software                                  |
17
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
18
// +------------------------------------------------------------------------------------------------------+
19
// CVS : $Id: telechargement.js,v 1.2 2007-06-25 12:15:07 alexandre_tb Exp $
20
/**
21
* Application projet
22
*
23
* La service de telechargement
24
*
25
*@package projet
26
//Auteur original :
27
*@author        Alexandre Granier <alexandre@tela-botanica.org>
28
//Autres auteurs :
29
*@author        Aucun
30
*@copyright     Tela-Botanica 2000-2007
31
*@version       $Revision: 1.2 $
32
// +------------------------------------------------------------------------------------------------------+
33
*/
1322 alexandre_ 34
var dojoConfig = {
35
isDebug: true
36
};
37
 
38
dojo.require("dojo.widget.Tree");
39
dojo.require("dojo.widget.TreeNode");
40
dojo.require("dojo.widget.TreeSelector");
41
dojo.require("dojo.widget.TreeLoadingController");
42
dojo.require("dojo.event.*");
43
 
44
 
45
function treeSelectFired() {
46
 
47
    // une reference vers treeSelector et vers le noeud selectionne
48
   	var treeSelector = dojo.widget.manager.getWidgetById('treeSelector');
49
   	var treeNode = treeSelector.selectedNode;
50
 
51
	// le noeud est il un repertoire
52
	var isFolder = treeNode['isFolder'];
53
 
54
	// Si non on dirige vers le document
55
	if ( !isFolder) {
1471 alexandre_ 56
	    var link = treeNode['link'];
57
	    document.location.href =link;
1322 alexandre_ 58
	} else {
59
		var repertoire = dojo.widget.manager.getWidgetById('treeController');
60
		repertoire.expand(treeNode);
61
	}
62
}
63
 
64
function init() {
65
    // une reference vers treeSelector
66
    var treeSelector = dojo.widget.manager.getWidgetById('treeSelector');
67
 
68
    // on connecte le select event a la fonction treeSelectFired() -->
69
    dojo.event.connect(treeSelector,'select','treeSelectFired');
70
 
71
	// On ouvre le noeud racine
1471 alexandre_ 72
	var rootNode = dojo.widget.manager.getWidgetById('rootNode');
1322 alexandre_ 73
	rootNode.expand();
74
}
75
 
1471 alexandre_ 76
dojo.addOnLoad(init);