source: tapas/web/resources/templates/templateEther_script.jsp @ 409

Last change on this file since 409 was 409, checked in by vmipsl, 12 years ago

backoffice

File size: 2.7 KB
Line 
1<script type="text/javascript">
2    var InterfaceTemplate = Class.create( {
3
4        initialize: function()
5        {
6            /** *********** CONTAINERS *********** **/
7            this.containerTools = $( "#tools" );
8            this.containerLogin = $( "#loginModule" );
9            this.containerMenuData = $( "#menuData" );
10
11            /** *********** VARIABLES *********** **/
12            // TODO : vérifier cette adresse de webmaster !!!!
13            this.webmaster = "rboipsl@ipsl.jussieu.fr";
14
15            /** ************ CREATE ************ **/
16            this.createTools();
17        },
18
19        // CREATES ********************************************************
20        createTools: function()
21        {
22            var backofficeButton = new Button( {value:templateTexts["label.backoffice"], parent:this.containerTools, id:"button_bo", className: "red_button", classNameText:"red_button_text", onClick:jQuery.proxy( this.onClickBO, this )} );
23
24            var mailButton = new Button( {value:templateTexts["label.mail"], parent:this.containerTools, id:"button_mail", className: "red_button", classNameText:"red_button_text", onClick:jQuery.proxy( this.onClickMail, this )} );
25            var languageButton = new Button( {value:templateTexts["label.language.to.switch"], parent:this.containerTools, id:"button_language", className: "red_button", classNameText:"red_button_text", onClick:jQuery.proxy( this.onClickLanguage, this )} );
26            var homeButton = new Button( {value:templateTexts["label.home"], parent:this.containerTools, id:"button_home", className: "red_button", classNameText:"red_button_text", onClick:this.onClickHome} );
27        },
28
29        // REQUESTS ********************************************************
30        requestChangeLocale: function()
31        {
32            $.ajax( {
33                url: "project?methodName=setLocale&language=" + templateTexts["label.language.value.to.switch"],
34                success:function()
35                {
36                    location.reload();
37                }
38            } );
39        },
40
41        // HANDLES ******************************************************** = retours ajax
42
43        // EVENTS ********************************************************
44        onClickBO: function()
45        {
46            document.location.href = "backoffice?methodName=home";
47        },
48
49        onClickHome: function()
50        {
51            document.location.href = "index.jsp";
52        },
53
54        onClickLanguage: function()
55        {
56            this.requestChangeLocale();
57        },
58
59        onClickMail: function()
60        {
61            document.location.href = "mailto:" + this.webmaster + "?subject=[TAPAS]";
62        }
63
64    } );
65
66</script>
Note: See TracBrowser for help on using the repository browser.