Changeset 477 for geisa/web/initGeisa_script.jsp
- Timestamp:
- 04/13/12 16:25:38 (12 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
geisa/web/initGeisa_script.jsp
r461 r477 90 90 { 91 91 /** *********** CONTAINERS *********** **/ 92 this.containerFormSpectralRange = $( "#spectralRange" ); 93 this.containerFormIntensity = $( "#intensity" ); 94 this.containerFormMeanValue = $( "#meanValue" ); 92 this.containerFormSpectralRangeLower = $( "#spectralRangeLower" ); 93 this.containerFormSpectralRangeUpper = $( "#spectralRangeUpper" ); 94 this.containerFormIntensityLower = $( "#intensityLower" ); 95 this.containerFormIntensityUpper = $( "#intensityUpper" ); 96 this.containerFormMeanValue1 = $( "#meanValue1" ); 95 97 this.containerDownload = $( "#downloadContainer" ); 96 98 … … 103 105 createForm: function() 104 106 { 107 //Titre de la page 108 var titlePage = document.createTextNode("Graphic vizualisation of the GEISA 2009 database"); 109 document.getElementById("titlePage").appendChild(titlePage); 110 111 //create cases à cocher pour les molécules 112 // var cbh = document.getElementById('molecules'); 113 // var val = '1'; 114 // var cap = 'Jan'; 115 116 // var cb = document.createElement('input'); 117 // cb.type = 'checkbox'; 118 // cbh.appendChild(cb); 119 // cb.name = val; 120 // cb.value = cap; 121 // cb.appendChild(document.createTextNode(cap)); 105 122 106 123 107 124 // Create menu deroulant 1er choix axe des y 125 //Titre 126 var titleAxeY1 = document.createTextNode("Choose the first vertical axis"); 127 document.getElementById("axeY1").appendChild(titleAxeY1); 128 var spaceBr = document.createElement ("br"); 129 document.getElementById("axeY1").appendChild(spaceBr); 130 //menu déroulant 108 131 var paramSelectAxeY1 = new Object(); 109 132 paramSelectAxeY1.id = "selectAxeY1"; … … 121 144 122 145 // Create menu deroulant type d'échelle linéaire ou logarithmique pour le choix y1 123 var paramSelectScale = new Object(); 124 paramSelectScale.id = "SelectScale1"; 125 paramSelectScale.parent = $("#typeScale1"); 126 this.selectScale = new Select( paramSelectScale ); 127 this.selectScale.add( 'l', "Linear" ); 128 this.selectScale.add( '-log_scale', "Logarithmic" ); 129 this.selectScale.selectFirst( false ); 130 131 132 146 //Titre 147 var titleScaleY1 = document.createTextNode("Select the type of Scale (if intensity is choosen)"); 148 document.getElementById("scaleY1").appendChild(titleScaleY1); 149 var spaceBr = document.createElement ("br"); 150 document.getElementById("scaleY1").appendChild(spaceBr); 151 //menu déroulant 152 var paramSelectScaleY1 = new Object(); 153 paramSelectScaleY1.id = "SelectScaleY1"; 154 paramSelectScaleY1.parent = $("#scaleY1"); 155 this.selectScaleY1 = new Select( paramSelectScaleY1 ); 156 this.selectScaleY1.add( 'l', "Linear" ); 157 this.selectScaleY1.add( '-log_scale', "Logarithmic" ); 158 this.selectScaleY1.selectFirst( false ); 159 160 161 // Create menu deroulant 1 courbe avec valeurs cumulées ou 1 courbe par molecules/isotopes 162 //Titre 163 var titleNbCourbes = document.createTextNode("Select the nomber of curves"); 164 document.getElementById("NbCourbes").appendChild(titleNbCourbes); 165 var spaceBr = document.createElement ("br"); 166 document.getElementById("NbCourbes").appendChild(spaceBr); 167 //menu déroulant 168 var paramNbCourbes = new Object(); 169 paramNbCourbes.id = "SelectNbCourbes"; 170 paramNbCourbes.parent = $("#NbCourbes"); 171 this.SelectNbCourbes = new Select( paramNbCourbes ); 172 this.SelectNbCourbes.add( '1c', "One curve for all molecules/isotopes selected" ); 173 this.SelectNbCourbes.add( 'mc', "One curve for each molecule/isotope selected" ); 174 this.SelectNbCourbes.selectFirst( false ); 133 175 134 176 // Create menu deroulant 2eme choix axe des y 177 //Titre 178 var titleAxeY2 = document.createTextNode("Choose the second vertical axis"); 179 document.getElementById("axeY2").appendChild(titleAxeY2); 180 var spaceBr = document.createElement ("br"); 181 document.getElementById("axeY2").appendChild(spaceBr); 182 //menu déroulant 135 183 var paramSelectAxeY2 = new Object(); 136 184 paramSelectAxeY2.id = "selectAxeY2"; … … 148 196 this.selectTraceAxeY2.selectFirst( false ); 149 197 198 150 199 // Create menu deroulant type d'échelle linéaire ou logarithmique pour le choix y2 151 var paramSelectScale = new Object(); 152 paramSelectScale.id = "SelectScale2"; 153 paramSelectScale.parent = $("#typeScale2"); 154 this.selectScale = new Select( paramSelectScale ); 155 this.selectScale.add( 'l', "Linear" ); 156 this.selectScale.add( '-log_scale2', "Logarithmic" ); 157 this.selectScale.selectFirst( false ); 158 159 160 // Create zone text 200 //Titre 201 var titleScaleY2 = document.createTextNode("Select the type of Scale (if intensity is choosen)"); 202 document.getElementById("scaleY2").appendChild(titleScaleY2); 203 var spaceBr = document.createElement ("br"); 204 document.getElementById("scaleY2").appendChild(spaceBr); 205 //menu déroulant 206 var paramSelectScaleY2 = new Object(); 207 paramSelectScaleY2.id = "SelectScaleY2"; 208 paramSelectScaleY2.parent = $("#scaleY2"); 209 this.selectScaleY2 = new Select( paramSelectScaleY2 ); 210 this.selectScaleY2.add( 'l', "Linear" ); 211 this.selectScaleY2.add( '-log_scale2', "Logarithmic" ); 212 this.selectScaleY2.selectFirst( false ); 213 214 215 216 217 //Zone texte SpectralRange 218 //Titre 219 var titleSpectralRangeLower = document.createTextNode("Lower Bound :"); 220 document.getElementById("spectralRangeLower").appendChild(titleSpectralRangeLower); 221 var titleSpectralRangeUpper = document.createTextNode("Upper Bound :"); 222 document.getElementById("spectralRangeUpper").appendChild(titleSpectralRangeUpper); 223 // var spaceBr = document.createElement ("br"); 224 // document.getElementById("spectralRange").appendChild(spaceBr); 225 //zone texte SpectralRangeLower 161 226 var inputSpectralRangeLower = $( document.createElement( "input" ) ); 227 inputSpectralRangeLower.attr( {id:"RangeLower", class:"styleInputs"} ); 228 inputSpectralRangeLower.val(0); 229 this.containerFormSpectralRangeLower.append( inputSpectralRangeLower ); 230 //zone texte SpectralRangeUpper 162 231 var inputSpectralRangeUpper = $( document.createElement( "input" ) ); 232 inputSpectralRangeUpper.attr( {id:"RangeUpper"} ); 233 inputSpectralRangeUpper.val(800); 234 this.containerFormSpectralRangeUpper.append( inputSpectralRangeUpper ); 235 236 237 //Zone texte Intensity 238 //Titre 239 var titleIntensityLower = document.createTextNode("Lower Bound :"); 240 document.getElementById("intensityLower").appendChild(titleIntensityLower); 241 var titleIntensityUpper = document.createTextNode("Upper Bound :"); 242 document.getElementById("intensityUpper").appendChild(titleIntensityUpper); 243 //zone texte IntensityLower 163 244 var inputIntensityLower = $( document.createElement( "input" ) ); 245 inputIntensityLower.attr( {id:"intensityLo", class:"styleInputs"} ); 246 inputIntensityLower.val(0); 247 this.containerFormIntensityLower.append( inputIntensityLower ); 248 //zone texte IntensityUpper 164 249 var inputIntensityUpper = $( document.createElement( "input" ) ); 165 var inputMeanValue = $( document.createElement( "input" ) ); 166 167 168 inputSpectralRangeLower.attr( {id:"spectralRangeLower", class:"styleInputs"} ); 169 inputSpectralRangeLower.val(20); 170 this.containerFormSpectralRange.append( inputSpectralRangeLower ); 171 172 inputSpectralRangeUpper.attr( {id:"spectralRangeUpper"} ); 173 inputSpectralRangeUpper.val(40); 174 this.containerFormSpectralRange.append( inputSpectralRangeUpper ); 175 176 inputIntensityLower.attr( {id:"intensityLower", class:"styleInputs"} ); 177 inputIntensityLower.val(1e-28); 178 this.containerFormIntensity.append( inputIntensityLower ); 179 180 inputIntensityUpper.attr( {id:"intensityUpper"} ); 181 inputIntensityUpper.val(1e-20); 182 this.containerFormIntensity.append( inputIntensityUpper ); 250 inputIntensityUpper.attr( {id:"intensityUp"} ); 251 inputIntensityUpper.val(1e-19); 252 this.containerFormIntensityUpper.append( inputIntensityUpper ); 183 253 184 254 185 255 186 256 // Create menu deroulant style de tracer 257 //Titre 258 var titleTypeTrace = document.createTextNode("Select the type of plot"); 259 document.getElementById("typePlot").appendChild(titleTypeTrace); 260 var spaceBr = document.createElement ("br"); 261 document.getElementById("typePlot").appendChild(spaceBr); 262 //menu déroulant 187 263 var paramSelectTypeTrace = new Object(); 188 264 paramSelectTypeTrace.id = "SelectTypePlot"; … … 195 271 this.selectTypeTrace.selectFirst( false ); 196 272 197 // Create menu deroulant type d'échelle linéaire ou logarithmique 198 var paramSelectScale = new Object(); 199 paramSelectScale.id = "SelectScale";200 paramSelectScale.parent = $("#typeScale");201 this.selectScale = new Select( paramSelectScale);202 this.selectScale.add( 'l', "Linear");203 this.selectScale.add( '-log_scale', "Logarithmic");204 this.selectScale.selectFirst( false);205 206 //Mean Value207 inputMeanValue.attr( {id:"meanValue 1"} );273 274 275 //Zone text Mean Value 276 //Titre 277 var titleMeanValue = document.createTextNode("Mean value :"); 278 document.getElementById("meanValue1").appendChild(titleMeanValue); 279 //var spaceBr = document.createElement ("br"); 280 //document.getElementById("meanValue").appendChild(spaceBr); 281 //champ input 282 var inputMeanValue = $( document.createElement( "input" ) ); 283 inputMeanValue.attr( {id:"meanValue2"} ); 208 284 inputMeanValue.val(0); 209 this.containerFormMeanValue.append( inputMeanValue ); 285 this.containerFormMeanValue1.append( inputMeanValue ); 286 287 288 //Create menu deroulant transition 289 //Titre 290 // var titleTransitionUpper = document.createTextNode("Upper Bound :"); 291 // document.getElementById("transitionUpper").appendChild(titleTransitionUpper); 292 //var titleTransitionLower = document.createTextNode("Lower Bound :"); 293 // document.getElementById("transitionLower").appendChild(titleTransitionLower); 294 295 // var spaceBr = document.createElement ("br"); 296 // document.getElementById("transition").appendChild(spaceBr); 297 // Create menu deroulant transition upper 298 var paramSelectTransitionUpper = new Object(); 299 paramSelectTransitionUpper.id = "transition1"; 300 paramSelectTransitionUpper.parent = $("#transitionUpper"); 301 this.selectTransitionUpper = new Select( paramSelectTransitionUpper ); 302 this.selectTransitionUpper.add( 'transi1', "transi1" ); 303 this.selectTransitionUpper.add( 'transi2', "transi2" ); 304 this.selectTransitionUpper.selectFirst( false ); 305 // Create menu deroulant transition lower 306 var paramSelectTransitionLower = new Object(); 307 paramSelectTransitionLower.id = "transition2"; 308 paramSelectTransitionLower.parent = $("#transitionLower"); 309 this.selectTransitionLower = new Select( paramSelectTransitionLower ); 310 this.selectTransitionLower.add( 'transi1', "transi1" ); 311 this.selectTransitionLower.add( 'transi2', "transi2" ); 312 this.selectTransitionLower.selectFirst( false ); 210 313 211 314 … … 231 334 // place_select.appendChild(trace_select); 232 335 336 //Create an input type dynamically. 337 //var element = document.createElement("input"); 338 339 //Assign different attributes to the element. 340 // element.setAttribute("type", "button"); 341 // element.setAttribute("value", "more"); 342 // element.setAttribute("name", "moreo"); 343 // element.setAttribute("id", "moreo1"); 344 // element.setAttribute("onclick","this.onClickMoreOptions"); 345 // var foo = document.getElementById("boutonMoreOptions"); 346 347 //Append the element in page (in span). 348 // foo.appendChild(element); 233 349 234 350 // Create bouton 235 236 // var submitButton = new Button( {value:initTexts["label.submitButton"], parent:this.containerForm1, id:"button_submit1", className: "red_button", classNameText:"red_button_text", onClick:jQuery.proxy( this.onClickSubmit, this )} ); 237 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 )} ); 238 }, 351 // this.moreOptionsButton = new Button( {value:"More options", parent:$( "#boutonMoreOptions" ), id:"boutonMoreOptions1",name:"more", className: "small", onClick:jQuery.proxy( this.onClickMoreOptions, this )} ); 352 this.moreOptionsButton = new Button( {value:"More options", parent:$( "#boutonMoreOptions" ), id:"boutonMoreOptions1",name:"more", onClick:jQuery.proxy( this.onClickMoreOptions, this )} ); 353 354 // 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 )} ); 355 var submitButton = new Button( {value:"Submit", parent:$( "#boutonSubmit" ), id:"button_submit_3", className: "positive", onClick:jQuery.proxy( this.onClickSubmit, this )} ); 356 357 }, 239 358 240 359 … … 257 376 // " -wavenb_max "+$("#spectralRangeUpper").val()+" -int_min "+$("#intensityLower").val()+" -int_max "+$("#intensityUpper").val()+" -line_type "+this.selectTypeTrace.getValue()+"\""; 258 377 259 260 //sélection ou non d'un 2eme choix pour l'axe des Y 261 if (this.selectTraceAxeY2.getValue() == 'no' ) 378 //molécules 379 //récupération des molécules sélectionnées 380 var inputs = document.getElementsByTagName( 'input' ); 381 var count = inputs.length; 382 var molName =""; 383 for( i = 0; i < count; i++ ) 384 { 385 input = inputs.item( i ); 386 if( input.type == 'checkbox' && input.checked == true ) 387 { 388 var molN=input.value; 389 var molN1=molN.replace("_", ":"); 390 molName = molName+"-moleisotEEE"+molN1+".EEE"; 391 } 392 } 393 //remplacement de "_" par ":" 394 //alert(molN); 395 396 //alert(molN1); 397 //var molName = "-moleisotEEEh2o:161,162.EEE-moleisotEEEco2:626,627.EEE-moleisotEEE"+molN1+"."; 398 alert(molName); 399 400 //sélection du type d'échelle pour le parametre Y1 401 if (this.selectScaleY1.getValue() == '-log_scale' ) 402 { 403 var logScale = this.selectScaleY1.getValue(); 404 } 405 else 406 { 407 var logScale = "" 408 } 409 410 //sélection 1 courbe ou 1 courbe par mol/iso 411 if (this.SelectNbCourbes.getValue() == 'mc' ) 412 { 413 var nbCourbes = "EEE-separate_molEEE-same_graphEEE"; 414 } 415 else 416 { 417 var nbCourbes = ""; 418 } 419 420 421 //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 visible) 422 if (this.selectTraceAxeY2.getValue() == 'no' || document.getElementById( "axeY2" ).style.display == "none") 262 423 { 263 424 var field2 = ""; … … 266 427 { 267 428 var field2 = "-field2EEE"+this.selectTraceAxeY2.getValue(); 429 } 430 431 //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 visible) 432 if (this.selectScaleY2.getValue() == '-log_scale2' && document.getElementById( "typeScaleY2" ).style.display == "") 433 { 434 var logScale2 =this.selectScaleY2.getValue(); 435 } 436 else 437 { 438 var logScale2 = ""; 439 } 440 441 //on ne prend la valeur de mean value que si l'option est visible 442 if ( document.getElementById( "meanValue" ).style.display == "") 443 { 444 var meanValue = "EEE-stepEEE"+$("#meanValue1").val(); 445 } 446 else 447 { 448 var meanValue = "" 268 449 } 269 450 … … 273 454 // " -wavenb_max "+$("#spectralRangeUpper").val()+" -int_min "+$("#intensityLower").val()+" -int_max "+$("#intensityUpper").val()+" -line_type "+this.selectTypeTrace.getValue()+"\""; 274 455 275 var parameters2 = "&fortranRequest=-fieldEEE"+this.selectTraceAxeY1.getValue()+"EEE"+field2+"EEE-wavenb_minEEE"+$("#spectralRangeLower").val()+ 276 "EEE-wavenb_maxEEE"+$("#spectralRangeUpper").val()+"EEE-int_minEEE"+$("#intensityLower").val()+"EEE-int_maxEEE"+$("#intensityUpper").val()+"EEE-line_typeEEE"+this.selectTypeTrace.getValue(); 456 457 var parameters2 = "&fortranRequest=-fieldEEE"+this.selectTraceAxeY1.getValue()+"EEE"+logScale+"EEE"+field2+"EEE"+logScale2+"EEE"+"EEE-wavenb_minEEE"+$("#RangeLower").val()+ 458 "EEE-wavenb_maxEEE"+$("#RangeUpper").val()+"EEE-int_minEEE"+$("#intensityLo").val()+"EEE-int_maxEEE"+$("#intensityUp").val()+"EEE-line_typeEEE"+this.selectTypeTrace.getValue()+"EEE"+molName+meanValue+nbCourbes; 459 277 460 278 461 //alert(parameters2); … … 288 471 { 289 472 var bob = jQuery.parseJSON( result ).resultAjax; 473 //chemin de l'image avec le nom 290 474 this.pathImg = jQuery.parseJSON( result ).pathImg; 291 475 //nom de l'image 476 this.nameImg = jQuery.parseJSON( result ).nameImg; 477 alert(this.nameImg); 478 479 //to do 292 480 if( !this.pathImg ) 293 481 setTimeout( jQuery.proxy( this.displayWindow, this ), 1000 ); … … 302 490 }, 303 491 492 onClickMoreOptions: function() 493 { 494 //test sur le nom et pas sur value pour eviter le pb des carateres speciaux 495 if (this.moreOptionsButton.getName() == "more") { 496 497 document.getElementById( "axeY2" ).style.display = ""; 498 document.getElementById( "scaleY2" ).style.display = ""; 499 document.getElementById( "meanValue" ).style.display = ""; 500 document.getElementById( "transition" ).style.display = ""; 501 document.getElementById( "NbCourbes" ).style.display = "none"; 502 503 this.moreOptionsButton.setName ("less"); 504 this.moreOptionsButton.setValue("Less options"); 505 } 506 else 507 { 508 if (this.moreOptionsButton.getName() == 'less') { 509 document.getElementById( "axeY2" ).style.display = "none"; 510 document.getElementById( "scaleY2" ).style.display = "none"; 511 document.getElementById( "meanValue" ).style.display = "none"; 512 document.getElementById( "transition" ).style.display = "none"; 513 document.getElementById( "NbCourbes" ).style.display = ""; 514 515 this.moreOptionsButton.setName ("more"); 516 this.moreOptionsButton.setValue("More options"); 517 } 518 } 519 520 }, 521 304 522 onClickDownload: function() 305 523 { … … 310 528 displayWindow: function() 311 529 { 312 var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName=bib.txt"><button class="dataProtocolDownloadButton">Download</button></a>'; 313 530 //var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName=bib.txt"><button class="dataProtocolDownloadButton">Download</button></a>'; 531 var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName=' + this.nameImg + '"><button class="dataProtocolDownloadButton">Download</button></a>'; 532 alert(content); 314 533 var $dialog = $( '<div></div>' ) 315 534 .html( content ) 316 535 .dialog( { 317 536 autoOpen: false, 318 title: " Titre",537 title: "GEISA : spectroscopic database", 319 538 minHeight: 500, 320 539 minWidth: 660
Note: See TracChangeset
for help on using the changeset viewer.