Ignore:
Timestamp:
12/01/11 21:10:05 (13 years ago)
Author:
vmipsl
Message:

Data protocole, inscription

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ether_megapoli/trunk/web/resources/js/classesForJQuery/LoginButton.js

    r269 r278  
    44// 
    55// use jQuery && librairies from TwitterLogin 
     6// isNeededInscription : true if we need the part "inscription for a new user" 
    67//******************************************************** 
    78 
     
    1819        this.urlLogout = param.urlLogout ? param.urlLogout : false; 
    1920        this.classNameToAdd = param.classNameToAdd ? param.classNameToAdd : false; 
     21        this.isNeededInscription = param.isNeededInscription ? param.isNeededInscription : false; 
     22        this.callbackInscription = param.callbackInscription ? param.callbackInscription : false; 
    2023 
    2124        // Texts 
    2225        this.connexionText = param.connexionText ? param.connexionText : loginTexts["app.connexion"]; 
    2326        this.loginText = param.loginText ? param.loginText : loginTexts["data.authentification.login"]; 
    24         this.pwdText = param.pwdText ? param.pwdText : loginTexts["data.authentification.pwd"]; 
     27        this.pwdText = param.pwdText ? param.pwdText : loginTexts["data.authentification.password"]; 
    2528        this.submitText = param.submitText ? param.submitText : loginTexts["data.authentification.sign"]; 
    2629        this.forgotPText = param.forgotPText ? param.forgotPText : loginTexts["data.authentification.pwdForget"]; 
    2730        this.forgotUNPHelpText = param.forgotUNPHelpText ? param.forgotUNPHelpText : loginTexts["data.authentification.loginForget.help"]; 
    2831        this.forgotUNPText = param.forgotUNPText ? param.forgotUNPText : loginTexts["data.authentification.loginForget"]; 
     32        this.inscriptionText = param.inscriptionText ? param.inscriptionText : loginTexts["data.authentification.inscription"]; 
    2933        this.text1 = param.text1 ? param.text1 : loginTexts["app.admin"]; 
    3034        this.errorText = param.errorText ? param.errorText : loginTexts[this.errors]; 
     
    5155        var labelLogin = $( document.createElement( "label" ) ); 
    5256        labelLogin.attr( {for:"login"} ); 
    53         labelLogin.append( this.loginText ); 
     57        labelLogin.html( this.loginText ); 
    5458        var inputLogin = $( document.createElement( "input" ) ); 
    5559        inputLogin.attr( {id:"login", name:"login", tabIndex:"4", type:"text"} ); 
     
    5963        var labelPwd = $( document.createElement( "label" ) ); 
    6064        labelPwd.attr( {for:"pwd"} ); 
    61         labelPwd.append( this.pwdText ); 
     65        labelPwd.html( this.pwdText ); 
    6266        var inputPwd = $( document.createElement( "input" ) ); 
    6367        inputPwd.attr( {id:"pwd", name:"pwd", tabIndex:"5", type:"password"} ); 
     
    7781        var aForgotP = $( document.createElement( "a" ) ); 
    7882        aForgotP.attr( {id:"resend_password_link", href:"mailto:${webmaster}?subject=[MEGAPOLI] login"} ); 
    79         aForgotP.append( this.forgotPText ); 
     83        aForgotP.html( this.forgotPText ); 
    8084        inputForgotP.append( aForgotP ); 
    8185        containerLoginForm.append( inputForgotP ); 
     
    8589        var aForgotUNP = $( document.createElement( "a" ) ); 
    8690        aForgotUNP.attr( {id:"forgot_username_link", href:"mailto:${webmaster}?subject=[MEGAPOLI] password", title:this.forgotUNPHelpText} ); 
    87         aForgotUNP.append( this.forgotUNPText ); 
     91        aForgotUNP.html( this.forgotUNPText ); 
    8892        inputForgotUNP.append( aForgotUNP ); 
    8993        containerLoginForm.append( inputForgotUNP ); 
     94 
     95        if( this.isNeededInscription ) 
     96        { 
     97            var inputInscription = $( document.createElement( "p" ) ); 
     98            inputInscription.addClass( "inscription" ); 
     99            var aInscription = $( document.createElement( "a" ) ); 
     100            aInscription.attr( {id:"inscription_link", href:"#"} ); 
     101            aInscription.html( this.inscriptionText ); 
     102            aInscription.bind( "click", jQuery.proxy( this.onClickInscription, this ) ); 
     103            inputInscription.append( aInscription ); 
     104            containerLoginForm.append( inputInscription ); 
     105        } 
    90106 
    91107        var divErrors = $( document.createElement( "div" ) ); 
     
    236252    { 
    237253        this.requestLogout(); 
     254    }, 
     255 
     256    onClickInscription: function() 
     257    { 
     258        this.containerErrors.hide(); 
     259        if( this.callbackInscription ) 
     260            this.callbackInscription(); 
    238261    } 
    239262 
Note: See TracChangeset for help on using the changeset viewer.