Changeset 779 for tapas/web/project/formTapas_script.jsp
- Timestamp:
- 04/01/14 16:56:38 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tapas/web/project/formTapas_script.jsp
r767 r779 1 1 <script src="js/library/jquery-ui-1.8.16.custom/js/jquery-ui-1.8.16.custom.min.js"></script> 2 2 <script type="text/javascript"> 3 3 … … 22 22 this.select_io3eList = new Object(); 23 23 this.select_ico2eList = new Object(); 24 this.select_ich4eList = new Object(); 25 this.select_in2oeList = new Object(); 24 26 this.select_irextinctionList = new Object(); 25 27 this.select_ibervCList = new Object(); … … 188 190 if (event.length > 0) input.bind( event, [this, champ], this.angleChoice ); 189 191 190 td1.html( texte ); 192 191 193 td1.attr( {class:"containerLabel"} ); 192 194 … … 204 206 205 207 if (info && (inputId.match(re1) || inputId.match(re2))) { 206 var mt="-4px";207 var ml="";208 209 if (this.browser == "Firefox") {210 if (this.language == "en") ml="-252px";211 else ml="-244px";212 }213 else if (this.browser == "Chrome") {214 if (this.language == "en") ml="-227px";215 else ml="-223px";216 }217 208 218 209 var img = $( document.createElement( "img" ) ); … … 226 217 a.append(img); 227 218 div.append(a); 228 div.attr( "style","margin-left:"+ml+";margin-top:"+mt); 229 219 220 221 td1.append( a ); 222 td1.append( texte ); 230 223 tr.append( div ); 231 224 232 /*td2.attr( {colspan:3} );233 tr.append( td2 );234 tr.append( div );*/235 225 } 236 226 else if (info) { … … 242 232 img.bind("click",[inputId,450,100,this],this.onClickInfos); 243 233 a.append(img); 244 td3.append(a); 234 td1.append(a); 235 td1.append( texte ); 245 236 246 237 } … … 280 271 input2.attr( {id: inputId2,class:"containerText",size:11} ); 281 272 282 td1.html( texte1 ); 273 283 274 td3.html( texte2 ); 284 275 td5.html( textesup ); … … 290 281 img.bind("click",["spectral_range",450,100,this],this.onClickInfos); 291 282 a.append(img); 292 td5.append(a); 283 td1.append(a); 284 td1.append( texte1 ); 293 285 294 286 //img.onclick(this.onClickInfos("spectral_range",1200,440)); … … 318 310 var td1 = $( document.createElement( "td" ) ); 319 311 var td2 = $( document.createElement( "td" ) ); 312 var td3 = $( document.createElement( "td" ) ); 320 313 var input = $( document.createElement( "input" ) ); 321 var champ="" , ml="", mt="-4px";314 var champ=""; 322 315 323 316 var div = $( document.createElement( "div" ) ); 324 317 318 325 319 input.attr( {id: inputId} ); 326 320 327 td1.html( texte ); 328 td1.attr( {class:"containerLabel"} ); 329 tr.append( td1 ); 330 331 332 // alert(inputId); 321 // alert(inputId); 333 322 if( 'format' == type ) { 334 323 this.displaySelect( td2, inputId, index, this.jSonFileFormats, this.selectFileFormatsList, false, null ); 335 324 info = true; 336 325 champ = "iformat_"; 337 ml="-2px"; 338 mt="-4px"; 339 } 340 326 327 } 341 328 else 342 329 if( 'yesno' == type ) … … 350 337 else if( (/^(ico2e_[1-9]+)$/.test( inputId ) ) ) 351 338 this.displaySelect( td2, inputId, index, this.jSonYesNos, this.select_ico2eList, false, "yesNos" ); 339 else if( (/^(ich4e_[1-9]+)$/.test( inputId ) ) ) 340 this.displaySelect( td2, inputId, index, this.jSonYesNos, this.select_ich4eList, false, "yesNos" ); 341 else if( (/^(in2oe_[1-9]+)$/.test( inputId ) ) ) 342 this.displaySelect( td2, inputId, index, this.jSonYesNos, this.select_in2oeList, false, "yesNos" ); 352 343 else if( (/^(irextinction_[1-9]+)$/.test( inputId ) ) ) { 353 344 … … 355 346 info = true; 356 347 champ=inputId; 357 if (this.language == "en") ml="-11px";358 else ml="-13px";359 360 348 } 361 349 else if( (/^(ibervC_[1-9]+)$/.test( inputId ) ) ) { … … 363 351 info = true; 364 352 champ=inputId; 365 if (this.language == "en") ml="-11px";366 else ml="-13px";367 353 } 368 354 } 369 355 else if( 'observatories' == type ) { 370 this.displaySelect( td2, inputId, index, this.jSonObservatories, this.selectObservatoriesList, true, "observatories" ); 371 372 if (this.browser == "Firefox") { 373 if (this.language == "en") ml="-162px"; 374 else ml="-116px"; 375 } 376 else if (this.browser == "Chrome") { 377 if (this.language == "en") ml="-123px"; 378 else ml="-84px"; 379 } 356 357 this.displaySelect1( td2, inputId, index, this.jSonObservatories, this.selectObservatoriesList, true, "observatories" ); 358 //this.displaySelect( td2, inputId, index, this.jSonObservatories, this.selectObservatoriesList, true, "observatories" ); 380 359 381 360 champ="iobservatory_"; … … 386 365 387 366 champ = "ispectral_choice_"; 388 389 if (this.browser == "Firefox") {390 if (this.language == "en") ml="-162px";391 else ml="-116px";392 }393 else if (this.browser == "Chrome") {394 if (this.language == "en") ml="-123px";395 else ml="-84px";396 }397 398 367 } 399 368 else if( 'ilsf' == type ) { … … 401 370 info = true; 402 371 champ = "ifunction_"; 403 if (this.language == "en") ml="-192px";404 else ml="-172px";405 406 if (this.browser == "Firefox") {407 if (this.language == "en") ml="-192px";408 else ml="-172px";409 }410 else if (this.browser == "Chrome") {411 if (this.language == "en") ml="-149px";412 else ml="-134px";413 }414 415 372 } 416 373 else if( 'climatoReference' == type ) { … … 418 375 info = true; 419 376 champ = "icr_"; 420 421 if (this.browser == "Firefox") { 422 if (this.language == "en") ml="-170px"; 423 else ml="-162px"; 424 } 425 else if (this.browser == "Chrome") { 426 if (this.language == "en") ml="-127px"; 427 else ml="-124px"; 428 } 429 430 } 431 377 } 378 379 td1.attr( {class:"containerLabel"} ); 380 tr.append( td1 ); 432 381 433 382 … … 442 391 a.append(img); 443 392 div.append(a); 444 div.attr( "style","margin-left:"+ml+";margin-top:"+mt); 445 446 td2.attr( {colspan:3} ); 393 394 395 td2.attr( {colspan:5} ); 396 td1.append( a ); 397 td1.append( texte ); 398 447 399 tr.append( td2 ); 448 tr.append( div ); 400 449 401 } 450 402 else { 403 td1.append( texte ); 451 404 td2.attr( {colspan:3} ); 452 405 tr.append( td2 ); … … 760 713 //$( "#tab_request" + i ).html( "toto"); 761 714 $( "#tab_request" + i ).attr( {name:z} ); 762 $( "#tab_request" + i ).attr( {id:"tab_request" + z} ); this.angleChoice715 $( "#tab_request" + i ).attr( {id:"tab_request" + z} ); //this.angleChoice 763 716 $( "#tabObservation_" + i ).attr( {id:"tabObservation_" + z} ); 764 717 // $( "#select_iobservatory_" + i ).attr( {id:"select_iobservatory_" + z} ); … … 801 754 this.select_ico2eList[i] = null; 802 755 756 this.select_ich4eList[z] = this.select_ich4eList[i]; 757 this.select_ich4eList[i] = null; 758 759 this.select_in2oeList[z] = this.select_in2oeList[i]; 760 this.select_in2oeList[i] = null; 761 803 762 this.select_ibervCList[z] = this.select_ibervCList[i]; 804 763 this.select_ibervCList[i] = null; … … 895 854 }, 896 855 856 createAutoCompleteMenuForRegions: function() 857 { 858 859 $( "#select_iobservatory_"+this.nbRequest ).autocomplete( { 860 source: this.listObs, 861 appendTo: "#regionContent"+this.nbRequest, 862 minLength: 0, 863 autoFocus: true, 864 autoSelect: true, 865 select: jQuery.proxy( function( event, ui ) 866 { 867 this.regionLabel = ui.item.value; 868 }, this ) 869 } ).focus( function( event ) 870 { 871 $( this ).autocomplete( "search", "" ); 872 } ); 873 874 //$( "#regionTags" ).focus(); 875 }, 876 877 878 // OTHERS ******************************************************** 879 // General method to display select 880 displaySelect1: function( container, id, index, jsonList, selectList, nullValueIsNeeded, contentManage ) 881 { 882 //alert("ok"); 883 var iselect = $( document.createElement( "select" ) ); 884 var option = document.createElement("option"); 885 886 var paramSelect = new Object(); 887 paramSelect.id = "select_" + id; 888 paramSelect.parent = container; 889 890 var observatoryArray=new Array(); 891 this.listObs=new Array(); 892 893 894 //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 902 903 var option = new Option(); 904 option.text = "-- " + tapasTexts["text.select"] + " --"; 905 option.value = "-1"; 906 iselect.append( option ); 907 908 jQuery.each( jsonList, jQuery.proxy( function ( i, jsonElement ) 909 { 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 920 921 }, this ) ); 922 //iselect.selectFirst( false ); 923 /*selectList[index] = select;*/ 924 //container.append(iselect); 925 container.append(bob); 926 selectList[index]="select_"+id; 927 928 }, 929 930 897 931 showErrors: function( result ) 898 932 { … … 967 1001 this.createTrList( tapasTexts["label.eo2"], "io2e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 968 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' ); 969 1005 this.createTrList( tapasTexts["label.berv"], "ibervC_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 970 1006 … … 993 1029 this.createTr( tapasTexts["label.iza"], "iza_" + this.nbRequest, tabObservation, "[0,90] °","keypress","za","2",true ); 994 1030 1031 this.createAutoCompleteMenuForRegions(); 995 1032 996 1033 this.initRequestFields(); … … 1036 1073 preference.co2Extinction.secondValue = this.select_ico2eList[i].getValue(); 1037 1074 1075 preference.ch4Extinction = new Object(); 1076 preference.ch4Extinction.firstValue = this.select_ich4eList[i].getValuesInString(); 1077 preference.ch4Extinction.secondValue = this.select_ich4eList[i].getValue(); 1078 1079 preference.n2oExtinction = new Object(); 1080 preference.n2oExtinction.firstValue = this.select_in2oeList[i].getValuesInString(); 1081 preference.n2oExtinction.secondValue = this.select_in2oeList[i].getValue(); 1082 1038 1083 preference.bervCorrection = new Object(); 1039 1084 preference.bervCorrection.firstValue = this.select_ibervCList[i].getValuesInString(); … … 1043 1088 // OBSERVATION 1044 1089 var observatory = new Object(); 1045 observatory.id = this.selectObservatoriesList[i].getValue(); 1090 //observatory.id = "European Southern Obs R La Serena Cerro La Silla";//this.selectObservatoriesList[i].getValue(); 1091 //observatory.id = this.selectObservatoriesList[i].getValue(); 1092 //observatory.id = 2; 1093 observatory.name = $("#select_iobservatory_"+i).val(); 1046 1094 1047 1095 // Los … … 1124 1172 var testOk2=false; 1125 1173 var testOk3=false; 1126 var testOk = isSup( this.selectObservatoriesList[i].getValue(), 0 ); 1127 if( !testOk ) 1174 //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 ) 1128 1178 { 1129 1179 this.divE.html( chaine + tapasTexts["label.observatory"] + " : " + tapasTexts["text.toselect"] ); … … 1305 1355 this.select_io2eList[indice].select(this.select_io2eList[indice-1].getValue(),false); 1306 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); 1307 1359 this.select_ibervCList[indice].select(this.select_ibervCList[indice-1].getValue(),false); 1308 1360
Note: See TracChangeset
for help on using the changeset viewer.