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

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

gestion langues fr/en

File size: 2.5 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 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 )} );
23            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 )} );
24            var homeButton = new Button( {value:templateTexts["label.home"], parent:this.containerTools, id:"button_home", className: "red_button", classNameText:"red_button_text", onClick:this.onClickHome} );
25        },
26
27        // REQUESTS ********************************************************
28        requestChangeLocale: function()
29        {
30            $.ajax( {
31                url: "project?methodName=setLocale&language=" + templateTexts["label.language.value.to.switch"],
32                success:function()
33                {
34                    location.reload();
35                }
36            } );
37        },
38
39        // HANDLES ******************************************************** = retours ajax
40        handleChangeLocale: function( result )
41        {
42            var bob = jQuery.parseJSON( result ).result;
43            alert( bob );
44        },
45
46        // EVENTS ********************************************************
47        onClickHome: function()
48        {
49            document.location.href = "index.jsp";
50        },
51
52        onClickLanguage: function()
53        {
54            this.requestChangeLocale();
55        },
56
57        onClickMail: function()
58        {
59            document.location.href = "mailto:" + this.webmaster + "?subject=[TAPAS]";
60        }
61
62    } );
63
64</script>
Note: See TracBrowser for help on using the repository browser.