Ignore:
Timestamp:
03/08/12 17:40:01 (12 years ago)
Author:
vmipsl
Message:

clean

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tapas/web/resources/templates/templateEther_script.jsp

    r396 r404  
    1313            /** *********** VARIABLES *********** **/ 
    1414            this.isLanguageFr = <%=Context.getLangue(request).equals( "fr" )%>; 
    15             this.webmaster = "<%=Context.getWebmaster(request)%>"; 
    16             <%--this.jSONUser = <%=Context.getJSONUser( request )%> ? <%=Context.getJSONUser( request )%> : false;--%> 
     15            // TODO : vérifier cette adresse de webmaster !!!! 
     16            this.webmaster = "rboipsl@ipsl.jussieu.fr"; 
    1717 
    1818            /** ************ CREATE ************ **/ 
    19 //        this.createLogin(); 
    2019            this.createTools(); 
    21             this.updateLoginOrLogout(); 
    2220        }, 
    2321 
     
    3634        }, 
    3735 
    38         createLogin: function() 
    39         { 
    40             this.loginModule = new LoginButton( {parent:this.containerLogin, urlLogin:"project?methodName=login", urlLogout:"project?methodName=logout", isNeededInscription:true, callbackInscription:jQuery.proxy( this.onClickInscription, this ), anotherOnClickLogin:this.updateLoginOrLogout, anotherOnClickLogout:this.updateLoginOrLogout } ); 
    41             this.loginModule.setJSONUser( this.jSONUser ); 
    42             this.loginModule.display(); 
    43             setLoginModule( this.loginModule ); 
    44         }, 
    45  
    4636        // REQUESTS ******************************************************** 
    4737 
     
    5747            this.webmaster = "<%=Context.getWebmaster(request)%>"; 
    5848 
    59             alert("<%=request.getQueryString()%>||<%=Context.getRelativePath( request )%>||<%=Context.getRelativePageURI(request)%>"); 
     49            alert( "<%=request.getQueryString()%>||<%=Context.getRelativePath( request )%>||<%=Context.getRelativePageURI(request)%>" ); 
    6050 
    6151            this.relativePageUri = <%=request.getQueryString() != null%> ? "<%=Context.getRelativePath( request )%>?<%=request.getQueryString()%>" : "<%=Context.getRelativePageURI(request)%>"; 
     
    7161        { 
    7262            document.location.href = "mailto:" + this.webmaster + "?subject=[TAPAS]"; 
    73         }, 
    74  
    75         onClickInscription: function() 
    76         { 
    77             var dataProtocol = "resources/jsp/dataProtocol_fr.jsp"; 
    78             if( !this.isLanguageFr ) 
    79                 dataProtocol = "resources/jsp/dataProtocol_en.jsp"; 
    80  
    81             var $dialog = $( '<div></div>' ) 
    82                     .load( dataProtocol ) 
    83                     .dialog( { 
    84                                  autoOpen: false, 
    85                                  title: loginTexts["login.inscription"], 
    86                                  height: 800, 
    87                                  width: 750 
    88                              } ); 
    89             $dialog.dialog( 'open' ); 
    90  
    91             // TODO : see with $dialog.ready() to manage buttons 
    92         }, 
    93  
    94         updateLoginOrLogout: function() 
    95         { 
    96             <%--if( "<%=UserRole.ADMINISTRATOR%>" == getJSONUserRole() )--%> 
    97             <%--$( "#button_bo" ).show();--%> 
    98             <%--else--%> 
    99             <%--$( "#button_bo" ).hide();--%> 
    10063        } 
    10164 
    10265    } ); 
    10366 
    104     /** ******************************* **/ 
    105     /** *********** ACCOUNT *********** **/ 
    106     /** ******************************* **/ 
    107     function onClickAcceptDataProtocol() 
    108     { 
    109         if( '' == $( "#lastName" ).val() || '' == $( "#email" ).val() || '' == $( "#password" ).val() ) 
    110         { 
    111             showErrorAccount( null, templateTexts["login.dataProtocolFields"] ); 
    112             return; 
    113         } 
    114  
    115         if( $( "#checkboxUser" ).attr( 'checked' ) ) 
    116             createAccount(); 
    117         else 
    118             showErrorAccount( null, templateTexts["login.dataProtocolAccept"] ); 
    119     } 
    120  
    121     function createAccount() 
    122     { 
    123         var parametersUrl = "name=" + $( "#lastName" ).val() + "&firstName=" + $( "#firstName" ).val() + "&email=" + $( "#email" ).val() + "&pwd=" + $( "#password" ).val(); 
    124         var request = $.ajax( { 
    125             url: "project?methodName=createAccount&" + parametersUrl, 
    126             success:handleCreateAccount, 
    127             error: showErrorAccount 
    128         } ); 
    129     } 
    130  
    131     function handleCreateAccount() 
    132     { 
    133         $( "#infosAccount" ).hide(); 
    134         $( "#infosAccount" ).removeClass( "containerErrors" ); 
    135         $( "#infosAccount" ).addClass( "containerInfos" ); 
    136         $( "#infosAccount" ).html( templateTexts["login.dataProtocol.account"] ); 
    137         $( "#infosAccount" ).show(); 
    138     } 
    139  
    140     function showErrorAccount( result, text ) 
    141     { 
    142         $( "#infosAccount" ).hide(); 
    143         $( "#infosAccount" ).removeClass( "containerInfos" ); 
    144         $( "#infosAccount" ).addClass( "containerErrors" ); 
    145         if( null != result ) 
    146             $( "#infosAccount" ).html( templateTexts[result.responseText] ); 
    147         else 
    148             $( "#infosAccount" ).html( text ); 
    149  
    150         $( "#infosAccount" ).show(); 
    151     } 
    15267</script> 
Note: See TracChangeset for help on using the changeset viewer.