source: ether_megapoli/trunk/web/resources/jsp/backofficeHead.jsp @ 278

Last change on this file since 278 was 278, checked in by vmipsl, 13 years ago

Data protocole, inscription

File size: 3.6 KB
Line 
1<%@ page import="com.medias.Context" %>
2
3<script type="text/javascript">
4    var InterfaceTemplate = Class.create( {
5
6        initialize: function()
7        {
8            /** *********** CONTAINERS *********** **/
9            this.containerTitle = $( "#title" );
10            this.containerTools = $( "#tools" );
11            this.containerLogin = $( "#loginModule" );
12            this.containerMenu = $( "#menuBO" );
13
14            /** *********** VARIABLES *********** **/
15            this.isLanguageFr = <%=Context.getLangue(request).equals( "fr" )%>;
16            this.path = "<%=request.getContextPath()%>";
17            this.webmaster = "<%=Context.getWebmaster(request)%>";
18            this.relativePageUri = <%=request.getQueryString() != null%> ? "<%=Context.getRelativePath( request )%>?<%=request.getQueryString()%>" : "<%=Context.getRelativePageURI(request)%>";
19            this.jSONUser = <%=Context.getJSONUser( request )%> ? <%=Context.getJSONUser( request )%> : false;
20            this.screenWidthLimit = 1336;
21
22            /** ************ CREATE ************ **/
23            this.createTitleTools();
24            this.createMenu();
25        },
26
27        // CREATES ********************************************************
28        createTitleTools: function()
29        {
30            this.containerTitle.addClass( "containerTitle" );
31            this.containerTitle.html( templateTexts["bo.fulltitle"] );
32
33            this.createLogin();
34
35            var homeButton = new Button( {value:templateTexts["app.home"], parent:this.containerTools, id:"button_home", className: "gray_button", classNameText:"blue_button_text", onClick:this.onClickHome} );
36
37            var divSmallLogoEther = $( document.createElement( "div" ) );
38            divSmallLogoEther.attr( {id:"smallLogoEther", class:"containerSmallLogoEther"} );
39            divSmallLogoEther.append( '<a href="http://ether.ipsl.jussieu.fr" target="help"><img src="resources/images/logo_Ether.jpg" width="40px" height="40px"/></a>' );
40            this.containerTools.append( divSmallLogoEther );
41            $( "#smallLogoEther" ).show();
42
43            this.updateLogoEther();
44        },
45
46        createLogin: function()
47        {
48            var buttonLogin = new LoginButton( { parent:this.containerLogin, urlLogin:"project?methodName=login", urlLogout:"project?methodName=logout", classNameToAdd:"gray" } );
49            buttonLogin.setJSONUser( this.jSONUser );
50            buttonLogin.display();
51        },
52
53        createMenu: function()
54        {
55            var usersButton = new Button( {value:templateTexts["bo.user"], parent:this.containerMenu, id:"button_home", className: "gray_button", classNameText:"blue_button_text", onClick:this.onClickUser} );
56        },
57
58        // EVENTS ********************************************************
59        onClickHome: function()
60        {
61            document.location.href = "backoffice?methodName=view";
62        },
63
64        onClickUser: function()
65        {
66            document.location.href = "backoffice?methodName=viewUser";
67        },
68
69        /**
70         * This method display a small Ether logo if the screen is too small to contain the big one
71         */
72        updateLogoEther: function()
73        {
74            if( this.screenWidthLimit > innerWidth )
75            {
76                $( "#logoEther" ).hide();
77                $( "#linkLogoEther" ).hide();
78                $( "#smallLogoEther" ).show();
79            }
80            else
81            {
82                $( "#logoEther" ).show();
83                $( "#linkLogoEther" ).show();
84                $( "#smallLogoEther" ).hide();
85            }
86        }
87
88    } );
89
90</script>
Note: See TracBrowser for help on using the repository browser.