Changeset 404 for tapas/web/resources/templates/templateEther_script.jsp
- Timestamp:
- 03/08/12 17:40:01 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tapas/web/resources/templates/templateEther_script.jsp
r396 r404 13 13 /** *********** VARIABLES *********** **/ 14 14 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"; 17 17 18 18 /** ************ CREATE ************ **/ 19 // this.createLogin();20 19 this.createTools(); 21 this.updateLoginOrLogout();22 20 }, 23 21 … … 36 34 }, 37 35 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 46 36 // REQUESTS ******************************************************** 47 37 … … 57 47 this.webmaster = "<%=Context.getWebmaster(request)%>"; 58 48 59 alert( "<%=request.getQueryString()%>||<%=Context.getRelativePath( request )%>||<%=Context.getRelativePageURI(request)%>");49 alert( "<%=request.getQueryString()%>||<%=Context.getRelativePath( request )%>||<%=Context.getRelativePageURI(request)%>" ); 60 50 61 51 this.relativePageUri = <%=request.getQueryString() != null%> ? "<%=Context.getRelativePath( request )%>?<%=request.getQueryString()%>" : "<%=Context.getRelativePageURI(request)%>"; … … 71 61 { 72 62 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: 75088 } );89 $dialog.dialog( 'open' );90 91 // TODO : see with $dialog.ready() to manage buttons92 },93 94 updateLoginOrLogout: function()95 {96 <%--if( "<%=UserRole.ADMINISTRATOR%>" == getJSONUserRole() )--%>97 <%--$( "#button_bo" ).show();--%>98 <%--else--%>99 <%--$( "#button_bo" ).hide();--%>100 63 } 101 64 102 65 } ); 103 66 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 else118 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: showErrorAccount128 } );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 else148 $( "#infosAccount" ).html( text );149 150 $( "#infosAccount" ).show();151 }152 67 </script>
Note: See TracChangeset
for help on using the changeset viewer.