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 | |
---|
13 | /** *********** VARIABLES *********** **/ |
---|
14 | this.isLanguageFr = <%=Context.getLangue(request).equals( "fr" )%>; |
---|
15 | this.path = "<%=request.getContextPath()%>"; |
---|
16 | this.webmaster = "<%=Context.getWebmaster(request)%>"; |
---|
17 | this.relativePageUri = <%=request.getQueryString() != null%> ? "<%=Context.getRelativePath( request )%>?<%=request.getQueryString()%>" : "<%=Context.getRelativePageURI(request)%>"; |
---|
18 | this.jSONUser = <%=Context.getJSONUser( request )%> ? <%=Context.getJSONUser( request )%> : false; |
---|
19 | this.screenWidthLimit = 1336; |
---|
20 | |
---|
21 | /** ************ CREATE ************ **/ |
---|
22 | this.createTitleTools(); |
---|
23 | this.createMenu(); |
---|
24 | }, |
---|
25 | |
---|
26 | // CREATES ******************************************************** |
---|
27 | createTitleTools: function() |
---|
28 | { |
---|
29 | this.containerTitle.addClass( "containerTitle" ); |
---|
30 | this.containerTitle.html( templateTexts["bo.fulltitle"] ); |
---|
31 | |
---|
32 | this.createLogin(); |
---|
33 | |
---|
34 | var homeButton = new Button( {value:templateTexts["app.home"], parent:this.containerTools, id:"button_home", className: "gray_button", classNameText:"blue_button_text", onClick:this.onClickHome} ); |
---|
35 | |
---|
36 | var divSmallLogoEther = $( document.createElement( "div" ) ); |
---|
37 | divSmallLogoEther.attr( {id:"smallLogoEther", class:"containerSmallLogoEther"} ); |
---|
38 | divSmallLogoEther.append( '<a href="http://ether.ipsl.jussieu.fr" target="help"><img src="resources/images/logo_Ether.jpg" width="40px" height="40px"/></a>' ); |
---|
39 | this.containerTools.append( divSmallLogoEther ); |
---|
40 | $( "#smallLogoEther" ).show(); |
---|
41 | }, |
---|
42 | |
---|
43 | createLogin: function() |
---|
44 | { |
---|
45 | var buttonLogin = new LoginButton( {parent:this.containerLogin, urlLogin:"project?methodName=login", urlLogout:"project?methodName=logout" } ); |
---|
46 | buttonLogin.setJSONUser( this.jSONUser ); |
---|
47 | buttonLogin.display(); |
---|
48 | }, |
---|
49 | |
---|
50 | createMenu: function() |
---|
51 | { |
---|
52 | }, |
---|
53 | |
---|
54 | // EVENTS ******************************************************** |
---|
55 | onClickHome: function() |
---|
56 | { |
---|
57 | document.location.href = "backoffice?methodName=view"; |
---|
58 | }, |
---|
59 | |
---|
60 | onClickLogout: function() |
---|
61 | { |
---|
62 | alert( "BO" ); |
---|
63 | document.location.href = "Disconnect.do"; |
---|
64 | }, |
---|
65 | |
---|
66 | onClickLogout: function() |
---|
67 | { |
---|
68 | alert( "BO" ); |
---|
69 | document.location.href = "Disconnect.do"; |
---|
70 | } |
---|
71 | } ); |
---|
72 | |
---|
73 | </script> |
---|