Changeset 265 for ether_megapoli/trunk/web/resources/jsp/backofficeHead.jsp
- Timestamp:
- 11/24/11 17:32:33 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ether_megapoli/trunk/web/resources/jsp/backofficeHead.jsp
r251 r265 9 9 this.containerTitle = $( "#title" ); 10 10 this.containerTools = $( "#tools" ); 11 this.containerLogin = $( "#loginModule" ); 11 12 12 13 /** *********** VARIABLES *********** **/ … … 20 21 /** ************ CREATE ************ **/ 21 22 this.createTitleTools(); 23 this.createMenu(); 22 24 }, 23 25 … … 30 32 this.createLogin(); 31 33 32 var valueLanguage = templateTexts["app.fr"];33 if( this.isLanguageFr )34 valueLanguage = templateTexts["app.en"];35 36 var languageButton = new Button( {value:valueLanguage, parent:this.containerTools, id:"button_language", className: "gray_button", classNameText:"blue_button_text", onClick:jQuery.proxy( this.onClickLanguage, this )} );37 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} ); 38 35 … … 46 43 createLogin: function() 47 44 { 48 var containerLoginButton = $( "#button_login" ); 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 49 50 if( this.jSONUser ) 51 { 52 var textLogin = this.jSONUser.name + " " + this.jSONUser.firstName; 53 if( this.jSONUser.role && this.jSONUser.role == "coordinateur" ) 54 textLogin += " (" + templateTexts["app.admin"] + ")"; 55 56 var loginButton = new ComplexButton( {value:textLogin, parent:this.containerTools, id:"button_login"} ); 57 58 $( "#button_login #button_middle #button_text" ).addClass( "containerUserLogout" ); 59 60 var loginMiddle = $( "#button_login #button_middle" ); 61 var divImgLogout = $( document.createElement( "div" ) ); 62 divImgLogout.addClass( "containerImgLogout" ); 63 divImgLogout.append( "<img src='resources/images/utils/logout.png' width='15px' height='15px/>" ); 64 divImgLogout.bind( "click", this.onClickLogout ); 65 loginMiddle.append( divImgLogout ); 66 } 67 else 68 { 69 var loginButton = new ComplexButton( {value:templateTexts["app.connexion"], parent:this.containerTools, id:"button_login"} ); 70 71 var loginMiddle = $( "#button_login #button_middle" ); 72 loginMiddle.empty(); 73 loginMiddle.attr( {id:"topnav", class:"topnav complexButton_middle"} ); 74 var aLogin = $( document.createElement( "a" ) ); 75 aLogin.attr( {id:"button_login_a", href:"login", class:"signin"} ); 76 aLogin.html( "<span>" + templateTexts["app.connexion"] + "</span>" ); 77 loginMiddle.append( aLogin ); 78 79 $( document ).ready( function() 80 { 81 $( ".signin" ).click( function( e ) 82 { 83 e.preventDefault(); 84 $( "fieldset#signin_menu" ).toggle(); 85 $( ".signin" ).toggleClass( "menu-open" ); 86 } ); 87 88 $( "fieldset#signin_menu" ).mouseup( function() 89 { 90 return false 91 } ); 92 93 $( document ).mouseup( function( e ) 94 { 95 if( $( e.target ).parent( "a.signin" ).length == 0 ) 96 { 97 $( ".signin" ).removeClass( "menu-open" ); 98 $( "fieldset#signin_menu" ).hide(); 99 } 100 } ); 101 } ); 102 103 $( function() 104 { 105 $( '#forgot_username_link' ).tipsy( {gravity: 'w'} ); 106 } ); 107 } 50 createMenu: function() 51 { 108 52 }, 109 53 … … 116 60 onClickLogout: function() 117 61 { 62 alert( "BO" ); 118 63 document.location.href = "Disconnect.do"; 119 64 }, 120 65 121 onClickL anguage: function()66 onClickLogout: function() 122 67 { 123 if( this.isLanguageFr ) 124 document.location.href = this.path + "/English.do?requestUri=" + this.relativePageUri; 125 else 126 document.location.href = this.path + "/French.do?requestUri=" + this.relativePageUri; 68 alert( "BO" ); 69 document.location.href = "Disconnect.do"; 127 70 } 128 71 } );
Note: See TracChangeset
for help on using the changeset viewer.