Changeset 714 for ether_iasi
- Timestamp:
- 01/17/13 12:43:50 (12 years ago)
- Location:
- ether_iasi/trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
ether_iasi/trunk/persistence/implementation/hibernate.cfg.xml
r710 r714 15 15 <property name="hibernateProperties"> 16 16 <props> 17 <!--<prop key="hibernate.bytecode.use_reflection_optimizer">false</prop>-->18 <!--<prop key="hibernate.connection.driver_class">org.postgresql.Driver</prop>-->19 <!--<prop key="hibernate.connection.url">jdbc:postgresql://darkstar.ipslnet:5432/PROJECT_SOURCE</prop>-->20 <!--<prop key="hibernate.connection.username">postgres</prop>-->21 <!--<prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</prop>-->22 <!--<prop key="hibernate.generate_statistics">true</prop>-->23 <!--<prop key="hibernate.connection.url">jdbc:mysql://localhost/geisa?autoReconnect=true</prop>-->24 25 26 <!--<prop key="hibernate.connection.driver_class">com.mysql.jdbc.Driver</prop>27 <prop key="hibernate.connection.url">jdbc:mysql://localhost/geisa</prop> -->28 <!-- en local-->29 <!-- <prop key="hibernate.connection.username">root</prop>-->30 <!-- sur naboo -->31 <!--<prop key="hibernate.connection.username">geisa</prop>-->32 <!-- <prop key="hibernate.connection.password">geisa11</prop>33 <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>34 <prop key="hibernate.show_sql">true</prop> -->35 36 37 17 <!-- configuration pool via c3p0--> 38 18 <prop key="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</prop> -
ether_iasi/trunk/service/implementation/service-context.xml
r713 r714 3 3 4 4 <beans> 5 <bean id="iasiServiceTarget" class="com.ether.IasiServiceImpl"> 6 <!--<property name="isotopeG03DAO" ref="refIsotopeG03DAO"/>--> 7 </bean> 5 <bean id="iasiService" class="com.ether.IasiServiceImpl"></bean> 8 6 9 <bean id="iasiService" parent="transactionProxy"> 10 <property name="target"> 11 <ref bean="iasiServiceTarget"/> 12 </property> 13 <property name="transactionAttributeSource"> 14 <bean class="org.springframework.transaction.annotation.AnnotationTransactionAttributeSource"/> 15 </property> 16 </bean> 7 <!--<bean id="iasiServiceTarget" class="com.ether.IasiServiceImpl">--> 8 <!--<property name="isotopeG03DAO" ref="refIsotopeG03DAO"/>--> 9 <!--</bean>--> 10 11 <!--<bean id="iasiService" parent="transactionProxy">--> 12 <!--<property name="target">--> 13 <!--<ref bean="iasiServiceTarget"/>--> 14 <!--</property>--> 15 <!--<property name="transactionAttributeSource">--> 16 <!--<bean class="org.springframework.transaction.annotation.AnnotationTransactionAttributeSource"/>--> 17 <!--</property>--> 18 <!--</bean>--> 17 19 18 20 </beans> -
ether_iasi/trunk/web/index.jsp
r713 r714 1 1 <%--This redirect is used to allow messages sources in the index page--%> 2 <jsp:forward page="project?methodName= home"/>2 <jsp:forward page="project?methodName=view"/> -
ether_iasi/trunk/web/project/quicklook.jsp
r713 r714 1 <%@ page contentType="text/html;charset=UTF-8" language="java" %> 1 <%@ page language="java" %> 2 <%@ taglib prefix="ether" tagdir="/WEB-INF/tags" %> 2 3 <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 3 <%@ taglib prefix="tiles" uri="/WEB-INF/tlds/struts-tiles.tld" %>4 <%@ taglib prefix="ether" tagdir="/WEB-INF/tags" %>5 4 6 < tiles:insert page="/resources/templates/templateGeisa.jsp" flush="true">5 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 7 6 8 <tiles:put name="insertCss" type="string"> 9 <ether:htmlCss cssFile="select"/> 10 <%-- pour créer la fenêtre pop up --%> 11 <ether:htmlCss cssFile="jquery-ui-1.8.16.custom/jquery-ui-1.8.16.custom"/> 12 </tiles:put> 7 <HTML> 8 <HEAD> 9 <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> 10 <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> 13 11 14 <tiles:put name="insertJsOrJsp" type="string"> 15 <ether:htmlJsp jspFile="initGeisa_script"/> 16 <ether:htmlJs jsFile="classesForJQuery/Select"/> 17 <ether:htmlJs jsFile="classesForJQuery/Loading"/> 18 <ether:htmlJs jsFile="classesForJQuery/Tab"/> 19 <%-- pour créer la fenêtre pop up --%> 20 <ether:htmlJs jsFile="library/jquery-ui-1.8.16.custom/js/jquery-ui-1.8.16.custom.min"/> 21 </tiles:put> 12 <title><spring:message code="title"/></title> 13 <%--<link rel="shortcut icon" href="<html:rewrite page='/resources/images/megapoli/favicon.ico'/>">--%> 22 14 23 <tiles:put name="title" type="string"><spring:message code="app.title"/> - <spring:message code="title.home"/></tiles:put> 15 <ether:htmlCss cssFile="button"/> 16 <ether:htmlCss cssFile="ether"/> 17 <ether:htmlCss cssFile="statistics"/> 18 <ether:htmlCss cssFile="printContent"/> 19 <ether:htmlCss cssFile="select"/> 24 20 21 <ether:htmlJs jsFile="library/jquery-1.4.2.min"/> 22 <ether:htmlJs jsFile="library/jquery.class"/> 23 <ether:htmlJs jsFile="library/jquery.protify-0.3"/> 25 24 26 <%-- ****************** CONTENT ****************** --%> 27 <tiles:put name="bodytitle" type="string"><spring:message code="title.home"/></tiles:put> 25 <ether:htmlJs jsFile="library/jquery-1.8.2.min"/> 26 <ether:htmlJs jsFile="library/jquery-ui-1.9.0.custom"/> 27 <ether:htmlJs jsFile="library/jquery.class"/> 28 <ether:htmlJs jsFile="library/jquery.protify-0.3"/> 29 <ether:htmlJs jsFile="classesForJQuery/etherHelper"/> 30 <ether:htmlJs jsFile="classesForJQuery/Button"/> 31 <ether:htmlJs jsFile="classesForJQuery/DragSlide"/> 32 <ether:htmlJs jsFile="classesForJQuery/Select"/> 33 <ether:htmlJs jsFile="classesForJQuery/PrintContent"/> 28 34 29 <tiles:put name="body" type="string"> 35 <ether:htmlJsp jspFile="quicklook_script"/> 36 </HEAD> 30 37 31 <div id="titlePage" class="titlePage"></div><br>38 <BODY> 32 39 33 <div id="tabs" class="containerTabs"></div>40 <div id="pageWrapper" class="pageWrapper"> 34 41 35 <!-- Variable cachée pour indiquée quelle option graphique est sélectionnée --> 36 <input type="hidden" id="graphicOptionChoice" name="" value="contents"> 42 qdjkqsldjqskldj 37 43 44 <%-- ****************** TITLE & TOOLS ****************** --%> 45 <script type="text/javascript"> 46 var interfaceTexts = $A( "" ); 38 47 39 <div id="informationContents" class="information"> This tool allows you to draw the spectroscopic parameters in function of the wavenumber. Please select the parameters to draw your own graph. 40 <br> 41 For further information, please download the <a href="initGeisa.jsp#">user manual</a>. 42 </div> 48 // new InterfaceIasi(); 49 </script> 43 50 44 <div style="display:none;" id="informationGlobal" class="information"> This tool is to draw global representation. 45 <br> 46 For further information, please download the <a href="initGeisa.jsp#">user manual</a>. 47 </div> 48 49 <div style="display:none;" id="informationComparison" class="information"> This tool is to compare two databases. 50 <br> 51 For further information, please download the <a href="initGeisa.jsp#">user manual</a>. 52 </div> 53 54 55 <div id="formulaire" class="formulaire"> 56 57 <div id="inputs" class="inputs"> 58 <fieldset class="general"><legend><span class="fieldsetGeneralTitle">Inputs :</span></legend> 59 <div id="database" class="database"> 60 <fieldset class="options"><legend> <b>Choosing database :</b></legend> 61 <!--Pour l'onglet "Database comparison" --> 62 <div style="display:none;" id="titreDatabase1" class="containerBeginDatabase">First database :</div> 63 <div id="database1" class="containerBeginDatabase"></div> 64 <!--Pour l'onglet "Database comparison" --> 65 <div style="display:none;" id="titreDatabase2" class="containerBeginDatabase">Seconde database : </div> 66 <div style="display:none;" id="database2" class="containerDatabase"></div> 67 </fieldset> 68 </div> 69 70 <div id="molecules" class="molecules"> 71 <fieldset class="options"><legend> <b>Choosing molecules :</b></legend> 72 <div id="BDD-GEISA2011" class="moleculesGEISA11"> 73 </div> 74 <div style="display:none;" id="BDD-GEISAIASI2011" class="moleculesGEISA11"> 75 </div> 76 <div style="display:none;" id="BDD-GEISA2003" class="moleculesGEISA11"> 77 </div> 78 <div style="display:none;" id="BDD-GEISAIASI2003" class="moleculesGEISA11"> 79 </div> 80 <div id="selectAndShow" class="selectAndShowIsotopes"> 81 </div> 82 </fieldset> 83 </div> 84 </fieldset> 85 </div> 86 87 88 89 <div id="basicOptions" class="basicOptions"> 90 <fieldset class="general"><legend><span class="fieldsetGeneralTitle">Basic Options :</span></legend> 91 92 <div id="spectralRange" class="spectralRange"> 93 <fieldset class="options"><legend><b><div id="spectralRangeTitre"></div></b></legend> 94 <div id="spectralRangeLower" class="containerInsideOptions"></div> 95 <div id="spectralRangeUpper" class="containerInsideOptions"></div> 96 <div id="samplingStep" class="containerInsideOptions"></div> 97 </fieldset> 98 </div> 99 100 <div id="intensity" class="intensity"> 101 <fieldset class="options"><legend><b>Choosing intensity range (0 to 1E<sup>-16</sup>cm<sup>-1</sup>/molecule.cm<sup>-2</sup>) :</b></legend> 102 <div id="intensityLower" class="containerInsideOptions"></div> 103 <div id="intensityUpper" class="containerInsideOptions"></div> 104 </fieldset> 105 </div> 106 107 <div id="axeY1Gene" class="axeY1Gene"> 108 <fieldset class="options"><legend><b>Choosing line transition parameter : </b><a href="initGeisa.jsp#" TITLE="Selection of spectral parameter to draw (intensity, HWM ..etc.) according to wavenumbers. Note that, itâs possible to draw also the number of transitions when a bin-average greater than 0 is chosen (see advanced options). "><img src="../resources/images/elements/index.jpeg" height="16px" width="16px"></a> </legend> 109 <div id="axeY1" class="containerInsideOptions"></div> 110 </fieldset> 111 </div> 112 113 <div id="drawingOptionsY1" class="drawingOptionsY1"> 114 <fieldset class="options"><legend> <b>Drawing options :</b></legend> 115 <div id="nbCourbes" class="containerInsideOptions"></div> 116 <div id="scaleY1Titre" class="containerInsideOptions"></div> 117 <div id="scaleY1" class="containerInsideOptions"></div> 118 <div id="typePlotY1Titre" class="containerInsideOptions"></div> 119 <!--Pour l'onglet "Database comparison" --> 120 <div style="display:none;" id="titreTypePlotDatabase1" class="containerBeginPlot">1st database</div> 121 <div id="typePlotY1" class="containerInsideOptions"></div> 122 <!--Pour l'onglet "Database comparison" --> 123 <div style="display:none;" id="titreTypePlotDatabase2" class="containerBeginPlot">2nd database</div> 124 <div style="display:none;" id="typePlotDatabase2" class="containerPlot"></div> 125 </fieldset> 126 </div> 127 </fieldset> 128 </div> 129 130 131 <div id="showAdvancedOptions" class="showAdvancedOptions"></div> 132 133 <div style="display:none;" id="advancedOptions" class="advancedOptions"> 134 <fieldset class="general"><legend><span class="fieldsetGeneralTitle">Advanced Options :</span></legend> 135 <div id="transition" class="transition"> 136 <fieldset class="options"><legend> <b>Choosing vibrational transitions : </b><a href="initGeisa.jsp#" TITLE="Selection of an upper and/or a lower vibrational state related to one given molecule. The list of available states depends on the chosen molecule and on the spectral interval."><img src="../resources/images/elements/index.jpeg" height="16px" width="16px"></a></legend> 137 <div id="transitionValue" class="transitionValue"> 138 <div id="transitionUpper" class="containerInsideOptions"></div> 139 <div id="transitionLower" class="containerInsideOptions"></div> 140 </div> 141 <div id="transitionReset" class="transitionReset"> 142 </div> 143 </fieldset> 144 </div> 145 146 <div id="meanValue" class="meanValue"> 147 <fieldset class="options"><legend> <b>Parameter mean values : </b><a href="initGeisa.jsp#" TITLE="To draw average values of the selected parameter, choose a bin-average greater than 0. The bin-average is the step according to which the averages values are calculated. "><img src="../resources/images/elements/index.jpeg" height="16px" width="16px"></a></legend> 148 <div id="meanValue1" class="containerInsideOptions"></div> 149 </fieldset> 150 </div> 151 152 <div id="axeY2Gene" class="axeY2Gene"> 153 <fieldset class="options"><legend> <b>Choosing secondary line transition parameter : </b><a href="initGeisa.jsp#" TITLE="Optional option, for drawing a secondary parameter (coupled with the primary one)."><img src="../resources/images/elements/index.jpeg" height="16px" width="16px"></a></legend> 154 <div id="axeY2Titre" class="containerInsideOptions"></div> 155 <div id="axeY2" class="containerInsideOptions"></div> 156 </fieldset> 157 </div> 158 159 <div id="drawingOptionsY2" class="drawingOptionsY2"> 160 <fieldset class="options"><legend> <b>Drawing options (secondary parameter) :</b></legend> 161 <div id="scaleY2Titre" class="containerInsideOptions"></div> 162 <div id="scaleY2" class="containerInsideOptions"></div> 163 <div id="typePlotY2Titre" class="containerInsideOptions"></div> 164 <div id="typePlotY2" class="containerInsideOptions"></div> 165 </fieldset> 166 </div> 167 <!--Pour l'onglet "Database comparison" --> 168 <div style="display:none;" id="outputDatabaseComparison" class="outputDatabaseComparison"> 169 <fieldset class="options"><legend> <b>Database comparison output choice :</b></legend> 170 <div id="outputDatabaseComparisonChoice" class="containerInsideOptions"></div> 171 172 </fieldset> 173 </div> 174 </fieldset> 175 </div> 176 177 178 <div id="boutonSubmit" class="boutonSubmit"></div> 179 <!-- image d'attente --> 180 <div id="loading" class="loading"></div> 181 <!-- <div id="boutonTemp"></div> --> 182 183 184 </div> 185 186 187 188 189 190 191 192 <div id="graphique"> 193 <!-- <img id="logotapas" src="resources/images/logo_tapas.jpg" width="80px" alt='logo.tapas.alt' title='logo.tapas.alt'/> --> 194 </div> 195 196 <script type="text/javascript"> 197 //tester le navigateur 198 var ua = navigator.userAgent, 199 index, 200 navigateur, 201 version; 202 //dans le cas d'internet explorer 203 if((index = ua.indexOf('MSIE'))>=0) { 204 version = ua.match(/MSIE ([0-9]+(?:\.[0-9]+)*)/)[1]; 205 var premierCaractere = version.charAt(0); 206 } 207 // Pour les versions d'Internet Explorer < 9 l'interface ne fonctionne pas 208 if ( premierCaractere < 9 ) 209 { 210 alert("This tool does not work for Internet Explorer versions less than 9. You can use Internet Explorer from version 9 or other browser like firefox, google chrome."); 211 } 212 213 214 215 216 var initTexts = $A( "" ); 217 218 initTexts["label.submitButton"] = '<spring:message code="label.submitButton"/>'; 219 var interfaceInit = new InterfaceInit(); 220 221 222 223 // function handleOnClickSubmit(result) 224 // { 225 // var bob = jQuery.parseJSON( result ).resultAjax; 226 // alert(bob); 227 // var pathImg = jQuery.parseJSON( result ).pathImg; 228 // alert(pathImg); 229 // var img = $(document.createElement("img")); 230 // 231 // //img.attr({src:pathImg, width:"200px", height:"200px"}); 232 // img.attr({src:pathImg}); 233 // 234 ////<img src="zrzer" width="100px" height="100px"/> 235 // 236 // $("#graphique").append(img); 237 // 238 // var selectValue = getSelectValue('trace_select_id'); 239 // alert(selectValue); 240 // } 241 242 // function onClickSubmit(){ 243 <%----%> 244 // $.ajax( { 245 // url: "project?methodName=createUserRequest&check1="+$("#chk-h2o_Bob").attr('checked')+"&check2="+$("#chk-h2o_Bob").val(), 246 // success:handleOnClickSubmit 247 // } ); 248 // } 249 250 251 252 // var submitButton = new Button( {value:"Submit", parent:$("#boutonSubmit"), id:"button_submit_2", className: "red_button", classNameText:"red_button_text", onClick:onClickSubmit} ); 253 254 255 </script> 256 257 258 259 260 261 262 </tiles:put> 263 264 </tiles:insert> 51 </BODY> 52 </HTML> -
ether_iasi/trunk/web/project/quicklook_script.jsp
r713 r714 1 <%@ page import="com.ether.Controller" %> 2 <%@ page import="com.ether.IsotopeG03" %> 3 <%@ page import="com.ether.IsotopeIasiG03" %> 4 <%@ page import="com.ether.IsotopeG09" %> 5 <%@ page import="com.ether.IsotopeIasiG09" %> 1 <%@ page import="com.ether.WebHelper" %> 2 <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 6 3 7 4 <script type="text/javascript"> 8 5 9 10 11 var InterfaceInit = Class.create( { 12 13 initialize: function() 6 var InterfaceIasi = Class.create( { 7 initialize: function() 8 { 9 /** *********** CONTAINERS *********** **/ 10 this.parent = $( "#containerMiddle" ); 11 this.containerMenu = $( "#menuLogo" ); 12 this.containerErrors = $( "#errors" ); 13 14 /** *********** VARIABLES *********** **/ 15 this.language = '<spring:message code="language"/>'; 16 this.webmaster = "<%=WebHelper.getProperty(request, "mail.webmaster")%>"; 17 <%--this.jSONUser = <%=WebHelper.getJSONUser( request )%> ? <%=WebHelper.getJSONUser( request )%> : false;--%> 18 this.logoSizeSmall = 30; 19 this.logoSizeBig = 50; 20 this.logoSizeBigger = 50; 21 22 this.projectsArray = [ 23 {id:"ETHER", img:"logo_Ether_50.jpg", top:"-16px", left:"125px"}, 24 {id:"NDACC", img:"logo_Ndacc_50.jpg", top:"1.66667px", left:"46.3334px"}, 25 {id:"ECCAD", img:"logo_ECCAD_50.gif", top:"39.3333px", left:"109.333px"}, 26 {id:"IASI", img:"logo_iasi_50.jpg", top:"-78.6667px", left:"77.6666px"}, 27 {id:"GOSAT", img:"logo_gosat_50.jpg", top:"-0.333328px", left:"200.667px"}, 28 {id:"IAGOS", img:"logo_Iagos_50.jpg", top:"36px", left:"138px"}, 29 {id:"TROPICO", img:"logo_tropico_50.jpg", top:"-74px", left:"45px"}, 30 {id:"MEGAPOLI", img:"logo_Megapoli_50.png", top:"-74.3333px", left:"15.3333px"}, 31 {id:"MIMOSA", img:"logo_mimosa_50.png", top:"-45.6667px", left:"76.3334px"}, 32 {id:"REPROBUS", img:"logo_reprobus_50.png", top:"-48px", left:"161.667px"}, 33 {id:"GEISA", img:"logo_geisa_50.jpg", top:"22px", left:"167.667px"}, 34 {id:"TAPAS", img:"logo_tapas_50.png", top:"58.3333px", left:"125px"}, 35 {id:"ACOMIDA", img:"logo_acomida_50.jpg", top:"-77.3333px", left:"225px"}, 36 {id:"OMER7A", img:"logo_omer7A_50.jpg", top:"22.6667px", left:"76.3334px"}, 37 {id:"GIRAFE", img:"logo_girafe_50.JPG", top:"-79.6667px", left:"192.333px"}, 38 {id:"ARLETTY", img:"logo_arletty_50.jpg", top:"-79px", left:"161.667px"} 39 ]; 40 this.widthInitMentionsOrCredits = $( "#mentions" ).width(); 41 42 this.xArray = ["2010-10", "2010-11", "2010-12", "2011-01", "2011-02"]; 43 this.yArray = [0, 10, 30, 50, 100]; 44 45 this.bindButtons(); 46 this.createMenuLogo(); 47 this.isMonthAndYearSelected = false; 48 49 $( document ).ready( jQuery.proxy( function() 50 { 51 // Menu 52 this.animateMenuLogos(); 53 this.bindMenuLogos(); 54 this.createRightSlide(); 55 56 if( !this.jSONUser ) 57 this.onClickHelp(); 58 else 59 this.handleLogin(); 60 }, this ) ); 61 }, 62 63 64 // CREATES AND BINDS ******************************************************** 65 bindButtons: function() 66 { 67 $( "#home_button" ).bind( "click", this.onClickHome ); 68 $( "#language_button" ).bind( "click", jQuery.proxy( this.onClickLanguage, this ) ); 69 $( "#mail_button" ).bind( "click", jQuery.proxy( this.onClickMail, this ) ); 70 $( "#help" ).bind( "click", jQuery.proxy( this.onClickHelp, this ) ); 71 $( "#credits" ).bind( "click", jQuery.proxy( this.onClickCredits, this ) ); 72 $( "#mentions" ).bind( "click", jQuery.proxy( this.onClickMentions, this ) ); 73 $( "#login_button" ).bind( "click", jQuery.proxy( this.onClickLogin, this ) ); 74 $( "#logout_button" ).bind( "click", jQuery.proxy( this.onClickLogout, this ) ); 75 }, 76 77 createMenuLogo: function() 78 { 79 var initTop = this.projectsArray[0].top; 80 var initLeft = this.projectsArray[0].left; 81 82 jQuery.each( this.projectsArray, jQuery.proxy( function( i, logo ) 83 { 84 var divLogo = $( document.createElement( "div" ) ); 85 divLogo.addClass( "divLogo" ); 86 divLogo.attr( {id:logo.id, style:"position:absolute; top:" + initTop + "; left:" + initLeft} ); 87 divLogo.html( '<img id="img_' + logo.id + '"src="resources/images/' + logo.img + '" width="' + this.logoSizeSmall + 'px" height="' + this.logoSizeSmall + 'px"/>' ); 88 this.containerMenu.append( divLogo ); 89 }, this ) ); 90 }, 91 92 createAllSlides: function() 93 { 94 this.middleSlide = new DragSlide( {id:"middle", parent:this.parent, minWidth:"700", minHeight:"550", top:"150px", right:"232px", 95 specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent", activeDbClick:"None"} ); 96 97 this.rightSlide = new DragSlide( {id:"right", parent:this.parent, width:"180", height:"325", top:"212px", left:"750px", 98 specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent"} ); 99 100 this.loginSlide = new DragSlide( {id:"loginMiddle", parent:this.parent, width:"150", height:"25", top:"115px", left:"39px", 101 specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent", activeDbClick:"None"} ); 102 103 this.projectsSlide = new DragSlide( {id:"projectsMiddle", parent:this.parent, width:"180", height:"390", top:"175px", left:"750px", 104 specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent"} ); 105 }, 106 107 createRightSlide: function() 108 { 109 this.rightSlide = new DragSlide( {id:"right", parent:this.parent, width:"180", height:"320", top:"175px", left:"750px", 110 specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent"} ); 111 }, 112 113 createProjectsSlide: function() 114 { 115 this.projectsSlide.setTitle( '<spring:message code="label.projects"/>' ); 116 this.projectsSlide.getDivContent().empty(); 117 118 jQuery.each( this.projectsArray, jQuery.proxy( function( i, logo ) 119 { 120 var divLogo = $( document.createElement( "div" ) ); 121 divLogo.addClass( "divLogo" ); 122 divLogo.attr( {id:logo.id} ); 123 divLogo.html( '<img id="img_' + logo.id + '"src="resources/images/' + logo.img + '" width="' + this.logoSizeBigger + 'px" height="' + this.logoSizeBigger + 'px" title="' + logo.id + '"/>' ); 124 this.projectsSlide.getDivContent().append( divLogo ); 125 }, this ) ); 126 this.projectsSlide.hideContainerContent(); 127 }, 128 129 createSelectMonths: function() 130 { 131 var div = $( document.createElement( "div" ) ); 132 div.addClass( "selectDates" ); 133 this.middleSlide.getDivContent().append( div ); 134 135 var paramSelect = new Object(); 136 paramSelect.id = "selectMonths"; 137 paramSelect.parent = div; 138 this.selectMonths = new Select( paramSelect ); 139 this.selectMonths.add( 1, '<spring:message code="label.january"/>' ); 140 this.selectMonths.add( 2, '<spring:message code="label.february"/>' ); 141 this.selectMonths.add( 3, '<spring:message code="label.march"/>' ); 142 this.selectMonths.add( 4, '<spring:message code="label.april"/>' ); 143 this.selectMonths.add( 5, '<spring:message code="label.may"/>' ); 144 this.selectMonths.add( 6, '<spring:message code="label.june"/>' ); 145 this.selectMonths.add( 7, '<spring:message code="label.july"/>' ); 146 this.selectMonths.add( 8, '<spring:message code="label.august"/>' ); 147 this.selectMonths.add( 9, '<spring:message code="label.september"/>' ); 148 this.selectMonths.add( 10, '<spring:message code="label.october"/>' ); 149 this.selectMonths.add( 11, '<spring:message code="label.november"/>' ); 150 this.selectMonths.add( 12, '<spring:message code="label.december"/>' ); 151 }, 152 153 createSelectYears: function() 154 { 155 var div = $( document.createElement( "div" ) ); 156 div.addClass( "selectDates" ); 157 this.middleSlide.getDivContent().append( div ); 158 159 var paramSelect = new Object(); 160 paramSelect.id = "selectYears"; 161 paramSelect.parent = div; 162 this.selectYears = new Select( paramSelect ); 163 164 var currentYear = (new Date()).getFullYear(); 165 for( var i = 0; i < 5; i++ ) 166 this.selectYears.add( currentYear - i, currentYear - i ); 167 }, 168 169 // REQUESTS ******************************************************** 170 requestChangeLocale: function() 171 { 172 $.ajax( { 173 url: "project?methodName=setLocale&language=<spring:message code="label.language.value.to.switch"/>", 174 success:function() 14 175 { 15 16 /** *********** CONTAINERS *********** **/ 17 this.containerFormSpectralRangeLower = $( "#spectralRangeLower" ); 18 this.containerFormSpectralRangeUpper = $( "#spectralRangeUpper" ); 19 this.containerFormIntensityLower = $( "#intensityLower" ); 20 this.containerFormIntensityUpper = $( "#intensityUpper" ); 21 this.containerFormMeanValue1 = $( "#meanValue1" ); 22 this.containerDownload = $( "#downloadContainer" ); 23 this.containerLoading = $( "#loading" ); 24 this.containerTabs = $("#tabs"); 25 26 /** *********** VARIABLE *********** **/ 27 //on va chercher les chemin déclaré dans le controller 28 this.pathProcess = "<%=Controller.PATH_PROCESS%>"; 29 this.LongPathImages = "<%=Controller.LONG_PATH_IMAGES%>"; 30 31 <%--this.pathImg = <%=Controller.PATH_IMAGES%>;--%> 32 33 this.initializeMolecules(); 34 this.createForm(); 35 36 var downloadButton = new Button( {value:"Download", parent:$( "#downloadContainer" ), id:"button_submit_2", className: "red_button", classNameText:"red_button_text", onClick:jQuery.proxy( this.onClickDownload, this )} ); 37 38 //onglet 39 this.ntabComparison = new Tab( {value:"Databases comparison", parent:this.containerTabs, numTab: 1, id:"tab_Comparison", className: "tab_class", onClick:jQuery.proxy( this.onClickDatabasesComparison, this )} ); 40 this.ntabGlobal = new Tab( {value:"Global representation", parent:this.containerTabs, numTab: 1, id:"tab_Global", className: "tab_class", onClick:jQuery.proxy( this.onClickGlobalRepresentation, this )} ); 41 this.ntabContents = new Tab( {value:"Database contents", parent:this.containerTabs, numTab: 1, id:"tab_Contents", className: "tab_class", onClick:jQuery.proxy( this.onClickDatabaseContents, this )} ); 42 //onglet avec la couleur active par défaut 43 this.ntabContents.active(); 176 location.reload(); 44 177 }, 45 46 initializeMolecules: function() 178 error: jQuery.proxy( this.showErrors, [this] ) 179 } ); 180 }, 181 182 requestLogin: function() 183 { 184 var login = $( "#loginValue" ).val(); 185 var pwd = $( "#pwdValue" ).val(); 186 $.ajax( { 187 url: "project?methodName=login&login=" + login + "&pwd=" + pwd, 188 dataType: 'json', // Info needed since jquery.1.7 !! 189 success:jQuery.proxy( this.handleLogin, this ), 190 error: jQuery.proxy( this.showErrors, [this, "489px", "566px"] ) 191 } ); 192 }, 193 194 requestLogout: function() 195 { 196 $.ajax( { 197 url: "project?methodName=logout", 198 dataType: 'json', // Info needed since jquery.1.7 !! 199 success:jQuery.proxy( this.handleLogout, this ), 200 error: jQuery.proxy( this.showErrors, [this] ) 201 } ); 202 }, 203 204 requestDataByLogo: function() 205 { 206 if( !this.selectedLogo && !this.selectedLogo.id ) 207 return; 208 209 $.ajax( { 210 url: "statistic?methodName=searchMainStatisticsByProject&name=" + this.selectedLogo.id, 211 success:jQuery.proxy( this.handleDataByLogo, this ), 212 error: jQuery.proxy( this.showLoginError, this ) 213 } ); 214 }, 215 216 // HANDLES ******************************************************** 217 handleDataByLogo: function( result ) 218 { 219 this.displaySummary(); 220 }, 221 222 handleLogin: function( result ) 223 { 224 this.containerErrors.empty(); 225 this.containerErrors.css( "visibility", "hidden" ); 226 227 if( result ) 228 this.jSONUser = result.jSONUser; 229 230 $( "#loginValue" ).val( "" ); 231 $( "#pwdValue" ).val( "" ); 232 $( "#login_text" ).css( "visibility", "hidden" ); 233 $( "#login" ).animate( { 234 top:'47px', 235 left:'577px' 236 }, 2000, function() 237 { 238 } ); 239 240 $( "#login_bg" ).animate( { 241 opacity: 1, 242 height:'60px', 243 width:'67px' 244 }, 2000, function() 245 { 246 } ); 247 248 $( "#login_img" ).animate( { 249 top:'25px', 250 left: '16px', 251 width: '0', 252 height: '0' 253 }, 2000, jQuery.proxy( function() 254 { 255 // Slides 256 this.parent.empty(); 257 this.createAllSlides(); 258 this.changeRightSlide(); 259 260 // User 261 if( this.jSONUser.name ) 262 this.loginSlide.setTitle( this.jSONUser.name ); 263 else 264 this.loginSlide.setTitle( '<spring:message code="label.unknown"/>' ); 265 $( "#logout_button" ).css( "visibility", "visible" ); 266 267 // Awstats button 268 if( "ADMINISTRATOR" == this.jSONUser.role ) 47 269 { 48 this.arrayGeisa2011 = new Array(); 49 this.arrayGeisa2003 = new Array(); 50 this.arrayGeisaIasi2011 = new Array(); 51 this.arrayGeisaIasi2003 = new Array(); 52 53 var molecule = new Object(); 54 molecule.id="h2o"; 55 molecule.name="H<sub>2</sub>O"; 56 molecule.isotopesArray = ["161", "162", "171", "181", "182", "172"]; 57 this.arrayGeisa2011.push(molecule); 58 this.arrayGeisa2003.push(molecule); 59 this.arrayGeisaIasi2011.push(molecule); 60 this.arrayGeisaIasi2003.push(molecule); 61 62 var molecule = new Object(); 63 molecule.id="co2"; 64 molecule.name="CO<sub>2</sub>"; 65 molecule.isotopesArray = ["626", "627", "628", "636", "637", "638", "728", "828", "838"]; 66 this.arrayGeisa2003.push(molecule); 67 this.arrayGeisa2011.push(molecule); 68 this.arrayGeisaIasi2011.push(molecule); 69 this.arrayGeisaIasi2003.push(molecule); 70 71 var molecule = new Object(); 72 molecule.id="o3"; 73 molecule.name="O<sub>3</sub>"; 74 molecule.isotopesArray = ["666", "668", "686", "667", "676"]; 75 this.arrayGeisa2003.push(molecule); 76 this.arrayGeisa2011.push(molecule); 77 this.arrayGeisaIasi2011.push(molecule); 78 this.arrayGeisaIasi2003.push(molecule); 79 80 var molecule = new Object(); 81 molecule.id="n2o"; 82 molecule.name="N<sub>2</sub>O"; 83 molecule.isotopesArray = ["446", "447", "448", "456","458", "546", "548", "556"]; 84 this.arrayGeisa2011.push(molecule); 85 this.arrayGeisaIasi2011.push(molecule); 86 87 var molecule = new Object(); 88 molecule.id="n2o"; 89 molecule.name="N<sub>2</sub>O"; 90 molecule.isotopesArray = ["446", "447", "448", "456", "546"]; 91 this.arrayGeisa2003.push(molecule); 92 this.arrayGeisaIasi2003.push(molecule); 93 94 var molecule = new Object(); 95 molecule.id="co"; 96 molecule.name="CO"; 97 molecule.isotopesArray = ["26", "36", "28", "27", "38", "37"]; 98 this.arrayGeisa2011.push(molecule); 99 this.arrayGeisa2003.push(molecule); 100 this.arrayGeisaIasi2011.push(molecule); 101 this.arrayGeisaIasi2003.push(molecule); 102 103 var molecule = new Object(); 104 molecule.id="ch4"; 105 molecule.name="CH<sub>4</sub>"; 106 molecule.isotopesArray = ["211", "311"]; 107 this.arrayGeisa2011.push(molecule); 108 this.arrayGeisa2003.push(molecule); 109 110 var molecule = new Object(); 111 molecule.id="ch4"; 112 molecule.name="CH<sub>4</sub>"; 113 molecule.isotopesArray = ["211", "311", "212", "312"]; 114 this.arrayGeisaIasi2011.push(molecule); 115 116 var molecule = new Object(); 117 molecule.id="ch4"; 118 molecule.name="CH<sub>4</sub>"; 119 molecule.isotopesArray = ["211", "311", "212"]; 120 this.arrayGeisaIasi2003.push(molecule); 121 122 var molecule = new Object(); 123 molecule.id="o2"; 124 molecule.name="O<sub>2</sub>"; 125 molecule.isotopesArray = ["66", "67", "68"]; 126 this.arrayGeisa2011.push(molecule); 127 this.arrayGeisa2003.push(molecule); 128 129 var molecule = new Object(); 130 molecule.id="o2"; 131 molecule.name="O<sub>2</sub>"; 132 molecule.isotopesArray = ["66"]; 133 this.arrayGeisaIasi2011.push(molecule); 134 this.arrayGeisaIasi2003.push(molecule); 135 136 var molecule = new Object(); 137 molecule.id="no"; 138 molecule.name="NO"; 139 molecule.isotopesArray = ["46", "48", "56"]; 140 this.arrayGeisa2011.push(molecule); 141 this.arrayGeisa2003.push(molecule); 142 this.arrayGeisaIasi2011.push(molecule); 143 this.arrayGeisaIasi2003.push(molecule); 144 145 var molecule = new Object(); 146 molecule.id="so2"; 147 molecule.name="SO<sub>2</sub>"; 148 molecule.isotopesArray = ["626", "646"]; 149 this.arrayGeisa2011.push(molecule); 150 this.arrayGeisa2003.push(molecule); 151 this.arrayGeisaIasi2011.push(molecule); 152 this.arrayGeisaIasi2003.push(molecule); 153 154 var molecule = new Object(); 155 molecule.id="no2"; 156 molecule.name="NO<sub>2</sub>"; 157 molecule.isotopesArray = ["646"]; 158 this.arrayGeisa2011.push(molecule); 159 this.arrayGeisa2003.push(molecule); 160 this.arrayGeisaIasi2011.push(molecule); 161 this.arrayGeisaIasi2003.push(molecule); 162 163 var molecule = new Object(); 164 molecule.id="nh3"; 165 molecule.name="NH<sub>3</sub>"; 166 molecule.isotopesArray = ["411", "511" ]; 167 this.arrayGeisa2011.push(molecule); 168 this.arrayGeisa2003.push(molecule); 169 this.arrayGeisaIasi2011.push(molecule); 170 171 var molecule = new Object(); 172 molecule.id="ph3"; 173 molecule.name="PH<sub>3</sub>"; 174 molecule.isotopesArray = ["131" ]; 175 this.arrayGeisa2011.push(molecule); 176 this.arrayGeisa2003.push(molecule); 177 178 var molecule = new Object(); 179 molecule.id="hno3"; 180 molecule.name="HNO<sub>3</sub>"; 181 molecule.isotopesArray = ["146" ]; 182 this.arrayGeisa2011.push(molecule); 183 this.arrayGeisa2003.push(molecule); 184 this.arrayGeisaIasi2011.push(molecule); 185 this.arrayGeisaIasi2003.push(molecule); 186 187 var molecule = new Object(); 188 molecule.id="oh"; 189 molecule.name="OH"; 190 molecule.isotopesArray = ["61", "62", "81" ]; 191 this.arrayGeisa2011.push(molecule); 192 this.arrayGeisa2003.push(molecule); 193 194 var molecule = new Object(); 195 molecule.id="hf"; 196 molecule.name="HF"; 197 molecule.isotopesArray = ["19" ]; 198 this.arrayGeisa2011.push(molecule); 199 this.arrayGeisa2003.push(molecule); 200 201 var molecule = new Object(); 202 molecule.id="hcl"; 203 molecule.name="HCL"; 204 molecule.isotopesArray = ["15", "17" ]; 205 this.arrayGeisa2011.push(molecule); 206 this.arrayGeisa2003.push(molecule); 207 208 var molecule = new Object(); 209 molecule.id="hbr"; 210 molecule.name="HBR"; 211 molecule.isotopesArray = ["11", "19" ]; 212 this.arrayGeisa2011.push(molecule); 213 this.arrayGeisa2003.push(molecule); 214 215 var molecule = new Object(); 216 molecule.id="hi"; 217 molecule.name="HI"; 218 molecule.isotopesArray = ["17" ]; 219 this.arrayGeisa2011.push(molecule); 220 this.arrayGeisa2003.push(molecule); 221 222 var molecule = new Object(); 223 molecule.id="clo"; 224 molecule.name="ClO"; 225 molecule.isotopesArray = ["56", "76" ]; 226 this.arrayGeisa2011.push(molecule); 227 this.arrayGeisa2003.push(molecule); 228 229 var molecule = new Object(); 230 molecule.id="ocs"; 231 molecule.name="OCS"; 232 molecule.isotopesArray = ["622", "624", "632", "623", "822", "634"]; 233 this.arrayGeisa2011.push(molecule); 234 this.arrayGeisa2003.push(molecule); 235 this.arrayGeisaIasi2011.push(molecule); 236 this.arrayGeisaIasi2003.push(molecule); 237 238 var molecule = new Object(); 239 molecule.id="h2co"; 240 molecule.name="H<sub>2</sub>CO"; 241 molecule.isotopesArray = ["126", "128", "136"]; 242 this.arrayGeisa2011.push(molecule); 243 this.arrayGeisa2003.push(molecule); 244 245 var molecule = new Object(); 246 molecule.id="h2co"; 247 molecule.name="H<sub>2</sub>CO"; 248 molecule.isotopesArray = ["126"]; 249 this.arrayGeisaIasi2011.push(molecule); 250 251 var molecule = new Object(); 252 molecule.id="c2h6"; 253 molecule.name="C<sub>2</sub>H<sub>6</sub>"; 254 molecule.isotopesArray = ["226", "236"]; 255 this.arrayGeisa2011.push(molecule); 256 this.arrayGeisa2003.push(molecule); 257 258 var molecule = new Object(); 259 molecule.id="ch3d"; 260 molecule.name="CH<sub>3</sub>D"; 261 molecule.isotopesArray = ["212", "312"]; 262 this.arrayGeisa2011.push(molecule); 263 264 var molecule = new Object(); 265 molecule.id="ch3d"; 266 molecule.name="CH<sub>3</sub>D"; 267 molecule.isotopesArray = ["212"]; 268 this.arrayGeisa2003.push(molecule); 269 270 var molecule = new Object(); 271 molecule.id="c2h2"; 272 molecule.name="C<sub>2</sub>H<sub>2</sub>"; 273 molecule.isotopesArray = ["221", "231"]; 274 this.arrayGeisa2011.push(molecule); 275 this.arrayGeisa2003.push(molecule); 276 this.arrayGeisaIasi2011.push(molecule); 277 this.arrayGeisaIasi2003.push(molecule); 278 279 var molecule = new Object(); 280 molecule.id="c2h4"; 281 molecule.name="C<sub>2</sub>H<sub>4</sub>"; 282 molecule.isotopesArray = ["211", "311"]; 283 this.arrayGeisa2011.push(molecule); 284 this.arrayGeisa2003.push(molecule); 285 this.arrayGeisaIasi2011.push(molecule); 286 287 var molecule = new Object(); 288 molecule.id="geh4"; 289 molecule.name="GeH<sub>4</sub>"; 290 molecule.isotopesArray = ["411"]; 291 this.arrayGeisa2011.push(molecule); 292 this.arrayGeisa2003.push(molecule); 293 294 var molecule = new Object(); 295 molecule.id="hcn"; 296 molecule.name="HCN"; 297 molecule.isotopesArray = ["124", "125", "134", "224"]; 298 this.arrayGeisa2011.push(molecule); 299 this.arrayGeisaIasi2011.push(molecule); 300 301 var molecule = new Object(); 302 molecule.id="hcn"; 303 molecule.name="HCN"; 304 molecule.isotopesArray = ["124", "125", "134"]; 305 this.arrayGeisa2003.push(molecule); 306 307 var molecule = new Object(); 308 molecule.id="c3h8"; 309 molecule.name="C<sub>3</sub>H<sub>8</sub>"; 310 molecule.isotopesArray = ["221"]; 311 this.arrayGeisa2011.push(molecule); 312 this.arrayGeisa2003.push(molecule); 313 314 var molecule = new Object(); 315 molecule.id="c2n2"; 316 molecule.name="C<sub>2</sub>N<sub>2</sub>"; 317 molecule.isotopesArray = ["224"]; 318 this.arrayGeisa2011.push(molecule); 319 this.arrayGeisa2003.push(molecule); 320 321 var molecule = new Object(); 322 molecule.id="c4h2"; 323 molecule.name="C<sub>4</sub>H<sub>2</sub>"; 324 molecule.isotopesArray = ["211"]; 325 this.arrayGeisa2011.push(molecule); 326 this.arrayGeisa2003.push(molecule); 327 328 var molecule = new Object(); 329 molecule.id="hc3n"; 330 molecule.name="HC<sub>3</sub>N"; 331 molecule.isotopesArray = ["124"]; 332 this.arrayGeisa2011.push(molecule); 333 this.arrayGeisa2003.push(molecule); 334 335 var molecule = new Object(); 336 molecule.id="hocl"; 337 molecule.name="HOCl"; 338 molecule.isotopesArray = ["165", "167"]; 339 this.arrayGeisa2011.push(molecule); 340 this.arrayGeisa2003.push(molecule); 341 342 var molecule = new Object(); 343 molecule.id="n2"; 344 molecule.name="N<sub>2</sub>"; 345 molecule.isotopesArray = ["44"]; 346 this.arrayGeisa2011.push(molecule); 347 this.arrayGeisa2003.push(molecule); 348 this.arrayGeisaIasi2011.push(molecule); 349 this.arrayGeisaIasi2003.push(molecule); 350 351 var molecule = new Object(); 352 molecule.id="ch3cl"; 353 molecule.name="CH<sub>3</sub>Cl"; 354 molecule.isotopesArray = ["215", "217"]; 355 this.arrayGeisa2011.push(molecule); 356 this.arrayGeisa2003.push(molecule); 357 358 var molecule = new Object(); 359 molecule.id="h2o2"; 360 molecule.name="H<sub>2</sub>O<sub>2</sub>"; 361 molecule.isotopesArray = ["166"]; 362 this.arrayGeisa2011.push(molecule); 363 this.arrayGeisa2003.push(molecule); 364 365 var molecule = new Object(); 366 molecule.id="h2s"; 367 molecule.name="H<sub>2</sub>S"; 368 molecule.isotopesArray = ["121", "141", "131"]; 369 this.arrayGeisa2011.push(molecule); 370 this.arrayGeisa2003.push(molecule); 371 372 var molecule = new Object(); 373 molecule.id="hcooh"; 374 molecule.name="HCOOH"; 375 molecule.isotopesArray = ["261"]; 376 this.arrayGeisa2011.push(molecule); 377 this.arrayGeisa2003.push(molecule); 378 this.arrayGeisaIasi2011.push(molecule); 379 380 var molecule = new Object(); 381 molecule.id="cof2"; 382 molecule.name="COF<sub>2</sub>"; 383 molecule.isotopesArray = ["269"]; 384 this.arrayGeisa2011.push(molecule); 385 this.arrayGeisa2003.push(molecule); 386 387 var molecule = new Object(); 388 molecule.id="sf6"; 389 molecule.name="SF<sub>6</sub>"; 390 molecule.isotopesArray = ["29"]; 391 this.arrayGeisa2011.push(molecule); 392 this.arrayGeisa2003.push(molecule); 393 394 var molecule = new Object(); 395 molecule.id="c3h4"; 396 molecule.name="C<sub>3</sub>H<sub>4</sub>"; 397 molecule.isotopesArray = ["341"]; 398 this.arrayGeisa2011.push(molecule); 399 this.arrayGeisa2003.push(molecule); 400 401 var molecule = new Object(); 402 molecule.id="ho2"; 403 molecule.name="HO<sub>2</sub>"; 404 molecule.isotopesArray = ["166"]; 405 this.arrayGeisa2011.push(molecule); 406 this.arrayGeisa2003.push(molecule); 407 408 var molecule = new Object(); 409 molecule.id="clono2"; 410 molecule.name="ClONO<sub>2</sub>"; 411 molecule.isotopesArray = ["564", "764"]; 412 this.arrayGeisa2011.push(molecule); 413 this.arrayGeisa2003.push(molecule); 414 415 var molecule = new Object(); 416 molecule.id="ch3br"; 417 molecule.name="CH<sub>3</sub>Br"; 418 molecule.isotopesArray = ["79", "81"]; 419 this.arrayGeisa2011.push(molecule); 420 421 var molecule = new Object(); 422 molecule.id="ch3oh"; 423 molecule.name="CH<sub>3</sub>OH"; 424 molecule.isotopesArray = ["216"]; 425 this.arrayGeisa2011.push(molecule); 426 this.arrayGeisaIasi2011.push(molecule); 427 428 var molecule = new Object(); 429 molecule.id="noplus"; 430 molecule.name="NO<sup>+</sup>"; 431 molecule.isotopesArray = ["46"]; 432 this.arrayGeisa2011.push(molecule); 433 434 var molecule = new Object(); 435 molecule.id="hnc"; 436 molecule.name="HNC"; 437 molecule.isotopesArray = ["142"]; 438 this.arrayGeisa2011.push(molecule); 439 440 var molecule = new Object(); 441 molecule.id="c6h6"; 442 molecule.name="C<sub>6</sub>H<sub>6</sub>"; 443 molecule.isotopesArray = ["266"]; 444 this.arrayGeisa2011.push(molecule); 445 446 var molecule = new Object(); 447 molecule.id="c2hd"; 448 molecule.name="C<sub>2</sub>HD"; 449 molecule.isotopesArray = ["122"]; 450 this.arrayGeisa2011.push(molecule); 451 452 var molecule = new Object(); 453 molecule.id="cf4"; 454 molecule.name="CF<sub>4</sub>"; 455 molecule.isotopesArray = ["291"]; 456 this.arrayGeisa2011.push(molecule); 457 458 var molecule = new Object(); 459 molecule.id="ch3cn"; 460 molecule.name="CH<sub>3</sub>CN"; 461 molecule.isotopesArray = ["234"]; 462 this.arrayGeisa2011.push(molecule); 463 464 465 }, 466 467 // CREATES ******************************************************** 468 createForm: function() 270 this.awstatsSlide = new DragSlide( {id:"awstats", parent:this.parent, width:"180", height:"25", top:"545px", left:"750px", 271 specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent", 272 title:'<spring:message code="label.awstats"/> ', activeDbClick:"None"} ); 273 this.awstatsSlide.getDivContainer().click( jQuery.proxy( this.displayAwstatsStatistics, this ) ); 274 } 275 276 // Projects slide 277 this.createProjectsSlide(); 278 this.bindLogos(); 279 280 // Logo 281 this.selectedLogo = $( "#ETHER" )[0]; 282 this.isSelectedLogoEther = true; 283 this.onClickLogo(); 284 }, this ) ); 285 }, 286 287 handleLogout: function() 288 { 289 this.jSONUser = false; 290 this.parent.empty(); 291 this.createRightSlide(); 292 this.onClickHelp(); 293 294 $( "#logout_button" ).css( "visibility", "hidden" ); 295 $( "#login" ).css( { zIndex:1 } ).animate( { 296 top:'79px', 297 left:'88px' 298 }, 2000, function() 299 { 300 } ); 301 302 $( "#login_bg" ).animate( { 303 opacity: 0.85, 304 height:'500px', 305 width:'500px' 306 }, 2000, function() 307 { 308 $( "#login_text" ).css( "visibility", "visible" ); 309 } ); 310 311 $( "#login_img" ).animate( { 312 top:'103px', 313 left: '148px', 314 width: '30px', 315 height: '30px' 316 }, 2000, function() 317 { 318 } ); 319 }, 320 321 // EVENTS ******************************************************** 322 onClickHome: function() 323 { 324 location.reload(); 325 }, 326 327 onClickLanguage: function() 328 { 329 this.requestChangeLocale(); 330 }, 331 332 onClickMail: function() 333 { 334 document.location.href = "mailto:" + this.webmaster + "?subject=[STATISTICS]"; 335 }, 336 337 onClickMentions: function() 338 { 339 if( this.widthInitMentionsOrCredits == $( "#mentions" ).width() ) 340 this.enlargeCreditsOrMentions( $( "#mentions" ), $( "#mentions_bg" ), $( "#mentions_text" ), $( "#mentions_title" ), "project/mentions_" + this.language + ".jsp" ); 341 else 342 this.reduceCreditsOrMentions( $( "#mentions" ), $( "#mentions_bg" ), $( "#mentions_text" ), $( "#mentions_title" ), "project/mentions_" + this.language + ".jsp" ); 343 }, 344 345 onClickCredits: function() 346 { 347 if( this.widthInitMentionsOrCredits == $( "#credits" ).width() ) 348 this.enlargeCreditsOrMentions( $( "#credits" ), $( "#credits_bg" ), $( "#credits_text" ), $( "#credits_title" ), "project/credits_" + this.language + ".jsp" ); 349 else 350 this.reduceCreditsOrMentions( $( "#credits" ), $( "#credits_bg" ), $( "#credits_text" ), $( "#credits_title" ), "project/credits_" + this.language + ".jsp" ); 351 }, 352 353 onClickHelp: function() 354 { 355 this.rightSlide.setTitle( '<spring:message code="label.help"/>' ); 356 this.rightSlide.setContent( "<spring:message code='label.help.content'/>" ); 357 if( this.jSONUser ) 358 var backHelpButton = new Button( {value:"<spring:message code="label.display.actions"/>", parent:this.rightSlide.getDivContent(), className: "small positive back_button", onClick:jQuery.proxy( this.changeRightSlide, this )} ); 359 }, 360 361 onClickLogin: function() 362 { 363 this.containerErrors.empty(); 364 this.containerErrors.css( "visibility", "hidden" ); 365 this.requestLogin(); 366 }, 367 368 onClickLogout: function() 369 { 370 this.requestLogout(); 371 }, 372 373 onClickLogo: function() 374 { 375 this.isSelectedLogoEther = (this.selectedLogo == $( "#ETHER" )[0]); 376 this.isMonthAndYearSelected = false; 377 378 if( this.jSONUser ) 379 this.requestDataByLogo(); 380 else 381 { 382 this.showErrors( "<spring:message code="error.connection.need"/>" ); 383 this.containerErrors.css( {top:"489px", left:"566px"} ); 384 this.containerErrors.css( "visibility", "visible" ); 385 } 386 }, 387 388 onClickPrint: function() 389 { 390 var printContent = new PrintContent(); 391 printContent.addContent( $( "#title" ).clone() ); 392 printContent.addContent( this.middleSlide.getDivContainer().clone().animate( {'right' : "100px", 'width' : "667px"} ) ); 393 printContent.displayPrintPreview(); 394 }, 395 396 onClickGo: function() 397 { 398 var url = this[0]; 399 var context = this[1]; 400 401 $( "#divAwstats" ).load( url + context.selectedLogo.id + "&month=" + context.selectMonths.getValue() + "&year=" + context.selectYears.getValue() ); 402 }, 403 404 // OTHERS ******************************************************** 405 showErrors: function( result ) 406 { 407 var context = this[0] ? this[0] : this; 408 var topValue = this[1] ? this[1] : false; 409 var leftValue = this[2] ? this[2] : false; 410 context.containerErrors.show(); 411 if( result.responseText && interfaceTexts[result.responseText] ) 412 context.containerErrors.html( interfaceTexts[result.responseText] ); 413 else if( result.responseText ) 414 context.containerErrors.html( result.responseText ); 415 else 416 context.containerErrors.html( result ); 417 if( topValue && leftValue ) 418 context.containerErrors.css( {top: topValue, left: leftValue} ); 419 context.containerErrors.css( "visibility", "visible" ); 420 }, 421 422 showLoginError: function( result ) 423 { 424 this.onClickLogout(); 425 this.onClickLogo(); 426 }, 427 428 reduceCreditsOrMentions: function( div, div_bg, div_text, div_title ) 429 { 430 div.css( { zIndex:0 } ); 431 div_text.css( "visibility", "hidden" ); 432 div.animate( { 433 left: '+=500', 434 top: '+=500' 435 }, 2000, function() 436 { 437 } ); 438 div_bg.animate( { 439 opacity: 1, 440 height:'42px', 441 width:this.widthInitMentionsOrCredits + 'px', 442 zIndex:'0' 443 }, 2000, function() 444 { 445 div_title.css( "visibility", "visible" ); 446 } ); 447 }, 448 449 enlargeCreditsOrMentions: function( div, div_bg, div_text, div_title, pageToLoad ) 450 { 451 div_title.css( "visibility", "hidden" ); 452 div.css( { zIndex:1 } ); 453 div.animate( { 454 left: '-=500', 455 top: '-=500' 456 }, 2000, function() 457 { 458 } ); 459 460 div_bg.animate( { 461 opacity: 0.95, 462 height:'500px', 463 width:'500px' 464 }, 2000, function() 465 { 466 div_text.css( "visibility", "visible" ); 467 div_text.load( pageToLoad ); 468 } ); 469 }, 470 471 animateMenuLogos: function() 472 { 473 jQuery.each( this.projectsArray, jQuery.proxy( function( i, logo ) 474 { 475 $( "#" + logo.id ).animate( { 476 top:logo.top, 477 left:logo.left 478 }, 5000, function() 469 479 { 470 //Titre de la page 471 var titlePage = document.createTextNode("Graphic vizualisation of the GEISA database"); 472 document.getElementById("titlePage").appendChild(titlePage); 473 474 // Create menu deroulant choix de la base 475 var paramDatabase = new Object(); 476 paramDatabase.id = "selectDatabase"; 477 paramDatabase.parent = $("#database1"); 478 this.selectDatabase = new Select( paramDatabase ); 479 this.selectDatabase.add( 'GEISA2011', "GEISA 2011", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeG09.class%>' ); 480 this.selectDatabase.add( 'GEISAIASI2011', "GEISA-IASI 2011", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeIasiG09.class%>' ); 481 this.selectDatabase.add( 'GEISA2003', "GEISA 2003", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeG03.class%>' ); 482 this.selectDatabase.add( 'GEISAIASI2003', "GEISA-IASI 2003", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeIasiG03.class%>' ); 483 this.selectDatabase.selectFirst( false ); 484 var bob = this.selectDatabase.getValues(); 485 486 // Create menu deroulant choix de la base2 pour l'onglet "Database comparison" 487 488 var paramDatabase2 = new Object(); 489 paramDatabase2.id = "selectDatabase2"; 490 paramDatabase2.parent = $("#database2"); 491 this.selectDatabase2 = new Select( paramDatabase2 ); 492 this.selectDatabase2.add( 'GEISA2011', "GEISA 2011"); 493 this.selectDatabase2.add( 'GEISA2003', "GEISA 2003"); 494 this.selectDatabase2.add( 'HITRAN2009', "HITRAN 2009" ); 495 this.selectDatabase2.selectFirst( false ); 496 497 498 499 500 //création du bloc des molécules 501 this.createMolecules($('#BDD-GEISA2011'), this.arrayGeisa2011, "GEISA2011"); 502 this.createMolecules($('#BDD-GEISA2003'), this.arrayGeisa2003, "GEISA2003"); 503 this.createMolecules($('#BDD-GEISAIASI2011'), this.arrayGeisaIasi2011, "GEISAIASI2011"); 504 this.createMolecules($('#BDD-GEISAIASI2003'), this.arrayGeisaIasi2003, "GEISAIASI2003"); 505 506 //bouton selection-deselection toutes les molécules et isotopes 507 this.selectButton = new Button( {value:"Select all molecules", parent:$( "#selectAndShow" ), id:"buttonSelect", className: "gray_button", onClick:jQuery.proxy( this.selectAll, this )} ); 508 //bouton montrer-cacher les isotopes 509 this.showButton = new Button( {value:"View all isotopologues", parent:$( "#selectAndShow" ), id:"buttonShow", className: "gray_button", onClick:jQuery.proxy( this.viewAll, this )} ); 510 511 512 513 //Zone texte SpectralRange 514 //Titre général (qui changera en fonction de la base geisa choisie) 515 document.getElementById('spectralRangeTitre').innerHTML = ""; 516 document.getElementById('spectralRangeTitre').innerHTML = "Choosing the spectral range (0 to 35877.030506 cm<sup>-1</sup>) :"; 517 518 //Titre 519 document.getElementById("spectralRangeLower").innerHTML = "Lower value, cm<sup>-1</sup> : "; 520 document.getElementById("spectralRangeUpper").innerHTML = "Upper value, cm<sup>-1</sup> : "; 521 document.getElementById("samplingStep").innerHTML = "<br> Splitting step, cm<sup>-1</sup> : <a href='#' TITLE='Split equally the selected spectral range for generating a series of graphs. Default case: one graph for the whole spectral range.'><img src='resources/images/elements/index.jpeg' height='16px' width='16px'></a> "; 522 //zone texte SpectralRangeLower 523 var inputSpectralRangeLower = $( document.createElement( "input" ) ); 524 inputSpectralRangeLower.attr( {id:"rangeLower", class:"styleInputs"} ); 525 inputSpectralRangeLower.val(0); 526 //pour mettre à jour le menu déroulant des transitions 527 inputSpectralRangeLower.bind( 'blur', this, jQuery.proxy( this.requestTransition, this )); 528 this.containerFormSpectralRangeLower.append( inputSpectralRangeLower ); 529 //zone texte SpectralRangeUpper 530 var inputSpectralRangeUpper = $( document.createElement( "input" ) ); 531 inputSpectralRangeUpper.attr( {id:"rangeUpper"} ); 532 inputSpectralRangeUpper.val(35877.030506); 533 //pour mettre à jour le menu déroulant des transitions lorsque l'on change la valeur du spectral range 534 inputSpectralRangeUpper.bind( 'blur', this, jQuery.proxy( this.requestTransition, this )); 535 this.containerFormSpectralRangeUpper.append( inputSpectralRangeUpper ); 536 //zone texte Sampling step Splitting step 537 var inputSamplingStep = $( document.createElement( "input" ) ); 538 inputSamplingStep.attr( {id:"sampStep", size:6} ); 539 $("#samplingStep").append( inputSamplingStep ); 540 541 542 543 544 //Zone texte Intensity 545 //Titre 546 document.getElementById("intensityLower").innerHTML = "Lower value, cm/mol. : " 547 document.getElementById("intensityUpper").innerHTML = "Upper value, cm/mol. : " 548 //zone texte IntensityLower 549 var inputIntensityLower = $( document.createElement( "input" ) ); 550 inputIntensityLower.attr( {id:"intensityLo", class:"styleInputs"} ); 551 inputIntensityLower.val(0); 552 this.containerFormIntensityLower.append( inputIntensityLower ); 553 //zone texte IntensityUpper 554 var inputIntensityUpper = $( document.createElement( "input" ) ); 555 inputIntensityUpper.attr( {id:"intensityUp"} ); 556 inputIntensityUpper.val(1e-16); 557 this.containerFormIntensityUpper.append( inputIntensityUpper ); 558 559 560 // Create menu deroulant 1er choix axe des y 561 //Titre 562 var titleAxeY1 = document.createTextNode("Select parameter (left Y-axis)"); 563 document.getElementById("axeY1").appendChild(titleAxeY1); 564 var spaceBr = document.createElement ("br"); 565 document.getElementById("axeY1").appendChild(spaceBr); 566 //menu déroulant 567 var paramSelectAxeY1 = new Object(); 568 paramSelectAxeY1.id = "selectAxeY1"; 569 paramSelectAxeY1.parent = $("#axeY1"); 570 this.selectTraceAxeY1 = new Select( paramSelectAxeY1 ); 571 this.selectTraceAxeY1.add( 'B', "Intensity", jQuery.proxy(this.onClickSelectTraceAxeY1, this )); 572 this.selectTraceAxeY1.add( 'C', "Air broadening pressure halfwidth HWHM", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) ); 573 this.selectTraceAxeY1.add( 'D', "Energy of the lower transition level", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) ); 574 this.selectTraceAxeY1.add( 'F', "Temperature dependence coefficient n of HWHM", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) ); 575 this.selectTraceAxeY1.add( 'N', "Self broadening pressure halfwidth (HWHMself)", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) ); 576 this.selectTraceAxeY1.add( 'O', "Air pressure shift of the line transition", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) ); 577 this.selectTraceAxeY1.add( 'R', "Temperature dependence coeff. of the air pressure shift", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) ); 578 this.selectTraceAxeY1.selectFirst( false ); 579 580 // Create menu deroulant type de graphe 581 //Titre 582 var titleTypeTrace = document.createTextNode("Type of graph"); 583 document.getElementById("nbCourbes").appendChild(titleTypeTrace); 584 var spaceBr = document.createElement ("br"); 585 document.getElementById("nbCourbes").appendChild(spaceBr); 586 //menu déroulant 587 var paramNbCourbes = new Object(); 588 paramNbCourbes.id = "selectNbCourbes"; 589 paramNbCourbes.parent = $("#nbCourbes"); 590 this.selectNbCourbes = new Select( paramNbCourbes ); 591 this.selectNbCourbes.add( 'ca', "One curve for all selection", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); 592 this.selectNbCourbes.add( 'cm', "Separated molecules : same graph", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); 593 this.selectNbCourbes.add( 'gm', "Separated molecules : different graphs", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); 594 this.selectNbCourbes.add( 'gi', "Separated isotopologues : different graphs", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); 595 this.selectNbCourbes.add( 'ci', "Separated isotopologues : same graph", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); 596 this.selectNbCourbes.selectFirst( false ); 597 598 // Create menu deroulant type d'échelle linéaire ou logarithmique pour le choix y1 599 //Titre 600 var titleScaleY1 = document.createTextNode("Select the type of Scale (if intensity is choosen)"); 601 document.getElementById("scaleY1Titre").appendChild(titleScaleY1); 602 //menu déroulant 603 var paramSelectScaleY1 = new Object(); 604 paramSelectScaleY1.id = "selectScaleY1"; 605 paramSelectScaleY1.parent = $("#scaleY1"); 606 this.selectScaleY1 = new Select( paramSelectScaleY1 ); 607 this.selectScaleY1.add( 'l', "Linear" ); 608 this.selectScaleY1.add( '-log_scale', "Logarithmic" ); 609 this.selectScaleY1.selectFirst( false ); 610 611 612 // Create menu deroulant style de tracer Y1 613 //Titre 614 var titleTypeTrace = document.createTextNode("Select the type of plot"); 615 document.getElementById("typePlotY1Titre").appendChild(titleTypeTrace); 616 var spaceBr = document.createElement ("br"); 617 document.getElementById("typePlotY1Titre").appendChild(spaceBr); 618 //menu déroulant 619 var paramSelectTypeTraceY1 = new Object(); 620 paramSelectTypeTraceY1.id = "selectTypePlotY1"; 621 paramSelectTypeTraceY1.parent = $("#typePlotY1"); 622 this.selectTypeTraceY1 = new Select( paramSelectTypeTraceY1 ); 623 this.selectTypeTraceY1.add( 'l', "Lines" ); 624 this.selectTypeTraceY1.add( 'p', "Dots" ); 625 this.selectTypeTraceY1.add( 'i', "Peaks" ); 626 this.selectTypeTraceY1.add( 'lp', "Lines and Dots" ); 627 this.selectTypeTraceY1.selectFirst( false ); 628 629 //menu déroulant tracé de la 2Úme base pour l'onglet "Database comparison" 630 var paramSelectTypeTraceDatabase2 = new Object(); 631 paramSelectTypeTraceDatabase2.id = "selectTypePlotDatabase2"; 632 paramSelectTypeTraceDatabase2.parent = $("#typePlotDatabase2"); 633 this.selectTypeTraceDatabase2 = new Select( paramSelectTypeTraceDatabase2 ); 634 this.selectTypeTraceDatabase2.add( 'l', "Lines" ); 635 this.selectTypeTraceDatabase2.add( 'p', "Dots" ); 636 this.selectTypeTraceDatabase2.add( 'i', "Peaks" ); 637 this.selectTypeTraceDatabase2.add( 'lp', "Lines and Dots" ); 638 this.selectTypeTraceDatabase2.selectFirst( false ); 639 640 641 //lien pour montrer ou cacher le bloc "advanced options" 642 var showHide = $(document.createElement("a")); 643 showHide.html("Show advanced options"); 644 showHide.attr( {id:"aShowHide", class:"fieldsetGeneralTitle"} ); 645 showHide.bind( 'click', this, jQuery.proxy( this.onClickShowAdvancedOptions)); 646 $("#showAdvancedOptions").append(showHide); 647 648 649 //titre menu deroulant transition upper 650 var titleTransitionUpper = document.createTextNode("Upper state : "); 651 document.getElementById("transitionUpper").appendChild(titleTransitionUpper); 652 //titre menu deroulant transition upper 653 this.selectTransitionUpper = $( document.createElement( "select" ) ); 654 this.selectTransitionUpper.attr( {id:"transition1"} ); 655 //fonction sur le menu déroulant (des qu'on clique dessus) et non sur chacune des options 656 this.selectTransitionUpper.bind( 'click', jQuery.proxy(this.OnclickVerifTransition, this)); 657 var optTransitionUpper = $( document.createElement( "option" ) ); 658 optTransitionUpper.attr( {value:"-1", text:"Select a molecule"} ); 659 this.selectTransitionUpper.append(optTransitionUpper); 660 $("#transitionUpper").append(this.selectTransitionUpper); 661 662 663 //titre menu deroulant transition lower 664 var titleTransitionLower = document.createTextNode("Lower state : "); 665 document.getElementById("transitionLower").appendChild(titleTransitionLower); 666 // Create menu deroulant transition lower 667 this.selectTransitionLower = $( document.createElement( "select" ) ); 668 this.selectTransitionLower.attr( {id:"transition2"} ); 669 this.selectTransitionLower.bind( 'click', jQuery.proxy(this.OnclickVerifTransition, this)); 670 var optTransitionLower = $( document.createElement( "option" ) ); 671 optTransitionLower.attr( {value:"-1", text:"Select a molecule"} ); 672 this.selectTransitionLower.append(optTransitionLower); 673 $("#transitionLower").append(this.selectTransitionLower); 674 675 //bouton reset pour les transition 676 var resetButton = new Button( {value:"Reset", parent:$( "#transitionReset" ), id:"buttonReset", className: "gray_button", onClick:jQuery.proxy( this.requestTransition, this )} ); 677 678 679 //Zone text Mean Value Bin-average 680 //Titre 681 var titleMeanValue = document.createTextNode("Bin-average : "); 682 document.getElementById("meanValue1").appendChild(titleMeanValue); 683 //champ input 684 var inputMeanValue = $( document.createElement( "input" ) ); 685 inputMeanValue.attr( {id:"meanValue2", size:6} ); 686 inputMeanValue.val(0); 687 this.containerFormMeanValue1.append( inputMeanValue ); 688 inputMeanValue.bind( 'blur', this, jQuery.proxy( this.onBlurInputMeanValue, this )); 689 690 691 // Create menu deroulant 2eme choix axe des y 692 //Titre 693 var titleAxeY2 = document.createTextNode("Select secondary parameter (right Y-axis)"); 694 document.getElementById("axeY2Titre").appendChild(titleAxeY2); 695 //menu déroulant 696 var paramSelectAxeY2 = new Object(); 697 paramSelectAxeY2.id = "selectAxeY2"; 698 paramSelectAxeY2.parent = $("#axeY2"); 699 this.selectTraceAxeY2 = new Select( paramSelectAxeY2 ); 700 this.selectTraceAxeY2.add( 'no', "None", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); 701 this.selectTraceAxeY2.add( 'B', "Intensity", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); 702 this.selectTraceAxeY2.add( 'C', "Air broadening pressure halfwidth HWHM", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); 703 this.selectTraceAxeY2.add( 'D', "Energy of the lower transition level", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); 704 this.selectTraceAxeY2.add( 'F', "Temperature dependence coefficient n of HWHM", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); 705 this.selectTraceAxeY2.add( 'N', "Self broadening pressure halfwidth (HWHMself)", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); 706 this.selectTraceAxeY2.add( 'O', "Air pressure shift of the line transition", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); 707 this.selectTraceAxeY2.add( 'R', "Temperature dependence coeff. of the air pressure shift", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); 708 this.selectTraceAxeY2.selectFirst( false ); 709 710 711 // Create menu deroulant type d'échelle linéaire ou logarithmique pour le choix y2 712 //Titre 713 var titleScaleY2 = document.createTextNode("Select the type of Scale (if intensity is choosen)"); 714 document.getElementById("scaleY2Titre").appendChild(titleScaleY2); 715 //menu déroulant 716 var paramSelectScaleY2 = new Object(); 717 paramSelectScaleY2.id = "SelectScaleY2"; 718 paramSelectScaleY2.parent = $("#scaleY2"); 719 this.selectScaleY2 = new Select( paramSelectScaleY2 ); 720 this.selectScaleY2.add( 'l', "Linear" ); 721 this.selectScaleY2.add( '-log_scale2', "Logarithmic" ); 722 this.selectScaleY2.selectFirst( false ); 723 //est inactif par defaut car selectTraceAxeY2 est positionne a none par defaut 724 document.getElementById("scaleY2Titre").className = "notActiveText"; 725 this.selectScaleY2.disable(); 726 727 728 // Create menu deroulant style de tracer Y2 729 //Titre 730 var titleTypeTrace = document.createTextNode("Select the type of plot"); 731 document.getElementById("typePlotY2Titre").appendChild(titleTypeTrace); 732 //menu déroulant 733 var paramSelectTypeTraceY2 = new Object(); 734 paramSelectTypeTraceY2.id = "selectTypePlotY2"; 735 paramSelectTypeTraceY2.parent = $("#typePlotY2"); 736 this.selectTypeTraceY2 = new Select( paramSelectTypeTraceY2 ); 737 this.selectTypeTraceY2.add( 'l', "Lines" ); 738 this.selectTypeTraceY2.add( 'p', "Dots" ); 739 this.selectTypeTraceY2.add( 'i', "Peaks" ); 740 this.selectTypeTraceY2.add( 'lp', "Lines and Dots" ); 741 this.selectTypeTraceY2.selectFirst( false ); 742 //est inactif par defaut car selectTraceAxeY2 est positionne a none par defaut 743 document.getElementById("typePlotY2Titre").className = "notActiveText"; 744 this.selectTypeTraceY2.disable(); 745 746 // Create menu deroulant choix de la sortie pour l'onglet "Database comparison" 747 var paramoutputDatabasecomparison = new Object(); 748 paramoutputDatabasecomparison.id = "outputDatabaseComparisonChoice1"; 749 paramoutputDatabasecomparison.parent = $("#outputDatabaseComparisonChoice"); 750 this.selectOutputDatabasecomparison = new Select( paramoutputDatabasecomparison ); 751 this.selectOutputDatabasecomparison.add( 'def', "Default output" ); 752 this.selectOutputDatabasecomparison.add( 'diff_step', "Mean difference" ); 753 this.selectOutputDatabasecomparison.add( 'diff_step100', "Mean difference in percentage" ); 754 this.selectOutputDatabasecomparison.add( 'diff_stepboth', "Both mean difference" ); 755 this.selectOutputDatabasecomparison.selectFirst( false ); 756 757 758 //création de l'image d'attente 759 var param = new Object(); 760 param.id = "loadingForGraphics"; 761 param.parent = this.containerLoading; 762 this.loadingGraphics = new Loading( param ); 763 // this.loadingGraphics.display(); 764 //this.loadingGraphics.hide(); 765 766 767 // var submitButton = new Button( {value:"Submit", parent:$( "#boutonSubmit" ), id:"button_submit_3", className: "red_button", classNameText:"red_button_text", onClick:jQuery.proxy( this.onClickSubmit, this )} ); 768 var submitButton = new Button( {value:"Submit", parent:$( "#boutonSubmit" ), id:"button_submit_3", className: "positive", onClick:jQuery.proxy( this.onClickSubmit, this )} ); 769 //bouton reset pour toute la page 770 var resetPageButton = new Button( {value:"Reset", parent:$( "#boutonSubmit" ), id:"buttonReset", className: "gray_button", onClick:jQuery.proxy( this.resetPage, this )} ); 771 772 773 774 }, 775 776 777 778 779 /** 780 * This method creates the case to check for the moles 781 * create cases à cocher pour les molécules 782 * @param container 783 * @param moleculesArray 784 */ 785 //createMolecules: function(container, moleculesArray) 786 createMolecules: function(container, moleculesArray, BddVersion) 787 { 788 var table = $(document.createElement("table")); 789 container.append(table); 790 791 var i=0; 792 //nombre de molecules par ligne 793 var l=11; 794 //taille du tableau 795 //alert("l" +moleculesArray.length); 796 797 798 $.each(moleculesArray, jQuery.proxy( function(index, moleculeElement ) 799 { 800 801 802 //this.tr et non var tr pour que tr existe encore à la sortie du if 803 if ( index == (i*l)) 804 { 805 //alert(index); 806 this.tr = $(document.createElement("tr")); 807 this.tr.attr({valign: "top"}); 808 table.append(this.tr); 809 i=i+1; 810 811 } 812 var td = $(document.createElement("td")); 813 this.tr.append(td); 814 815 var span= $(document.createElement("span")); 816 span.addClass("molecule"); 817 td.append(span); 818 819 var input = $(document.createElement("input")); 820 input.attr({type:"checkbox", id:"all-"+moleculeElement.id+"-"+BddVersion}); 821 input.bind( 'click', this, jQuery.proxy( this.cliquetout, [this, moleculeElement.id, BddVersion ] )); 822 span.append(input); 823 824 var a = $(document.createElement("a")); 825 a.html("<b>"+moleculeElement.name+"</b>"); 826 827 a.bind( 'click', this, jQuery.proxy( this.visibilite, [this,"Cache-"+ moleculeElement.id] )); 828 span.append(a); 829 830 var div= $(document.createElement("div")); 831 div.addClass("divViolet"); 832 div.attr({id:"Cache-"+moleculeElement.id, style: "display:none"}); 833 td.append(div); 834 835 var spanIsotopes= $(document.createElement("span")); 836 spanIsotopes.addClass("isotope"); 837 spanIsotopes.attr({id:moleculeElement.id+"Isotope"+BddVersion}); 838 div.append(spanIsotopes); 839 840 841 this.createIsotopes($("#"+moleculeElement.id+"Isotope"+BddVersion), moleculeElement.isotopesArray, moleculeElement.id, BddVersion); 842 843 844 }, this) ); 845 846 847 }, 848 849 createIsotopes: function(container, isotopesArray, moleculeElement, BddVersion ) 850 { 851 852 853 $.each(isotopesArray, jQuery.proxy( function( index, isotopeElement ) 854 { 855 container.append(" "); 856 var inputIsotopes = $(document.createElement("input")); 857 inputIsotopes.attr({type:"checkbox", id:"chk-"+moleculeElement+"_"+isotopeElement+"-"+BddVersion, name:"moles", value:moleculeElement+"_"+isotopeElement}); 858 inputIsotopes.bind( 'click', this, jQuery.proxy( this.cliqueIsotope, [this, moleculeElement+"_"+isotopeElement, moleculeElement, BddVersion ] )); 859 container.append(inputIsotopes); 860 container.append(isotopeElement); 861 var br = $(document.createElement("br")); 862 container.append(br); 863 864 }, this) ); 865 }, 866 867 // <table><tr><td> 868 // <span class="molecule"><input type=checkbox id=all-ch3cn-GEISA2011 onclick="cliquetout('this, ch3cn, GEISA2011');"> 869 // <a href="javascript:visibilite('this, Cache-ch3cn');"><B>CH<sub>3</sub>CN</a></B> 870 // </span> 871 // <div class="divViolet" id="Cache-ch3cn" style="display:none;"> 872 // <span class="isotope" id="ch3cnIsotopeGEISA2011"> <input type=checkbox id=chk-ch3cn_234-GEISA2011 name=moles value=ch3cn_234 onclick="cliqueIsotope('this, ch3cn_234, GEISA2011');">234<br></span> 873 // </div> 874 // </td></tr></table> 875 876 // REQUESTS ******************************************************** 877 //récupération de toutes les valeurs choisies par l'utilisateur et transformation de ces valeurs pour les inclure dans la requête fortran 878 requestGeisa: function() 879 { 880 //temps en ms pour obtenir un nom unique de répertoire 881 var dateTime = new Date().getTime(); 882 this.NomRepFileOut = "graph"+dateTime+"/"; 883 884 885 // appel ajax 886 887 //sélection du fichier binaire de la base geisa sélectionnée 888 var paramBase = ""; 889 switch (this.selectDatabase.getValue()) { 890 case 'GEISA2003': 891 paramBase = " -dirin "+this.pathProcess+" -dirout "+this.LongPathImages+this.NomRepFileOut+" -filein "+this.pathProcess+"line_GEISA2003_asc_gs03_v1.0 -input_format asc -database_name GEISA2003 -database_type gs03 -type_out png"; 892 break; 893 case 'GEISA2011': 894 paramBase = " -dirin "+this.pathProcess+" -dirout "+this.LongPathImages+this.NomRepFileOut+" -filein "+this.pathProcess+"line_GEISA2009_bin -database_name GEISA2011 -database_type gs08 -type_out png"; 895 break; 896 case 'GEISAIASI2003': 897 paramBase = " -dirin "+this.pathProcess+" -dirout "+this.LongPathImages+this.NomRepFileOut+" -filein "+this.pathProcess+"line_GEISAIASI2003_asc_gsi03_v1.0 -input_format asc -database_name GEISAIASI2003 -database_type gsi03 -type_out png"; 898 break; 899 case 'GEISAIASI2011': 900 paramBase = " -dirin "+this.pathProcess+" -dirout "+this.LongPathImages+this.NomRepFileOut+" -filein "+this.pathProcess+"line_GEISAIASI2011_bin_gsi08_v1.0 -database_name GEISAIASI2011 -database_type gsi08 -type_out png"; 901 break; 902 } 903 904 //sélection du fichier binaire de deuxiÚme base geisa sélectionnée pour l'option graphique "databases comparison" 905 var paramBase2 = ""; 906 switch (this.selectDatabase2.getValue()) { 907 case 'GEISA2003': 908 paramBase2 = " -filein2 "+this.pathProcess+"line_GEISA2003_bin_gs08_v1.0 -database_name2 GEISA2003"; 909 break; 910 case 'GEISA2011': 911 paramBase2 = " -filein2 "+this.pathProcess+"line_GEISA2009_bin -database_name2 GEISA2011 -database_type gs08"; 912 break; 913 case 'HITRAN2009': 914 paramBase2 = " -filein2 "+this.pathProcess+"HITRAN_2009_bin -database_name2 HITRAN2009"; 915 break; 916 } 917 918 919 //molécules 920 //récupération des molécules sélectionnées 921 var inputs = document.getElementsByTagName( 'input' ); 922 var count = inputs.length; 923 var isotopesSelectedName =""; 924 // alert(this.selectDatabase.getValue()); 925 var i=0; 926 this.nbIsotopes = 0; 927 this.nbMolecules = 0; 928 this.nbGraph = 0; 929 for( i = 0; i < count; i++ ) 930 { 931 var input = inputs.item( i ); 932 //ne prendre que les isotopes sélectionnés dans la base de données sélectionnée (rechercher des id du type : "chk-ch3cn-GEISA-11") 933 if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("chk-")!= -1 && input.id.indexOf(this.selectDatabase.getValue())!= -1) 934 { 935 //nombre d'isotopes sélectionnés 936 this.nbIsotopes = this.nbIsotopes + 1; 937 938 var molN=input.value; 939 var molN1=molN.replace("_", ":"); 940 // exemple : -moleisot h2o:161 -moleisot h2o:162 -moleisot co2:626 -moleisot co2:627 -moleisot o3:666 -moleisot o3:668 941 isotopesSelectedName = isotopesSelectedName+"-moleisot "+molN1+" "; 942 } 943 //récupération du nombre de molécules sélectionnées 944 if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("all-")!= -1 && input.id.indexOf(this.selectDatabase.getValue())!= -1) 945 { 946 //nombre d'isotopes sélectionnés 947 this.nbMolecules = this.nbMolecules + 1; 948 } 949 } 950 951 952 //averti l'utilisateur qu'il faut au moins sélectionner un isotope 953 if (this.nbIsotopes == 0) { 954 alert("Error : no molecule or isotopoloque was selected"); 955 return; 956 } 957 958 959 960 //sélection du nombre de courbes ou de graphs 961 962 var nbCourbes = ""; 963 964 switch (this.selectNbCourbes.getValue()) { 965 //sswitch (document.getElementById('selectNbCourbes').options[document.getElementById('selectNbCourbes').selectedIndex].value) { 966 case 'cm': 967 nbCourbes = "-separate_mol -same_graph "; 968 this.nbGraph = 1; 969 this.nbCourbe = this.nbMolecules; 970 if (this.nbCourbe > 8) { 971 alert("Too much molecules selected to draw one curve for each molecule selected (>8)"); 972 return; 973 } 974 break; 975 case 'ci': 976 nbCourbes = "-separate_iso -same_graph "; 977 this.nbGraph = 1; 978 this.nbCourbe = this.nbIsotopes; 979 if (this.nbCourbe > 8) { 980 alert("Too much isotopologues selected to draw one curve for each isotopologues selected (>8)"); 981 return; 982 } 983 break; 984 case 'gm': 985 nbCourbes = "-separate_mol "; 986 this.nbGraph = this.nbMolecules; 987 if (this.nbGraph > 20) { 988 alert("Too much molecules selected to draw one graph for each molecules selected (>20)"); 989 return; 990 } 991 break; 992 case 'gi': 993 nbCourbes = "-separate_iso "; 994 this.nbGraph = this.nbIsotopes; 995 if (this.nbGraph > 20) { 996 alert("Too much isotopologues selected to draw one graph for each isotopologues selected (>20)"); 997 return; 998 } 999 break; 1000 default: 1001 nbCourbes = ""; 1002 this.nbGraph = 1; 1003 break; 1004 } 1005 1006 1007 //Spectral range 1008 var rangeLower="-wavenb_min "+$("#rangeLower").val(); 1009 var rangeUpper="-wavenb_max "+$("#rangeUpper").val(); 1010 1011 //controle des valeurs entrées par l'utilisateur 1012 1013 switch (this.selectDatabase.getValue()) { 1014 case 'GEISA2003': 1015 //isNaN = n'est pas un nombre 1016 if(isNaN(($("#rangeLower").val())) == true || parseFloat($("#rangeLower").val()) < 0 || parseFloat($("#rangeLower").val()) > 35877.030506) 1017 { 1018 alert("Error: Invalid value for lower spectral range area. The value must be between 0 and 35877.030506"); 1019 return; 1020 } 1021 1022 if(isNaN(($("#rangeUpper").val())) == true || parseFloat( $("#rangeUpper").val()) == 0 || parseFloat( $("#rangeUpper").val()) < 0 || parseFloat($("#rangeUpper").val()) > 35877.030506) 1023 { 1024 alert("Error: Invalid value for upper spectral range area. The value must be between 0 and 35877.030506"); 1025 return; 1026 } 1027 1028 break; 1029 case 'GEISA2011': 1030 //isNaN = n'est pas un nombre 1031 if(isNaN(($("#rangeLower").val())) == true || parseFloat($("#rangeLower").val()) < 0 || parseFloat($("#rangeLower").val()) > 35877.030506) 1032 { 1033 alert("Error: Invalid value for lower spectral range area. The value must be between 0 and 35877.030506"); 1034 return; 1035 } 1036 1037 if(isNaN(($("#rangeUpper").val())) == true || parseFloat( $("#rangeUpper").val()) == 0 || parseFloat( $("#rangeUpper").val()) < 0 || parseFloat($("#rangeUpper").val()) > 35877.030506) 1038 { 1039 alert("Error: Invalid value for upper spectral range area. The value must be between 0 and 35877.030506"); 1040 return; 1041 } 1042 break; 1043 case 'GEISAIASI2003': 1044 //isNaN = n'est pas un nombre 1045 if(isNaN(($("#rangeLower").val())) == true || parseFloat($("#rangeLower").val()) < 0 || parseFloat($("#rangeLower").val()) < 599.000793 || parseFloat($("#rangeLower").val()) > 3000.998767) 1046 { 1047 alert("Error: Invalid value for lower spectral range area. The value must be between 599.000793 and 3000.998767"); 1048 return; 1049 } 1050 1051 if(isNaN(($("#rangeUpper").val())) == true || parseFloat( $("#rangeUpper").val()) == 0 || parseFloat( $("#rangeUpper").val()) < 0 || parseFloat($("#rangeUpper").val()) < 599.000793 || parseInt($("#rangeUpper").val()) > 3000.998767) 1052 { 1053 alert("Error: Invalid value for upper spectral range area. The value must be between 599.000793 and 3000.998767"); 1054 return; 1055 } 1056 break; 1057 case 'GEISAIASI2011': 1058 //isNaN = n'est pas un nombre 1059 if(isNaN(($("#rangeLower").val())) == true || parseFloat($("#rangeLower").val()) < 0 || parseFloat($("#rangeLower").val()) < 599.000793 || parseFloat($("#rangeLower").val()) > 3000.998767) 1060 { 1061 alert("Error: Invalid value for lower spectral range area. The value must be between 599.000793 and 3000.998767"); 1062 return; 1063 } 1064 1065 if(isNaN(($("#rangeUpper").val())) == true || parseFloat( $("#rangeUpper").val()) == 0 || parseFloat( $("#rangeUpper").val()) < 0 || parseFloat($("#rangeUpper").val()) < 599.000793 || parseInt($("#rangeUpper").val()) > 3000.998767) 1066 { 1067 alert("Error: Invalid value for upper spectral range area. The value must be between 599.000793 and 3000.998767"); 1068 return; 1069 } 1070 break; 1071 } 1072 1073 1074 if ($("#rangeLower").val() == "" ) 1075 { 1076 rangeLower=""; 1077 } 1078 1079 if ($("#rangeUpper").val() == "" ) 1080 { 1081 rangeUpper=""; 1082 } 1083 if( parseInt($("#rangeLower").val()) > parseInt($("#rangeUpper").val()) ) 1084 { 1085 alert("Error: lower spectral range area is superior to upper spectral range area "); 1086 return; 1087 } 1088 1089 1090 1091 //Sampling step Splitting step 1092 if( $("#sampStep").val() > 0 ) 1093 { 1094 var samplingStep="-band "+$("#sampStep").val(); 1095 //calcul du nombre de graphs générés par l'option Sampling step 1096 this.nbGraphSamplingStep = (parseFloat($("#rangeUpper").val()) - parseFloat($("#rangeLower").val())) / parseFloat($("#sampStep").val()); 1097 //calcul du nombre de graphs total à tracer (nbr de graph générés par "type of graph" * nbr de graph généré par "Sampling Step") 1098 //test pour voir si "nbGraphSamplingStep" est un entier 1099 if ((this.nbGraphSamplingStep - parseInt(this.nbGraphSamplingStep)) == 0) 1100 { 1101 this.nbGraph=(this.nbGraph)*(this.nbGraphSamplingStep); 1102 } 1103 else 1104 { 1105 // si "nbGraphSamplingStep" n'est pas un entier prendre le nbre entier suivant 1106 this.nbGraph=this.nbGraph*(parseInt(this.nbGraphSamplingStep)+1); 1107 } 1108 } 1109 1110 if(isNaN($("#sampStep").val()) == true || parseInt($("#sampStep").val()) < 0 ) 1111 { 1112 alert("Error: Invalid value for sampling step"); 1113 return; 1114 } 1115 1116 //Splitting step 1117 if( $("#sampStep").val() == 0 ) 1118 { 1119 var samplingStep=""; 1120 } 1121 1122 //test sur le nombre de graphs générés 1123 if (this.nbGraph > 20) 1124 { 1125 alert("Too many graphics will be drawn ("+this.nbGraph+"). Please change the value of the sampling step or change the type of graph."); 1126 return; 1127 } 1128 1129 1130 1131 //Transitions to do 1132 //exemple de requete avec transition 1133 //./all -filein line_GEISA2009_bin -moleisot h2o:161 -wavenb_min 1 -wavenb_max 1000 -database_name "GEISA2011" -vib_ident_lower '[000]' 1134 var transitionUpper=document.getElementById('transition1').options[document.getElementById('transition1').selectedIndex].value; 1135 1136 //certaine transitions ont plusieurs espaces à droite qui ne sont pas conservés (ex ch4 et C2HD) 1137 //si la longueur de la chaine de caracteres n'est pas 25 on rajoute le nobre d'espace nécessaire pour arriver à 25 1138 var nb=0; 1139 nb=25-transitionUpper.length 1140 if (nb != 0) 1141 { 1142 for (i = 1; i <= nb; i++) { 1143 transitionUpper=transitionUpper+" "; 1144 } 1145 } 1146 1147 1148 var transitionLower=document.getElementById('transition2').options[document.getElementById('transition2').selectedIndex].value; 1149 1150 //certaine transitions ont plusieurs espaces à droite qui ne sont pas conservés (ex ch4 et C2HD) 1151 //si la longueur de la chaine de caracteres n'est pas 25 on rajoute le nobre d'espace nécessaire pour arriver à 25 1152 var nb=0; 1153 nb=25-transitionLower.length 1154 if (nb != 0) 1155 { 1156 for (i = 1; i <= nb; i++) { 1157 transitionLower=transitionLower+" "; 1158 } 1159 } 1160 1161 //pas de transition sélectionnée 1162 1163 if (( document.getElementById('transition1').options[document.getElementById('transition1').selectedIndex].value == -1) || (document.getElementById('transition1').options[document.getElementById('transition1').selectedIndex].value == "transition" )) 1164 { 1165 transitionUpper ="no"; 1166 } 1167 if (( document.getElementById('transition2').options[document.getElementById('transition2').selectedIndex].value == -1) || (document.getElementById('transition2').options[document.getElementById('transition2').selectedIndex].value == "transition" )) 1168 { 1169 transitionLower ="no"; 1170 } 1171 1172 if ( document.getElementById('transition1').options[document.getElementById('transition1').selectedIndex].value == "") 1173 { 1174 transitionUpper ="noValue"; 1175 } 1176 1177 if ( document.getElementById('transition2').options[document.getElementById('transition2').selectedIndex].value == "") 1178 { 1179 transitionLower ="noValue"; 1180 } 1181 1182 var sel = document.getElementById('transition1'); 1183 var idupper = sel.options[sel.selectedIndex].value; 1184 1185 //Intensity range 1186 var intensityLower="-int_min "+$("#intensityLo").val(); 1187 var intensityUpper="-int_max "+$("#intensityUp").val(); 1188 1189 //controle des valeurs entrées par l'utilisateur 1190 if(isNaN($("#intensityLo").val()) == true || $("#intensityLo").val() < 0 ) 1191 { 1192 alert("Error: Invalid value for lower intensity range area. The value must be between 0 and 1E-16"); 1193 return; 1194 } 1195 if ($("#intensityLo").val() == "" ) 1196 { 1197 intensityLower=""; 1198 } 1199 if(isNaN($("#intensityUp").val()) == true || $("#intensityUp").val() < 0 ) 1200 { 1201 alert("Error: Invalid value for upper intensity range area. The value must be between 0 and 1E-16"); 1202 return; 1203 } 1204 if ($("#intensityUp").val() == "" ) 1205 { 1206 intensityUpper=""; 1207 } 1208 1209 //to do javascript ne sait comparer des exponenciels 1210 // if( $("#intensityLo").val() > $("#intensityUp").val() ) 1211 1212 // { 1213 // alert("Error: lower intensity range area is superior to upper intensity range area "); 1214 // return; 1215 // } 1216 1217 1218 //Valeur de mean value Bin-average 1219 var meanValue = "-step "+$("#meanValue2").val(); 1220 //controle des valeurs entrées par l'utilisateur 1221 //Si ce n'est pas un nombre ou si il est négatif ou si mean value est supérieur ou égal à l'interval spectral 1222 if(isNaN($("#meanValue2").val()) == true || $("#meanValue2").val() < 0 || $("#meanValue2").val() >= (parseFloat($("#rangeUpper").val()) - parseFloat($("#rangeLower").val())) ) 1223 { 1224 alert("Error: Invalid value for Average calculation area"); 1225 return; 1226 } 1227 //si aucune valeur 1228 if ($("#meanValue2").val() == "" ) 1229 { 1230 meanValue=""; 1231 } 1232 1233 //sélection du premier choix pour l'axe des Y 1234 var field="-field "+this.selectTraceAxeY1.getValue(); 1235 1236 1237 //sélection du type d'échelle pour le parametre Y1 (il y a une valeur pour ce champ que si logaritmic est choisi et si l'option est activée) 1238 if (this.selectScaleY1.getValue() == '-log_scale' && this.selectScaleY1.isDisable == false) 1239 { 1240 var logScale = this.selectScaleY1.getValue(); 1241 } 1242 else 1243 { 1244 var logScale = "" 1245 } 1246 1247 1248 1249 //sélection du type de tracé pour Y1 1250 var lineType="-line_type "+this.selectTypeTraceY1.getValue(); 1251 //var lineType="-line_type "+document.getElementById('selectTypePlotY1').options[document.getElementById('selectTypePlotY1').selectedIndex].value; 1252 1253 // sélection du type de tracé pour la deuxiÚme base dans l'option "databases comparison" 1254 //var lineType3="-line_type3 "+this.selectTypeTraceDatabase2.getValue(); 1255 1256 //sélection ou non d'un 2eme choix pour l'axe des Y (pas de valeur pour ce champ si choix none ou si l'option n'est pas activée) 1257 if (this.selectTraceAxeY2.getValue() == 'no' || this.selectTraceAxeY2.isDisable == true) 1258 { 1259 var field2 = ""; 1260 } 1261 else 1262 { 1263 var field2 = "-field2 "+this.selectTraceAxeY2.getValue(); 1264 //var field2 = "-field2 "+document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value; 1265 } 1266 1267 1268 1269 //sélection du type d'échelle pour le parametre Y2 (il y a une valeur pour ce champ que si logaritmic est choisi et si l'option est activée) 1270 if (this.selectScaleY2.getValue() == '-log_scale2' && this.selectScaleY2.isDisable == false) 1271 { 1272 var logScale2 =this.selectScaleY2.getValue(); 1273 // var logScale2 = document.getElementById('selectScaleY2').options[document.getElementById('selectScaleY2').selectedIndex].value; 1274 } 1275 else 1276 { 1277 var logScale2 = ""; 1278 } 1279 1280 1281 //sélection du type de tracé pour Y2 (pas de valeur si l'option n'est pas activée) 1282 if ( this.selectTypeTraceY2.isDisable == true) 1283 { 1284 var lineType2 = ""; 1285 } 1286 else 1287 { 1288 var lineType2 = "-line_type2 "+this.selectTypeTraceY2.getValue(); 1289 } 1290 1291 //choix du type de sortie pour l'option graphique 'databases comparison" 1292 var diffStep=""; 1293 switch (this.selectOutputDatabasecomparison.getValue()) { 1294 case 'def': 1295 diffStep = ""; 1296 break; 1297 case 'diff_step': 1298 diffStep = "-diff_step"; 1299 break; 1300 case 'diff_step100': 1301 diffStep = "-diff_step100"; 1302 break; 1303 case 'diff_stepboth': 1304 diffStep = "-diff_stepboth"; 1305 break; 1306 } 1307 1308 //Dans l'option graphique "databases comparison", pour les sorties par différence moyenne le champ "Bin-average" doit être supérieur à 0 1309 if ($("#graphicOptionChoice").val() =="comparison" && $("#meanValue2").val() == 0 && this.selectOutputDatabasecomparison.getValue() != "def" ) 1310 { 1311 alert("For average output, the Bin-average field must be > 0"); 1312 return; 1313 } 1314 1315 1316 //ouverture de la div de l'image d'attente 1317 this.loadingGraphics.display(); 1318 1319 1320 //construction du nom du fichier (exemple GEISA2011-0_100) 1321 //this.nomFichier=this.selectDatabase.getValue()+"-"+$("#rangeLower").val()+"_"+$("#rangeUpper").val(); 1322 switch ($("#graphicOptionChoice").val()) { 1323 //(exemple GEISA2011-0_100) 1324 case 'contents': 1325 this.nomFichier=this.selectDatabase.getValue()+"-"+$("#rangeLower").val()+"_"+$("#rangeUpper").val(); 1326 break; 1327 case 'global': 1328 this.nomFichier=this.selectDatabase.getValue()+"-"+$("#rangeLower").val()+"_"+$("#rangeUpper").val(); 1329 break; 1330 //(exemple GEISA2011_GEISA2003-0_100) 1331 case 'comparison': 1332 this.nomFichier=this.selectDatabase.getValue()+"_"+this.selectDatabase2.getValue()+"-"+$("#rangeLower").val()+"_"+$("#rangeUpper").val(); 1333 break; 1334 } 1335 1336 //Submit pour l'option graphique "Database contents" 1337 if ($("#graphicOptionChoice").val() == "contents" ) 1338 { 1339 //construction de la requête Fortran 1340 var parameters = "&fortranRequest="+paramBase+" "+isotopesSelectedName+" "+rangeLower+" "+rangeUpper+" "+samplingStep+" "+intensityLower+" "+intensityUpper+" "+ 1341 meanValue+" "+nbCourbes+" "+field+" "+logScale+" "+lineType+" "+field2+" "+logScale2+" "+lineType2; 1342 1343 1344 //remplacement de espace par "EEE" pour que le shell script ne voit qu'un seul argument en entrée 1345 parameters=parameters.replace(/ /g,"kkk"); 1346 transitionUpper=transitionUpper.replace(/ /g,"kkk"); 1347 //le + est interprété comme un espace (plus sera retransformé en + dans le shell) 1348 transitionUpper=transitionUpper.replace(/\+/g,"plus"); 1349 transitionLower=transitionLower.replace(/ /g,"kkk"); 1350 transitionLower=transitionLower.replace(/\+/g,"plus"); 1351 1352 //envoie de la requête au controller 1353 //en cas de succes appel de la fonction "handleGeisa" 1354 $.ajax( { 1355 url: "project?methodName=createUserRequest&"+parameters+"&transitionUpper="+ transitionUpper+"&transitionLower="+ transitionLower+"&nbGraph="+ this.nbGraph+"&nomFichier="+this.nomFichier+"&NomRepFileOut="+this.NomRepFileOut, 1356 success:jQuery.proxy( this.handleGeisa, this ) 1357 } ); 1358 1359 } 1360 1361 //Submit pour l'option graphique "Global representation" 1362 if ($("#graphicOptionChoice").val() =="global" ) 1363 { 1364 //construction de la requête Fortran 1365 1366 var parameters = "&fortranRequest="+paramBase+" "+isotopesSelectedName+" "+rangeLower+" "+rangeUpper+" "+samplingStep+" "+intensityLower+" "+intensityUpper+" "+ 1367 nbCourbes+" "+logScale+" "+lineType+" -global_position"; 1368 1369 1370 //remplacement de espace par "EEE" pour que le shell script ne voit qu'un seul argument en entrée 1371 parameters=parameters.replace(/ /g,"kkk"); 1372 1373 //pas de transition dans cette option 1374 transitionUpper ="no"; 1375 transitionLower ="no"; 1376 1377 //envoie de la requête au controller 1378 //en cas de succes appel de la fonction "handleGeisa" 1379 $.ajax( { 1380 url: "project?methodName=createUserRequest&"+parameters+"&transitionUpper="+ transitionUpper+"&transitionLower="+ transitionLower+"&nbGraph="+ this.nbGraph+"&nomFichier="+this.nomFichier+"&NomRepFileOut="+this.NomRepFileOut, 1381 success:jQuery.proxy( this.handleGeisa, this ) 1382 } ); 1383 1384 } 1385 1386 //ParamÚtres à prendre en compte pour l'option "Databases comparison" 1387 1388 //Submit pour l'option graphique "Databases comparison" 1389 if ($("#graphicOptionChoice").val() =="comparison" ) 1390 { 1391 //sélection du type de tracé pour pour la 2Úme base de données pour l'option "database comparison" 1392 var lineType2="-line_type2 "+this.selectTypeTraceDatabase2.getValue(); 1393 1394 1395 //construction de la requête Fortran 1396 var parameters = "&fortranRequest="+paramBase+" "+paramBase2+" "+isotopesSelectedName+" "+rangeLower+" "+rangeUpper+" "+samplingStep+" "+intensityLower+" "+intensityUpper+" "+ 1397 meanValue+" "+nbCourbes+" "+field+" "+logScale+" "+lineType+" "+lineType2+" "+diffStep; 1398 1399 1400 //remplacement de espace par "EEE" pour que le shell script ne voit qu'un seul argument en entrée 1401 parameters=parameters.replace(/ /g,"kkk"); 1402 transitionUpper=transitionUpper.replace(/ /g,"kkk"); 1403 //le + est interprété comme un espace (plus sera retransformé en + dans le shell) 1404 transitionUpper=transitionUpper.replace(/\+/g,"plus"); 1405 transitionLower=transitionLower.replace(/ /g,"kkk"); 1406 transitionLower=transitionLower.replace(/\+/g,"plus"); 1407 1408 //envoie de la requête au controller 1409 //en cas de succes appel de la fonction "handleGeisa" 1410 $.ajax( { 1411 url: "project?methodName=createUserRequest&"+parameters+"&transitionUpper="+ transitionUpper+"&transitionLower="+ transitionLower+"&nbGraph="+ this.nbGraph+"&nomFichier="+this.nomFichier+"&NomRepFileOut="+this.NomRepFileOut, 1412 success:jQuery.proxy( this.handleGeisa, this ) 1413 } ); 1414 1415 } 1416 1417 }, 1418 1419 1420 //requête pour interrogation de la base de données des transitions 1421 requestTransition: function() 1422 { 1423 1424 var nbMolecules=0; 1425 1426 //Récupération du spectral range 1427 var spectralRangeLower = $("#rangeLower").val(); 1428 var spectralRangeUpper = $("#rangeUpper").val(); 1429 1430 //Récupération des isotopes sélectionnés 1431 var inputs = document.getElementsByTagName( 'input' ); 1432 var count = inputs.length; 1433 var isotopesSelectedNameArray = new Array(); 1434 var i=0; 1435 1436 for( i = 0; i < count; i++ ) 1437 { 1438 var input = inputs.item( i ); 1439 //ne prendre que les isotopes sélectionnés dans la base de données sélectionnée (rechercher des id du type : "chk-ch3cn-GEISA-11") 1440 if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("chk-")!= -1 && input.id.indexOf(this.selectDatabase.getValue())!= -1) 1441 { 1442 var molN=input.value; 1443 var molN1=molN.replace("_", ":"); 1444 //tous les isotopes sélectionnés sont placés dans un tableau 1445 isotopesSelectedNameArray.push(molN1); 1446 } 1447 1448 //récupération du nombre de molécules sélectionnées 1449 if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("all-")!= -1 && input.id.indexOf(this.selectDatabase.getValue())!= -1) 1450 { 1451 nbMolecules = nbMolecules + 1; 1452 } 1453 1454 } 1455 //alert ("nbMolecules"+nbMolecules); 1456 //si le nombre de molécule sélectionnées est supérieure à 1 les menus des transition sont inactifs 1457 if (nbMolecules > 1) 1458 { 1459 //ajoute une classe à celle déjà existante de transitionUpper 1460 $("#transitionUpper").addClass("notActiveText"); 1461 $("#transitionLower").addClass("notActiveText"); 1462 } 1463 else 1464 { 1465 $("#transitionUpper").removeClass("notActiveText"); 1466 $("#transitionLower").removeClass("notActiveText"); 1467 } 1468 1469 1470 //On ne fait appel à la BDD des transitions et si au plus 1 molécule est sélectionnée 1471 if (nbMolecules == 1 ) 1472 { 1473 1474 1475 $.ajax( { 1476 url: "project?methodName=getTransitionByIsotopeName&isotopesSelectedNameArray="+isotopesSelectedNameArray+"&geisaSelectedDatabase="+this.selectDatabase.getValue2()+"&spectralRangeLower="+spectralRangeLower+"&spectralRangeUpper="+spectralRangeUpper, 1477 success:jQuery.proxy( this.handleRequestTransition, this ), 1478 error: jQuery.proxy( this.handleErrorRequestTransition, this ) 1479 } ); 1480 1481 } 1482 else 1483 { 1484 //pour réinitialiser le menu déroulant si aucune ou plusieurs molécules sont sélectionnées 1485 document.getElementById("transition2").length=0; 1486 //this.selectTransitionUpper.clear(); 1487 document.getElementById("transition1").length=0; 1488 1489 if (nbMolecules == 0 ) 1490 { 1491 this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"Select a molecule", selected:"selected"} )); 1492 this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"Select a molecule", selected:"selected"} )); 1493 //pour forcer à afficher le premier élément (et non le premier élément précédent) 1494 //this.selectTransitionLower.selectFirst(); 1495 //this.selectTransitionUpper.selectFirst(); 1496 } 1497 1498 if (nbMolecules > 1 ) 1499 { 1500 1501 this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"", selected:"selected", disabled:"disabled"} )); 1502 this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"", selected:"selected", disabled:"disabled"} )); 1503 //pour forcer à afficher le premier élément (et non le premier élément précédent) 1504 //this.selectTransitionLower.selectFirst(); 1505 //this.selectTransitionUpper.selectFirst(); 1506 //ajoute une classe à celle déjà existante de transitionUpper 1507 $("#transitionUpper").addClass("notActiveText"); 1508 $("#transitionLower").addClass("notActiveText"); 1509 } 1510 } 1511 }, 1512 1513 1514 1515 1516 //requête pour interrogation de la base de données des transitions en fonction d'une transition lower 1517 requestTransitionByTransitionLower: function() 1518 { 1519 var context = this[0]; 1520 //exemple transitionLower=" 000" : il y a 25 caractÚres dans chaque transition 1521 context.transitionLower = this[1]; 1522 1523 //Récupération de la Base Geisa sélectionnée 1524 var GeisaSelectedDatabase = context.selectDatabase.getValue(); 1525 1526 //Récupération du spectral range 1527 var spectralRangeLower = $("#rangeLower").val(); 1528 var spectralRangeUpper = $("#rangeUpper").val(); 1529 1530 //Récupération des isotopes sélectionnés 1531 var inputs = document.getElementsByTagName( 'input' ); 1532 var count = inputs.length; 1533 var isotopesSelectedNameArray = new Array(); 1534 var i=0; 1535 1536 for( i = 0; i < count; i++ ) 1537 { 1538 var input = inputs.item( i ); 1539 //ne prendre que les isotopes sélectionnés dans la base de données sélectionnée (rechercher des id du type : "chk-ch3cn-GEISA-11") 1540 if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("chk-")!= -1 && input.id.indexOf(context.selectDatabase.getValue())!= -1) 1541 { 1542 var molN=input.value; 1543 var molN1=molN.replace("_", ":"); 1544 //tous les isotopes sélectionnés sont placés dans un tableau 1545 isotopesSelectedNameArray.push(molN1); 1546 } 1547 1548 } 1549 1550 //le passage de javascript à java par ajax transforme les + en espace donc transformation des + en plus et dans le controller on fait l'inverse 1551 var transitionLowerReplaced = context.transitionLower.replace(/\+/g,"plus"); 1552 1553 //Appel à la BDD 1554 1555 $.ajax( { 1556 url: "project?methodName=getTransitionByIsotopeNameByTransitionLower&isotopesSelectedNameArray="+isotopesSelectedNameArray+"&geisaSelectedDatabase="+context.selectDatabase.getValue2()+"&spectralRangeLower="+spectralRangeLower+"&spectralRangeUpper="+spectralRangeUpper+"&transitionLower="+transitionLowerReplaced, 1557 success:jQuery.proxy( context.handleRequestTransitionByTransitionLower, context) 1558 } ); 1559 1560 1561 1562 }, 1563 1564 1565 //requête pour interrogation de la base de données des transitions en fonction d'une transition upper 1566 requestTransitionByTransitionUpper: function() 1567 { 1568 var context = this[0]; 1569 //exemple transitionLower=" 000" : il y a 25 caractÚres dans chaque transition 1570 context.transitionUpper = this[1]; 1571 1572 //Récupération de la Base Geisa sélectionnée 1573 var GeisaSelectedDatabase = context.selectDatabase.getValue(); 1574 1575 //Récupération du spectral range 1576 var spectralRangeLower = $("#rangeLower").val(); 1577 var spectralRangeUpper = $("#rangeUpper").val(); 1578 1579 //Récupération des isotopes sélectionnés 1580 var inputs = document.getElementsByTagName( 'input' ); 1581 var count = inputs.length; 1582 var isotopesSelectedNameArray = new Array(); 1583 var i=0; 1584 1585 for( i = 0; i < count; i++ ) 1586 { 1587 var input = inputs.item( i ); 1588 //ne prendre que les isotopes sélectionnés dans la base de données sélectionnée (rechercher des id du type : "chk-ch3cn-GEISA-11") 1589 if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("chk-")!= -1 && input.id.indexOf(context.selectDatabase.getValue())!= -1) 1590 { 1591 var molN=input.value; 1592 var molN1=molN.replace("_", ":"); 1593 //tous les isotopes sélectionnés sont placés dans un tableau 1594 isotopesSelectedNameArray.push(molN1); 1595 } 1596 1597 } 1598 //le passage de javascript à java par ajax transforme les + en espace donc transformation des + en plus et dans le controller on fait l'inverse 1599 var transitionUpperReplaced = context.transitionUpper.replace(/\+/g,"plus"); 1600 1601 //Appel à la BDD 1602 $.ajax( { 1603 url: "project?methodName=getTransitionByIsotopeNameByTransitionUpper&isotopesSelectedNameArray="+isotopesSelectedNameArray+"&geisaSelectedDatabase="+context.selectDatabase.getValue2()+"&spectralRangeLower="+spectralRangeLower+"&spectralRangeUpper="+spectralRangeUpper+"&transitionUpper="+transitionUpperReplaced, 1604 success:jQuery.proxy( context.handleRequestTransitionByTransitionUpper, context) 1605 } ); 1606 1607 1608 1609 }, 1610 1611 1612 1613 // requestTransition: function() 1614 // { 1615 // $.ajax( { 1616 // url: "project?methodName=transition&transitionValue="+ this.selectTransitionUpper.getValue(), 1617 // success:jQuery.proxy( this.handleRequestTransition, this ) 1618 // } ); 1619 // }, 1620 1621 // HANDLES ******************************************************** = retours ajax 1622 //affichage sur l'interface 1623 1624 handleGeisa: function( result ) 1625 { 1626 1627 //nom du répertoire : exemple de retour de valeur du controleur 1628 //this.nb = jQuery.parseJSON( result ).nb; 1629 //this.NomRepFileOut = jQuery.parseJSON( result ).NomRepFileOut; 1630 1631 //chemin court de l'image 1632 this.pathImg = "<%=Controller.PATH_IMAGES%>"+this.NomRepFileOut; 1633 1634 1635 //Pour tracer le bon nombre de graphe et de bouton download 1636 var i=1; 1637 var content=""; 1638 //bouton "Download All" si il y a plus d'un graph 1639 if (this.nbGraph > 1) 1640 { 1641 content = "<a href=project?methodName=downloadFile&fileName=" +this.NomRepFileOut + "GEISA.tar&fileNameToDisplay=GEISA.tar><button class='dataProtocolDownloadButton'>Download All</button></a>"; 1642 } 1643 //tracer chaque graphe avec son bouton download associé 1644 for (i=1; i<this.nbGraph+1; i++) { 1645 //content = content + '<img src=' + this.pathImg + "graph" + this.nb +"-"+i+ ".png"+ ' /><a href="project?methodName=downloadFile&fileName=' + "graph" + this.nb+"-"+i + ".png"+ '"><button class="dataProtocolDownloadButton">Download</button></a>'; 1646 content = content +'<img src=' + this.pathImg + this.nomFichier +"-"+i+ ".png"+ ' /><a href="project?methodName=downloadFile&fileName=' +this.NomRepFileOut + this.nomFichier+"-"+i + ".png&fileNameToDisplay="+this.nomFichier+"-"+i + ".png"+ '"><button class="dataProtocolDownloadButton">Download</button></a>'; 1647 } 1648 1649 this.displayWindow(content); 1650 }, 1651 1652 1653 handleRequestTransition: function( result ) 1654 { 1655 1656 1657 // var transitions = jQuery.parseJSON( result ).transitions; 1658 var transitionsLower = jQuery.parseJSON( result ).transitionsLower; 1659 var transitionsUpper = jQuery.parseJSON( result ).transitionsUpper; 1660 1661 //pour vider les menus déroulant des transitions précédentes 1662 // this.selectTransitionLower.clear(); 1663 document.getElementById("transition2").length=0; 1664 //this.selectTransitionUpper.clear(); 1665 document.getElementById("transition1").length=0; 1666 1667 // this.selectTransitionLower.add('transition', "Choose a transition"); 1668 this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled", selected:"selected"} )); 1669 // this.selectTransitionUpper.add('transition', "Choose a transition"); 1670 this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled", selected:"selected"} )); 1671 //pour forcer à afficher le premier élément (et non le premier élément précédent) 1672 // this.selectTransitionLower.selectFirst(); 1673 // this.selectTransitionUpper.selectFirst(); 1674 1675 1676 $.each(transitionsLower, jQuery.proxy( function(index, transitionsLower ) 1677 { 1678 // this.selectTransitionLower.add(transitionsLower, transitionsLower,jQuery.proxy(this.requestTransitionByTransitionLower, [this, transitionsLower ])); 1679 1680 1681 this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:transitionsLower, text:transitionsLower} ).bind( 'click', jQuery.proxy(this.requestTransitionByTransitionLower, [this, transitionsLower ]))); 1682 1683 }, this)); 1684 1685 $.each(transitionsUpper, jQuery.proxy( function(index, transitionsUpper ) 1686 { 1687 //this.selectTransitionUpper.add(transitionsUpper, transitionsUpper,jQuery.proxy(this.requestTransitionByTransitionUpper, [this, transitionsUpper ])); 1688 this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:transitionsUpper, text:transitionsUpper} ).bind( 'click', jQuery.proxy(this.requestTransitionByTransitionUpper, [this, transitionsUpper ]))); 1689 1690 }, this)); 1691 1692 }, 1693 1694 //en cas d'erreur dans la requête des transitions ( pas de valeur ou caractÚres à la place de nombres dans champ spectral) 1695 handleErrorRequestTransition : function() 1696 { 1697 //pour vider les menus déroulant des transitions précédentes 1698 document.getElementById("transition2").length=0; 1699 document.getElementById("transition1").length=0; 1700 1701 this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"requestError", text:"Choose a transition", disabled:"disabled", selected:"selected"} )); 1702 this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"requestError", text:"Choose a transition", disabled:"disabled", selected:"selected"} )); 1703 1704 }, 1705 1706 handleRequestTransitionByTransitionLower : function( result ) 1707 { 1708 //alert("transitionLower"+this.transitionLower); 1709 var transitionsUpperBis = jQuery.parseJSON( result ).transitionsUpperBis; 1710 //alert("transitionsUpper"+transitionsUpper); 1711 1712 //pour vider les menus déroulant des transitions précédentes 1713 // this.selectTransitionLower.clear(); 1714 document.getElementById("transition2").length=0; 1715 //this.selectTransitionUpper.clear(); 1716 document.getElementById("transition1").length=0; 1717 // while(0 < document.getElementById("transition1").length) 1718 // { 1719 // document.getElementById("transition1").options[0] = null; 1720 // } 1721 1722 1723 //this.selectTransitionLower.add(this.transitionLower, this.transitionLower); 1724 this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled"} )); 1725 this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:this.transitionLower, text:this.transitionLower, selected:"selected"} )); 1726 //this.selectTransitionUpper.add('transition', "Choose a transition"); 1727 //rajout du text "Choose a transition" selectionné en premier mais on ne peut pas cliquer dessus 1728 this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled", selected:"selected"} )); 1729 1730 1731 //pour forcer à afficher le premier élément (et non le premier élément précédent) 1732 //this.selectTransitionLower.selectFirst(); 1733 //this.selectTransitionUpper.selectFirst(); 1734 1735 1736 1737 $.each(transitionsUpperBis, jQuery.proxy( function(index, transitionsUpperBis ) 1738 { 1739 // this.selectTransitionUpper.add(transitionsUpper, transitionsUpper); 1740 this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:transitionsUpperBis, text:transitionsUpperBis} )); 1741 1742 }, this)); 1743 1744 }, 1745 1746 1747 handleRequestTransitionByTransitionUpper : function( result ) 1748 { 1749 // alert("transitionUpper"+this.transitionUpper); 1750 var transitionsLowerBis = jQuery.parseJSON( result ).transitionsLowerBis; 1751 //alert("transitionsLower"+transitionsLower); 1752 1753 //pour vider les menus déroulant des transitions précédentes 1754 // this.selectTransitionLower.clear(); 1755 document.getElementById("transition2").length=0; 1756 //this.selectTransitionUpper.clear(); 1757 document.getElementById("transition1").length=0; 1758 1759 // this.selectTransitionLower.add('transition', "Choose a transition"); 1760 this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled", selected:"selected"} )); 1761 1762 // this.selectTransitionUpper.add(this.transitionUpper, this.transitionUpper); 1763 this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled"} )); 1764 this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:this.transitionUpper, text:this.transitionUpper, selected:"selected"} )); 1765 1766 1767 //pour forcer à afficher le premier élément (et non le premier élément précédent) 1768 //this.selectTransitionLower.selectFirst(); 1769 //this.selectTransitionUpper.selectFirst(); 1770 1771 1772 1773 $.each(transitionsLowerBis, jQuery.proxy( function(index, transitionsLowerBis ) 1774 { 1775 //this.selectTransitionLower.add(transitionsLower, transitionsLower); 1776 this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:transitionsLowerBis, text:transitionsLowerBis} )); 1777 }, this)); 1778 1779 }, 1780 // EVENTS ******************************************************** 1781 // 1782 //Action quand on clique sur l'onglet DatabaseContents 1783 onClickDatabaseContents: function() 1784 { 1785 1786 //change la couleur des onglets 1787 this.ntabContents.active(); 1788 this.ntabGlobal.inactive(); 1789 this.ntabComparison.inactive(); 1790 //rempli la valeur d'une variable cachée pour indiquée quelle option graphique est choisi par l'utilisateur au moment du submit 1791 $("#graphicOptionChoice").val("contents"); 1792 //change le titre de la page en fonction de l'onglet cliqué 1793 document.getElementById('titlePage').innerHTML = ""; 1794 document.getElementById('titlePage').innerHTML = "Graphic vizualisation of the GEISA database"; 1795 //Eléments qui apparaissent avec cette option 1796 document.getElementById("informationContents").style.display= ""; 1797 document.getElementById("axeY1Gene").style.display= ""; 1798 document.getElementById("showAdvancedOptions").style.display= ""; 1799 document.getElementById("axeY2Gene").style.display= ""; 1800 document.getElementById("drawingOptionsY2").style.display= ""; 1801 //Eléments qui disparaissent avec cette option 1802 document.getElementById("informationGlobal").style.display= "none"; 1803 document.getElementById("informationComparison").style.display= "none"; 1804 document.getElementById("titreDatabase1").style.display= "none"; 1805 document.getElementById("titreDatabase2").style.display= "none"; 1806 document.getElementById("database2").style.display= "none"; 1807 document.getElementById("titreTypePlotDatabase1").style.display= "none"; 1808 document.getElementById("titreTypePlotDatabase2").style.display= "none"; 1809 document.getElementById("typePlotDatabase2").style.display= "none"; 1810 document.getElementById("outputDatabaseComparison").style.display= "none"; 1811 //modification de titre d'option 1812 document.getElementById('scaleY1Titre').innerHTML = ""; 1813 document.getElementById('scaleY1Titre').innerHTML = "Select the type of scale (if intensity is choosen)"; 1814 //ProblÚme de marge avec le bord du fieldset 1815 $("#database1").removeClass("containerDatabase"); 1816 $("#database1").addClass("containerBeginDatabase"); 1817 $("#typePlotY1").removeClass("containerPlot"); 1818 $("#typePlotY1").addClass("containerInsideOptions"); 1819 //Pour que le lien show/hide advanced option et le bloc "advanced option" fonctionnent correctement ensemble 1820 if( document.getElementById( "aShowHide" ).innerHTML == "Show advanced options" ) 1821 { 1822 document.getElementById( "advancedOptions" ).style.display = "none"; 1823 1824 } 1825 if( document.getElementById( "aShowHide" ).innerHTML == "Hide advanced options" ) 1826 1827 { 1828 document.getElementById( "advancedOptions" ).style.display = ""; 1829 1830 } 1831 //modification du contenu des menus déroulants 1832 this.selectDatabase.clear(); 1833 this.selectDatabase.add( 'GEISA2011', "GEISA 2011", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeG09.class%>' ); 1834 this.selectDatabase.add( 'GEISAIASI2011', "GEISA-IASI 2011", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeIasiG09.class%>' ); 1835 this.selectDatabase.add( 'GEISA2003', "GEISA 2003", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeG03.class%>' ); 1836 this.selectDatabase.add( 'GEISAIASI2003', "GEISA-IASI 2003", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeIasiG03.class%>' ); 1837 this.selectDatabase.selectFirst(); 1838 1839 //pour effacer le menu déroulant 1840 this.selectNbCourbes.clear(); 1841 this.selectNbCourbes.add( 'ca', "One curve for all selection", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); 1842 this.selectNbCourbes.add( 'cm', "Separated molecules : same graph", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); 1843 this.selectNbCourbes.add( 'gm', "Separated molecules : different graphs", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); 1844 this.selectNbCourbes.add( 'gi', "Separated isotopologues : different graphs", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); 1845 this.selectNbCourbes.add( 'ci', "Separated isotopologues : same graph", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); 1846 //pour remettre par défaut le premier de la liste 1847 this.selectNbCourbes.selectFirst(); 1848 1849 this.selectTypeTraceY1.clear(); 1850 this.selectTypeTraceY1.add( 'l', "Lines" ); 1851 this.selectTypeTraceY1.add( 'p', "Dots" ); 1852 this.selectTypeTraceY1.add( 'i', "Peaks" ); 1853 this.selectTypeTraceY1.add( 'lp', "Lines and Dots" ); 1854 this.selectTypeTraceY1.selectFirst(); 1855 1856 }, 1857 //Action quand on clique sur l'onglet GlobalRepresentation 1858 onClickGlobalRepresentation: function() 1859 { 1860 //change la couleur des onglets 1861 this.ntabGlobal.active(); 1862 this.ntabContents.inactive(); 1863 this.ntabComparison.inactive(); 1864 //rempli la valeur d'une variable cachée pour indiquée quelle option graphique est choisi par l'utilisateur au moment du submit 1865 $("#graphicOptionChoice").val("global"); 1866 //change le titre de la page en fonction de l'onglet cliqué 1867 document.getElementById('titlePage').innerHTML = ""; 1868 document.getElementById('titlePage').innerHTML = "Global Representation"; 1869 //Eléments qui apparaissent avec cette option 1870 document.getElementById("informationGlobal").style.display= ""; 1871 //Eléments qui disparaissent avec cette option 1872 document.getElementById("informationContents").style.display= "none"; 1873 document.getElementById("informationComparison").style.display= "none"; 1874 document.getElementById("titreDatabase1").style.display= "none"; 1875 document.getElementById("titreDatabase2").style.display= "none"; 1876 document.getElementById("database2").style.display= "none"; 1877 document.getElementById("axeY1Gene").style.display= "none"; 1878 document.getElementById("titreTypePlotDatabase1").style.display= "none"; 1879 document.getElementById("titreTypePlotDatabase2").style.display= "none"; 1880 document.getElementById("typePlotDatabase2").style.display= "none"; 1881 document.getElementById("showAdvancedOptions").style.display= "none"; 1882 document.getElementById("advancedOptions").style.display= "none"; 1883 //modification de titre d'option 1884 document.getElementById('scaleY1Titre').innerHTML = ""; 1885 document.getElementById('scaleY1Titre').innerHTML = "Select the type of scale"; 1886 //ProblÚme de marge avec le bord du fieldset 1887 $("#database1").removeClass("containerDatabase"); 1888 $("#database1").addClass("containerBeginDatabase"); 1889 $("#typePlotY1").removeClass("containerPlot"); 1890 $("#typePlotY1").addClass("containerInsideOptions"); 1891 //modification du contenu des menus déroulants 1892 this.selectDatabase.clear(); 1893 this.selectDatabase.add( 'GEISA2011', "GEISA 2011", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeG09.class%>' ); 1894 this.selectDatabase.add( 'GEISAIASI2011', "GEISA-IASI 2011", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeIasiG09.class%>' ); 1895 this.selectDatabase.add( 'GEISA2003', "GEISA 2003", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeG03.class%>' ); 1896 this.selectDatabase.add( 'GEISAIASI2003', "GEISA-IASI 2003", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeIasiG03.class%>' ); 1897 this.selectDatabase.selectFirst(); 1898 1899 this.selectNbCourbes.clear(); 1900 this.selectNbCourbes.add( 'cm', "Separated molecules : same graph", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); 1901 this.selectNbCourbes.add( 'ci', "Separated isotopologues : same graph", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); 1902 this.selectNbCourbes.selectFirst(); 1903 1904 this.selectTypeTraceY1.clear(); 1905 this.selectTypeTraceY1.add( 'i', "Peaks" ); 1906 this.selectTypeTraceY1.add( 'l', "Lines" ); 1907 this.selectTypeTraceY1.add( 'p', "Dots" ); 1908 this.selectTypeTraceY1.add( 'lp', "Lines and Dots" ); 1909 this.selectTypeTraceY1.selectFirst(); 1910 1911 }, 1912 //Action quand on clique sur l'onglet DatabasesComparison 1913 onClickDatabasesComparison: function() 1914 { 1915 //change la couleur des onglets 1916 this.ntabComparison.active(); 1917 this.ntabGlobal.inactive(); 1918 this.ntabContents.inactive(); 1919 //rempli la valeur d'une variable cachée pour indiquée quelle option graphique est choisi par l'utilisateur au moment du submit 1920 $("#graphicOptionChoice").val("comparison"); 1921 //change le titre de la page en fonction de l'onglet cliqué 1922 document.getElementById('titlePage').innerHTML = ""; 1923 document.getElementById('titlePage').innerHTML = "Databases Comparison"; 1924 //Eléments qui apparaissent avec cette option 1925 document.getElementById("informationComparison").style.display= ""; 1926 document.getElementById("titreDatabase1").style.display= ""; 1927 document.getElementById("titreDatabase2").style.display= ""; 1928 document.getElementById("database2").style.display= ""; 1929 document.getElementById("axeY1Gene").style.display= ""; 1930 document.getElementById("titreTypePlotDatabase1").style.display= ""; 1931 document.getElementById("titreTypePlotDatabase2").style.display= ""; 1932 document.getElementById("typePlotDatabase2").style.display= ""; 1933 document.getElementById("showAdvancedOptions").style.display= ""; 1934 document.getElementById("outputDatabaseComparison").style.display= ""; 1935 //Eléments qui disparaissent avec cette option 1936 document.getElementById("informationContents").style.display= "none"; 1937 document.getElementById("informationGlobal").style.display= "none"; 1938 document.getElementById("axeY2Gene").style.display= "none"; 1939 document.getElementById("drawingOptionsY2").style.display= "none"; 1940 //modification de titre d'option 1941 document.getElementById('scaleY1Titre').innerHTML = ""; 1942 document.getElementById('scaleY1Titre').innerHTML = "Select the type of scale (if intensity is choosen)"; 1943 //ProblÚme de marge avec le bord du fieldset 1944 $("#database1").removeClass("containerBeginDatabase"); 1945 $("#database1").addClass("containerDatabase"); 1946 $("#typePlotY1").removeClass("containerInsideOptions"); 1947 $("#typePlotY1").addClass("containerPlot"); 1948 1949 //Pour que le lien show/hide advanced option et le bloc "advanced option" fonctionnent correctement ensemble 1950 if( document.getElementById( "aShowHide" ).innerHTML == "Show advanced options" ) 1951 1952 { 1953 document.getElementById( "advancedOptions" ).style.display = "none"; 1954 } 1955 if( document.getElementById( "aShowHide" ).innerHTML == "Hide advanced options" ) 1956 1957 { 1958 document.getElementById( "advancedOptions" ).style.display = ""; 1959 } 1960 //modification du contenu des menus déroulants 1961 this.selectDatabase.clear(); 1962 this.selectDatabase.add( 'GEISA2011', "GEISA 2011", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeG09.class%>' ); 1963 this.selectDatabase.add( 'GEISA2003', "GEISA 2003", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeG03.class%>' ); 1964 this.selectDatabase.selectFirst(); 1965 1966 this.selectNbCourbes.clear(); 1967 this.selectNbCourbes.add( 'ca', "One curve for all selection", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); 1968 this.selectNbCourbes.add( 'gm', "Separated molecules : different graphs", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); 1969 this.selectNbCourbes.add( 'gi', "Separated isotopologues : different graphs", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); 1970 this.selectNbCourbes.selectFirst(); 1971 1972 this.selectTypeTraceY1.clear(); 1973 this.selectTypeTraceY1.add( 'l', "Lines" ); 1974 this.selectTypeTraceY1.add( 'p', "Dots" ); 1975 this.selectTypeTraceY1.add( 'i', "Peaks" ); 1976 this.selectTypeTraceY1.add( 'lp', "Lines and Dots" ); 1977 this.selectTypeTraceY1.selectFirst(); 1978 }, 1979 1980 1981 //affichage de la valeur du spectral range et affichage du bloc des molecules en fonction de la base de donnees selectionnee 1982 onClickSelectDatabase: function(value) 1983 { 1984 1985 if ('GEISA2011' == value) 1986 { 1987 //modifier le titre en fonction de la base sélectionnée 1988 document.getElementById('spectralRangeTitre').innerHTML = ""; 1989 document.getElementById('spectralRangeTitre').innerHTML = "Choosing the spectral range (0 to 35877.030506 cm<sup>-1</sup>) :"; 1990 1991 //remplir les valeurs par défaut 1992 if($("#rangeLower").val()=="") 1993 { 1994 $("#rangeLower").val(0); 1995 } 1996 if($("#rangeUpper").val()=="") 1997 { 1998 $("#rangeUpper").val(35877.030506); 1999 } 2000 2001 //Si les valeur entrées par l'utilisateur ne sont pas correctes, on remet les valeurs des bornes 2002 if(isNaN(($("#rangeLower").val())) == true || parseFloat( $("#rangeLower").val()) < 0 || parseFloat($("#rangeLower").val()) > 35877.030506) 2003 { 2004 $("#rangeLower").val(0); 2005 } 2006 if(isNaN(($("#rangeLower").val())) == true || parseFloat( $("#rangeUpper").val()) < 0 || parseFloat($("#rangeUpper").val()) > 35877.030506) 2007 { 2008 $("#rangeUpper").val(35877.030506); 2009 } 2010 2011 //afficher le bon bloc de molécules 2012 document.getElementById( "BDD-GEISA2011" ).style.display = ""; 2013 document.getElementById( "BDD-GEISAIASI2011" ).style.display = "none"; 2014 document.getElementById( "BDD-GEISA2003" ).style.display = "none"; 2015 document.getElementById( "BDD-GEISAIASI2003" ).style.display = "none"; 2016 } 2017 2018 if ('GEISAIASI2011' == value) 2019 { 2020 document.getElementById('spectralRangeTitre').innerHTML = ""; 2021 document.getElementById('spectralRangeTitre').innerHTML = "Choosing spectral range (599.000793 to 3000.998767 cm<sup>-1</sup>) :"; 2022 2023 2024 //remplir les valeurs par défaut 2025 if($("#rangeLower").val()=="") 2026 { 2027 $("#rangeLower").val(599.000793); 2028 } 2029 if($("#rangeUpper").val()=="") 2030 { 2031 $("#rangeUpper").val(3000.998767); 2032 } 2033 //Si les valeur entrées par l'utilisateur ne sont pas correctes, on remet les valeurs des bornes 2034 if(isNaN(($("#rangeLower").val())) == true || parseFloat( $("#rangeLower").val()) < 599.000793 || parseFloat($("#rangeLower").val()) > 3000.998767) 2035 { 2036 $("#rangeLower").val(599.000793); 2037 } 2038 if(isNaN(($("#rangeLower").val())) == true || parseFloat( $("#rangeUpper").val()) < 599.000793 || parseFloat($("#rangeUpper").val()) > 3000.998767) 2039 { 2040 $("#rangeUpper").val(3000.998767); 2041 } 2042 2043 document.getElementById( "BDD-GEISA2011" ).style.display = "none"; 2044 document.getElementById( "BDD-GEISAIASI2011" ).style.display = ""; 2045 document.getElementById( "BDD-GEISA2003" ).style.display = "none"; 2046 document.getElementById( "BDD-GEISAIASI2003" ).style.display = "none"; 2047 } 2048 2049 if ('GEISA2003' == value) 2050 { 2051 document.getElementById('spectralRangeTitre').innerHTML = ""; 2052 document.getElementById('spectralRangeTitre').innerHTML = "Choosing the spectral range (0 to 35877.030506 cm<sup>-1</sup>) :"; 2053 2054 //remplir les valeurs par défaut 2055 if($("#rangeLower").val()=="") 2056 { 2057 $("#rangeLower").val(0); 2058 } 2059 if($("#rangeUpper").val()=="") 2060 { 2061 $("#rangeUpper").val(35877.030506); 2062 } 2063 //Si les valeur entrées par l'utilisateur ne sont pas correctes, on remet les valeurs des bornes 2064 if(isNaN(($("#rangeLower").val())) == true || parseFloat( $("#rangeLower").val()) < 0 || parseFloat($("#rangeLower").val()) > 35877.030506) 2065 { 2066 $("#rangeLower").val(0); 2067 } 2068 if(isNaN(($("#rangeLower").val())) == true || parseFloat( $("#rangeUpper").val()) < 0 || parseFloat($("#rangeUpper").val()) > 35877.030506) 2069 { 2070 $("#rangeUpper").val(35877.030506); 2071 } 2072 2073 document.getElementById( "BDD-GEISA2011" ).style.display = "none"; 2074 document.getElementById( "BDD-GEISAIASI2011" ).style.display = "none"; 2075 document.getElementById( "BDD-GEISA2003" ).style.display = ""; 2076 document.getElementById( "BDD-GEISAIASI2003" ).style.display = "none"; 2077 } 2078 if ('GEISAIASI2003' == value) 2079 { 2080 document.getElementById('spectralRangeTitre').innerHTML = ""; 2081 document.getElementById('spectralRangeTitre').innerHTML = "Choosing spectral range (599.000793 to 3000.998767 cm<sup>-1</sup>) :"; 2082 2083 //remplir les valeurs par défaut 2084 if($("#rangeLower").val()=="") 2085 { 2086 $("#rangeLower").val(599.000793); 2087 } 2088 if($("#rangeUpper").val()=="") 2089 { 2090 $("#rangeUpper").val(3000.998767); 2091 } 2092 //Si les valeur entrées par l'utilisateur ne sont pas correctes, on remet les valeurs des bornes 2093 if(isNaN(($("#rangeLower").val())) == true || parseFloat( $("#rangeLower").val()) < 599.000793 || parseFloat($("#rangeLower").val()) > 3000.998767) 2094 { 2095 $("#rangeLower").val(599.000793); 2096 } 2097 if(isNaN(($("#rangeLower").val())) == true || parseFloat( $("#rangeUpper").val()) < 599.000793 || parseFloat($("#rangeUpper").val()) > 3000.998767) 2098 { 2099 $("#rangeUpper").val(3000.998767); 2100 } 2101 2102 document.getElementById( "BDD-GEISA2011" ).style.display = "none"; 2103 document.getElementById( "BDD-GEISAIASI2011" ).style.display = "none"; 2104 document.getElementById( "BDD-GEISA2003" ).style.display = "none"; 2105 document.getElementById( "BDD-GEISAIASI2003" ).style.display = ""; 2106 } 2107 2108 //mettre a jour le menu déroulant des transitions en fonction des isotopes sélectionnés, de la longueur d'onde et de la base geisa 2109 this.requestTransition(); 2110 }, 2111 2112 //Pour sélectionner-desélectionner tous les isotopes 2113 selectAll: function() 2114 { 2115 var inputs = document.getElementsByTagName( 'input' ); 2116 var count = inputs.length; 2117 var i=0; 2118 2119 2120 if( this.selectButton.getValue() == 'Select all molecules') 2121 { 2122 for( i = 0; i < count; i++ ) 2123 { 2124 var input = inputs.item( i ); 2125 if( input.type == 'checkbox' ) 2126 { 2127 input.checked = true; 2128 } 2129 } 2130 this.selectButton.setValue("Unselect all molecules"); 2131 2132 } 2133 else 2134 { 2135 for( i = 0; i < count; i++ ) 2136 { 2137 var input = inputs.item( i ); 2138 if( input.type == 'checkbox' ) 2139 { 2140 input.checked = false; 2141 } 2142 } 2143 this.selectButton.setValue("Select all molecules"); 2144 } 2145 2146 //mettre a jour le menu déroulant des transitions en fonction des isotopes sélectionnés, de la longueur d'onde et de la base geisa 2147 this.requestTransition(); 2148 2149 }, 2150 2151 //Pour montrer-cacher tous les isotopes 2152 viewAll: function() 2153 { 2154 var divs = document.getElementsByTagName( 'div' ); 2155 var count = divs.length; 2156 var i = 0; 2157 if( this.showButton.getValue() == 'View all isotopologues') 2158 { 2159 for( i = 0; i < count; i++ ) 2160 { 2161 //ouvrir que les div dont l'id contient la chaine Cache 2162 if (divs.item(i).id.indexOf("Cache") != -1) { 2163 divs.item(i).style.display = "" ; 2164 } 2165 } 2166 this.showButton.setValue("Hide all isotopologues"); 2167 } 2168 else 2169 { 2170 for( i = 0; i < count; i++ ) 2171 { 2172 //fermer que les div dont l'id contient la chaine Cache 2173 if (divs.item(i).id.indexOf("Cache") != -1) { 2174 divs.item(i).style.display = "none" ; 2175 } 2176 } 2177 this.showButton.setValue("View all isotopologues"); 2178 } 2179 }, 2180 2181 //Actions déclenchées quand on clique sur le nom d'une molécule 2182 cliquetout: function() 2183 { 2184 var context = this[0]; 2185 // exemple :moleculeName = ch3ch 2186 var moleculeName = this[1]; 2187 var bddVersion = this[2]; 2188 var inputs = document.getElementsByTagName( 'input' ); 2189 var count = inputs.length; 2190 var i=0; 2191 for( i = 0; i < count; i++ ) 2192 { 2193 var input = inputs.item( i ); 2194 //cliquer toutes les molécules et isotopes du meme nom dans toutes les bases 2195 //if( input.type == 'checkbox' && ( input.id == ('chk-' + name + '-GEISA-11') || input.id == ('chk-' + name + '-GEISA-03') || input.id == ('chk-' + name + '-GEISA-IASI-11') || input.id == ('chk-' + name + '-GEISA-IASI-03') 2196 // || input.id == (name + '-all-GEISA-03') || input.id == (name + '-all-GEISA-11') || input.id == (name + '-all-GEISA-IASI-03') || input.id == (name + '-all-GEISA-IASI-11'))) 2197 2198 if( input.type == 'checkbox' && ( input.id.indexOf('chk-' + moleculeName + '_') != -1 || input.id.indexOf('all-'+moleculeName+'-')!= -1 )) 2199 2200 { 2201 input.checked = document.getElementById( 'all-'+ moleculeName + '-' + bddVersion ).checked; 2202 } 2203 } 2204 //mettre a jour le menu déroulant des transitions en fonction des isotopes sélectionnés, de la longueur d'onde et de la base geisa 2205 context.requestTransition(); 2206 }, 2207 2208 //actions déclenchées quand on clique sur un isotope 2209 cliqueIsotope: function() 2210 { 2211 var context = this[0]; 2212 //exemple isotopeName = ch3cn_134 2213 var isotopeName = this[1]; 2214 // exemple moleculeName= ch3cn 2215 var moleculeName = this[2]; 2216 var bddVersion = this[3]; 2217 var inputs = document.getElementsByTagName( 'input' ); 2218 var count = inputs.length; 2219 var i = 0; 2220 for( i = 0; i < count; i++ ) 2221 { 2222 input = inputs.item( i ); 2223 2224 //id=chk-ch3cn_234-GEISA2011 2225 //cliquer ou decliquer le meme isotope dans toutes les bases 2226 if( input.type == 'checkbox' && input.id.indexOf('chk-' + isotopeName) != -1) 2227 { 2228 input.checked = document.getElementById( 'chk-' + isotopeName + '-' + bddVersion ).checked; 2229 2230 } 2231 // id=all-ch3cn-GEISA2011 2232 //pour décocher la case de la molecule quand on décoche un isotope 2233 // if( input.type == 'checkbox' && input.id.indexOf('all-'+ moleculeName) != -1 && input.checked == true ) 2234 // { 2235 // input.checked = false; 2236 // } 2237 } 2238 2239 2240 //pour cocher molecule quand on clique sur un isotope et décocher molécule quand tous les isotopes de la molécule sont décochés 2241 var nbIsotopeSelected=0; 2242 var input = ""; 2243 var j=0; 2244 var k=0; 2245 2246 //tableau contenant toutes les valeurs du menu déroulant "choosing Database" 2247 var databaseValues=context.selectDatabase.getValues(); 2248 //taille du menu déroulant 2249 var nbdatabaseValues=context.selectDatabase.getSize(); 2250 2251 //pour chaque base faire ... 2252 for( j = 0; j < nbdatabaseValues ; j++ ) 2253 { 2254 var nbIsotopeSelected=0; 2255 //calcul du nombre d'isotopes sélectionnés pour une molécule précise et une base de données 2256 for( k = 0; k < count; k++ ) 2257 { 2258 input = inputs.item( k ); 2259 if( input.type == 'checkbox' && input.id.indexOf('chk-'+moleculeName+'_') != -1 && input.id.indexOf(databaseValues[j]) != -1 && input.checked == true ) 2260 { 2261 nbIsotopeSelected=nbIsotopeSelected+1; 2262 } 2263 2264 } 2265 //si aucun isotope est sélectionné et que la molécule existe dans cette base alors on décoche la molécule 2266 if ( nbIsotopeSelected == 0 && document.getElementById('all-'+ moleculeName+'-'+databaseValues[j])) 2267 { 2268 document.getElementById('all-'+ moleculeName+'-'+databaseValues[j]).checked=false; 2269 } 2270 //si au moins unisotope est sélectionné et que la molécule existe dans cette base alors on coche la molécule 2271 if ( nbIsotopeSelected > 0 && document.getElementById('all-'+ moleculeName+'-'+databaseValues[j])) 2272 { 2273 document.getElementById('all-'+ moleculeName+'-'+databaseValues[j]).checked=true; 2274 } 2275 } 2276 2277 2278 //mettre a jour le menu déroulant des transitions en fonction des isotopes sélectionnés, de la longueur d'onde et de la base geisa 2279 context.requestTransition(); 2280 2281 }, 2282 2283 2284 2285 //pour cacher ou voir les isotopes d'une molecule 2286 visibilite: function( ) 2287 { 2288 var context = this[0]; 2289 var thingId = this[1]; 2290 var divs = document.getElementsByTagName( 'div' ); 2291 var count = divs.length; 2292 var i = 0; 2293 for( i = 0; i < count; i++ ) 2294 { 2295 var div = divs.item( i ); 2296 2297 2298 if ( div.id == thingId) 2299 { 2300 if( div.style.display == "none" ) 2301 { 2302 div.style.display = ""; 2303 } 2304 else 2305 { 2306 div.style.display = "none"; 2307 } 2308 } 2309 } 2310 }, 2311 2312 //Faire apparatre ou disparaitre le bloc "advanced options" quand on clique sur le lien "show advanced options" 2313 onClickShowAdvancedOptions: function() 2314 { 2315 //document.getElementById( "advancedOptions" ).style.display = "none"; 2316 if( document.getElementById( "advancedOptions" ).style.display == "none" ) 2317 { 2318 document.getElementById( "advancedOptions" ).style.display = ""; 2319 document.getElementById( "aShowHide" ).innerHTML = ""; 2320 document.getElementById( "aShowHide" ).innerHTML = "Hide advanced options"; 2321 } 2322 else 2323 { 2324 document.getElementById( "advancedOptions" ).style.display = "none"; 2325 document.getElementById( "aShowHide" ).innerHTML = ""; 2326 document.getElementById( "aShowHide" ).innerHTML = "Show advanced options"; 2327 } 2328 }, 2329 2330 //Alerter l'utilisateur si aucune transition n'a été trouvée 2331 OnclickVerifTransition : function() 2332 { 2333 //si l'utilisateur change les valeurs de spectral range et clique directement sur le menu déroulant des transitions 2334 //le menu déroulant ne se met pas à jour avant de faire la vérification 2335 this.containerFormSpectralRangeLower.blur(); 2336 this.containerFormSpectralRangeUpper.blur(); 2337 2338 2339 2340 2341 //si il n'y a qu'un élément dans les menu déroulant transition upper et lower et que la valeur est "transition" 2342 //cas où la requete utilisateur est correct mais il n'y a pas de transition pour cette molecule t ce domaine spectral 2343 if (document.getElementById('transition1').length==1 && document.getElementById('transition1').options[0].value=="transition" && document.getElementById('transition2').length==1 && document.getElementById('transition2').options[0].value=="transition") 2344 { 2345 // document.getElementById( "transitionUpper" ).style.display = "none"; 2346 // document.getElementById( "transitionLower" ).style.display = "none"; 2347 this.selectTransitionUpper.blur(); 2348 this.selectTransitionLower.blur(); 2349 alert("Change isotopologues selection or spectral range values to obtain transition values"); 2350 2351 //document.getElementById( "transitionUpper" ).style.display = ""; 2352 //document.getElementById( "transitionLower" ).style.display = ""; 2353 } 2354 //si il n'y a qu'un élément dans les menu déroulant transition upper et lower et que la valeur est "transition" 2355 //cas où la requete est fausse = les valeurs du domaine spectral sont fausses 2356 if (document.getElementById('transition1').length==1 && document.getElementById('transition1').options[0].value=="requestError" && document.getElementById('transition2').length==1 && document.getElementById('transition2').options[0].value=="requestError") 2357 { 2358 this.selectTransitionUpper.blur(); 2359 this.selectTransitionLower.blur(); 2360 //document.getElementById( "transitionUpper" ).style.display = "none"; 2361 // document.getElementById( "transitionLower" ).style.display = "none"; 2362 alert("Change spectral range values to obtain transition values"); 2363 // document.getElementById( "transitionUpper" ).style.display = ""; 2364 // document.getElementById( "transitionLower" ).style.display = ""; 2365 } 2366 2367 2368 }, 2369 2370 onBlurInputMeanValue: function() 2371 { 2372 //si step est sup a 0, ajout d'une ligne Z aux parametres Y1 et y2 si elle n'est pas déjà présente 2373 // !this.selectTraceAxeY1.content('Z') indique que "Z" n'exite pas dans le menu déroulant selectTraceAxeY1 2374 if ($("#meanValue2").val() > 0 && !this.selectTraceAxeY1.content('Z')) 2375 // if ($("#meanValue2").val() > 0 && document.getElementById('selectAxeY1').options[document.getElementById('selectAxeY1').selectedIndex].value != "Z") 2376 { 2377 2378 this.selectTraceAxeY1.add( 'Z', "Number of lines ", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) ); 2379 this.selectTraceAxeY2.add( 'Z', "Number of lines ", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); 2380 //this.selectTraceAxeY1.append($( document.createElement( "option" ) ).attr( {value:"Z", text:"Number of lines"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY1, [this, "Z" ]))); 2381 //this.selectTraceAxeY2.append($( document.createElement( "option" ) ).attr( {value:"Z", text:"Number of lines"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY2, [this, "Z" ]))); 2382 } 2383 //si step = a 0 et autres valeurs (a faire) , retrait de la ligne Z aux parametres Y1 et y2 2384 if ($("#meanValue2").val() == 0) 2385 { 2386 this.selectTraceAxeY1.remove( 'Z', "Number of lines ", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) ); 2387 this.selectTraceAxeY2.remove( 'Z', "Number of lines ", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); 2388 //Selection par defaut du 1er element (pour que "Number of lines" ne soit plus selectionne par defaut si il n'existe plus) 2389 this.selectTraceAxeY1.selectFirst(); 2390 this.selectTraceAxeY2.selectFirst(); 2391 } 2392 }, 2393 2394 onClickSelectNbCourbes: function(value) 2395 { 2396 var context = this[0]; 2397 var optionVal = this[1]; 2398 2399 //si plusieurs courbes choisis pour les isotopes et ou molecules, les choix pour Y2 sont inactifs 2400 if ('cm' == value || 'ci' == value) 2401 //if ('cm' == optionVal || 'ci' == optionVal) 2402 { 2403 //transformer le texte en gris 2404 document.getElementById("axeY2Titre").className = "notActiveText"; 2405 document.getElementById("scaleY2Titre").className = "notActiveText"; 2406 document.getElementById("typePlotY2Titre").className = "notActiveText"; 2407 //pour rendre le menu déroulant inactif 2408 this.selectTraceAxeY2.disable(); 2409 this.selectScaleY2.disable(); 2410 this.selectTypeTraceY2.disable(); 2411 //document.getElementById("selectAxeY2" ).disabled=true; 2412 //document.getElementById("selectScaleY2" ).disabled=true; 2413 //document.getElementById("selectTypePlotY2" ).disabled=true; 2414 2415 } 2416 //si une seule courbe choisie pour les isotopes et ou molecules, les choix pour Y2 sont actifs 2417 if ('ca' == value || 'gm' == value || 'gi' == value) 2418 //if ('ca' == optionVal || 'gm' == optionVal || 'gi' == optionVal) 2419 { 2420 //remet le texte en couleur active 2421 document.getElementById("axeY2Titre").className = "activeText"; 2422 //rendre actif l'echelle que si l'intensite est choisie dans les parametres 2423 if (this.selectTraceAxeY2.getValue() == 'B') 2424 { 2425 document.getElementById("scaleY2Titre").className = "activeText"; 2426 } 2427 //rendre actif le type de plot si ce n'est pas la valeur none qui est choisie 2428 if (this.selectTraceAxeY2.getValue() != 'no') 2429 { 2430 document.getElementById("typePlotY2Titre").className = "activeText"; 2431 } 2432 //pour rendre les menu déroulant actifs 2433 this.selectTraceAxeY2.enable(); 2434 //rendre actif l'echelle que si l'intensite est choisie dans les parametres 2435 if (this.selectTraceAxeY2.getValue() == 'B') 2436 { 2437 this.selectScaleY2.enable(); 2438 } 2439 //rendre actif le type de plot si ce n'est pas la valeur none qui est choisie 2440 if (this.selectTraceAxeY2.getValue() != 'no') 2441 { 2442 this.selectTypeTraceY2.enable(); 2443 } 2444 2445 //remet le texte en couleur active 2446 // document.getElementById("axeY2Titre").className = "activeText"; 2447 //pour rendre les menu déroulant actifs 2448 // document.getElementById("selectAxeY2" ).disabled=false; 2449 //rendre actif l'echelle que si l'intensite est choisie dans les parametres 2450 // if (document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value == 'B') 2451 // { 2452 // document.getElementById("scaleY2Titre").className = "activeText"; 2453 // document.getElementById("selectScaleY2" ).disabled=false; 2454 //} 2455 //rendre actif le type de plot si ce n'est pas la valeur none qui est choisie 2456 // if (document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value != 'no') 2457 //{ 2458 // document.getElementById("typePlotY2Titre").className = "activeText"; 2459 // document.getElementById("selectTypePlotY2" ).disabled=false; 2460 //} 2461 } 2462 2463 2464 }, 2465 2466 2467 onClickSelectTraceAxeY1: function(value) 2468 { 2469 //si intensite n'est pas choisi pour Y1, le type d'échelle est inactif 2470 if (this.selectTraceAxeY1.getValue() != 'B') 2471 // if ( document.getElementById('selectAxeY1').options[document.getElementById('selectAxeY1').selectedIndex].value != 'B') 2472 { 2473 //transformer le texte en gris 2474 document.getElementById("scaleY1Titre").className = "notActiveText"; 2475 //pour rendre le menu déroulant inactif 2476 this.selectScaleY1.disable(); 2477 // document.getElementById("selectScaleY1" ).disabled=true; 2478 } 2479 //si intensite est choisi pour Y1, le type d'échelle est actif 2480 if (this.selectTraceAxeY1.getValue() == 'B') 2481 //if ( document.getElementById('selectAxeY1').options[document.getElementById('selectAxeY1').selectedIndex].value == 'B') 2482 { 2483 //transformer le texte en gris 2484 document.getElementById("scaleY1Titre").className = "activeText"; 2485 //pour rendre le menu déroulant inactif 2486 this.selectScaleY1.enable(); 2487 // document.getElementById("selectScaleY1" ).disabled=false; 2488 } 2489 }, 2490 2491 onClickSelectTraceAxeY2: function(value) 2492 { 2493 //si intensite n'est pas choisi pour Y2, le type d'échelle est inactif 2494 if (this.selectTraceAxeY2.getValue() != 'B') 2495 //if ( document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value != 'B') 2496 { 2497 //transformer le texte en gris 2498 document.getElementById("scaleY2Titre").className = "notActiveText"; 2499 //pour rendre le menu déroulant inactif 2500 this.selectScaleY2.disable(); 2501 //document.getElementById("selectScaleY2" ).disabled=true; 2502 } 2503 //si intensite est choisi pour Y2, le type d'échelle est actif 2504 if (this.selectTraceAxeY2.getValue() == 'B') 2505 //if ( document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value == 'B') 2506 { 2507 //transformer le texte en foncé 2508 document.getElementById("scaleY2Titre").className = "activeText"; 2509 //pour rendre le menu déroulant actif 2510 this.selectScaleY2.enable(); 2511 //document.getElementById("selectScaleY2" ).disabled=false; 2512 } 2513 //si aucun parametre est choisi pour Y2, le type de plot est inactif 2514 if (this.selectTraceAxeY2.getValue() == 'no') 2515 //if ( document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value == 'no') 2516 { 2517 //transformer le texte en gris 2518 document.getElementById("typePlotY2Titre").className = "notActiveText"; 2519 //pour rendre le menu déroulant inactif 2520 this.selectTypeTraceY2.disable(); 2521 // document.getElementById("selectTypePlotY2" ).disabled=true; 2522 } 2523 //si un parametre est choisi pour Y2, le type de plot est actif 2524 if (this.selectTraceAxeY2.getValue() != 'no') 2525 // if ( document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value != 'no') 2526 { 2527 //transformer le texte en foncé 2528 document.getElementById("typePlotY2Titre").className = "activeText"; 2529 //pour rendre le menu déroulant actif 2530 this.selectTypeTraceY2.enable(); 2531 //document.getElementById("selectTypePlotY2" ).disabled=false; 2532 } 2533 2534 }, 2535 2536 //bouton reset de toute la page (rechargement de la page) 2537 resetPage: function() 2538 { 2539 //location.reload(); //pas appliquée car supprime la fenêtre graphique 2540 2541 //reset du choix de la base de données 2542 // selectFirst : affiche le premier élément de la liste 2543 //true : active la fonction associée au bouton 2544 //this.selectDatabase.selectFirst( true ); 2545 2546 //cacher tous les isotopes 2547 var divs = document.getElementsByTagName( 'div' ); 2548 var count = divs.length; 2549 var i = 0; 2550 2551 for( i = 0; i < count; i++ ) 2552 { 2553 //fermer que les div dont l'id contient la chaine Cache 2554 if (divs.item(i).id.indexOf("Cache") != -1) { 2555 divs.item(i).style.display = "none" ; 2556 } 2557 } 2558 this.showButton.setValue("View all isotopologues"); 2559 2560 //déselectionner tous les isotopes 2561 var inputs = document.getElementsByTagName( 'input' ); 2562 var count = inputs.length; 2563 var i=0; 2564 2565 for( i = 0; i < count; i++ ) 2566 { 2567 var input = inputs.item( i ); 2568 if( input.type == 'checkbox' ) 2569 { 2570 input.checked = false; 2571 } 2572 } 2573 this.selectButton.setValue("Select all isotopologues"); 2574 2575 //spectral range 2576 //remettre les valeurs par défaut en fonction de la base sélectionnée : 2577 switch (this.selectDatabase.getValue()) { 2578 case 'GEISA2003': 2579 $("#rangeLower").val(0); 2580 $("#rangeUpper").val(35877.030506); 2581 break; 2582 case 'GEISA2011': 2583 $("#rangeLower").val(0); 2584 $("#rangeUpper").val(35877.030506); 2585 break; 2586 case 'GEISAIASI2003': 2587 $("#rangeLower").val(599.000793); 2588 $("#rangeUpper").val(3000.998767); 2589 break; 2590 case 'GEISAIASI2011': 2591 $("#rangeLower").val(599.000793); 2592 $("#rangeUpper").val(3000.998767); 2593 break; 2594 } 2595 2596 $("#sampStep").val(""); 2597 2598 //intensity range 2599 $("#intensityLo").val(0); 2600 $("#intensityUp").val(1e-16); 2601 2602 this.selectNbCourbes.selectFirst( true ); 2603 2604 this.selectTraceAxeY1.selectFirst( true ); 2605 this.selectScaleY1.selectFirst( true ); 2606 this.selectTypeTraceY1.selectFirst( true ); 2607 2608 document.getElementById("transition1").length=0; 2609 document.getElementById("transition2").length=0; 2610 this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"Select a molecule", selected:"selected"} )); 2611 this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"Select a molecule", selected:"selected"} )); 2612 $("#transitionUpper").removeClass("notActiveText"); 2613 $("#transitionLower").removeClass("notActiveText"); 2614 2615 2616 $("#meanValue2").val(""); 2617 2618 this.selectTraceAxeY2.selectFirst( true ); 2619 this.selectScaleY2.selectFirst( true ); 2620 this.selectTypeTraceY2.selectFirst( true ); 2621 2622 }, 2623 2624 onClickSubmit: function() 2625 { 2626 this.requestGeisa(); 2627 }, 2628 2629 displayWindow: function(content) 2630 { 2631 //fermeture de la div de l'image d'attente 2632 this.loadingGraphics.hide(); 2633 2634 // var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName=' + this.nameImg + '"><button class="dataProtocolDownloadButton">Download</button></a>'; 2635 2636 //alert(content); 2637 var $dialog = $( '<div></div>' ) 2638 2639 .html( content ) 2640 2641 .dialog( { 2642 autoOpen: false, 2643 title: "GEISA : spectroscopic database", 2644 //buttons: { "Close": function() { $(this).dialog("close"); }, "Min": function() { $(this).dialog({ height: 20, width:350 }); },"Max": function() { $(this).dialog({ height: 560, width:700 }); } }, 2645 buttons:{ 2646 "close":{ 2647 id:'close', 2648 text:'Close', 2649 height:'30px', 2650 width:'53px', 2651 title :'to close the window', 2652 click: function() { $(this).dialog("close"); }, 2653 }, 2654 "min" :{ 2655 id:'Min', 2656 text:'-', 2657 height:'30px', 2658 width:'30px', 2659 title :'to reduce the window', 2660 click: function() { $(this).dialog({ height:18, width:350 }); }, 2661 }, 2662 "max" :{ 2663 id:'Max', 2664 text:'+', 2665 height:'30px', 2666 width:'30px', 2667 title :'to enlarge the window ', 2668 click: function() { $(this).dialog({ height: 640, width:700 }); }, 2669 }, 2670 }, 2671 2672 //minHeight: 500, 2673 // minWidth: 660, 2674 height: 640, 2675 width:700, 2676 //Exemple de valeurs possible pour position : "middle", "top", [200, 100] 2677 position: "middle" 2678 } ); 2679 $dialog.dialog( 'open' ); 2680 }, 2681 2682 // displayWindow: function(coordinate) 2683 //{ 2684 //var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName=bib.txt"><button class="dataProtocolDownloadButton">Download</button></a>'; 2685 // var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName=' + this.nameImg + '"><button class="dataProtocolDownloadButton">Download</button></a>'; 2686 2687 //alert(content); 2688 // var $dialog = $( '<div></div>' ) 2689 // .html( content + content1 ) 2690 2691 // .dialog( { 2692 // autoOpen: false, 2693 // title: "GEISA : spectroscopic database", 2694 // minHeight: 500, 2695 // minWidth: 660, 2696 2697 //coordonnee y y 2698 // position:coordinate 2699 2700 // } ); 2701 // $dialog.dialog( 'open' ) 2702 //}, 2703 2704 2705 onClickDownload: function() 2706 { 2707 document.location.href = "project?methodName=downloadFile&fileName=bib.txt"; 2708 } 2709 2710 2711 } ); 2712 480 } ); 481 }, this ) ); 482 }, 483 484 bindMenuLogos: function() 485 { 486 var gap = (this.logoSizeBig - this.logoSizeSmall) / 2; 487 var logoSizeBig = this.logoSizeBig + "px"; 488 var logoSizeSmall = this.logoSizeSmall + "px"; 489 var gridimage; 490 491 $( '.divLogo' ).mouseover( function( element ) 492 { 493 gridimage = $( this ).find( 'img' ); //Define target as a variable 494 gridimage.stop().animate( { 495 width: logoSizeBig, 496 height: logoSizeBig 497 }, 150 ); 498 $( this ).animate( { 499 top: "-=10px", 500 left: "-=10px" 501 }, 150 ); 502 } ); 503 504 $( '.divLogo' ).mouseout( function( element ) 505 { 506 $( this ).animate( { 507 top: "+=10px", 508 left: "+=10px" 509 }, 150 ); 510 gridimage.stop().animate( { 511 width: logoSizeSmall, 512 height:logoSizeSmall 513 }, 150 ); 514 } ); 515 this.bindLogos(); 516 }, 517 518 bindLogos:function() 519 { 520 $( '.divLogo' ).click( jQuery.proxy( function( element ) 521 { 522 this.selectedLogo = element.currentTarget; 523 this.onClickLogo(); 524 }, this ) ); 525 }, 526 527 changeRightSlide: function() 528 { 529 this.rightSlide.setTitle( '<spring:message code="label.actions"/>' ); 530 this.rightSlide.getDivContent().empty(); 531 new Button( {value:"<spring:message code="statistics.summary"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displaySummary, this )} ); 532 new Button( {value:"<spring:message code="statistics.monthly"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayMonthly, this )} ); 533 new Button( {value:"<spring:message code="statistics.daily"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayDaily, this )} ); 534 new Button( {value:"<spring:message code="statistics.daysofweek"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayDaysOfWeek, this )} ); 535 new Button( {value:"<spring:message code="statistics.hours"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayHours, this )} ); 536 new Button( {value:"<spring:message code="statistics.visit.duration"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayVisitDuration, this )} ); 537 538 new Button( {value:"<spring:message code="statistics.visit"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayVisit, this )} ); 539 new Button( {value:"<spring:message code="statistics.domain"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayDomainCountry, this )} ); 540 new Button( {value:"<spring:message code="statistics.data.download"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayDownload, this )} ); 541 542 new Button( {value:"<spring:message code="label.print"/>", parent:this.rightSlide.getDivContent(), className: "blue export_button print-preview", onClick:jQuery.proxy( this.onClickPrint, this )} ); 543 }, 544 545 changeMiddleSlide: function( title, url ) 546 { 547 var selectedMonth = this.selectMonths ? this.selectMonths.getValue() : false; 548 var selectedYear = this.selectYears ? this.selectYears.getValue() : false; 549 550 this.middleSlide.setTitle( this.selectedLogo.id + ' : ' + title ); 551 this.middleSlide.getDivContent().empty(); 552 553 // Button 554 new Button( {value:"<spring:message code="label.go"/>", parent:this.middleSlide.getDivContent(), className: "blue selectDates", onClick:jQuery.proxy( this.onClickGo, [url, this] )} ); 555 556 // Years 557 this.createSelectYears(); 558 if( !this.isMonthAndYearSelected ) 559 this.selectYears.selectFirst( true ); 560 else 561 this.selectYears.select( selectedYear ); 562 563 // Months 564 this.createSelectMonths(); 565 if( !this.isMonthAndYearSelected ) 566 { 567 var currentMonth = (new Date()).getMonth() + 1; 568 this.selectMonths.select( currentMonth ); 569 } 570 else 571 this.selectMonths.select( selectedMonth ); 572 573 this.isMonthAndYearSelected = true; 574 575 var div = $( document.createElement( "div" ) ); 576 div.attr( {id:"divAwstats"} ); 577 div.addClass( "containerAwstats" ); 578 this.middleSlide.getDivContent().append( div ); 579 580 div.load( url + this.selectedLogo.id + "&month=" + this.selectMonths.getValue() + "&year=" + this.selectYears.getValue() ); 581 }, 582 583 584 // STATISTICS ******************************************************** 585 displaySummary: function() 586 { 587 this.changeMiddleSlide( '<spring:message code="statistics.summary"/>', <%=WebHelper.getProperty(request, "url.summary")%> ); 588 }, 589 590 displayMonthly: function() 591 { 592 this.changeMiddleSlide( '<spring:message code="statistics.monthly"/>', <%=WebHelper.getProperty(request, "url.monthly")%> ); 593 }, 594 595 displayDaily: function() 596 { 597 this.changeMiddleSlide( '<spring:message code="statistics.daily"/>', <%=WebHelper.getProperty(request, "url.daily")%> ); 598 }, 599 600 displayDaysOfWeek: function() 601 { 602 this.changeMiddleSlide( '<spring:message code="statistics.daysofweek"/>', <%=WebHelper.getProperty(request, "url.daysofweek")%> ); 603 }, 604 605 displayHours: function() 606 { 607 this.changeMiddleSlide( '<spring:message code="statistics.hours"/>', <%=WebHelper.getProperty(request, "url.hours")%> ); 608 }, 609 610 displayVisitDuration: function() 611 { 612 this.changeMiddleSlide( '<spring:message code="statistics.visit.duration"/>', <%=WebHelper.getProperty(request, "url.sessions")%> ); 613 }, 614 615 displayVisit: function() 616 { 617 this.changeMiddleSlide( '<spring:message code="statistics.visit"/>', <%=WebHelper.getProperty(request, "url.visited.pages")%> ); 618 }, 619 620 displayDomainCountry: function() 621 { 622 this.changeMiddleSlide( '<spring:message code="statistics.domain"/>', <%=WebHelper.getProperty(request, "url.domains")%> ); 623 }, 624 625 displayDownload: function() 626 { 627 this.changeMiddleSlide( '<spring:message code="statistics.data.download"/>', <%=WebHelper.getProperty(request, "url.downloads")%> ); 628 }, 629 630 displayAwstatsStatistics: function() 631 { 632 window.open( "http://www.pole-ether.fr/cgi-bin/awstats/awstats.pl?config=" + this.selectedLogo.id ); 633 } 634 635 } ); 2713 636 2714 637 </script> 2715 2716 2717 -
ether_iasi/trunk/web/src/com/ether/Controller.java
r713 r714 7 7 import org.apache.commons.logging.Log; 8 8 import org.apache.commons.logging.LogFactory; 9 import org.springframework.beans.factory.annotation.Required; 9 10 import org.springframework.web.servlet.ModelAndView; 10 11 … … 62 63 } 63 64 65 @Required 66 public void setIasiService( final IasiService iasiService ) 67 { 68 _iasiService = iasiService; 69 } 70 64 71 private static final Log LOGGER = LogFactory.getLog( Controller.class ); 72 73 private IasiService _iasiService; 65 74 66 75 public static final String PATH_IMAGES = "resources/images/graphGeisa/"; -
ether_iasi/trunk/web/src/com/ether/WebHelper.java
r710 r714 157 157 158 158 public static final int STATUS_CODE_SERVICE_EXCEPTION = 500; 159 public static final String PROPERTIES_FILE = " geisa.properties";159 public static final String PROPERTIES_FILE = "iasi.properties"; 160 160 161 161 private static final Log LOGGER = LogFactory.getLog( WebHelper.class ); -
ether_iasi/trunk/web/src/messages_en.properties
r710 r714 1 1 inWork=Work in progress.. 2 language=English 3 label.language.fr=French 4 label.language.en=English 5 label.language=Language 2 language=en 3 label.language.to.switch=French 4 label.language.value.to.switch=fr 6 5 7 app.title=Geisa 8 app.fulltitle=Full title de Tapas 9 app.Geisafulltitle=GEISA : spectroscopic database 6 title=Statistics 7 label.connection=Connection 8 label.firstname=First name 9 label.lastname=Last name 10 label.login=Login 11 label.pwd=Password 12 label.help=Help 13 label.help.content=This interface display statistics for projects above.<BR/>After connection, you could get them by a click on the logo or use the rollable slide 'Projects'.<BR/>All green slides are rollable by using the <B>double-click</B> on the title ! 14 label.display.actions=Display actions 15 label.actions=Actions 16 label.mentions=Mentions 17 label.credits=Credits 18 label.print=Print 19 label.unknown=Unknown 20 label.awstats=Launch Awstats 21 label.projects=Projects 22 label.january=January 23 label.february=February 24 label.march=March 25 label.april=April 26 label.may=May 27 label.june=June 28 label.july=July 29 label.august=August 30 label.september=September 31 label.october=October 32 label.november=November 33 label.december=December 34 label.go=Go 10 35 11 title.home=Geisa data 36 statistics.online=Online since 37 statistics.since=Statistics since 38 statistics.user.registered=Registered users 39 statistics.user.connected=Connected users 40 statistics.visit=Visited pages 41 statistics.email=Emails 42 statistics.data=Data 43 statistics.data.download=Downloads 44 statistics.data.download.size=Size 45 statistics.duration=Connection duration 46 statistics.duration.total=Total 47 statistics.duration.average=Average 48 statistics.domain=Domains / Countries 49 statistics.summary=Summary 50 statistics.monthly=Monthly history 51 statistics.daily=Days of month 52 statistics.daysofweek=Days of week 53 statistics.hours=Hours 54 statistics.visit.duration=Visits duration 12 55 13 label.home=Home 14 label.map=Map 15 label.mail=Email 56 statistics.evolution=Statistics evolution 57 statistics.evolution.distribution=Statistics evolution and distribution 58 statistics.evolution.visit=Visited pages evolution 59 statistics.distribution.visit=Visited pages distribution 60 statistics.evolution.user.registered=Registered users evolution 61 statistics.distribution.user.registered=Registered users distribution 62 statistics.evolution.user.connected=Connected users evolution 63 statistics.distribution.user.connected=Connected users distribution 64 statistics.evolution.download=Downloads evolution 65 statistics.distribution.download=Downloads distribution 66 statistics.map.distribution=Geographic distribution 16 67 17 label.atmosphere.chemistry=Atmosphere chemistry 18 label.activities=Activities 19 label.data.services=Data/Services 20 label.community=Community 21 label.pole.presentation=Pole presentation 22 label.users.committee=Users committee 23 label.laboratories=Laboratories 24 label.workshops=Workshops 25 label.ether.letters=Ether letters 26 label.informations=Informations 27 28 label.balloons=Balloons 29 label.satellites=Satellites 30 label.campaigns=Campaigns 31 label.models=Models 32 label.meteo=Meteo 33 label.links=Links 34 35 home.title.part1=Centre for Atmospheric Chemistry 36 home.title.part2=Products and Services 37 home.news=N E W S 38 home.main.activities=ETHER MAIN ACTIVITIES 39 home.data=DATA 40 home.databases=DATABASES 41 home.services=SERVICES 42 43 logo.mimosa.alt=Potential vorticity, temperature analysis and forecasts 44 logo.reprobus.alt=Chemistry Transport Model in Polar Winters 45 logo.iasi.alt=Infrared Atmospheric Sounding Interferometer 46 logo.tropico.alt=TRO-pico campaign 47 logo.geisa.alt=Spectroscopic data 48 logo.mozaic.alt=Measurements of OZone, water vapour, carbon monoxide and nitrogen oxides by in-services AIrbus airCraft 49 logo.eccad.alt=Emissions data and ancillary data for emissions calculation 50 logo.megapoli.alt=Megacities: Emissions, urban, regional and Global Atmospheric POLlution and climate effects, and Integrated tools for assessment and mitigation 51 logo.balloons.alt=Balloon experiments 52 logo.satellites.alt=Available data in ETHER 53 logo.campaigns.alt=Campaigns 54 logo.models.alt=Models 55 logo.meteo.alt=Meteo 56 logo.ramces.alt=Atmospheric Network for the Measurement of Greenhouse Compounds 57 logo.kinetics.alt=Chemical Kinetics Database 58 logo.links.alt=Links 59 60 61 label.submitButton=RUN 68 error.connection.need=Please connect to access to statistics 69 error.login.failed=Error to connect 70 ERROR_LOGIN_NOT_FOUND=Error : unknown login 71 ERROR_PASSWORD=Error : wrong password 72 ERROR_ENCRYPT_PASSWORD=Error : password can't be encrypted -
ether_iasi/trunk/web/src/messages_fr.properties
r710 r714 1 1 inWork=Page en cours de construction.. 2 language=Français 3 label.language.fr=Français 4 label.language.en=Anglais 5 label.language=Langue 2 language=fr 3 label.language.to.switch=Anglais 4 label.language.value.to.switch=en 6 5 7 app.title=Geisa 8 app.fulltitle=Titre complet de Tapas 9 app.Geisafulltitle=GEISA : spectroscopic database 6 title=Statistiques 7 label.connection=Connexion 8 label.firstname=Prénom 9 label.lastname=Nom 10 label.login=Login 11 label.pwd=Mot de passe 12 label.help=Aide 13 label.help.content=Cette interface propose les statistiques des projets présentés ci-dessus.<BR/>AprÚs s'être connecté, vous pourrez y accéder en cliquant sur l'un de ces logos ou en déroulant le slide 'Projets'.<BR/>Les slides verts sont roulables/déroulables via un <B>double-click</B> sur leur bandeau ! 14 label.display.actions=Afficher les actions 15 label.actions=Actions 16 label.mentions=Mentions 17 label.credits=Crédits 18 label.print=Imprimer 19 label.unknown=Inconnu 20 label.awstats=Lancer Awstats 21 label.projects=Projets 22 label.january=Janvier 23 label.february=Février 24 label.march=Mars 25 label.april=Avril 26 label.may=Mai 27 label.june=Juin 28 label.july=Juillet 29 label.august=Août 30 label.september=Septembre 31 label.october=Octobre 32 label.november=Novembre 33 label.december=Décembre 34 label.go=Go 10 35 11 title.home=Les données Geisa 12 13 label.home=Accueil 14 label.map=Plan 15 label.mail=Email 16 17 label.atmosphere.chemistry=Chimie de l'atmosphÚre 18 label.activities=Activités 19 label.data.services=Données/Services 20 label.community=Communauté 21 label.pole.presentation=Présentation du pÎle 22 label.users.committee=Comité utilisateurs 23 label.laboratories=Laboratoires 24 label.workshops=Colloques/Ateliers 25 label.ether.letters=Lettres Ether 26 label.informations=Informations 27 28 label.balloons=Ballons 29 label.satellites=Satellites 30 label.campaigns=Campagnes 31 label.models=ModÚles 32 label.meteo=Météo 33 label.links=Liens 34 35 home.title.part1=Centre de Produits et Services 36 home.title.part2=de la Chimie de l'AtmosphÚre 37 home.news=A C T U A L I T E S 38 home.main.activities=PRINCIPALES ACTIVITES D'ETHER 39 home.data=DONNEES 40 home.databases=BASES DE DONNEES 41 home.services=SERVICES 42 43 logo.mimosa.alt=Potential vorticity, temperature analysis and forecasts 44 logo.reprobus.alt=Chemistry Transport Model in Polar Winters 45 logo.iasi.alt=Infrared Atmospheric Sounding Interferometer 46 logo.tropico.alt=TRO-pico campaign 47 logo.geisa.alt=Spectroscopic data 48 logo.mozaic.alt=Measurements of OZone, water vapour, carbon monoxide and nitrogen oxides by in-services AIrbus airCraft 49 logo.eccad.alt=Emissions data and ancillary data for emissions calculation 50 logo.megapoli.alt=Megacities: Emissions, urban, regional and Global Atmospheric POLlution and climate effects, and Integrated tools for assessment and mitigation 51 logo.balloons.alt=Ballons 52 logo.satellites.alt=Données disponibles dans ETHER 53 logo.campaigns.alt=Campagnes 54 logo.models.alt=ModÚles 55 logo.meteo.alt=Météo 56 logo.ramces.alt=Réseau atmosphérique de Mesure des Composés à Effet de Serre 57 logo.kinetics.alt=Chemical Kinetics Database 58 logo.links.alt=Liens 36 statistics.online=En ligne depuis le 37 statistics.since=Statistiques depuis 38 statistics.user.registered=Utilisateurs enregistrés 39 statistics.user.connected=Utilisateurs connectés 40 statistics.visit=Pages visitées 41 statistics.email=Emails 42 statistics.data=Données 43 statistics.data.download=Téléchargements 44 statistics.data.download.size=Taille 45 statistics.duration=Durée de connexions 46 statistics.duration.total=Totale 47 statistics.duration.average=Moyenne 48 statistics.domain=Domaines / Pays 49 statistics.summary=Résumé 50 statistics.monthly=Historique mensuel 51 statistics.daily=Jours du mois 52 statistics.daysofweek=Jours de la semaine 53 statistics.hours=Heures 54 statistics.visit.duration=Durée des visites 59 55 60 56 61 label.submitButton=COURIR 57 statistics.evolution=Evolution des statistiques 58 statistics.evolution.distribution=Evolution et répartition des statistiques 59 statistics.evolution.visit=Evolution des pages visitées 60 statistics.distribution.visit=Répartition des pages visitées 61 statistics.evolution.user.registered=Evolution des utilisateurs enregistrés 62 statistics.distribution.user.registered=Répartition des utilisateurs enregistrés 63 statistics.evolution.user.connected=Evolution des utilisateurs connectés 64 statistics.distribution.user.connected=Répartition des utilisateurs connectés 65 statistics.evolution.download=Evolution des téléchargements 66 statistics.distribution.download=Répartition des téléchargements 67 statistics.map.distribution=Répartition géographique 62 68 69 error.connection.need=Veuillez tout d'abord vous connecter 70 error.login.failed=Erreur de connexion 71 ERROR_LOGIN_NOT_FOUND=Erreur : login inconnu 72 ERROR_PASSWORD=Erreur : mot de passe incorrect 73 ERROR_ENCRYPT_PASSWORD=Erreur d'encryptage du mot de passe
Note: See TracChangeset
for help on using the changeset viewer.