Changeset 816 for tapas/web/project/formTapas_script.jsp
- Timestamp:
- 03/12/15 12:28:06 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tapas/web/project/formTapas_script.jsp
r784 r816 3 3 4 4 5 var InterfaceTapas = Class.create( { 5 var InterfaceTapas; 6 InterfaceTapas = Class.create( { 6 7 initialize: function( jsonFileFormats, jsonYesNos, jsonObservatories, jsonSpectralUnits, jsonInstrumentalFunctions, jsonClimatoReferences ) 7 8 { … … 26 27 this.select_irextinctionList = new Object(); 27 28 this.select_ibervCList = new Object(); 29 this.select_iOneTransmissionList = new Object(); 28 30 29 31 this.jSonObservatories = jsonObservatories || false; … … 35 37 this.jSonClimatoReferences = jsonClimatoReferences || null; 36 38 this.selectClimatoReferencesList = new Object(); 39 this.dateTemp = "zz"; 37 40 this.nbRequest = 1; 38 41 this.tabActive = false; 39 42 this.numRequest = 1; 40 43 41 this.language = tapasTexts["language"] ; 42 this.browser="Firefox"; 43 44 if (navigator.userAgent.indexOf('Firefox') != -1 && parseFloat(navigator.userAgent.substring(navigator.userAgent.indexOf('Firefox') + 8)) >= 3.6){ 45 this.browser="Firefox"; 46 } 47 else if (navigator.userAgent.indexOf('Chrome') != -1 && parseFloat(navigator.userAgent.substring(navigator.userAgent.indexOf('Chrome') + 7).split(' ')[0]) >= 15){ 48 this.browser="Chrome"; 49 } 50 else if(navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Version') != -1 && parseFloat(navigator.userAgent.substring(navigator.userAgent.indexOf('Version') + 8).split(' ')[0]) >= 5){ 51 this.browser="Safari"; 44 45 this.language = tapasTexts["language"]; 46 this.browser = "Firefox"; 47 48 if( navigator.userAgent.indexOf( 'Firefox' ) != -1 && parseFloat( navigator.userAgent.substring( navigator.userAgent.indexOf( 'Firefox' ) + 8 ) ) >= 3.6 ) 49 { 50 this.browser = "Firefox"; 51 } 52 else if( navigator.userAgent.indexOf( 'Chrome' ) != -1 && parseFloat( navigator.userAgent.substring( navigator.userAgent.indexOf( 'Chrome' ) + 7 ).split( ' ' )[0] ) >= 15 ) 53 { 54 this.browser = "Chrome"; 55 } 56 else if( navigator.userAgent.indexOf( 'Safari' ) != -1 && navigator.userAgent.indexOf( 'Version' ) != -1 && parseFloat( navigator.userAgent.substring( navigator.userAgent.indexOf( 'Version' ) + 8 ).split( ' ' )[0] ) >= 5 ) 57 { 58 this.browser = "Safari"; 52 59 } 53 60 54 61 // Buttons 55 var submitButton = new Button( {value:tapasTexts["label.submitButton"], parent:this.containerCenter, id:"button_submit", className: " red_button", classNameText:"red_button_text", onClick:jQuery.proxy( this.onClickSubmit, this )} );62 var submitButton = new Button( {value:tapasTexts["label.submitButton"], parent:this.containerCenter, id:"button_submit", className: "tapas1", classNameText:"tapas1_text", onClick:jQuery.proxy( this.onClickSubmit, this )} ); 56 63 this.addRequestButton = new Button( {title:tapasTexts["label.title.add"],value:tapasTexts["label.addButton"], parent:this.containerCenter, id:"button_add", className: "positive", onClick:jQuery.proxy( this.onClickAdd, this )} ); 57 64 this.delRequestButton = new Button( {title:tapasTexts["label.title.del"],value:tapasTexts["label.delButton"], parent:this.containerCenter, id:"button_del", className: "negative", onClick:jQuery.proxy( this.onClickDel, this )} ); … … 59 66 60 67 this.createForm(); 68 61 69 this.tabActive = this.createTab(); 62 70 this.divE = $( document.createElement( "div" ) ); … … 76 84 param.className = "loading-classic"; 77 85 this.loadingRequest = new Loading( param ); 86 87 var nbr=1; 88 89 $( '#select_iobservatory_'+this.nbRequest ).bind( 'focus', ["1"], jQuery.proxy(this.locationChoice,this)); 90 78 91 //this.loadingRequest.display(); 79 92 }, … … 89 102 90 103 91 createCalendar: function( containerCalendar, texte, inputDateId, currentDate, isTrToCreate )104 createCalendar: function( containerCalendar, texte, texte2, inputDateId, inputDateId2, currentDate, isTrToCreate ) 92 105 { 93 106 if( isTrToCreate ) … … 97 110 var td1 = $( document.createElement( "td" ) ); 98 111 var td2 = $( document.createElement( "td" ) ); 112 var td3 = $( document.createElement( "td" ) ); 113 var td4 = $( document.createElement( "td" ) ); 99 114 var inputDate = $( document.createElement( "input" ) ); 100 115 inputDate.attr( {id:inputDateId, size:"17"} ); 116 117 var inputDate2 = $( document.createElement( "input" ) ); 118 inputDate2.attr( {id:inputDateId2, size:"17"} ); 101 119 102 120 td1.html( texte ); … … 104 122 tr.append( td1 ); 105 123 106 td2.attr( {colspan: 4} );124 td2.attr( {colspan:3} ); 107 125 td2.append( inputDate ); 108 126 tr.append( td2 ); 109 127 containerCalendar.append( tr ); 128 129 td3.html( texte2 ); 130 td3.attr( { class:"containerLabel" } ); 131 td3.attr( {colspan:2} ); 132 tr.append( td3 ); 133 134 td4.attr( {colspan:5} ); 135 td4.append( inputDate2 ); 136 inputDate2.bind( "change", jQuery.proxy(this.checkDate,this)); 137 inputDate.bind( "focusin", jQuery.proxy(this.tempDate,this)); 138 inputDate.bind( "focusout", jQuery.proxy(this.emptyCpyDate,this)); 139 tr.append( td4 ); 140 containerCalendar.append( tr ); 141 110 142 } 111 143 … … 178 210 createTr: function( texte, inputId, container, textesup, event, champ, ctnb, info ) 179 211 { 180 181 212 var tr = $( document.createElement( "tr" ) ); 182 213 var td1 = $( document.createElement( "td" ) ); … … 185 216 var input = $( document.createElement( "input" ) ); 186 217 187 input.attr( {id: inputId, class:"containerText" +ctnb, size:11} );188 189 190 if (event.length > 0) input.bind( event, [this, champ], this.angleChoice );218 input.attr( {id: inputId, class:"containerText" + ctnb, size:11} ); 219 220 221 if( event.length > 0 ) input.bind( event, [this, champ], this.angleChoice ); 191 222 192 223 … … 198 229 td2.append( input ); 199 230 231 td2.attr( {colspan:2} ); 232 200 233 tr.append( td2 ); 201 234 tr.append( td3 ); 202 235 container.append( tr ); 203 236 204 var re1 = new RegExp("isr_"); 205 var re2 = new RegExp("irp_"); 206 207 if (info && (inputId.match(re1) || inputId.match(re2))) { 237 238 239 var re1 = new RegExp( "isr_" ); 240 var re2 = new RegExp( "irp_" ); 241 242 if( info && (inputId.match( re1 ) || inputId.match( re2 )) ) 243 { 208 244 209 245 var img = $( document.createElement( "img" ) ); 210 246 var a = $( document.createElement( "a" ) ); 211 247 var div = $( document.createElement( "div" ) ); 212 img.attr("src","resources/images/info.png"); 213 img.attr("width","19"); 214 a.attr("style","cursor:pointer"); 215 216 img.bind("click",[inputId,450,100,this],this.onClickInfos); 217 a.append(img); 218 div.append(a); 219 248 img.attr( "src", "resources/images/info.png" ); 249 img.attr( "width", "19" ); 250 a.attr( "style", "cursor:pointer" ); 251 252 img.bind( "click", [inputId,450,100,this], this.onClickInfos ); 253 a.append( img ); 254 div.append( a ); 220 255 221 256 td1.append( a ); … … 223 258 tr.append( div ); 224 259 225 } 226 else if (info) { 260 if (inputId.match( re2 )) { 261 input.css("backgroundColor", "#bfafd6"); 262 input.attr('disabled','disabled'); 263 } 264 265 } 266 else if( info ) 267 { 227 268 var img = $( document.createElement( "img" ) ); 228 269 var a = $( document.createElement( "a" ) ); 229 img.attr( "src","resources/images/info.png");230 img.attr( "width","19");231 a.attr( "style","cursor:pointer");232 img.bind( "click",[inputId,450,100,this],this.onClickInfos);233 a.append( img);234 td1.append( a);270 img.attr( "src", "resources/images/info.png" ); 271 img.attr( "width", "19" ); 272 a.attr( "style", "cursor:pointer" ); 273 img.bind( "click", [inputId,450,100,this], this.onClickInfos ); 274 a.append( img ); 275 td1.append( a ); 235 276 td1.append( texte ); 236 277 237 278 } 279 280 238 281 }, 239 282 … … 241 284 createTrTxt: function( texte, container ) 242 285 { 243 var tr = $( document.createElement( "tr" ) ); 244 var td1 = $( document.createElement( "td" ) ); 245 246 td1.html( texte ); 247 td1.attr( {class:"containerLabelT", colspan:4} ); 248 249 tr.append( td1 ); 250 container.append( tr ); 251 252 253 }, 254 286 287 var tr = $( document.createElement( "tr" ) ); 288 var td1 = $( document.createElement( "td" ) ); 289 290 td1.html( texte ); 291 td1.attr( {class:"containerLabelT", colspan:4} ); 292 293 tr.append( td1 ); 294 container.append( tr ); 295 296 }, 255 297 256 298 … … 267 309 var input2 = $( document.createElement( "input" ) ); 268 310 269 270 311 input1.attr( {id: inputId1,class:"containerText",size:11} ); 271 312 input2.attr( {id: inputId2,class:"containerText",size:11} ); 272 273 313 274 314 td3.html( texte2 ); … … 276 316 var img = $( document.createElement( "img" ) ); 277 317 var a = $( document.createElement( "a" ) ); 278 img.attr( "src","resources/images/info.png");279 img.attr( "width","19");280 a.attr( "style","cursor:pointer");281 img.bind( "click",["spectral_range",450,100,this],this.onClickInfos);282 a.append( img);283 td1.append( a);284 318 img.attr( "src", "resources/images/info.png" ); 319 img.attr( "width", "19" ); 320 a.attr( "style", "cursor:pointer" ); 321 img.bind( "click", ["spectral_range",450,100,this], this.onClickInfos ); 322 a.append( img ); 323 td1.append( a ); 324 td1.append( texte1 ); 285 325 286 326 //img.onclick(this.onClickInfos("spectral_range",1200,440)); 287 327 288 328 td1.attr( {class:"containerLabel"} ); 289 td3.attr( {class:"containerLabel 3"} );329 td3.attr( {class:"containerLabel4"} ); 290 330 td5.attr( {class:"containerLabel2"} ); 291 331 … … 293 333 //td2.html( texte2 ); 294 334 td4.append( input2 ); 335 td4.attr( {colspan:2} ); 336 td5.attr( {colspan:2} ); 295 337 296 338 tr.append( td1 ); … … 304 346 305 347 306 307 createTrList: function( texte, inputId, index, container, type, info ) 348 createTr3Input: function( texte1, texte2, texte3, texte4, inputId1, inputId2, inputId3, inputId4, container, textesup, textesup2 ) 349 { 350 var tr = $( document.createElement( "tr" ) ); 351 var td1 = $( document.createElement( "td" ) ); 352 var td2 = $( document.createElement( "td" ) ); 353 var td3 = $( document.createElement( "td" ) ); 354 var td4 = $( document.createElement( "td" ) ); 355 var td5 = $( document.createElement( "td" ) ); 356 var td6 = $( document.createElement( "td" ) ); 357 var td7 = $( document.createElement( "td" ) ); 358 var td8 = $( document.createElement( "td" ) ); 359 var td9 = $( document.createElement( "td" ) ); 360 361 362 var input1 = $( document.createElement( "input" ) ); 363 var input2 = $( document.createElement( "input" ) ); 364 var input3 = $( document.createElement( "input" ) ); 365 var input4 = $( document.createElement( "input" ) ); 366 367 368 input1.attr( {id: inputId1,class:"containerText",size:14} ); 369 input2.attr( {id: inputId2,class:"containerText",size:4} ); 370 input3.attr( {id: inputId3,class:"containerText",size:4} ); 371 input4.attr( {id: inputId4,class:"containerText",size:4} ); 372 373 input1.bind( "change", ["2"], jQuery.proxy(this.locationChoice,this)); 374 input2.bind( "change", ["2"], jQuery.proxy(this.locationChoice,this)); 375 input3.bind( "change", ["2"], jQuery.proxy(this.locationChoice,this)); 376 input4.bind( "change", ["2"], jQuery.proxy(this.locationChoice,this)); 377 378 td3.html( texte2 ); 379 td5.html( texte3 ); 380 td7.html( texte4 ); 381 td9.html( textesup ); 382 383 384 385 var img = $( document.createElement( "img" ) ); 386 var a = $( document.createElement( "a" ) ); 387 img.attr( "src", "resources/images/info.png" ); 388 img.attr( "width", "19" ); 389 a.attr( "style", "cursor:pointer" ); 390 img.bind( "click", ["spectral_range",450,100,this], this.onClickInfos ); 391 a.append( img ); 392 td1.append( a ); 393 td1.append( texte1 ); 394 395 //img.onclick(this.onClickInfos("spectral_range",1200,440)); 396 397 td1.attr( {class:"containerLabel"} ); 398 td3.attr( {class:"containerLabel4"} ); 399 td5.attr( {class:"containerLabel2"} ); 400 td7.attr( {class:"containerLabel2"} ); 401 td9.attr( {class:"containerLabel2"} ); 402 403 404 405 td2.append( input1 ); 406 td4.append( input2 ); 407 td6.append( input3 ); 408 td8.append( input4 ); 409 td4.append( textesup2 ); 410 411 td2.attr( {colspan:2} ); 412 413 tr.append( td1 ); 414 tr.append( td2 ); 415 tr.append( td3 ); 416 tr.append( td4 ); 417 tr.append( td5 ); 418 tr.append( td6 ); 419 tr.append( td7 ); 420 tr.append( td8 ); 421 tr.append( td9 ); 422 423 container.append( tr ); 424 }, 425 426 427 createTrList: function( texte, inputId, index, container, type, info, event ) 308 428 { 309 429 var tr = $( document.createElement( "tr" ) ); … … 312 432 var td3 = $( document.createElement( "td" ) ); 313 433 var input = $( document.createElement( "input" ) ); 314 var champ ="";434 var champ = ""; 315 435 316 436 var div = $( document.createElement( "div" ) ); 317 437 318 319 438 input.attr( {id: inputId} ); 320 439 321 // alert(inputId);322 if( 'format' == type ){440 if( 'format' == type ) 441 { 323 442 this.displaySelect( td2, inputId, index, this.jSonFileFormats, this.selectFileFormatsList, false, null ); 324 443 info = true; 325 444 champ = "iformat_"; 326 327 445 } 328 446 else … … 338 456 this.displaySelect( td2, inputId, index, this.jSonYesNos, this.select_ico2eList, false, "yesNos" ); 339 457 else if( (/^(ich4e_[1-9]+)$/.test( inputId ) ) ) 340 this.displaySelect( td2, inputId, index, this.jSonYesNos, this.select_ich4eList, false, "yesNos" );458 this.displaySelect( td2, inputId, index, this.jSonYesNos, this.select_ich4eList, false, "yesNos" ); 341 459 else if( (/^(in2oe_[1-9]+)$/.test( inputId ) ) ) 342 460 this.displaySelect( td2, inputId, index, this.jSonYesNos, this.select_in2oeList, false, "yesNos" ); 343 else if( (/^(irextinction_[1-9]+)$/.test( inputId ) ) ) { 461 else if( (/^(iOneTransmission_[1-9]+)$/.test( inputId ) ) ) 462 this.displaySelect( td2, inputId, index, this.jSonYesNos, this.select_iOneTransmissionList, false, "yesNos" ); 463 else if( (/^(irextinction_[1-9]+)$/.test( inputId ) ) ) 464 { 344 465 345 466 this.displaySelect( td2, inputId, index, this.jSonYesNos, this.select_irextinctionList, false, "yesNos" ); 346 467 info = true; 347 champ=inputId; 348 } 349 else if( (/^(ibervC_[1-9]+)$/.test( inputId ) ) ) { 468 champ = inputId; 469 } 470 else if( (/^(ibervC_[1-9]+)$/.test( inputId ) ) ) 471 { 350 472 this.displaySelect( td2, inputId, index, this.jSonYesNos, this.select_ibervCList, false, "yesNos" ); 351 473 info = true; 352 champ=inputId; 353 } 354 } 355 else if( 'observatories' == type ) { 356 474 champ = inputId; 475 476 } 477 } 478 else if( 'observatories' == type ) 479 { 357 480 this.displaySelect1( td2, inputId, index, this.jSonObservatories, this.selectObservatoriesList, true, "observatories" ); 358 481 //this.displaySelect( td2, inputId, index, this.jSonObservatories, this.selectObservatoriesList, true, "observatories" ); 359 360 champ="iobservatory_"; 361 } 362 else if( 'spectralUnit' == type ) { 482 champ = "iobservatory_"; 483 //input.bind( 'click', [this, 'select_iobservatory_1'], this.locationChoice ); 484 } 485 else if( 'spectralUnit' == type ) 486 { 363 487 this.displaySelect( td2, inputId, index, this.jSonSpectralUnits, this.selectSpectralUnitsList, true, "spectralUnits" ); 364 488 info = true; … … 366 490 champ = "ispectral_choice_"; 367 491 } 368 else if( 'ilsf' == type ) { 492 else if( 'ilsf' == type ) 493 { 369 494 this.displaySelect( td2, inputId, index, this.jSonInstrumentalFunctions, this.selectInstrumentalFunctionsList, false, "instrumentalFunctions" ); 370 495 info = true; 371 496 champ = "ifunction_"; 372 497 } 373 else if( 'climatoReference' == type ) { 498 else if( 'climatoReference' == type ) 499 { 374 500 this.displaySelect( td2, inputId, index, this.jSonClimatoReferences, this.selectClimatoReferencesList, false, "climatoReferences" ); 375 501 info = true; … … 377 503 } 378 504 505 506 379 507 td1.attr( {class:"containerLabel"} ); 380 508 tr.append( td1 ); 381 509 382 510 383 if (info) { 511 512 513 if( info ) 514 { 384 515 var img = $( document.createElement( "img" ) ); 385 516 var a = $( document.createElement( "a" ) ); 386 img.attr("src","resources/images/info.png"); 387 img.attr("width","19"); 388 a.attr("style","cursor:pointer"); 389 390 img.bind("click",[champ,450,100,this],this.onClickInfos); 391 a.append(img); 392 div.append(a); 393 394 395 td2.attr( {colspan:5} ); 517 img.attr( "src", "resources/images/info.png" ); 518 img.attr( "width", "19" ); 519 a.attr( "style", "cursor:pointer" ); 520 img.bind( "click", [champ,450,100,this], this.onClickInfos ); 521 a.append( img ); 522 div.append( a ); 523 524 525 td2.attr( {colspan:10} ); 396 526 td1.append( a ); 397 527 td1.append( texte ); … … 400 530 401 531 } 402 else { 532 else 533 { 403 534 td1.append( texte ); 404 535 td2.attr( {colspan:3} ); … … 406 537 } 407 538 container.append( tr ); 539 408 540 }, 409 541 … … 439 571 440 572 // EVENTS ******************************************************** 441 onClickInfos: function(param) 442 { 443 444 var parametre=param.data[0]; 445 var width=param.data[1]; 446 var height=param.data[2]; 447 var context=param.data[3]; 448 449 if ("spectral_range" == parametre) { 450 width=600; 451 height=120; 573 onClickInfos: function( param ) 574 { 575 576 var parametre = param.data[0]; 577 var width = param.data[1]; 578 var height = param.data[2]; 579 var context = param.data[3]; 580 581 if( "spectral_range" == parametre ) 582 { 583 width = 600; 584 height = 120; 452 585 var titre = "Définition de l'intervalle spectral pour le calcul."; 453 586 var pageInfo = "resources/doc/infosSpectralRange_fr.txt"; 454 587 455 if( "fr" != context.language ) { 588 if( "fr" != context.language ) 589 { 456 590 titre = "Definition of spectral interval for the computation."; 457 591 pageInfo = "resources/doc/infosSpectralRange_en.txt"; 458 width=600; 459 height=100; 460 } 461 462 } 463 464 if ("ispectral_choice_" == parametre) { 592 width = 600; 593 height = 100; 594 } 595 596 } 597 598 if( "ispectral_choice_" == parametre ) 599 { 465 600 var titre = "Unité spectrale"; 466 601 var pageInfo = "resources/doc/infosSpectralUnit_fr.txt"; 467 width=600; 468 height=450; 469 if( "fr" != context.language ) { 602 width = 600; 603 height = 450; 604 if( "fr" != context.language ) 605 { 470 606 titre = "Spectral unit"; 471 607 pageInfo = "resources/doc/infosSpectralUnit_en.txt"; 472 width=500; 473 height=450; 474 } 475 } 476 477 var re = new RegExp("irp_"); 478 if (parametre.match(re)) { 608 width = 500; 609 height = 450; 610 } 611 } 612 613 var re = new RegExp( "irp_" ); 614 if( parametre.match( re ) ) 615 { 479 616 var titre = "Résolution"; 480 617 var pageInfo = "resources/doc/infosResolution_fr.txt"; 481 width=600; 482 height=200; 483 if( "fr" != context.language ) { 618 width = 600; 619 height = 200; 620 if( "fr" != context.language ) 621 { 484 622 titre = "Resolution power"; 485 623 pageInfo = "resources/doc/infosResolution_en.txt"; 486 width=500; 487 height=200; 488 } 489 } 490 491 var re = new RegExp("isr_"); 492 if (parametre.match(re)) { 624 width = 500; 625 height = 200; 626 } 627 } 628 629 var re = new RegExp( "isr_" ); 630 if( parametre.match( re ) ) 631 { 493 632 var titre = "Taux d'échantillonnage"; 494 633 var pageInfo = "resources/doc/infosSamplingRatio_fr.txt"; 495 width=600; 496 height=100; 497 if( "fr" != context.language ) { 634 width = 600; 635 height = 100; 636 if( "fr" != context.language ) 637 { 498 638 titre = "Sampling ratio"; 499 639 pageInfo = "resources/doc/infosSamplingRatio_en.txt"; 500 width=500; 501 height=100; 502 } 503 } 504 505 var re = new RegExp("ibervC_"); 506 if (parametre.match(re)) { 640 width = 500; 641 height = 100; 642 } 643 } 644 645 var re = new RegExp( "ibervC_" ); 646 if( parametre.match( re ) ) 647 { 507 648 var titre = "Correction BERV"; 508 649 var pageInfo = "resources/doc/infosBERV_fr.txt"; 509 width=950; 510 height=700; 511 if( "fr" != context.language ) { 650 width = 950; 651 height = 700; 652 if( "fr" != context.language ) 653 { 512 654 titre = "BERV correction"; 513 655 pageInfo = "resources/doc/infosBERV_en.txt"; 514 width=950; 515 height=680; 516 } 517 } 518 519 var re = new RegExp("ira_"); 520 if (parametre.match(re)) { 656 width = 950; 657 height = 680; 658 } 659 } 660 661 var re = new RegExp( "ira_" ); 662 if( parametre.match( re ) ) 663 { 521 664 var titre = "LOS Ascension Droite"; 522 665 var pageInfo = "resources/doc/infosLOSRA_fr.txt"; 523 width=600; 524 height=150; 525 if( "fr" != context.language ) { 666 width = 600; 667 height = 150; 668 if( "fr" != context.language ) 669 { 526 670 titre = "LOS Right Ascension"; 527 671 pageInfo = "resources/doc/infosLOSRA_en.txt"; 528 width=500; 529 height=150; 530 } 531 } 532 533 var re = new RegExp("ide_"); 534 if (parametre.match(re)) { 672 width = 500; 673 height = 150; 674 } 675 } 676 677 var re = new RegExp( "ide_" ); 678 if( parametre.match( re ) ) 679 { 535 680 var titre = "LOS Déclinaison"; 536 681 var pageInfo = "resources/doc/infosLOSD_fr.txt"; 537 width=600; 538 height=100; 539 if( "fr" != context.language ) { 682 width = 600; 683 height = 100; 684 if( "fr" != context.language ) 685 { 540 686 titre = "LOS Declination"; 541 687 pageInfo = "resources/doc/infosLOSD_en.txt"; 542 width=600; 543 height=100; 544 } 545 } 546 547 var re = new RegExp("iza_"); 548 if (parametre.match(re)) { 688 width = 600; 689 height = 100; 690 } 691 } 692 693 var re = new RegExp( "iza_" ); 694 if( parametre.match( re ) ) 695 { 549 696 var titre = "Angle zénithal"; 550 697 var pageInfo = "resources/doc/infosZenithalAngle_fr.txt"; 551 width=600; 552 height=100; 553 if( "fr" != context.language ) { 698 width = 600; 699 height = 100; 700 if( "fr" != context.language ) 701 { 554 702 titre = "Zenithal angle"; 555 703 pageInfo = "resources/doc/infosZenithalAngle_en.txt"; 556 width=600; 557 height=100; 558 } 559 } 560 561 var re = new RegExp("isr_"); 562 if (parametre.match(re)) { 704 width = 600; 705 height = 100; 706 } 707 } 708 709 var re = new RegExp( "isr_" ); 710 if( parametre.match( re ) ) 711 { 563 712 var titre = "Taux d'échantillonnage"; 564 713 var pageInfo = "resources/doc/infosSamplingRatio_fr.txt"; 565 width=600; 566 height=150; 567 if( "fr" != context.language ) { 714 width = 600; 715 height = 150; 716 if( "fr" != context.language ) 717 { 568 718 titre = "Sampling Ratio"; 569 719 pageInfo = "resources/doc/infosSamplingRatio_en.txt"; 570 width=500; 571 height=150; 572 } 573 } 574 575 var re = new RegExp("irextinction_"); 576 if (parametre.match(re)) { 720 width = 500; 721 height = 150; 722 } 723 } 724 725 var re = new RegExp( "irextinction_" ); 726 if( parametre.match( re ) ) 727 { 577 728 var titre = "Sélection des composants atmosphériques"; 578 729 var pageInfo = "resources/doc/infosSpecies_fr.txt"; 579 width=600; 580 height=350; 581 if( "fr" != context.language ) { 730 width = 600; 731 height = 350; 732 if( "fr" != context.language ) 733 { 582 734 titre = "Selection of atmospheric constituents"; 583 735 pageInfo = "resources/doc/infosSpecies_en.txt"; 584 width=600; 585 height=360; 586 } 587 } 588 589 if ("icr_" == parametre) { 736 width = 600; 737 height = 360; 738 } 739 } 740 741 if( "icr_" == parametre ) 742 { 590 743 var titre = "Modèle atmosphérique"; 591 744 var pageInfo = "resources/doc/infosAtmosphericModel_fr.txt"; 592 width=600; 593 height=400; 594 if( "fr" != context.language ) { 745 width = 600; 746 height = 400; 747 if( "fr" != context.language ) 748 { 595 749 titre = "Atmospheric model"; 596 750 pageInfo = "resources/doc/infosAtmosphericModel_en.txt"; 597 width=500; 598 height=400; 599 } 600 } 601 602 if ("iobservatory_" == parametre) { 751 width = 500; 752 height = 400; 753 } 754 } 755 756 if( "iobservatory_" == parametre ) 757 { 603 758 var titre = "Observatoire"; 604 759 var pageInfo = "resources/doc/infosObservatory_fr.txt"; 605 width=600; 606 height=100; 607 if( "fr" != context.language ) { 760 width = 600; 761 height = 100; 762 if( "fr" != context.language ) 763 { 608 764 titre = "Observatory"; 609 765 pageInfo = "resources/doc/infosObservatory_en.txt"; 610 width=500; 611 height=100; 612 } 613 } 614 615 if ("iformat_" == parametre) { 766 width = 500; 767 height = 100; 768 } 769 } 770 771 if( "iformat_" == parametre ) 772 { 616 773 var titre = "Format fichier"; 617 774 var pageInfo = "resources/doc/infosFileFomat_fr.txt"; 618 width=600; 619 height=100; 620 if( "fr" != context.language ) { 775 width = 600; 776 height = 100; 777 if( "fr" != context.language ) 778 { 621 779 titre = "File format"; 622 780 pageInfo = "resources/doc/infosFileFomat_en.txt"; 623 width=500; 624 height=80; 625 } 626 } 627 628 if ("ifunction_" == parametre) { 781 width = 500; 782 height = 80; 783 } 784 } 785 786 if( "ifunction_" == parametre ) 787 { 629 788 var titre = "Fonction instrumentale"; 630 789 var pageInfo = "resources/doc/infosInstrumentalFunction_fr.txt"; 631 width=600; 632 height=230; 633 if( "fr" != context.language ) { 790 width = 600; 791 height = 230; 792 if( "fr" != context.language ) 793 { 634 794 titre = "Instrumental function"; 635 795 pageInfo = "resources/doc/infosInstrumentalFunction_en.txt"; 636 width =500;637 height =240;796 width = 500; 797 height = 240; 638 798 } 639 799 } … … 642 802 var $dialog = $( '<div></div>' ) 643 803 .load( pageInfo ) 644 645 autoOpen: false,646 title:titre,647 height:height,648 width:width649 } );804 .dialog( { 805 autoOpen: false, 806 title:titre, 807 height:height, 808 width:width 809 } ); 650 810 651 811 $dialog.dialog( 'open' ); … … 697 857 $( "#tab_request" + numCurrent ).remove(); 698 858 AnyTime.noPicker( "iobservation_date_" + numCurrent ); 859 AnyTime.noPicker( "iobservation_cpydate_" + numCurrent ); 699 860 AnyTime.noPicker( "ira_" + numCurrent ); 700 861 … … 760 921 this.select_in2oeList[i] = null; 761 922 923 this.select_iOneTransmissionList[z] = this.select_iOneTransmissionList[i]; 924 this.select_iOneTransmissionList[i] = null; 925 762 926 this.select_ibervCList[z] = this.select_ibervCList[i]; 763 927 this.select_ibervCList[i] = null; … … 765 929 // Supression du calendrier puis re-création en insérant l'ancienne date 766 930 var oldDate = this.calendarConverter.parse( $( "#iobservation_date_" + i ).val() ); 767 //var oldDate = $( "#iobservation_date_" + i ).val();768 769 931 AnyTime.noPicker( "iobservation_date_" + i ); 932 933 if (!isEmpty($( "#iobservation_cpydate_" + i ).val())) { 934 var oldDate2 = this.calendarConverter.parse( $( "#iobservation_cpydate_" + i ).val() ); 935 AnyTime.noPicker( "iobservation_cpydate_" + i ); 936 } 937 770 938 //this.createCalendar( $( "#tabObservation_" + z ), tapasTexts["label.datemesure"], "iobservation_date_" + z, oldDate, false ); 771 939 772 940 $( "#iobservation_date_" + i ).attr( {id:"iobservation_date_" + z} ); 773 this.createCalendar( $( "#tabObservation_" + z ), tapasTexts["label.datemesure"], "iobservation_date_" + z, oldDate, false ); 774 //this.createCalendar( $( "#tabObservation_" + z ), tapasTexts["label.datemesure"], "iobservation_date_" + z, false, false ); 941 $( "#iobservation_cpydate_" + i ).attr( {id:"iobservation_cpydate_" + z} ); 942 this.createCalendar( $( "#tabObservation_" + z ), tapasTexts["label.datemesure"], tapasTexts["label.cpydatemesure"], "iobservation_date_" + z, "iobservation_cpydate_" + z, oldDate, false ); 943 944 775 945 776 946 // Idem pour les heures !!! … … 778 948 // var oldTime = this.timeConverter.parse( $( "#ira_" + i ).val() ); 779 949 /*var oldTime = $( "#ira_" + i ).val(); 780 AnyTime.noPicker( "ira_" + i );781 this.createTime( $( "#tabObservation_" + z ), tapasTexts["label.ira"], "ira_" + z, oldTime, false,"j2000" );782 $( "#ira_" + i ).attr( {id:"ira_" + z} );*/950 AnyTime.noPicker( "ira_" + i ); 951 this.createTime( $( "#tabObservation_" + z ), tapasTexts["label.ira"], "ira_" + z, oldTime, false,"j2000" ); 952 $( "#ira_" + i ).attr( {id:"ira_" + z} );*/ 783 953 } 784 954 } … … 828 998 paramSelect.parent = container; 829 999 var select = new Select( paramSelect ); 1000 1001 1002 //select.add( "tt", "bob " + tapasTexts["text.select"] + " --",this.ifunctionChoice); 1003 830 1004 if( nullValueIsNeeded ) 831 1005 select.add( "-1", "-- " + tapasTexts["text.select"] + " --" ); … … 841 1015 break; 842 1016 case "instrumentalFunctions" : 1017 select.add( jsonElement.value, tapasTexts[jsonElement.text],jQuery.proxy(this.ifunctionChoice,this) ); // passe le gros this 1018 break; 843 1019 case "climatoReferences" : 844 1020 case "yesNos" : … … 847 1023 default: 848 1024 select.add( jsonElement.value, jsonElement.text ); 1025 849 1026 break; 850 1027 } … … 857 1034 { 858 1035 859 $( "#select_iobservatory_" +this.nbRequest ).autocomplete( {1036 $( "#select_iobservatory_" + this.nbRequest ).autocomplete( { 860 1037 source: this.listObs, 861 appendTo: "#regionContent" +this.nbRequest,1038 appendTo: "#regionContent" + this.nbRequest, 862 1039 minLength: 0, 863 1040 autoFocus: true, … … 880 1057 displaySelect1: function( container, id, index, jsonList, selectList, nullValueIsNeeded, contentManage ) 881 1058 { 882 //alert("ok");883 1059 var iselect = $( document.createElement( "select" ) ); 884 var option = document.createElement( "option");1060 var option = document.createElement( "option" ); 885 1061 886 1062 var paramSelect = new Object(); … … 888 1064 paramSelect.parent = container; 889 1065 890 var observatoryArray =new Array();891 this.listObs =new Array();1066 var observatoryArray = new Array(); 1067 this.listObs = new Array(); 892 1068 893 1069 894 1070 //var bob =$('<div id="region" class="containerField"><div class="containerTitle"><div class="containerTitleText">Region</div><div class="containerTitleClose"><img src="img/close.png"></div></div><div class="containerRegion"><input id="regionTags" size="23"/></div><div id="regionContent"></div></div> '); 895 var bob =$('<div class="containerField"><input id="select_'+id+'" size="42"/></div><div id="regionContent'+this.nbRequest+'" class="regionContent"></div> '); 896 897 //alert('<div class=containerField><input id=select_'+id+' size=23/></div><div id=regionContent></div> '); 898 899 //var select = new Select( paramSelect ); 900 //iselect.options.add("1","1"); 901 //if( nullValueIsNeeded ) Select1 1071 var bob = $( '<div class="containerField"><input id="select_' + id + '" size="42"/></div><div id="regionContent' + this.nbRequest + '" class="regionContent"></div> ' ); 902 1072 903 1073 var option = new Option(); 904 1074 option.text = "-- " + tapasTexts["text.select"] + " --"; 905 1075 option.value = "-1"; 906 iselect.append( option ); 1076 907 1077 908 1078 jQuery.each( jsonList, jQuery.proxy( function ( i, jsonElement ) 909 1079 { 910 //ajouter fonction 911 912 /*var option = new Option(); 913 option.text = jsonElement.name; 914 option.value = jsonElement.id;*/ 915 //observatoryArray.push(jsonElement.name); 916 this.listObs.push(jsonElement.name); 917 //console.log(option.value+"-"+option.text); 918 //iselect.append(option); 919 1080 //ajouter fonction 1081 1082 /*var option = new Option(); 1083 option.text = jsonElement.name; 1084 option.value = jsonElement.id;*/ 1085 //observatoryArray.push(jsonElement.name); 1086 this.listObs.push( jsonElement.name ); 1087 //console.log(option.value+"-"+option.text); 1088 //iselect.append(option); 920 1089 921 1090 }, this ) ); … … 923 1092 /*selectList[index] = select;*/ 924 1093 //container.append(iselect); 925 container.append(bob); 926 selectList[index]="select_"+id; 1094 1095 container.append( bob ); 1096 selectList[index] = "select_" + id; 1097 927 1098 928 1099 }, … … 937 1108 createForm: function() 938 1109 { 939 940 941 1110 942 1111 var divAll = $( document.createElement( "div" ) ); … … 981 1150 divAll.append( divObservation ); 982 1151 983 984 1152 divAtmosphere.append( tabAtmosphere ); 985 1153 //divAtmosphere.addClass("divAtmosphere"); … … 995 1163 //this.tabInput = new Array(3); 996 1164 997 this.createTrList( tapasTexts["label.format"], "iformat_" + this.nbRequest, this.nbRequest, tabPreference, 'format' ); 998 this.createTrList( tapasTexts["label.era"], "irextinction_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 999 this.createTrList( tapasTexts["label.eh2o"], "ih2oe_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1000 this.createTrList( tapasTexts["label.eo3"], "io3e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1001 this.createTrList( tapasTexts["label.eo2"], "io2e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1002 this.createTrList( tapasTexts["label.eco2"], "ico2e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1003 this.createTrList( tapasTexts["label.ech4"], "ich4e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1004 this.createTrList( tapasTexts["label.en2o"], "in2oe_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1005 this.createTrList( tapasTexts["label.berv"], "ibervC_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1006 1007 this.createTrList( tapasTexts["label.observatory"], "iobservatory_" + this.nbRequest, this.nbRequest, tabObservation, 'observatories',true ); 1008 this.createCalendar( tabObservation, tapasTexts["label.datemesure"], "iobservation_date_" + this.nbRequest, false, true ); 1165 this.createTrList( tapasTexts["label.format"], "iformat_" + this.nbRequest, this.nbRequest, tabPreference, 'format',false,"" ); 1166 this.createTrList( tapasTexts["label.berv"], "ibervC_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno',false,"" ); 1167 this.createTrList( tapasTexts["label.era"], "irextinction_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno',false,"" ); 1168 this.createTrList( tapasTexts["label.eh2o"], "ih2oe_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno',false,"" ); 1169 this.createTrList( tapasTexts["label.eo3"], "io3e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno',false,"" ); 1170 this.createTrList( tapasTexts["label.eo2"], "io2e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno',false,"" ); 1171 this.createTrList( tapasTexts["label.eco2"], "ico2e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno',false,"" ); 1172 this.createTrList( tapasTexts["label.ech4"], "ich4e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno',false,"" ); 1173 this.createTrList( tapasTexts["label.en2o"], "in2oe_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno',false,"" ); 1174 this.createTrList( tapasTexts["label.onetransmission"], "iOneTransmission_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno',false,"" ); 1175 1176 1177 1178 this.createTrList( tapasTexts["label.observatory"], "iobservatory_" + this.nbRequest, this.nbRequest, tabObservation, 'observatories', true, "" ); 1179 this.createTrTxt( tapasTexts["label.or"], tabObservation ); 1180 this.createTr3Input( tapasTexts["label.locality"], tapasTexts["label.altitude"], tapasTexts["label.latitude"],tapasTexts["label.longitude"],"ilocality_" + this.nbRequest, "ialtitude_" + this.nbRequest, "ilatitude_" + this.nbRequest, "ilongitude_" + this.nbRequest , tabObservation, "[decimal]"," m" ); 1181 1182 this.createCalendar( tabObservation, tapasTexts["label.datemesure"], tapasTexts["label.cpydatemesure"], "iobservation_date_" + this.nbRequest, "iobservation_cpydate_" + this.nbRequest, false, true ); 1183 1009 1184 1010 1185 //unite 1011 this.createTrList( tapasTexts["label.spectralUnit"], "ispectral_choice_" + this.nbRequest, this.nbRequest, tabObservation, 'spectralUnit' );1186 this.createTrList( tapasTexts["label.spectralUnit"], "ispectral_choice_" + this.nbRequest, this.nbRequest, tabObservation, 'spectralUnit', false, "" ); 1012 1187 this.createTr2Input( tapasTexts["label.spectralRange"], tapasTexts["label.to"], "iminspectral_ranger_" + this.nbRequest, "imaxspectral_ranger_" + this.nbRequest, tabObservation, "[350,2500] nm" ); 1013 1188 1014 1189 //fonction instrumentale 1015 this.createTrList( tapasTexts["label.ifunction"], "ifunction_" + this.nbRequest, this.nbRequest, tabObservation, "ilsf" 1190 this.createTrList( tapasTexts["label.ifunction"], "ifunction_" + this.nbRequest, this.nbRequest, tabObservation, "ilsf", false, "select"); 1016 1191 //reference climato 1017 1192 //this.createTrList( tapasTexts["label.climato"], "icr", tabAtmosphere, "climatoReference" ); 1018 this.createTrList( tapasTexts["label.climato"], "icr_" + this.nbRequest, this.nbRequest, tabObservation, "climatoReference" ); 1019 1020 1021 this.createTr( tapasTexts["label.resolution"], "irp_" + this.nbRequest, tabObservation, "", "", "","",true ); 1022 this.createTr( tapasTexts["label.ratio"], "isr_" + this.nbRequest, tabObservation, "", "","","",true ); 1023 1024 1025 this.createTr( tapasTexts["label.ira"], "ira_" + this.nbRequest,tabObservation,"hh:mm:ss (J2000)","keypress","ra","2",true ); 1193 this.createTrList( tapasTexts["label.climato"], "icr_" + this.nbRequest, this.nbRequest, tabObservation, "climatoReference", false, ""); 1194 1195 this.createTr( tapasTexts["label.resolution"], "irp_" + this.nbRequest, tabObservation, "", "", "", "", true ); 1196 this.createTr( tapasTexts["label.ratio"], "isr_" + this.nbRequest, tabObservation, "", "", "", "", true ); 1197 1198 this.createTr( tapasTexts["label.ira"], "ira_" + this.nbRequest, tabObservation, "hh:mm:ss (J2000)", "keypress", "ra", "2", true ); 1026 1199 //this.createTime( tabObservation, tapasTexts["label.ira"], "ira_" + this.nbRequest, false, true,"hh:mm:ss (J2000)" ); 1027 this.createTr( tapasTexts["label.ide"], "ide_" + this.nbRequest, tabObservation, "deg:':''", "keypress","de","2",true );1200 this.createTr( tapasTexts["label.ide"], "ide_" + this.nbRequest, tabObservation, "deg:':''", "keypress", "de", "2", true ); 1028 1201 this.createTrTxt( tapasTexts["label.or"], tabObservation ); 1029 this.createTr( tapasTexts["label.iza"], "iza_" + this.nbRequest, tabObservation, "[0,90] °", "keypress","za","2",true );1202 this.createTr( tapasTexts["label.iza"], "iza_" + this.nbRequest, tabObservation, "[0,90] °", "keypress", "za", "2", true ); 1030 1203 1031 1204 this.createAutoCompleteMenuForRegions(); 1032 1205 1033 1206 this.initRequestFields(); 1207 1208 1209 1210 1034 1211 //jQuery.proxy permet d'envoyer le contexte this courant 1035 1212 … … 1037 1214 1038 1215 1216 1039 1217 createTapasObject: function() 1040 1218 { 1041 1219 1042 1220 var requests = new Array(); 1221 var i = 1; 1222 1223 1043 1224 1044 1225 for( var i = 1; i <= this.nbRequest; i++ ) … … 1085 1266 preference.bervCorrection.secondValue = this.select_ibervCList[i].getValue(); 1086 1267 1268 preference.oneTransmission = new Object(); 1269 preference.oneTransmission.firstValue = this.select_iOneTransmissionList[i].getValuesInString(); 1270 preference.oneTransmission.secondValue = this.select_iOneTransmissionList[i].getValue(); 1271 1087 1272 1088 1273 // OBSERVATION … … 1091 1276 //observatory.id = this.selectObservatoriesList[i].getValue(); 1092 1277 //observatory.id = 2; 1093 observatory.name = $("#select_iobservatory_"+i).val(); 1278 observatory.name = $( "#select_iobservatory_" + i ).val(); 1279 1280 1281 var location = new Object(); 1282 location.name = $( "#ilocality_" + i ).val(); 1283 location.longitude = $( "#ilongitude_" + i ).val(); 1284 location.latitude = $( "#ilatitude_" + i ).val(); 1285 location.altitude = $( "#ialtitude_" + i ).val(); 1286 location.shortName = $( "#ilocality_" + i ).val(); 1094 1287 1095 1288 // Los … … 1097 1290 1098 1291 //if ($( "#iza_" + i ).val().toString() != null) 1099 1292 los.zenithAngle = $( "#iza_" + i ).val(); 1100 1293 //else { 1101 1102 1294 los.raJ2000 = $( "#ira_" + i ).val(); 1295 los.decJ2000 = $( "#ide_" + i ).val(); 1103 1296 //} 1104 1297 … … 1131 1324 1132 1325 var observation = new Object(); 1133 observation.date = this.calendarConverter.parse( $( "#iobservation_date_" + i ).val() ).getTime(); 1326 1327 if (!isEmpty($( "#iobservation_cpydate_" + i ).val()) && isDate($("#iobservation_cpydate_" + i ).val()) ) 1328 { 1329 observation.date = this.calendarConverter.parse( $( "#iobservation_cpydate_" + i ).val() ).getTime(); 1330 } 1331 else 1332 { 1333 observation.date = this.calendarConverter.parse( $( "#iobservation_date_" + i ).val() ).getTime(); 1334 } 1134 1335 1135 1336 1136 1337 observation.observatory = observatory; 1338 1339 observation.location = location; 1137 1340 1138 1341 observation.los = los; … … 1165 1368 validFields: function() 1166 1369 { 1370 1167 1371 for( var i = 1; i <= this.nbRequest; i++ ) 1168 1372 { 1169 1373 1170 1374 var chaine = tapasTexts["text.erreur.saisie"] + " " + i + "<br>"; 1171 var testOk1=false; 1172 var testOk2=false; 1173 var testOk3=false; 1375 var testOk1 = false; 1376 var testOk2 = false; 1377 var testOk3 = false; 1378 1379 testOk1 = isDate( $( "#iobservation_cpydate_" + this.nbRequest ).val() ) || isEmpty( $( "#iobservation_cpydate_" + this.nbRequest ).val() ); 1380 if( !testOk1 ) 1381 { 1382 this.divE.hide(); 1383 this.divE.html( chaine + " : " + tapasTexts["text.errcpydate"] ); 1384 this.divE.show(); 1385 return false; 1386 } 1387 1388 1174 1389 //var testOk = isSup( this.selectObservatoriesList[i].getValue(), 0 ); 1175 var testOk = isEmpty($( "#select_iobservatory_" + i ).val()) || this.listObs.indexOf($( "#select_iobservatory_" + i ).val())<0; 1176 //alert(testOk); 1177 if( testOk ) 1178 { 1179 this.divE.html( chaine + tapasTexts["label.observatory"] + " : " + tapasTexts["text.toselect"] ); 1390 var testOk = isEmpty( $( "#select_iobservatory_" + i ).val() ) || this.listObs.indexOf( $( "#select_iobservatory_" + i ).val() ) < 0; 1391 testOk2 = !isEmpty( $( "#ilocality_" + i ).val() ) && isValidNum( $( "#ialtitude_" + i ).val() ) && isValidNum( $( "#ilatitude_" + i ).val() ) && isValidNum( $( "#ilongitude_" + i ).val() ) 1392 1393 if( testOk && !testOk2) 1394 { 1395 this.divE.hide(); 1396 this.divE.html( chaine + " " + tapasTexts["text.selectlocation"] ); 1180 1397 this.divE.show(); 1181 1398 return false; … … 1199 1416 1200 1417 /*testOk = isDeg( $( "#ide_" + i ).val() ); 1201 if( !testOk )1202 {1203 1204 1205 1206 } */1418 if( !testOk ) 1419 { 1420 this.divE.html( chaine + tapasTexts["label.ide"] + " : " + tapasTexts["text.badvalue"] ); 1421 this.divE.show(); 1422 return false; 1423 } */ 1207 1424 1208 1425 1209 1426 testOk = isBetween( $( "#iza_" + i ).val(), 0, 90 ); 1210 testOk1 = isValidNum( $( "#iza_" + i ).val() );1211 testOk2 = isDeg( $( "#ide_" + i ).val() );1212 testOk3 = isHourDeg( $( "#ira_" + i ).val() );1427 testOk1 = isValidNum( $( "#iza_" + i ).val() ); 1428 testOk2 = isDeg( $( "#ide_" + i ).val() ); 1429 testOk3 = isHourDeg( $( "#ira_" + i ).val() ); 1213 1430 if( !((testOk && testOk1) || (testOk2 && testOk3)) ) 1214 1431 { 1215 if 1432 if( !(testOk && testOk1) ) 1216 1433 this.divE.html( chaine + "LOS : " + tapasTexts["text.badvalue"] ); 1217 1434 else … … 1222 1439 1223 1440 /*testOk = isBetween( $( "#iza_" + i ).val(), 0, 90 ); 1224 if( !testOk ) 1225 { 1226 this.divE.html( chaine + tapasTexts["label.iza"] + " : " + tapasTexts["text.badvalue"] ); 1227 this.divE.show(); 1228 return false; 1229 } */ 1441 if( !testOk ) 1442 { 1443 this.divE.html( chaine + tapasTexts["label.iza"] + " : " + tapasTexts["text.badvalue"] ); 1444 this.divE.show(); 1445 return false; 1446 } */ 1447 1230 1448 1231 1449 testOk = isValidNum( $( "#irp_" + i ).val() ); 1232 if( !testOk ) 1233 { 1234 this.divE.html( chaine + tapasTexts["label.resolution"] + " : " + tapasTexts["text.badvalue"] ); 1235 this.divE.show(); 1236 return false; 1237 } 1238 1239 testOk = isSup( $( "#irp_" + i ).val(), 1 ); 1240 if( !testOk ) 1241 { 1242 this.divE.html( chaine + tapasTexts["label.resolution"] + " : " + tapasTexts["text.badvalue"] ); 1243 this.divE.show(); 1244 return false; 1245 } 1450 testOk2 = isSupS( this.selectInstrumentalFunctionsList[i].getValue() , -1 ); 1451 1452 1453 if (testOk2) 1454 { 1455 if( !testOk ) 1456 { 1457 this.divE.html( chaine + tapasTexts["label.resolution"] + " : " + tapasTexts["text.badvalue"] ); 1458 this.divE.show(); 1459 return false; 1460 } 1461 1462 testOk = isSup( $( "#irp_" + i ).val(), 1 ); 1463 if( !testOk ) 1464 { 1465 this.divE.html( chaine + tapasTexts["label.resolution"] + " : " + tapasTexts["text.badvalue"] ); 1466 this.divE.show(); 1467 return false; 1468 } 1469 } 1470 1246 1471 1247 1472 testOk = isValidNum( $( "#isr_" + i ).val() ); … … 1264 1489 return true; 1265 1490 }, 1491 1492 1266 1493 1267 1494 updateButtons: function() … … 1279 1506 1280 1507 1281 angleChoice: function(params) 1282 { 1508 1509 angleChoice: function( params ) 1510 { 1511 1283 1512 var context = params.data[0]; 1284 1513 var champ = params.data[1]; 1285 //alert(context.nbRequest);1286 1514 var indice = context.nbRequest; 1287 if (champ == "za") { 1288 //$( "#iza_"+indice ).val($( "#iza_"+indice ).val().replace(/^\s+|\s+$/g,"")); 1289 //alert($( "#iza_"+indice ).val($( "#iza_"+indice ).val().replace(/^\s+|\s+$/g,"")).length); 1290 //if ($( "#iza_"+indice ).val($( "#iza_"+indice ).val().replace(/^\s+|\s+$/g,"")).length >0 ) { 1291 $( "#ira_"+indice ).val(""); 1292 $( "#ide_"+indice ).val(""); 1515 if( champ == "za" ) 1516 { 1517 $( "#ira_" + indice ).val( "" ); 1518 $( "#ide_" + indice ).val( "" ); 1293 1519 //} 1294 1520 } 1521 else 1522 { 1523 $( "#iza_" + indice ).val( "" ); 1524 } 1525 1526 }, 1527 1528 1529 ifunctionChoice: function() 1530 { 1531 //this.selectInstrumentalFunctionsList[indice].select(this.selectInstrumentalFunctionsList[indice-1].getValue(),false); 1532 //var context = params.data[0]; 1533 //var champ = params.data[1]; 1534 var valeur = this.selectInstrumentalFunctionsList[this.nbRequest].getValue(); 1535 1536 if ( valeur == -1 ) { 1537 $( "#irp_" + this.nbRequest ).val(""); 1538 $( "#irp_" + this.nbRequest ).css("backgroundColor", "#bfafd6"); 1539 $( "#irp_" + this.nbRequest ).attr('disabled','disabled'); 1540 } 1295 1541 else { 1296 $( "#iza_"+indice ).val(""); 1297 } 1298 1299 1300 }, 1301 1302 1303 1304 /*this.createTrList( tapasTexts["label.format"], "iformat_" + this.nbRequest, this.nbRequest, tabPreference, 'format' ); 1305 this.createTrList( tapasTexts["label.era"], "irextinction_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1306 this.createTrList( tapasTexts["label.eh2o"], "ih2oe_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1307 this.createTrList( tapasTexts["label.eo3"], "io3e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1308 this.createTrList( tapasTexts["label.eo2"], "io2e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1309 this.createTrList( tapasTexts["label.eco2"], "ico2e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1310 1311 this.createTrList( tapasTexts["label.observatory"], "iobservatory_" + this.nbRequest, this.nbRequest, tabObservation, 'observatories' ); 1312 this.createCalendar( tabObservation, tapasTexts["label.datemesure"], "iobservation_date_" + this.nbRequest, false, true ); 1313 1314 //unite 1315 this.createTrList( tapasTexts["label.spectralUnit"], "ispectral_choice_" + this.nbRequest, this.nbRequest, tabObservation, 'spectralUnit' ); 1316 this.createTr2Input( tapasTexts["label.spectralRange"], tapasTexts["label.to"], "iminspectral_ranger_" + this.nbRequest, "imaxspectral_ranger_" + this.nbRequest, tabObservation, "[350,2500] nm" ); 1317 1318 //fonction instrumentale 1319 this.createTrList( tapasTexts["label.ifunction"], "ifunction_" + this.nbRequest, this.nbRequest, tabObservation, "ilsf" ); 1320 //reference climato 1321 //this.createTrList( tapasTexts["label.climato"], "icr", tabAtmosphere, "climatoReference" ); 1322 this.createTrList( tapasTexts["label.climato"], "icr_" + this.nbRequest, this.nbRequest, tabObservation, "climatoReference" ); 1323 1324 1325 this.createTr( tapasTexts["label.ira"], "ira_" + this.nbRequest,tabObservation,"hh:mm:ss (J2000)","keypress","ra","2" ); 1326 //this.createTime( tabObservation, tapasTexts["label.ira"], "ira_" + this.nbRequest, false, true,"hh:mm:ss (J2000)" ); 1327 this.createTr( tapasTexts["label.ide"], "ide_" + this.nbRequest, tabObservation, "deg:':''","keypress","de","2" ); 1328 1329 this.createTrTxt( "or", tabObservation ); 1330 this.createTr( tapasTexts["label.iza"], "iza_" + this.nbRequest, tabObservation, "[0,90] °","keypress","za","2" ); 1331 1332 this.createTr( tapasTexts["label.resolution"], "irp_" + this.nbRequest, tabObservation, "", "", "","" ); 1333 this.createTr( tapasTexts["label.ratio"], "isr_" + this.nbRequest, tabObservation, "", "","","" ); 1334 */ 1542 $( "#irp_" + this.nbRequest ).css("backgroundColor", "#FFFFFF"); 1543 $( "#irp_" + this.nbRequest ).removeAttr('disabled'); 1544 } 1545 1546 1547 //var indice = context.nbRequest; 1548 1549 }, 1550 1551 1552 locationChoice: function(ind) 1553 { 1554 var option = ind.data[0].toString(); 1555 1556 if ("1" == option) 1557 { 1558 $( '#ilocality_' + this.nbRequest).val(""); 1559 $( '#ialtitude_' + this.nbRequest).val(""); 1560 $( '#ilatitude_' + this.nbRequest).val(""); 1561 $( '#ilongitude_' + this.nbRequest).val(""); 1562 } 1563 else 1564 { 1565 $( '#select_iobservatory_' + this.nbRequest).val(""); 1566 } 1567 }, 1568 1569 1570 1571 checkDate: function() 1572 { 1573 var testOk1 = isDate( $( "#iobservation_cpydate_" + this.nbRequest ).val() ) || isEmpty( $( "#iobservation_cpydate_" + this.nbRequest ).val()) ; 1574 if( !testOk1 ) 1575 { 1576 alert( tapasTexts["text.errcpydate"] ); 1577 return false; 1578 } 1579 return true; 1580 }, 1581 1582 1583 1584 emptyCpyDate: function() 1585 { 1586 if ( this.dateTemp != $( "#iobservation_cpydate_" + this.nbRequest ).val("") ) { 1587 $( "#iobservation_cpydate_" + this.nbRequest ).val(""); 1588 } 1589 return true; 1590 }, 1591 1592 1593 tempDate: function() 1594 { 1595 this.dateTemp = "1234"; 1596 return true; 1597 }, 1598 1599 /*this.createTrList( tapasTexts["label.format"], "iformat_" + this.nbRequest, this.nbRequest, tabPreference, 'format' ); 1600 this.createTrList( tapasTexts["label.era"], "irextinction_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1601 this.createTrList( tapasTexts["label.eh2o"], "ih2oe_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1602 this.createTrList( tapasTexts["label.eo3"], "io3e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1603 this.createTrList( tapasTexts["label.eo2"], "io2e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1604 this.createTrList( tapasTexts["label.eco2"], "ico2e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1605 1606 this.createTrList( tapasTexts["label.observatory"], "iobservatory_" + this.nbRequest, this.nbRequest, tabObservation, 'observatories' ); 1607 this.createCalendar( tabObservation, tapasTexts["label.datemesure"], "iobservation_date_" + this.nbRequest, false, true ); 1608 1609 //unite 1610 this.createTrList( tapasTexts["label.spectralUnit"], "ispectral_choice_" + this.nbRequest, this.nbRequest, tabObservation, 'spectralUnit' ); 1611 this.createTr2Input( tapasTexts["label.spectralRange"], tapasTexts["label.to"], "iminspectral_ranger_" + this.nbRequest, "imaxspectral_ranger_" + this.nbRequest, tabObservation, "[350,2500] nm" ); 1612 1613 //fonction instrumentale 1614 this.createTrList( tapasTexts["label.ifunction"], "ifunction_" + this.nbRequest, this.nbRequest, tabObservation, "ilsf" ); 1615 //reference climato 1616 //this.createTrList( tapasTexts["label.climato"], "icr", tabAtmosphere, "climatoReference" ); 1617 this.createTrList( tapasTexts["label.climato"], "icr_" + this.nbRequest, this.nbRequest, tabObservation, "climatoReference" ); 1618 1619 1620 this.createTr( tapasTexts["label.ira"], "ira_" + this.nbRequest,tabObservation,"hh:mm:ss (J2000)","keypress","ra","2" ); 1621 //this.createTime( tabObservation, tapasTexts["label.ira"], "ira_" + this.nbRequest, false, true,"hh:mm:ss (J2000)" ); 1622 this.createTr( tapasTexts["label.ide"], "ide_" + this.nbRequest, tabObservation, "deg:':''","keypress","de","2" ); 1623 1624 this.createTrTxt( "or", tabObservation ); 1625 this.createTr( tapasTexts["label.iza"], "iza_" + this.nbRequest, tabObservation, "[0,90] °","keypress","za","2" ); 1626 1627 this.createTr( tapasTexts["label.resolution"], "irp_" + this.nbRequest, tabObservation, "", "", "","" ); 1628 this.createTr( tapasTexts["label.ratio"], "isr_" + this.nbRequest, tabObservation, "", "","","" ); 1629 */ 1335 1630 1336 1631 1337 1632 initRequestFields: function() 1338 1633 { 1339 if (this.nbRequest > 1 && this.nbRequest <=9) { 1634 if( this.nbRequest > 1 && this.nbRequest <= 9 ) 1635 { 1340 1636 var indice = this.nbRequest; 1341 1637 var indice0 = indice - 1; 1342 1638 1343 this.selectObservatoriesList[indice].select(this.selectObservatoriesList[indice-1].getValue(),false);1344 $( "#iobservation_date_" + indice ).val( $( "#iobservation_date_" + indice0 ).val() );1345 this.selectSpectralUnitsList[indice].select(this.selectSpectralUnitsList[indice-1].getValue(),false);1346 1347 1348 this.selectInstrumentalFunctionsList[indice].select( this.selectInstrumentalFunctionsList[indice-1].getValue(),false);1349 this.selectClimatoReferencesList[indice].select( this.selectClimatoReferencesList[indice-1].getValue(),false);1350 1351 this.selectFileFormatsList[indice].select( this.selectFileFormatsList[indice-1].getValue(),false);1352 this.select_irextinctionList[indice].select( this.select_irextinctionList[indice-1].getValue(),false);1353 this.select_ih2oeList[indice].select( this.select_ih2oeList[indice-1].getValue(),false);1354 this.select_io3eList[indice].select( this.select_io3eList[indice-1].getValue(),false);1355 this.select_io2eList[indice].select( this.select_io2eList[indice-1].getValue(),false);1356 this.select_ico2eList[indice].select( this.select_ico2eList[indice-1].getValue(),false);1357 this.select_ich4eList[indice].select( this.select_ich4eList[indice-1].getValue(),false);1358 this.select_in2oeList[indice].select( this.select_in2oeList[indice-1].getValue(),false);1359 this.select_i bervCList[indice].select(this.select_ibervCList[indice-1].getValue(),false);1360 1361 $( "#iminspectral_ranger_" + indice ).val($( "#iminspectral_ranger_" + indice0 ).val() ); 1362 $( "#im axspectral_ranger_" + indice ).val($( "#imaxspectral_ranger_" + indice0 ).val() );1363 1364 $( "#irp_" + indice ).val($( "#irp_" + indice0 ).val() ); 1365 $( "#i sr_" + indice ).val($( "#isr_" + indice0 ).val() );1366 $( "#i ra_" + indice ).val($( "#ira_" + indice0 ).val() );1367 $( "#i de_" + indice ).val($( "#ide_" + indice0 ).val() );1368 $( "#i za_" + indice ).val($( "#iza_" + indice0 ).val() );1369 1370 1371 1372 // $( "#iobservatory_date_" + indice ).val( $( "#iobservatory_date_" + indice0 ).val() );1373 // $( "#iobservatory_date_" + indice ).val( this.calendarConverter.format( currentDate ) );1639 //this.selectObservatoriesList[indice].select( this.selectObservatoriesList[indice - 1].getValue(), false ); 1640 $( "#iobservation_date_" + indice ).val( $( "#iobservation_date_" + indice0 ).val() ); 1641 $( "#iobservation_cpydate_" + indice ).val( $( "#iobservation_cpydate_" + indice0 ).val() ); 1642 this.selectSpectralUnitsList[indice].select( this.selectSpectralUnitsList[indice - 1].getValue(), false ); 1643 1644 this.selectInstrumentalFunctionsList[indice].select( this.selectInstrumentalFunctionsList[indice - 1].getValue(), false ); 1645 this.selectClimatoReferencesList[indice].select( this.selectClimatoReferencesList[indice - 1].getValue(), false ); 1646 1647 this.selectFileFormatsList[indice].select( this.selectFileFormatsList[indice - 1].getValue(), false ); 1648 this.select_irextinctionList[indice].select( this.select_irextinctionList[indice - 1].getValue(), false ); 1649 this.select_ih2oeList[indice].select( this.select_ih2oeList[indice - 1].getValue(), false ); 1650 this.select_io3eList[indice].select( this.select_io3eList[indice - 1].getValue(), false ); 1651 this.select_io2eList[indice].select( this.select_io2eList[indice - 1].getValue(), false ); 1652 this.select_ico2eList[indice].select( this.select_ico2eList[indice - 1].getValue(), false ); 1653 this.select_ich4eList[indice].select( this.select_ich4eList[indice - 1].getValue(), false ); 1654 this.select_in2oeList[indice].select( this.select_in2oeList[indice - 1].getValue(), false ); 1655 this.select_iOneTransmissionList[indice].select( this.select_iOneTransmissionList[indice - 1].getValue(), false ); 1656 this.select_ibervCList[indice].select( this.select_ibervCList[indice - 1].getValue(), false ); 1657 1658 $( "#iminspectral_ranger_" + indice ).val( $( "#iminspectral_ranger_" + indice0 ).val() ); 1659 $( "#imaxspectral_ranger_" + indice ).val( $( "#imaxspectral_ranger_" + indice0 ).val() ); 1660 1661 $( "#irp_" + indice ).val( $( "#irp_" + indice0 ).val() ); 1662 $( "#isr_" + indice ).val( $( "#isr_" + indice0 ).val() ); 1663 $( "#ira_" + indice ).val( $( "#ira_" + indice0 ).val() ); 1664 $( "#ide_" + indice ).val( $( "#ide_" + indice0 ).val() ); 1665 $( "#iza_" + indice ).val( $( "#iza_" + indice0 ).val() ); 1666 1667 1668 // $( "#iobservatory_date_" + indice ).val( $( "#iobservatory_date_" + indice0 ).val() ); 1669 // $( "#iobservatory_date_" + indice ).val( this.calendarConverter.format( currentDate ) ); 1374 1670 1375 1671 //$( "#iobservatory_date_" + indice ).val( this.calendarConverter.format( this.calendarConverter.parse( $( "#iobservation_date_" + indice0 ).val() ).getTime() ) ); 1376 1672 // this.selectSpectralUnitsList[z] = this.selectSpectralUnitsList[i]; 1377 1673 /*this.selectSpectralUnitsList[i] = null; 1378 $( "#iminspectral_ranger_" + i ).attr( {id:"iminspectral_ranger_" + z} );1379 $( "#imaxspectral_ranger_" + i ).attr( {id:"imaxspectral_ranger_" + z} );*/1674 $( "#iminspectral_ranger_" + i ).attr( {id:"iminspectral_ranger_" + z} ); 1675 $( "#imaxspectral_ranger_" + i ).attr( {id:"imaxspectral_ranger_" + z} );*/ 1380 1676 1381 1677 //$( "#irp_"+indice ).val($( "#irp_"+(indice-1)).val() );
Note: See TracChangeset
for help on using the changeset viewer.