Changeset 290 for ether_megapoli/trunk/web/resources/js
- Timestamp:
- 12/07/11 16:10:28 (13 years ago)
- Location:
- ether_megapoli/trunk/web/resources/js/classesForJQuery
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
ether_megapoli/trunk/web/resources/js/classesForJQuery/Button.js
r267 r290 19 19 this.parent = param.parent ? param.parent : false; 20 20 this.value = param.value ? param.value : ""; 21 this.title = param.title ? param.title : false; 21 22 this.className = param.className ? param.className : false; 22 23 this.classNameText = param.classNameText ? param.classNameText : false; … … 33 34 if( this.className ) 34 35 this.divContainer.addClass( this.className ); 35 this.divContainer.attr( {id:this.id} ); 36 if( this.title ) 37 this.divContainer.attr( {id:this.id, title:this.title} ); 38 else 39 this.divContainer.attr( {id:this.id} ); 36 40 if( this.parent ) 37 41 this.parent.append( this.divContainer ); -
ether_megapoli/trunk/web/resources/js/classesForJQuery/LoginButton.js
r281 r290 13 13 // Init 14 14 this.parent = param.parent ? param.parent : document.body; 15 this. onClickLogin = param.anotherOnClickLogin ? param.anotherOnClickLogin : this.onClickLogin;16 this. onClickLogout = param.anotherOnClickLogout ? param.anotherOnClickLogout : this.onClickLogout;15 this.anotherOnClickLogin = param.anotherOnClickLogin ? param.anotherOnClickLogin : false; 16 this.anotherOnClickLogout = param.anotherOnClickLogout ? param.anotherOnClickLogout : false; 17 17 this.jSONUser = param.jSONUser ? param.jSONUser : false; 18 18 this.urlLogin = param.urlLogin ? param.urlLogin : false; … … 31 31 this.forgotUNPText = param.forgotUNPText ? param.forgotUNPText : loginTexts["data.authentification.loginForget"]; 32 32 this.inscriptionText = param.inscriptionText ? param.inscriptionText : loginTexts["data.authentification.inscription"]; 33 this.text1 = param.text1 ? param.text1 : loginTexts["app.admin"];34 33 this.errorText = param.errorText ? param.errorText : loginTexts[this.errors]; 35 34 }, … … 44 43 { 45 44 return this.jSONUser; 45 }, 46 47 getJSONUserRole: function() 48 { 49 return this.jSONUser.role; 46 50 }, 47 51 … … 115 119 if( this.jSONUser ) 116 120 { 117 var textLogin = this.jSONUser.name + " " + this.jSONUser.firstName; 118 // TODO : revoir les rÃŽles 119 if( this.jSONUser.role && "COORDINATOR" == this.jSONUser.role ) 120 textLogin += " (" + this.text1 + ")"; 121 var textLogin = this.jSONUser.name + " " + this.jSONUser.firstName + " (" + loginTexts[this.jSONUser.role] + ")"; 121 122 122 123 var loginButton = new ComplexButton( {value:textLogin, parent:this.parent, id:"button_login", classNameToAdd: this.classNameToAdd} ); … … 169 170 }, 170 171 171 updateLogin : function()172 updateLoginOrLogout: function() 172 173 { 173 174 this.parent.empty(); … … 200 201 return; 201 202 202 // TODO : passer en crypter ces infos !!!!!203 203 var login = $( "#login" ).val(); 204 204 var pwd = $( "#pwd" ).val(); … … 226 226 this.setJSONUser( null != jQuery.parseJSON( result ).jSONPeople ? jQuery.parseJSON( result ).jSONPeople : false ); 227 227 if( null == this.errors ) 228 this.updateLogin ();228 this.updateLoginOrLogout(); 229 229 else 230 230 this.displayLoginErrors( loginTexts[this.errors] ); 231 232 if( this.anotherOnClickLogin ) 233 this.anotherOnClickLogin(); 231 234 }, 232 235 … … 237 240 { 238 241 this.setJSONUser( false ); 239 this.updateLogin ();242 this.updateLoginOrLogout(); 240 243 } 241 244 else 242 245 this.displayLoginErrors( loginTexts[this.errors] ); 246 247 if( this.anotherOnClickLogout ) 248 this.anotherOnClickLogout(); 243 249 }, 244 250 -
ether_megapoli/trunk/web/resources/js/classesForJQuery/etherHelper.js
r287 r290 17 17 { 18 18 return getLoginModule().getJSONUser(); 19 } 20 21 function getJSONUserRole() 22 { 23 return getLoginModule().getJSONUserRole(); 19 24 } 20 25
Note: See TracChangeset
for help on using the changeset viewer.