- Timestamp:
- 04/26/12 15:42:13 (12 years ago)
- Location:
- tapas/web
- Files:
-
- 11 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
tapas/web/init.jsp
r481 r490 20 20 <div id="errors"><spring:message code="${errors}"/></div> 21 21 </c:if> 22 Home 22 23 24 23 25 </tiles:put> 24 26 -
tapas/web/project/formTapas.jsp
r489 r490 23 23 <ether:htmlJsp jspFile="formTapas_script"/> 24 24 <ether:htmlJs jsFile="tools/controls"/> 25 <ether:htmlJs jsFile="classesForJQuery/Tab"/> 25 26 </tiles:put> 26 27 … … 35 36 <tiles:put name="body" type="string"> 36 37 38 <div class="containerTabs" id="tab"></div> 39 37 40 <div class="containerForm" id="formulaire"></div> 38 41 39 <div id="err ors"></div>42 <div id="errForm" class="errorsForm"></div> 40 43 41 44 <script type="text/javascript"> … … 43 46 44 47 tapasTexts["label.submitButton"] = '<spring:message code="label.submitButton"/>'; 48 tapasTexts["label.addButton"] = '<spring:message code="label.addButton"/>'; 49 45 50 tapasTexts["<%=WebException.WebCode.ERROR_JSON_TAPAS_IS_NULL%>"] = "<spring:message code="error.ERROR_JSON_TAPAS_IS_NULL"/>"; 46 51 tapasTexts["<%=SpectralUnit.NM_STANDARD%>"] = "<spring:message code="label.spectralUnit.NM_STANDARD"/>"; … … 83 88 tapasTexts["label.eo3"]="<spring:message code="label.eo3"/>"; 84 89 tapasTexts["text.select"]="<spring:message code="text.select"/>"; 90 tapasTexts["text.toselect"]="<spring:message code="text.toselect"/>"; 85 91 86 92 … … 90 96 tapasTexts["text.badvalue"]="<spring:message code="text.badvalue"/>"; 91 97 98 tapasTexts["label.requete"]="<spring:message code="label.requete"/>"; 99 100 tapasTexts["label.delButton"]="<spring:message code="label.delButton"/>"; 92 101 93 102 94 103 95 var interfaceTapas = new InterfaceTapas(${jSonFileFormats},${jSonYesNos},${jSonObservatories},${jSonSpectralUnits},${jSonInstrumentalFunctions},${jSonClimatoReferences}); 104 105 106 107 //var interfaceTapas = new InterfaceTapas(${jSonFileFormats},${jSonYesNos},${jSonObservatories},${jSonSpectralUnits},${jSonInstrumentalFunctions},${jSonClimatoReferences}); 108 var interfaceTapas = new InterfaceTapas(${jSonFileFormats},${jSonYesNos},${jSonSpectralUnits},${jSonInstrumentalFunctions},${jSonClimatoReferences}); 96 109 97 110 </script> -
tapas/web/project/formTapas_script.jsp
r489 r490 1 2 1 <script type="text/javascript"> 3 2 4 3 5 6 4 var InterfaceTapas = Class.create( { 7 5 8 initialize: function( jsonFileFormats, jsonYesNos, jsonObservatories, jsonSpectralUnits, jsonInstrumentalFunctions, jsonClimatoReferences ) 6 //initialize: function( jsonFileFormats, jsonYesNos, jsonObservatories, jsonSpectralUnits, jsonInstrumentalFunctions, jsonClimatoReferences ) 7 initialize: function( jsonFileFormats, jsonYesNos, jsonSpectralUnits, jsonInstrumentalFunctions, jsonClimatoReferences ) 9 8 { 10 9 /** *********** CONTAINERS *********** **/ 11 10 this.containerForm = $( "#formulaire" ); 12 this.containerErrors = $( "#errors" ); 11 //this.containerErrors = $( "#errors" ); 12 this.containerErrors = $( "#errForm" ); 13 13 this.containerCenter = $( "#containerCenter" ); 14 this.containerTabs = $( "#tab" ); 14 15 15 16 this.jSonFileFormats = jsonFileFormats || null; 16 17 this.jSonYesNos = jsonYesNos || null; 17 this.jSonObservatories = jsonObservatories || null; 18 //this.jSonObservatories = jsonObservatories || false; 19 this.jSonObservatories = false; 18 20 this.jSonSpectralUnits = jsonSpectralUnits || null; 19 21 this.jSonInstrumentalFunctions = jsonInstrumentalFunctions || null; 20 22 this.jSonClimatoReferences = jsonClimatoReferences || null; 21 22 this.containerErrors.hide(); 23 23 this.nbRequest = 1; 24 this.tabActive = false; 25 26 27 this.containerErrors.show(); 28 29 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 )} ); 30 this.addRequestButton = new Button( {value:tapasTexts["label.addButton"], parent:this.containerCenter, id:"button_add", className: "positive", onClick:jQuery.proxy( this.onClickAdd, this )} ); 31 this.delRequestButton = new Button( {value:tapasTexts["label.delButton"], parent:this.containerCenter, id:"button_del", className: "negative", onClick:jQuery.proxy( this.onClickDel, this )} ); 32 this.delRequestButton.disable(); 24 33 25 34 this.createForm(); 35 this.tabActive = this.createTab(); 26 36 27 37 }, … … 29 39 30 40 // CREATES ******************************************************** 31 createCalendar: function( containerCalendar, texte ) 41 createTab:function() 42 { 43 44 var ntab = new Tab( {value:tapasTexts["label.requete"] + " " + this.nbRequest, parent:this.containerTabs, numTab: this.nbRequest, id:"tab_request" + this.nbRequest, className: "tab_class", onClick:jQuery.proxy( this.onClickTab, this )} ); 45 ntab.active(); 46 return ntab; 47 48 }, 49 50 51 createCalendar: function( containerCalendar, texte, inputDateId ) 32 52 { 33 53 // Create input for date text 34 var inputDateId = "iobservation_date";35 54 var tr = $( document.createElement( "tr" ) ); 36 55 var td1 = $( document.createElement( "td" ) ); … … 45 64 46 65 47 td2.attr({colspan:4});66 td2.attr( {colspan:4} ); 48 67 td2.append( inputDate ); 49 68 tr.append( td2 ); … … 60 79 61 80 var currentDate = new Date(); 62 $( "#iobservation_date" ).val( this.calendarConverter.format( currentDate ) ); 81 $( "#" + inputDateId ).val( this.calendarConverter.format( currentDate ) ); 82 $( "#" + inputDateId ).addClass( "calendar" ); 83 63 84 }, 64 85 65 86 66 87 // CREATES ******************************************************** 67 createTime: function( containerCalendar, texte, input )88 createTime: function( containerCalendar, texte, inputDateId ) 68 89 { 69 90 // Create input for date text 70 var inputDateId = input;71 91 var tr = $( document.createElement( "tr" ) ); 72 92 var td1 = $( document.createElement( "td" ) ); … … 81 101 82 102 83 td2.attr( {colspan:3});103 td2.attr( {colspan:3} ); 84 104 td2.append( inputDate ); 85 105 tr.append( td2 ); 86 106 containerCalendar.append( tr ); 87 107 88 // Calendar 89 this.calendarFormat = "%H:%i:%s"; 90 this.calendarConverter = new AnyTime.Converter( { format: this.calendarFormat } ); 91 92 AnyTime.picker( inputDateId, { format: this.calendarFormat, firstDOW: 1, 108 // Time 109 this.timeFormat = "%H:%i:%s"; 110 this.timeConverter = new AnyTime.Converter( { format: this.timeFormat } ); 111 112 113 AnyTime.picker( inputDateId, { format: this.timeFormat, firstDOW: 1, 93 114 labelTitle: "Select hour", labelHour: "Hour", labelMinute: "Minute", labelSecond: "Second" 94 115 } ); 95 116 96 $( "#"+inputDateId ).val( "00:00:00" ); 97 }, 117 118 $( "#" + inputDateId ).val( "00:00:00" ); 119 $( "#" + inputDateId ).addClass( "time" ); 120 }, 121 98 122 99 123 createTr: function( texte, inputId, container, textesup ) … … 134 158 return selectYesNos; 135 159 }, 160 136 161 137 162 … … 154 179 td3.html( texte2 ); 155 180 td5.html( textesup ); 156 td1.attr( {class:"containerLabel"});157 td3.attr( {class:"containerLabel3"});158 td5.attr( {class:"containerLabel2"});181 td1.attr( {class:"containerLabel"} ); 182 td3.attr( {class:"containerLabel3"} ); 183 td5.attr( {class:"containerLabel2"} ); 159 184 160 185 td2.append( input1 ); … … 171 196 172 197 198 173 199 createTrList: function( texte, inputId, container, type ) 174 200 { … … 184 210 185 211 tr.append( td1 ); 186 if( type == 'format' ) this.displayFileFormats( td2 );212 if( type == 'format' ) this.displayFileFormats( td2, inputId ); 187 213 else if( type == 'yesno' ) 188 214 { 189 if( inputId == "ih2oe") this.select_ih2oe = this.createSelectYesNo( td2, inputId );190 else if( inputId == "io2e") this.select_io2e = this.createSelectYesNo( td2, inputId );191 else if( inputId == "io3e") this.select_io3e = this.createSelectYesNo( td2, inputId );192 else if( inputId == "ico2e") this.select_ico2e = this.createSelectYesNo( td2, inputId );193 else if( inputId == "irextinction") this.select_irextinction = this.createSelectYesNo( td2, inputId );215 if( (/^(ih2oe_[1-9]+)$/.test( inputId ) ) ) this.select_ih2oe = this.createSelectYesNo( td2, inputId ); 216 else if( (/^(io2e_[1-9]+)$/.test( inputId ) ) ) this.select_io2e = this.createSelectYesNo( td2, inputId ); 217 else if( (/^(io3e_[1-9]+)$/.test( inputId ) ) ) this.select_io3e = this.createSelectYesNo( td2, inputId ); 218 else if( (/^(ico2e_[1-9]+)$/.test( inputId ) ) ) this.select_ico2e = this.createSelectYesNo( td2, inputId ); 219 else if( (/^(irextinction_[1-9]+)$/.test( inputId ) ) ) this.select_irextinction = this.createSelectYesNo( td2, inputId ); 194 220 } 195 else if( type == 'observatories' ) this.displayObservatories( td2 ); 196 else if( type == 'spectralUnit' ) { 197 this.displaySpectralUnits( td2 ); 221 else if( type == 'observatories' ) this.displayObservatories( td2, inputId ); 222 else if( type == 'spectralUnit' ) 223 { 224 this.displaySpectralUnits( td2, inputId ); 198 225 //td2.attr({colspan:3}); 199 226 } 200 else if( type == 'ilsf' ) this.displayInstrumentalFunctions( td2 ); 201 else if( type == 'climatoReference' ) { 202 this.displayClimatoReferences( td2 ); 203 204 227 else if( type == 'ilsf' ) this.displayInstrumentalFunctions( td2, inputId ); 228 else if( type == 'climatoReference' ) 229 { 230 this.displayClimatoReferences( td2, inputId ); 205 231 } 206 232 207 td2.attr( {colspan:3});233 td2.attr( {colspan:3} ); 208 234 tr.append( td2 ); 209 235 container.append( tr ); 210 236 }, 211 212 213 214 237 215 238 … … 230 253 }, 231 254 255 232 256 // HANDLES ******************************************************** = retours ajax 233 257 handleCreateXML: function( result ) … … 241 265 onClickSubmit: function() 242 266 { 243 if ( true && isDeg($( "#ide").val(),tapasTexts["label.ide"],tapasTexts["text.badvalue"] )) { 244 245 if ( confirm(tapasTexts["confirm"]) ) { 246 this.containerErrors.hide(); 247 this.requestCreateXML(); 267 // if( this.validFields() ) 268 // { 269 if( confirm( tapasTexts["confirm"] ) ) 270 { 271 this.containerErrors.hide(); 272 this.requestCreateXML(); 273 } 274 // } 275 }, 276 277 278 onClickAdd: function() 279 { 280 //if( this.validFields() ) 281 if( true ) 282 { 283 this.containerErrors.hide(); 284 this.nbRequest++; 285 286 //tabs 287 $( ".tab_class" ).removeClass( "activated" ); 288 this.createTab(); 289 290 //formulaires 291 $( ".divAll" ).hide(); 292 this.createForm(); 293 294 this.delRequestButton.enable(); 295 if( this.nbRequest == 9) this.addRequestButton.disable(); 296 else this.addRequestButton.enable(); 297 } 298 }, 299 300 301 onClickDel: function() 302 { 303 //if( this.validFields() ) 304 if( true ) 305 { 306 var numCurrent = this.tabActive.numTab; 307 308 //tabs 309 $( ".tab_class" ).removeClass( "activated" ); 310 $( "#tab_request" + numCurrent ).remove(); 311 //$( "#tab_request" + this.last ).addClass( "activated" ); 312 $( "#tab_request1" ).addClass( "activated" ); 313 314 //formulaires 315 $( ".divAll" ).hide(); 316 $( "#all_" + numCurrent ).remove(); 317 318 319 var i; 320 var z=1; 321 322 for (i=1 ; i<= this.nbRequest ; i++ ) { 323 if (i!=numCurrent) { 324 //alert(document.getElementById("tab_request"+i).getAttribute("id")); 325 $( "#tab_request"+i).html("Request "+z); 326 document.getElementById("tab_request"+i).id="tab_request"+z; 327 328 document.getElementById("select_iobservatory_"+i).id="select_iobservatory_"+z; 329 document.getElementById("iobservation_date_"+i).id="iobservation_date_"+z; 330 document.getElementById("select_ispectral_choice_"+i).id="select_ispectral_choice_"+z; 331 document.getElementById("iminspectral_ranger_"+i).id="iminspectral_ranger_"+z; 332 document.getElementById("imaxspectral_ranger_"+i).id="imaxspectral_ranger_"+z; 333 document.getElementById("select_ifunction_"+i).id="select_ifunction_"+z; 334 document.getElementById("select_icr_"+i).id="select_icr_"+z; 335 document.getElementById("ira_"+i).id="ira_"+z; 336 document.getElementById("ide_"+i).id="ide_"+z; 337 document.getElementById("iza_"+i).id="iza_"+z; 338 document.getElementById("irp_"+i).id="irp_"+z; 339 document.getElementById("isr_"+i).id="isr_"+z; 340 document.getElementById("select_iformat_"+i).id="select_iformat_"+z; 341 document.getElementById("select_irextinction_"+i).id="select_irextinction_"+z; 342 document.getElementById("select_ih2oe_"+i).id="select_ih2oe_"+z; 343 document.getElementById("select_io2e_"+i).id="select_io2e_"+z; 344 document.getElementById("select_io3e_"+i).id="select_io3e_"+z; 345 document.getElementById("select_ico2e_"+i).id="select_ico2e_"+z; 346 347 348 document.getElementById("all_"+i).id="all_"+z; 349 350 351 352 z++; 353 } 248 354 } 355 356 $( "#all_1" ).show(); 357 358 this.delRequestButton.disable(); 359 this.nbRequest--; 360 361 if( this.nbRequest <= 1 ) 362 this.delRequestButton.disable(); 363 364 if( this.nbRequest == 9) this.addRequestButton.disable(); 365 else this.addRequestButton.enable(); 366 249 367 } 250 368 }, 251 369 252 370 371 onClickTab: function( tabClicked ) 372 { 373 //tabs 374 this.tabActive = tabClicked; 375 $( ".tab_class" ).removeClass( "activated" ); 376 this.tabActive.active(); 377 378 //forms 379 $( ".divAll" ).hide(); 380 $( "#all_" + this.tabActive.numTab ).show(); 381 382 if( 1 == this.tabActive.numRequest ) this.delRequestButton.disable(); 383 else this.delRequestButton.enable(); 384 }, 385 386 387 253 388 // OTHERS ******************************************************** 254 displayFileFormats: function( container )389 displayFileFormats: function( container, id ) 255 390 { 256 391 var paramSelect = new Object(); 257 paramSelect.id = "select_ formats";392 paramSelect.id = "select_" + id; 258 393 paramSelect.parent = container; 259 394 this.selectFormats = new Select( paramSelect ); … … 266 401 267 402 268 displayObservatories: function( container )403 displayObservatories: function( container, id ) 269 404 { 270 405 var paramSelect = new Object(); 271 paramSelect.id = "select_ observatory";406 paramSelect.id = "select_" + id; 272 407 paramSelect.parent = container; 273 408 this.selectObservatories = new Select( paramSelect ); 274 409 //ajouter select vide avec add 275 this.selectObservatories.add( "-1", "-- " +tapasTexts["text.select"]+" --" );410 this.selectObservatories.add( "-1", "-- " + tapasTexts["text.select"] + " --" ); 276 411 jQuery.each( this.jSonObservatories, jQuery.proxy( function ( i, jsonObservatory ) 277 412 { … … 282 417 283 418 284 displaySpectralUnits: function( container )419 displaySpectralUnits: function( container, id ) 285 420 { 286 421 var paramSelect = new Object(); 287 paramSelect.id = "select_ spectral_unit";422 paramSelect.id = "select_" + id; 288 423 paramSelect.parent = container; 289 424 this.selectSpectralUnits = new Select( paramSelect ); 290 425 //ajouter select vide avec add 291 this.selectSpectralUnits.add( "-1", "-- " +tapasTexts["text.select"]+" --" );426 this.selectSpectralUnits.add( "-1", "-- " + tapasTexts["text.select"] + " --" ); 292 427 jQuery.each( this.jSonSpectralUnits, jQuery.proxy( function ( i, jsonSpectralUnit ) 293 428 { … … 298 433 }, 299 434 300 displayInstrumentalFunctions: function( container )435 displayInstrumentalFunctions: function( container, id ) 301 436 { 302 437 var paramSelect = new Object(); 303 paramSelect.id = "select_ instrumental_function";438 paramSelect.id = "select_" + id; 304 439 paramSelect.parent = container; 305 440 this.selectInstrumentalFunctions = new Select( paramSelect ); … … 313 448 314 449 315 displayClimatoReferences: function( container )450 displayClimatoReferences: function( container, id ) 316 451 { 317 452 var paramSelect = new Object(); 318 paramSelect.id = "select_ climato_reference";453 paramSelect.id = "select_" + id; 319 454 paramSelect.parent = container; 320 455 this.selectClimatoReferences = new Select( paramSelect ); … … 330 465 showErrors: function( result ) 331 466 { 332 this.containerErrors.show();333 this.containerErrors.html( tapasTexts[result.responseText] );467 //this.containerErrors.show(); 468 // this.containerErrors.html( tapasTexts[result.responseText] ); 334 469 }, 335 470 … … 338 473 createForm: function() 339 474 { 340 //Creation div tab 475 this.divErreurs = $( document.createElement( "div" ) ); 476 this.divErreurs.addClass( "errorsForm" ); 477 this.divErreurs.hide(); 478 479 var divAll = $( document.createElement( "div" ) ); 480 divAll.attr( {id:"all_" + this.nbRequest, class:"divAll"} ); 481 482 483 //Creation div 341 484 var divPreference = $( document.createElement( "div" ) ); 342 485 var tabPreference = $( document.createElement( "table" ) ); 343 tabPreference.attr( {cellspacing:3});486 tabPreference.attr( {cellspacing:3} ); 344 487 345 488 var divObservation = $( document.createElement( "div" ) ); 346 489 var tabObservation = $( document.createElement( "table" ) ); 347 490 //tabObservation.attr({border:1}); 348 tabObservation.attr( {cellspacing:3});491 tabObservation.attr( {cellspacing:3} ); 349 492 350 493 … … 354 497 355 498 var fieldSetObservation = $( document.createElement( "fieldset" ) ); 356 fieldSetObservation.addClass( "cfs1");357 divObservation.append( fieldSetObservation);499 fieldSetObservation.addClass( "cfs1" ); 500 divObservation.append( fieldSetObservation ); 358 501 359 502 var legendObservation = $( document.createElement( "legend" ) ); 360 legendObservation.html( "Observation");361 fieldSetObservation.append( legendObservation);362 legendObservation.addClass( "containerField");503 legendObservation.html( "Observation" ); 504 fieldSetObservation.append( legendObservation ); 505 legendObservation.addClass( "containerField" ); 363 506 364 507 var fieldSetPreference = $( document.createElement( "fieldset" ) ); 365 fieldSetPreference.addClass( "cfs2");366 divPreference.append( fieldSetPreference);508 fieldSetPreference.addClass( "cfs2" ); 509 divPreference.append( fieldSetPreference ); 367 510 368 511 var legendPreference = $( document.createElement( "legend" ) ); 369 legendPreference.html(tapasTexts["label.preferences"]); 370 fieldSetPreference.append(legendPreference); 371 legendPreference.addClass("containerField"); 372 373 fieldSetObservation.append( tabObservation ); 374 divObservation.addClass("divObservation"); 375 this.containerForm.append( divObservation ); 512 legendPreference.html( tapasTexts["label.preferences"] ); 513 fieldSetPreference.append( legendPreference ); 514 legendPreference.addClass( "containerField" ); 515 516 fieldSetObservation.append( tabObservation ); 517 divObservation.addClass( "divObservation" ); 518 divAll.append( divObservation ); 519 376 520 377 521 divAtmosphere.append( tabAtmosphere ); … … 381 525 382 526 fieldSetPreference.append( tabPreference ); 383 divPreference.addClass("divPreference"); 384 this.containerForm.append( divPreference ); 527 divPreference.addClass( "divPreference" ); 528 divAll.append( divPreference ); 529 530 this.containerForm.append( divAll ); 531 this.containerForm.append( this.divErreurs ); 385 532 //this.tabInput = new Array(3); 386 533 387 this.createTrList( tapasTexts["label.format"], "iformat ", tabPreference, 'format' );388 this.createTrList( tapasTexts["label.era"], "irextinction ", tabPreference, 'yesno' );389 this.createTrList( tapasTexts["label.eh2o"], "ih2oe ", tabPreference, 'yesno' );390 this.createTrList( tapasTexts["label.eo3"], "io3e ", tabPreference, 'yesno' );391 this.createTrList( tapasTexts["label.eo2"], "io2e ", tabPreference, 'yesno' );392 this.createTrList( tapasTexts["label.eco2"], "ico2e ", tabPreference, 'yesno' );393 394 this.createTrList( tapasTexts["label.observatory"], "iobservatory ", tabObservation, 'observatories' );395 this.createCalendar( tabObservation, tapasTexts["label.datemesure"] );534 this.createTrList( tapasTexts["label.format"], "iformat_" + this.nbRequest, tabPreference, 'format' ); 535 this.createTrList( tapasTexts["label.era"], "irextinction_" + this.nbRequest, tabPreference, 'yesno' ); 536 this.createTrList( tapasTexts["label.eh2o"], "ih2oe_" + this.nbRequest, tabPreference, 'yesno' ); 537 this.createTrList( tapasTexts["label.eo3"], "io3e_" + this.nbRequest, tabPreference, 'yesno' ); 538 this.createTrList( tapasTexts["label.eo2"], "io2e_" + this.nbRequest, tabPreference, 'yesno' ); 539 this.createTrList( tapasTexts["label.eco2"], "ico2e_" + this.nbRequest, tabPreference, 'yesno' ); 540 541 this.createTrList( tapasTexts["label.observatory"], "iobservatory_" + this.nbRequest, tabObservation, 'observatories' ); 542 this.createCalendar( tabObservation, tapasTexts["label.datemesure"], "iobservation_date_" + this.nbRequest ); 396 543 397 544 //unite 398 this.createTrList( tapasTexts["label.spectralUnit"], "ispectral_choice ", tabObservation, 'spectralUnit' );399 this.createTr2Input( tapasTexts["label.spectralRange"], tapasTexts["label.to"], "iminspectral_ranger ", "imaxspectral_ranger", tabObservation, "[350,2500] nm" );545 this.createTrList( tapasTexts["label.spectralUnit"], "ispectral_choice_" + this.nbRequest, tabObservation, 'spectralUnit' ); 546 this.createTr2Input( tapasTexts["label.spectralRange"], tapasTexts["label.to"], "iminspectral_ranger_" + this.nbRequest, "imaxspectral_ranger_" + this.nbRequest, tabObservation, "[350,2500] nm" ); 400 547 401 548 //fonction instrumentale 402 this.createTrList( tapasTexts["label.ifunction"], "ifunction ", tabObservation, "ilsf" );549 this.createTrList( tapasTexts["label.ifunction"], "ifunction_" + this.nbRequest, tabObservation, "ilsf" ); 403 550 //reference climato 404 551 //this.createTrList( tapasTexts["label.climato"], "icr", tabAtmosphere, "climatoReference" ); 405 this.createTrList( tapasTexts["label.climato"], "icr ", tabObservation, "climatoReference" );552 this.createTrList( tapasTexts["label.climato"], "icr_" + this.nbRequest, tabObservation, "climatoReference" ); 406 553 407 554 408 555 //this.createTr( tapasTexts["label.ira"], "ira", tabObservation ); 409 this.createTime( tabObservation, tapasTexts["label.ira"],"ira" ); 410 this.createTr( tapasTexts["label.ide"],"ide", tabObservation,"hh:mm:ss.ms [-90,90] °" ); 411 this.createTr( tapasTexts["label.iza"], "iza", tabObservation, "[0,90] °" ); 412 413 this.createTr( tapasTexts["label.resolution"], "irp", tabObservation, "" ); 414 this.createTr( tapasTexts["label.ratio"], "isr", tabObservation, "" ); 556 this.createTime( tabObservation, tapasTexts["label.ira"], "ira_" + this.nbRequest ); 557 this.createTr( tapasTexts["label.ide"], "ide_" + this.nbRequest, tabObservation, "hh:mm:ss.ms [-90,90] °" ); 558 this.createTr( tapasTexts["label.iza"], "iza_" + this.nbRequest, tabObservation, "[0,90] °" ); 559 560 this.createTr( tapasTexts["label.resolution"], "irp_" + this.nbRequest, tabObservation, "" ); 561 this.createTr( tapasTexts["label.ratio"], "isr_" + this.nbRequest, tabObservation, "" ); 562 415 563 416 564 //jQuery.proxy permet d'envoyer le contexte this courant 417 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 )} );418 565 419 566 }, … … 423 570 createTapasObject: function() 424 571 { 425 // PREFERENCE426 var preference = new Object();427 428 preference.format = new Object();429 //toutes les valeurs possibles430 preference.format.firstValue = this.selectFormats.getValuesInString();431 432 //la valeur selectionnee433 preference.format.secondValue = this.selectFormats.getValue();434 435 preference.rayleighExtinction = new Object();436 preference.rayleighExtinction.firstValue = this.select_ih2oe.getValuesInString();437 preference.rayleighExtinction.secondValue =this.select_irextinction.getValue();438 439 440 preference.h2oExtinction = new Object();441 preference.h2oExtinction.firstValue = this.select_ih2oe.getValuesInString();442 preference.h2oExtinction.secondValue = this.select_ih2oe.getValue();443 444 445 preference.o3Extinction = new Object();446 preference.o3Extinction.firstValue = this.select_io3e.getValuesInString();447 preference.o3Extinction.secondValue = this.select_io3e.getValue();448 449 preference.o2Extinction = new Object();450 preference.o2Extinction.firstValue = this.select_io2e.getValuesInString();451 preference.o2Extinction.secondValue = this.select_io2e.getValue();452 453 preference.co2Extinction = new Object();454 preference.co2Extinction.firstValue = this.select_ico2e.getValuesInString();455 preference.co2Extinction.secondValue = this.select_ico2e.getValue();456 457 458 // OBSERVATION459 var observatory = new Object();460 461 observatory.id = this.selectObservatories.getValue();462 463 // Los464 var los = new Object();465 466 467 los.raJ2000 = $( "#ira" ).val();468 los.decJ2000 = $( "#ide" ).val();469 470 471 los.zenithAngle = $( "#iza" ).val();472 473 474 // Instrument475 var instrument = new Object();476 477 instrument.ilsfChoice = new Object();478 instrument.ilsfChoice.firstValue = this.selectInstrumentalFunctions.getValuesInString();479 instrument.ilsfChoice.secondValue = this.selectInstrumentalFunctions.getValue();480 481 instrument.spectralChoice = new Object();482 this.selectSpectralUnits.remove("-1");483 instrument.spectralChoice.firstValue = this.selectSpectralUnits.getValuesInString();484 instrument.spectralChoice.secondValue = this.selectSpectralUnits.getValue();485 486 instrument.spectralRange = $( "#iminspectral_ranger" ).val()+' '+$( "#imaxspectral_ranger" ).val();487 488 489 instrument.resolvingPower=new Object();490 instrument.resolvingPower.secondValue=$( "#irp" ).val();491 492 instrument.samplingRatio = new Object();493 instrument.samplingRatio.secondValue = $( "#isr" ).val();494 495 var observation = new Object();496 observation.date = this.calendarConverter.parse( $( "#iobservation_date" ).val() );497 observation.observatory = observatory;498 499 observation.los = los;500 observation.instrument = instrument;501 502 503 // ATMOSPHERE504 var atmosphere = new Object();505 506 atmosphere.reference = new Object();507 atmosphere.reference.firstValue = this.selectClimatoReferences.getValuesInString();508 atmosphere.reference.secondValue = this.selectClimatoReferences.getValue();509 510 511 // REQUEST512 var request = new Object();513 request.id = 1;514 request.preference = preference;515 request.observation = observation;516 request.atmosphere = atmosphere;517 572 518 573 var requests = new Array(); 519 requests[0] = request; 574 575 for( var i = 1; i <= this.nbRequest; i++ ) 576 { 577 // PREFERENCE 578 var preference = new Object(); 579 580 preference.format = new Object(); 581 //toutes les valeurs possibles 582 preference.format.firstValue = this.selectFormats.getValuesInString(); 583 584 //la valeur selectionnee 585 preference.format.secondValue = this.selectFormats.getValue(); 586 587 preference.rayleighExtinction = new Object(); 588 preference.rayleighExtinction.firstValue = this.select_ih2oe.getValuesInString(); 589 preference.rayleighExtinction.secondValue = this.select_irextinction.getValue(); 590 591 592 preference.h2oExtinction = new Object(); 593 preference.h2oExtinction.firstValue = this.select_ih2oe.getValuesInString(); 594 preference.h2oExtinction.secondValue = this.select_ih2oe.getValue(); 595 596 597 preference.o3Extinction = new Object(); 598 preference.o3Extinction.firstValue = this.select_io3e.getValuesInString(); 599 preference.o3Extinction.secondValue = this.select_io3e.getValue(); 600 601 preference.o2Extinction = new Object(); 602 preference.o2Extinction.firstValue = this.select_io2e.getValuesInString(); 603 preference.o2Extinction.secondValue = this.select_io2e.getValue(); 604 605 preference.co2Extinction = new Object(); 606 preference.co2Extinction.firstValue = this.select_ico2e.getValuesInString(); 607 preference.co2Extinction.secondValue = this.select_ico2e.getValue(); 608 609 610 // OBSERVATION 611 var observatory = new Object(); 612 613 //observatory.id = this.selectObservatories.getValue(); 614 observatory.id = "3"; 615 616 // Los 617 var los = new Object(); 618 619 620 los.raJ2000 = $( "#ira_" + i ).val(); 621 los.decJ2000 = $( "#ide_" + i ).val(); 622 623 624 los.zenithAngle = $( "#iza_" + i ).val(); 625 626 627 // Instrument 628 var instrument = new Object(); 629 630 instrument.ilsfChoice = new Object(); 631 instrument.ilsfChoice.firstValue = this.selectInstrumentalFunctions.getValuesInString(); 632 instrument.ilsfChoice.secondValue = this.selectInstrumentalFunctions.getValue(); 633 634 instrument.spectralChoice = new Object(); 635 636 this.selectSpectralUnits.remove( "-1" ); 637 instrument.spectralChoice.firstValue = this.selectSpectralUnits.getValuesInString(); 638 instrument.spectralChoice.secondValue = this.selectSpectralUnits.getValue(); 639 640 instrument.spectralRange = $( "#iminspectral_ranger_" + i ).val() + ' ' + $( "#imaxspectral_ranger_" + i ).val(); 641 642 643 instrument.resolvingPower = new Object(); 644 instrument.resolvingPower.firstValue = "0"; 645 instrument.resolvingPower.secondValue = $( "#irp_" + i ).val(); 646 647 instrument.samplingRatio = new Object(); 648 instrument.samplingRatio.firstValue = "0"; 649 instrument.samplingRatio.secondValue = $( "#isr_" + i ).val(); 650 651 var observation = new Object(); 652 observation.date = this.calendarConverter.parse( $( "#iobservation_date_" + i ).val() ); 653 observation.observatory = observatory; 654 655 observation.los = los; 656 observation.instrument = instrument; 657 658 659 // ATMOSPHERE 660 var atmosphere = new Object(); 661 662 atmosphere.reference = new Object(); 663 atmosphere.reference.firstValue = this.selectClimatoReferences.getValuesInString(); 664 atmosphere.reference.secondValue = this.selectClimatoReferences.getValue(); 665 666 667 // REQUEST 668 var request = new Object(); 669 request.id = i; 670 request.preference = preference; 671 request.observation = observation; 672 request.atmosphere = atmosphere; 673 674 requests[i] = request; 675 } 520 676 521 677 // TAPAS … … 525 681 526 682 return tapas; 683 }, 684 685 validFields: function() 686 { 687 return ( 688 isSup( this.selectObservatories.getValue(), 0, tapasTexts["label.observatory"], tapasTexts["text.toselect"], this.containerErrors ) && 689 isDiff( this.selectSpectralUnits.getValue(), -1, tapasTexts["label.spectralUnit"], tapasTexts["text.toselect"] ) && 690 isValidRange( $( "#iminspectral_ranger" ).val(), $( "#imaxspectral_ranger" ).val(), this.selectSpectralUnits.getValue(), tapasTexts["label.spectralRange"], tapasTexts["text.badvalue"] ) && 691 isDeg( $( "#ide" ).val(), tapasTexts["label.ide"], tapasTexts["text.badvalue"] ) && 692 isValidNum( $( "#iza" ).val(), tapasTexts["label.iza"], tapasTexts["text.badvalue"] ) && isBetween( $( "#iza" ).val(), 0, 90, tapasTexts["label.iza"], tapasTexts["text.badvalue"] ) && 693 isValidNum( $( "#irp" ).val(), tapasTexts["label.resolution"], tapasTexts["text.badvalue"] ) && isSup( $( "#irp" ).val(), 1, tapasTexts["label.resolution"], tapasTexts["text.badvalue"] ) && 694 isValidNum( $( "#isr" ).val(), tapasTexts["label.ratio"], tapasTexts["text.badvalue"] ) && isSup( $( "#isr" ).val(), 1, tapasTexts["label.ratio"], tapasTexts["text.badvalue"] ) 695 ) 527 696 } 528 697 698 529 699 /*, 530 700 531 isEmpty: function(string){532 533 },534 535 536 isMail: function(email){537 538 },539 540 541 isInt: function(number){542 543 },544 545 546 isFloat: function(number){547 548 },549 550 551 isIP: function(ip){552 553 },554 555 556 557 isURL: function(string){558 559 },560 561 isValidNum: function(number) {562 563 564 }*/701 isEmpty: function(string){ 702 return (string.trim()==''); 703 }, 704 705 706 isMail: function(email){ 707 return (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email)); 708 }, 709 710 711 isInt: function(number){ 712 return (/^[0-9]+$/.test(number)); 713 }, 714 715 716 isFloat: function(number){ 717 return (/^[0-9]+(\.[0-9]+)?$/.test(number)); 718 }, 719 720 721 isIP: function(ip){ 722 return (/^(([0-2]*[0-9]+[0-9]+)\.([0-2]*[0-9]+[0-9]+)\.([0-2]*[0-9]+[0-9]+)\.([0-2]*[0-9]+[0-9]+))$/.test(ip)); 723 }, 724 725 726 727 isURL: function(string){ 728 return (/^(((ht|f)tp(s?))\:\/\/)([0-9a-zA-Z\-]+\.)+[a-zA-Z]{2,6}(\:[0-9]+)?(\/\S*)?$/.test(string.toLowerCase())); 729 }, 730 731 isValidNum: function(number) { 732 if (!this.isEmpty(number) && this.isFloat(number)) return true; 733 else return false; 734 }*/ 565 735 566 736 -
tapas/web/resources/css/button.css
r480 r490 140 140 button.red_button { 141 141 background-color: #574176; 142 height: 39px;142 height: 40px; 143 143 float: right; 144 144 margin-right: 0; -
tapas/web/resources/css/tapas.css
r489 r490 16 16 /** ********************** CONTAINER ******************** **/ 17 17 /** ***************************************************** **/ 18 .cfs1 { 19 border:2px solid white ; 20 -moz-border-radius:8px; 21 -webkit-border-radius:8px; 22 border-radius:8px; 23 padding-right:40px; 24 padding-left:30px; 25 margin-left:20px; 26 padding-bottom:30px; 18 button.positive, button.negative { 19 20 float:right; 21 } 22 23 .tab_class { 24 float: right; 25 background: #BFAFD6; 26 color: #574176; 27 margin-left: 11px; 28 margin-right: -10px; 29 padding: 4px; 30 -moz-border-radius: 4px 4px 0 0; 31 -webkit-border-radius: 4px 4px 0 0; 32 margin-top: 3px; 33 height:19px; 34 //-moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3); 35 //-webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3); 36 //box-shadow: 0 0 4px rgba(0, 0, 0, 0.3); 37 } 38 39 .tab_class.activated { 40 background: #574176; 41 color: #BFAFD6; 42 43 } 44 45 46 .divAll { 47 48 } 49 50 51 .cfs1 { 52 border: 2px solid white; 53 -moz-border-radius: 8px; 54 -webkit-border-radius: 8px; 55 border-radius: 8px; 56 padding-right: 40px; 57 padding-left: 30px; 58 margin-left: -10px; 59 padding-bottom: 30px; 27 60 } 28 61 29 62 .cfs2 { 30 border:2px solid white ; 31 -moz-border-radius:8px; 32 -webkit-border-radius:8px; 33 border-radius:8px; 34 padding-right:40px; 35 padding-bottom:30px; 36 margin-right:50px; 37 margin-left:0px; 38 padding-left:30px 39 } 40 63 border: 2px solid white; 64 -moz-border-radius: 8px; 65 -webkit-border-radius: 8px; 66 border-radius: 8px; 67 padding-right: 40px; 68 padding-bottom: 30px; 69 margin-right: 0px; 70 margin-left: -30px; 71 padding-left: 30px 72 } 41 73 42 74 .containerForm { 43 75 44 float:left; 45 width:1000px; 76 float: left; 77 width: 1000px; 78 height:400px; 79 80 } 81 82 .containerTabs { 83 84 float: right; 85 margin-top: -40px; 46 86 47 87 } 48 88 49 89 .divPreference { 50 margin-top: 20px;51 float: left;90 margin-top: 20px; 91 float: left; 52 92 } 53 93 54 94 #button_submit { 55 margin-right: 30px;95 margin-right: 30px; 56 96 57 97 } 58 98 59 99 .divObservation { 60 margin-top: 20px;61 margin-left: 30px;62 margin-right: 80px;63 float: left;100 margin-top: 20px; 101 margin-left: 30px; 102 margin-right: 80px; 103 float: left; 64 104 } 65 105 … … 93 133 font-size: 12px; 94 134 color: #574176; 95 // float: left;96 //margin-top: 10px;135 / / float : left; 136 / / margin-top : 10 px; 97 137 padding-left: 0px; 98 //width:100px;138 / / width : 100 px; 99 139 100 140 } … … 104 144 color: white; 105 145 font-weight: bold; 106 //margin-bottom: 10px;146 / / margin-bottom : 10 px; 107 147 padding-left: 20px; 108 text-align: right;148 text-align: right; 109 149 } 110 150 … … 113 153 color: white; 114 154 font-weight: bold; 115 //margin-bottom: 10px; 116 //padding-left: 20px; 117 } 118 155 / / margin-bottom : 10 px; 156 / / padding-left : 20 px; 157 } 119 158 120 159 .containerLabel3 { … … 123 162 font-weight: bold; 124 163 125 text-align:center; 126 } 127 164 text-align: center; 165 } 128 166 129 167 .containerTapas { … … 186 224 padding-left: 10px; 187 225 font-size: 11px; 188 top: 12px;226 top: 12px; 189 227 } 190 228 … … 215 253 float: left; 216 254 position: relative; 217 width: 800px;255 width: 150px; 218 256 height: 26px; 219 257 color: white; … … 221 259 padding-left: 10px; 222 260 padding-top: 4px; 223 top:19px; 224 text-decoration:underline; 261 top: 23px; 262 margin-right:600px; 263 text-decoration: underline; 225 264 226 265 } … … 229 268 color: white; 230 269 font-weight: bold; 231 font-size: 14px;270 font-size: 14px; 232 271 } 233 272 … … 237 276 background: -moz-linear-gradient(#574176, #bfafd6); 238 277 background: -webkit-linear-gradient(#574176, #bfafd6); 239 background: -ms-linear-gradient(white, #C03000) repeat scroll 0 0 transparent; /*For IE10*/278 background: -ms-linear-gradient(white, #C03000) repeat scroll 0 0 transparent; /*For IE10*/ 240 279 filter: progid:DXImageTransform.Microsoft.gradient(GradientType = 0, startColorstr = 'white', endColorstr = '#574176'); /*For IE7-8-9*/ 241 280 min-height: 400px; … … 249 288 .containerBottom { 250 289 background: #574176; 251 background: -moz-linear-gradient(left center, white, #574176); 252 /*background: -webkit-linear-gradient(white, #574176);*/ 290 background: -moz-linear-gradient(left center, white, #574176); /*background: -webkit-linear-gradient(white, #574176);*/ 253 291 background: -ms-linear-gradient(white, #574176) repeat scroll 0 0 transparent; /*For IE10*/ 254 292 filter: progid:DXImageTransform.Microsoft.gradient(GradientType = 0, startColorstr = 'white', endColorstr = '#574176'); /*For IE7-8-9*/ … … 275 313 } 276 314 315 .errorsForm { 316 background: white; 317 -moz-border-radius: 4px 4px 4px 4px; 318 -webkit-border-radius: 4px 4px 4px 4px; 319 border: 1px solid #574176; 320 color: red; 321 padding-bottom: 10px; 322 margin-left: 645px; 323 margin-right: 70px; 324 margin-top: 270px; 325 text-align: left; 326 font-weight: bold; 327 } 328 277 329 .containerErrors { 278 330 display: none; … … 293 345 /** ************************ OTHER ********************** **/ 294 346 /** ***************************************************** **/ 347 #button_submit { 348 height: 27px; 349 } 350 295 351 #tools .complexButton { 296 352 float: right; … … 372 428 /** ************ CALENDAR ************** **/ 373 429 /** ************************************ **/ 374 #iobservation_date{430 .calendar { 375 431 background-image: url("../../resources/icons/calendrier-icone-16x16.png"); 376 432 background-position: right center; … … 378 434 } 379 435 380 381 #ira { 436 .time { 382 437 background-image: url("../../resources/icons/icone_heure.png"); 383 background-position: bottom right;438 background-position: bottom right; 384 439 background-repeat: no-repeat; 385 440 386 387 388 } 441 } -
tapas/web/resources/js/classesForJQuery/LoginButton.js
r416 r490 251 251 if( this.anotherOnClickLogout ) 252 252 this.anotherOnClickLogout(); 253 254 document.location.href = "project?methodName=home"; 255 253 256 }, 254 257 -
tapas/web/resources/js/classesForJQuery/Tab.js
r469 r490 1 1 //******************************************************** 2 // Class Button3 // Display a button2 // Class Tab 3 // Display a tab 4 4 // 5 5 // use JQuery … … 12 12 //******************************************************** 13 13 14 var Button= Class.create( {14 var Tab = Class.create( { 15 15 initialize: function( param ) 16 16 { 17 17 // Init 18 this.numTab=param.numTab? param.numTab : 1; 18 19 this.id = param.id ? param.id : ""; 19 20 this.parent = param.parent ? param.parent : false; … … 21 22 this.title = param.title ? param.title : false; 22 23 this.className = param.className ? param.className : false; 23 this.classNameText = param.classNameText ? param.classNameText : false;24 24 this.callbackOnClick = param.onClick ? param.onClick : false; 25 this.callbackOnMouseOver = param.onMouseOver ? param.onMouseOver : false;26 this.callbackOnMouseOut = param.onMouseOut ? param.onMouseOut : false;27 25 this.contextToSave = param.contextToSave ? param.contextToSave : false; 28 this.boolDisabled = false;29 this.boolSelected = false;30 this.boolDisplayed = false;31 26 32 // Create buttonelements33 this.divContainer = $( document.createElement( " button" ) );27 // Create tab elements 28 this.divContainer = $( document.createElement( "div" ) ); 34 29 if( this.className ) 35 30 this.divContainer.addClass( this.className ); … … 38 33 else 39 34 this.divContainer.attr( {id:this.id} ); 35 36 this.divContainer.html( this.value ); 37 40 38 if( this.parent ) 41 39 this.parent.append( this.divContainer ); 42 40 43 this.divText = $( document.createElement( "div" ) );44 if( this.classNameText )45 this.divText.addClass( this.classNameText );46 this.divText.html( this.value );47 this.divContainer.append( this.divText );48 41 49 42 // Define button events 50 43 if( this.contextToSave ) 51 this.divContainer.bind( 'click', [this, this.contextToSave], this.onClick );44 this.divContainer.bind( 'click', [this, this.contextToSave], this.onClickEvent ); 52 45 else 53 this.divContainer.bind( 'click', this, this.onClick );54 this.divContainer.bind( 'mouseover', this, this.onHover ); 55 this.divContainer.bind( 'mouseout', this, this.onOut ); 46 this.divContainer.bind( 'click', this, this.onClickEvent ); 47 48 56 49 }, 57 50 58 51 // Getter / Setter ******************************************************** 59 60 52 getContainer: function() 61 53 { 62 54 return this.divContainer; 63 },64 65 isDisable : function()66 {67 return this.boolDisabled;68 },69 70 isSelected: function()71 {72 return this.boolSelected;73 55 }, 74 56 … … 85 67 86 68 // Actions ******************************************************** 87 disable : function()69 active : function() 88 70 { 89 this.boolDisabled = true; 90 this.divContainer.addClass( "disable" ); 71 this.divContainer.addClass( "activated" ); 91 72 }, 92 73 93 enable : function()74 inactive : function() 94 75 { 95 this.boolDisabled = false; 96 this.divContainer.removeClass( "disable" ); 76 this.divContainer.removeClass( "activated" ); 97 77 }, 98 78 99 select : function( value)79 remove : function() 100 80 { 101 this.boolSelected = value; 102 if( this.boolSelected ) 103 this.divContainer.addClass( "selected" ); 104 else 105 this.divContainer.removeClass( "selected" ); 106 }, 81 this.divContainer.remove(); 107 82 108 show : function()109 {110 this.boolDisplayed = true;111 this.divContainer.show();112 },113 114 hide : function()115 {116 this.boolDisplayed = false;117 this.divContainer.hide();118 83 }, 119 84 120 85 // Events ******************************************************** 121 onClick : function( event )86 onClickEvent : function( event ) 122 87 { 123 var contextButton = event.data; 124 var isContextToPut = false; 125 if( jQuery.isArray( event.data ) ) 126 { 127 isContextToPut = true; 128 contextButton = event.data[0]; 129 } 88 var clickedTab = event.data; 89 if( (undefined == event.detail || 1 == event.detail) && clickedTab.callbackOnClick ) 90 clickedTab.callbackOnClick( clickedTab ); 91 } 130 92 131 if( !contextButton.isDisable() && (undefined == event.detail || 1 == event.detail) && contextButton.callbackOnClick )132 if( isContextToPut )133 contextButton.callbackOnClick( event.data[1] );134 else135 contextButton.callbackOnClick();136 },137 138 onHover : function( event )139 {140 var contextButton = event.data;141 if( !contextButton.isDisable() && contextButton.callbackOnMouseOver )142 contextButton.callbackOnMouseOver();143 },144 145 onOut: function( event )146 {147 var contextButton = event.data;148 if( !contextButton.isDisable() && contextButton.callbackOnMouseOut )149 contextButton.callbackOnMouseOut();150 }151 93 } ); -
tapas/web/resources/js/tools/controls.js
r489 r490 2 2 * Created by IntelliJ IDEA. 3 3 * User: rboipsl 4 * Date: 18/04/12 4 * Date: 18/04/12 * 5 5 * Time: 11:26 6 6 */ 7 7 8 8 function isEmpty(string){ 9 9 10 return (string.trim()==''); 10 11 } … … 28 29 29 30 function isFloat(number,champ,texte){ 30 if (!(/^[0-9]+(\.[0-9]+)?$/.test(number))) { 31 //if (!(/^[0-9]+(\.[0-9]+)?$/.test(number))) { 32 if (!(/^([\+-])?([0-9])*(\.?[0-9]*)?$/.test(number))) { 31 33 alert(champ+' : '+texte); 32 return true;34 return false; 33 35 } 34 36 else { 35 return false;37 return true; 36 38 } 37 39 } … … 44 46 function isDeg(val,champ,texte){ 45 47 //return (/^(([0-2]*[0-9][0-9])\.([0-2]*[0-9][0-9])\.([0-2]*[0-9][0-9])\.([0-2]*[0-9][0-9]))$/.test(val)); 46 if ( !(/^(([\+-])?[0-9]?[0-9]):([0-9]+[0-9]+):([0-9]+[0-9]+)(\.) *([0-9]*[0-9]*[0-9]*)*$/.test(val)) || isEmpty(val)){48 if ( !(/^(([\+-])?[0-9]?[0-9]):([0-9]+[0-9]+):([0-9]+[0-9]+)(\.)?([0-9]*[0-9]*[0-9]*)*$/.test(val)) || isEmpty(val)){ 47 49 alert(champ+' : '+texte); 48 50 return false; … … 68 70 69 71 function isValidNum(number,champ,texte){ 72 //alert(number); 70 73 if (!isEmpty(number) && isFloat(number,champ,texte)) return true; 74 else { 75 alert(champ+' : '+texte); 76 this.dive 77 return false; 78 } 79 } 80 81 function isSup(number,limit,champ,texte,container) { 82 83 if (number >= limit) return true; 84 else { 85 container=champ+' : '+texte; 86 //container.html('ssss : '); 87 return false; 88 } 89 } 90 91 function isDiff(val,badvalue,champ,texte) { 92 93 if (val != badvalue) return true; 71 94 else { 72 95 alert(champ+' : '+texte); … … 74 97 } 75 98 } 99 100 function isBetween(number,limitinf,limitsup,champ,texte) { 101 102 if (number >= limitinf && number <= limitsup) return true; 103 else { 104 alert(champ+' : '+texte); 105 return false; 106 } 107 } 108 109 110 function isValidRange(val1,val2,unit,champ,texte) { 111 if (unit == 'NM_VACUUM' || unit == 'NM_STANDARD') { 112 if (isFloat(val1,champ,texte) && isFloat(val2,champ,texte) && parseFloat(val1) >= 350 && parseFloat(val2) <= 2500 && parseFloat(val1) <= parseFloat(val2) ) return true; 113 else { 114 alert(champ+' : '+texte); 115 return false; 116 } 117 } 118 } -
tapas/web/resources/templates/templateEther_script.jsp
r481 r490 31 31 32 32 var mailButton = new Button( {value:'<spring:message code="label.mail"/>', parent:this.containerTools, id:"button_mail", className: "red_button", classNameText:"red_button_text", onClick:jQuery.proxy( this.onClickMail, this )} ); 33 //var languageButton = new Button( {value:'<spring:message code="label.language.to.switch"/>', parent:this.containerTools, id:"button_language", className: "red_button", classNameText:"red_button_text", onClick:jQuery.proxy( this.onClickLanguage, this )} ); 33 34 var languageButton = new Button( {value:'<spring:message code="label.language.to.switch"/>', parent:this.containerTools, id:"button_language", className: "red_button", classNameText:"red_button_text", onClick:jQuery.proxy( this.onClickLanguage, this )} ); 34 35 //var homeButton = new Button( {value:'<spring:message code="label.home"/>', parent:this.containerTools, id:"button_home", className: "red_button", classNameText:"red_button_text", onClick:this.onClickHome} ); -
tapas/web/src/com/ether/Controller.java
r480 r490 16 16 import java.io.IOException; 17 17 import java.util.ArrayList; 18 import java.util.Date; 18 19 import java.util.List; 19 20 import java.util.Properties; … … 37 38 * @throws WebException 38 39 */ 39 @ControllerMethod(view = VIEW_FORM_TAPAS, loginMandatory = true, defaultView = VIEW_INDEX)40 @ControllerMethod(view = VIEW_FORM_TAPAS, loginMandatory = false, defaultView = VIEW_INDEX) 40 41 public JSONObject viewForm() 41 42 throws WebException 42 43 { 43 try44 { 45 final List<Observatory> allObservatories = getTapasService().getAllObservatories();44 /*try 45 { */ 46 //final List<Observatory> allObservatories = getTapasService().getAllObservatories(); 46 47 47 48 final JSONObject jsonObject = new JSONObject(); 48 49 jsonObject.put( "jSonFileFormats", getJSONFileFormat() ); 49 50 jsonObject.put( "jSonYesNos", getJSONYesNo() ); 50 jsonObject.put( "jSonObservatories", allObservatories );51 //jsonObject.put( "jSonObservatories", allObservatories ); 51 52 jsonObject.put( "jSonSpectralUnits", getJSONSpectralUnit() ); 52 53 jsonObject.put( "jSonInstrumentalFunctions", getJSONInstrumentalFunction() ); 53 54 jsonObject.put( "jSonClimatoReferences", getJSONClimatoReference() ); 54 55 return jsonObject; 55 }56 catch( ServiceException e )56 //} 57 /*catch( ServiceException e ) 57 58 { 58 59 throw new WebException( WebException.WebCode.ERROR_NO_OBSERVATORY_FOUND, e ); 59 } 60 } */ 60 61 61 62 } … … 73 74 * @throws WebException 74 75 */ 75 @ControllerMethod(jsonResult = true, userMandatory = true, defaultView = VIEW_INDEX) 76 public JSONObject createUserRequest( @ParamName("jsonTapas") @Mandatory @UseJSON final Tapas javaTapas, @NotNull final User user ) // TODO rajouter parametre USER 76 //@ControllerMethod(jsonResult = true, userMandatory = true, defaultView = VIEW_INDEX) 77 @ControllerMethod(jsonResult = true, userMandatory = false, defaultView = VIEW_INDEX) 78 //public JSONObject createUserRequest( @ParamName("jsonTapas") @Mandatory @UseJSON final Tapas javaTapas, @NotNull final User user ) 79 public JSONObject createUserRequest( @ParamName("jsonTapas") @Mandatory @UseJSON final Tapas javaTapas ) 77 80 throws WebException 78 81 { 82 83 /***********/ 84 final User user= new User(); 85 user.setId( 12 ); 86 user.setLastName( "tamere" ); 87 user.setEmail( "rbopipsl@ipsl.jussieu.fr" ); 88 user.setCreationDate( new Date() ); 89 user.setPassword( "pif" ); 90 /******/ 91 79 92 if( null == javaTapas ) 80 93 throw new WebException( WebException.WebCode.ERROR_JSON_TAPAS_IS_NULL, "Serialization error : jsonTapas is null", WebException.getExceptionThrowable() ); … … 115 128 try 116 129 { 117 getTapasService().execAppelQSub( user, prop );130 getTapasService().execAppelQSub( "popo", user, prop ); 118 131 } 119 132 catch( ServiceException e ) -
tapas/web/src/messages_en.properties
r489 r490 30 30 text.NONE=None 31 31 text.badvalue=bad value 32 text.toselect=must be selected 32 33 34 label.delButton=CANCEL 33 35 34 36 … … 55 57 error.ERROR_JSON_TAPAS_IS_NULL=Error to create the form 56 58 57 label.submitButton=RUN 59 label.submitButton=EXECUTE 60 label.addButton=ADD REQUEST 58 61 label.confirm=ARE YOU SURE YOU WANT TO SEND THIS REQUEST ? 62 label.requete=Request 59 63 60 64 label.spectralUnit.NM_STANDARD=Standard Wavelength (nm) -
tapas/web/src/messages_fr.properties
r489 r490 27 27 label.preferences=Préférences 28 28 29 label.delButton=ANNULER 30 29 31 text.validnum=doit être numérique 30 32 text.select=Sélectionnez 31 33 text.badvalue=mauvaise valeur 32 34 text.NONE=Aucune 35 text.toselect=à sélectionner 33 36 34 37 … … 41 44 42 45 title.home=Accueil 43 title.form=Formulaire req ête46 title.form=Formulaire requête 44 47 title.legals=Mentions légales 45 48 … … 58 61 59 62 label.submitButton=EXECUTER 63 label.addButton=ENREGISTRER 64 label.requete=Requete 60 65 61 66 label.spectralUnit.NM_STANDARD=Standard Wavelength (nm)
Note: See TracChangeset
for help on using the changeset viewer.