Changeset 496 for tapas/web/project
- Timestamp:
- 04/27/12 16:41:58 (12 years ago)
- Location:
- tapas/web/project
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tapas/web/project/formTapas.jsp
r490 r496 1 <%@ page import="com.ether.ClimatoReference" %> 2 <%@ page import="com.ether.InstrumentalFunction" %> 3 <%@ page import="com.ether.SpectralUnit" %> 1 4 <%@ page import="com.ether.WebException" %> 2 <%@ page import="com.ether.SpectralUnit" %>3 <%@ page import="com.ether.InstrumentalFunction" %>4 <%@ page import="com.ether.ClimatoReference" %>5 5 <%@ page import="com.ether.YesNo" %> 6 6 <%@ page contentType="text/html;charset=UTF-8" language="java" %> … … 67 67 tapasTexts["confirm"] = "<spring:message code="label.confirm"/>"; 68 68 69 tapasTexts["label.ira"] ="<spring:message code="label.ira"/>";70 tapasTexts["label.ide"] ="<spring:message code="label.ide"/>";71 tapasTexts["label.iza"] ="<spring:message code="label.iza"/>";72 tapasTexts["label.spectralUnit"] ="<spring:message code="label.spectralUnit"/>";73 tapasTexts["label.spectralRange"] ="<spring:message code="label.spectralRange"/>";74 tapasTexts["label.to"] ="<spring:message code="label.to"/>";75 tapasTexts["label.observatory"] ="<spring:message code="label.observatory"/>";76 tapasTexts["label.preferences"] ="<spring:message code="label.preferences"/>";77 tapasTexts["label.resolution"] ="<spring:message code="label.resolution"/>";78 tapasTexts["label.ratio"] ="<spring:message code="label.ratio"/>";79 tapasTexts["label.ifunction"] ="<spring:message code="label.ifunction"/>";80 tapasTexts["label.climato"] ="<spring:message code="label.climato"/>";81 tapasTexts["label.datemesure"] ="<spring:message code="label.datemesure"/>";69 tapasTexts["label.ira"] = "<spring:message code="label.ira"/>"; 70 tapasTexts["label.ide"] = "<spring:message code="label.ide"/>"; 71 tapasTexts["label.iza"] = "<spring:message code="label.iza"/>"; 72 tapasTexts["label.spectralUnit"] = "<spring:message code="label.spectralUnit"/>"; 73 tapasTexts["label.spectralRange"] = "<spring:message code="label.spectralRange"/>"; 74 tapasTexts["label.to"] = "<spring:message code="label.to"/>"; 75 tapasTexts["label.observatory"] = "<spring:message code="label.observatory"/>"; 76 tapasTexts["label.preferences"] = "<spring:message code="label.preferences"/>"; 77 tapasTexts["label.resolution"] = "<spring:message code="label.resolution"/>"; 78 tapasTexts["label.ratio"] = "<spring:message code="label.ratio"/>"; 79 tapasTexts["label.ifunction"] = "<spring:message code="label.ifunction"/>"; 80 tapasTexts["label.climato"] = "<spring:message code="label.climato"/>"; 81 tapasTexts["label.datemesure"] = "<spring:message code="label.datemesure"/>"; 82 82 83 tapasTexts["label.format"] ="<spring:message code="label.format"/>";84 tapasTexts["label.era"] ="<spring:message code="label.era"/>";85 tapasTexts["label.eo2"] ="<spring:message code="label.eo2"/>";86 tapasTexts["label.eh2o"] ="<spring:message code="label.eh2o"/>";87 tapasTexts["label.eco2"] ="<spring:message code="label.eco2"/>";88 tapasTexts["label.eo3"] ="<spring:message code="label.eo3"/>";89 tapasTexts["text.select"] ="<spring:message code="text.select"/>";90 tapasTexts["text.toselect"] ="<spring:message code="text.toselect"/>";83 tapasTexts["label.format"] = "<spring:message code="label.format"/>"; 84 tapasTexts["label.era"] = "<spring:message code="label.era"/>"; 85 tapasTexts["label.eo2"] = "<spring:message code="label.eo2"/>"; 86 tapasTexts["label.eh2o"] = "<spring:message code="label.eh2o"/>"; 87 tapasTexts["label.eco2"] = "<spring:message code="label.eco2"/>"; 88 tapasTexts["label.eo3"] = "<spring:message code="label.eo3"/>"; 89 tapasTexts["text.select"] = "<spring:message code="text.select"/>"; 90 tapasTexts["text.toselect"] = "<spring:message code="text.toselect"/>"; 91 91 92 92 93 tapasTexts["label.datemesure"] ="<spring:message code="label.datemesure"/>";93 tapasTexts["label.datemesure"] = "<spring:message code="label.datemesure"/>"; 94 94 95 tapasTexts["text.validnum"] ="<spring:message code="text.validnum"/>";96 tapasTexts["text.badvalue"] ="<spring:message code="text.badvalue"/>";95 tapasTexts["text.validnum"] = "<spring:message code="text.validnum"/>"; 96 tapasTexts["text.badvalue"] = "<spring:message code="text.badvalue"/>"; 97 97 98 tapasTexts["label.requete"] ="<spring:message code="label.requete"/>";98 tapasTexts["label.requete"] = "<spring:message code="label.requete"/>"; 99 99 100 tapasTexts["label.delButton"] ="<spring:message code="label.delButton"/>";100 tapasTexts["label.delButton"] = "<spring:message code="label.delButton"/>"; 101 101 102 103 104 105 106 107 //var interfaceTapas = new InterfaceTapas(${jSonFileFormats},${jSonYesNos},${jSonObservatories},${jSonSpectralUnits},${jSonInstrumentalFunctions},${jSonClimatoReferences}); 108 var interfaceTapas = new InterfaceTapas(${jSonFileFormats},${jSonYesNos},${jSonSpectralUnits},${jSonInstrumentalFunctions},${jSonClimatoReferences}); 109 102 var interfaceTapas = new InterfaceTapas( ${jSonFileFormats}, ${jSonYesNos}, ${jSonObservatories}, ${jSonSpectralUnits}, ${jSonInstrumentalFunctions}, ${jSonClimatoReferences} ); 110 103 </script> 111 104 -
tapas/web/project/formTapas_script.jsp
r495 r496 4 4 var InterfaceTapas = Class.create( { 5 5 6 //initialize: function( jsonFileFormats, jsonYesNos, jsonObservatories, jsonSpectralUnits, jsonInstrumentalFunctions, jsonClimatoReferences ) 7 initialize: function( jsonFileFormats, jsonYesNos, jsonSpectralUnits, jsonInstrumentalFunctions, jsonClimatoReferences ) 6 initialize: function( jsonFileFormats, jsonYesNos, jsonObservatories, jsonSpectralUnits, jsonInstrumentalFunctions, jsonClimatoReferences ) 8 7 { 9 8 /** *********** CONTAINERS *********** **/ … … 16 15 this.jSonFileFormats = jsonFileFormats || null; 17 16 this.jSonYesNos = jsonYesNos || null; 18 //this.jSonObservatories = jsonObservatories || false; 19 this.jSonObservatories = false; 17 this.jSonObservatories = jsonObservatories || false; 20 18 this.jSonSpectralUnits = jsonSpectralUnits || null; 21 19 this.jSonInstrumentalFunctions = jsonInstrumentalFunctions || null; … … 35 33 this.createForm(); 36 34 this.tabActive = this.createTab(); 37 38 35 }, 39 36 … … 42 39 createTab:function() 43 40 { 44 45 41 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 )} ); 46 42 ntab.active(); 47 43 return ntab; 48 49 44 }, 50 45 … … 265 260 handleCreateXML: function( result ) 266 261 { 262 // TODO : gérer le bob ?? 267 263 var bob = jQuery.parseJSON( result ).result; 268 264 alert( bob ); … … 301 297 this.createForm(); 302 298 303 this.delRequestButton.enable(); 304 if( 9 == this.nbRequest ) this.addRequestButton.disable(); 305 else this.addRequestButton.enable(); 299 this.updateButtons(); 306 300 } 307 301 }, … … 324 318 this.tabActive.numTab = "1"; 325 319 this.numRequest = "1"; 326 // this.nbRequest--;327 if( 1 >= this.nbRequest )328 this.delRequestButton.disable();329 330 if( 9 == this.nbRequest ) this.addRequestButton.disable();331 else this.addRequestButton.enable();332 320 333 321 for( var i = 1; i <= this.nbRequest; i++ ) … … 340 328 $( "#tab_request" + i ).attr( {name:z} ); 341 329 //document.getElementById("tab_request"+i).name=z; 342 document.getElementById( "tab_request" + i ).id = "tab_request" + z;343 document.getElementById( "tabObservation_" + i ).id = "tabObservation_" + z;344 document.getElementById( "select_iobservatory_" + i ).id = "select_iobservatory_" + z;345 document.getElementById( "select_ispectral_choice_" + i ).id = "select_ispectral_choice_" + z;346 document.getElementById( "iminspectral_ranger_" + i ).id = "iminspectral_ranger_" + z;347 document.getElementById( "imaxspectral_ranger_" + i ).id = "imaxspectral_ranger_" + z;348 document.getElementById( "select_ifunction_" + i ).id = "select_ifunction_" + z;349 document.getElementById( "select_icr_" + i ).id = "select_icr_" + z;350 document.getElementById( "ide_" + i ).id = "ide_" + z;351 document.getElementById( "iza_" + i ).id = "iza_" + z;352 document.getElementById( "irp_" + i ).id = "irp_" + z;353 document.getElementById( "isr_" + i ).id = "isr_" + z;354 document.getElementById( "select_iformat_" + i ).id = "select_iformat_" + z;355 document.getElementById( "select_irextinction_" + i ).id = "select_irextinction_" + z;356 document.getElementById( "select_ih2oe_" + i ).id = "select_ih2oe_" + z;357 document.getElementById( "select_io2e_" + i ).id = "select_io2e_" + z;358 document.getElementById( "select_io3e_" + i ).id = "select_io3e_" + z;359 document.getElementById( "select_ico2e_" + i ).id = "select_ico2e_" + z;330 $( "#tab_request" + i ).attr( {id:"tab_request" + z} ); 331 $( "#tabObservation_" + i ).attr( {id:"tabObservation_" + z} ); 332 $( "#select_iobservatory_" + i ).attr( {id:"select_iobservatory_" + z} ); 333 $( "#select_ispectral_choice_" + i ).attr( {id:"select_ispectral_choice_" + z} ); 334 $( "#iminspectral_ranger_" + i ).attr( {id:"iminspectral_ranger_" + z} ); 335 $( "#imaxspectral_ranger_" + i ).attr( {id:"imaxspectral_ranger_" + z} ); 336 $( "#select_ifunction_" + i ).attr( {id:"select_ifunction_" + z} ); 337 $( "#select_icr_" + i ).attr( {id:"select_icr_" + z} ); 338 $( "#ide_" + i ).attr( {id:"ide_" + z} ); 339 $( "#iza_" + i ).attr( {id:"iza_" + z} ); 340 $( "#irp_" + i ).attr( {id:"irp_" + z} ); 341 $( "#isr_" + i ).attr( {id:"isr_" + z} ); 342 $( "#select_iformat_" + i ).attr( {id:"select_iformat_" + z} ); 343 $( "#select_irextinction_" + i ).attr( {id:"select_irextinction_" + z} ); 344 $( "#select_ih2oe_" + i ).attr( {id:"select_ih2oe_" + z} ); 345 $( "#select_io2e_" + i ).attr( {id:"select_io2e_" + z} ); 346 $( "#select_io3e_" + i ).attr( {id:"select_io3e_" + z} ); 347 $( "#select_ico2e_" + i ).attr( {id:"select_ico2e_" + z} ); 360 348 361 349 // Supression du calendrier puis re-création en insérant l'ancienne date … … 363 351 AnyTime.noPicker( "iobservation_date_" + i ); 364 352 this.createCalendar( $( "#tabObservation_" + z ), tapasTexts["label.datemesure"], "iobservation_date_" + z, oldDate, false ); 365 document.getElementById( "iobservation_date_" + i ).id = "iobservation_date_" + z;353 $( "#iobservation_date_" + i ).attr( {id:"iobservation_date_" + z} ); 366 354 367 355 // Idem pour les heures !!! … … 371 359 AnyTime.noPicker( "ira_" + i ); 372 360 this.createTime( $( "#tabObservation_" + z ), tapasTexts["label.ira"], "ira_" + z, oldTime, false ); 373 document.getElementById( "ira_" + i ).id = "ira_" + z; 374 // z++; 361 $( "#ira_" + i ).attr( {id:"ira_" + z} ); 375 362 } 376 363 } 377 364 378 365 this.nbRequest--; 366 367 // Mise à jour des boutons 368 this.updateButtons(); 379 369 380 370 //tabs … … 405 395 this.tabActive.numTab = realTabId; 406 396 407 if( 1 == realTabId ) this.delRequestButton.disable(); 408 else this.delRequestButton.enable(); 397 this.updateButtons(); 409 398 }, 410 399 … … 702 691 var tapas = new Object(); 703 692 tapas.requests = requests; 704 705 706 693 return tapas; 707 694 }, … … 718 705 isValidNum( $( "#isr" ).val(), tapasTexts["label.ratio"], tapasTexts["text.badvalue"] ) && isSup( $( "#isr" ).val(), 1, tapasTexts["label.ratio"], tapasTexts["text.badvalue"] ) 719 706 ) 707 }, 708 709 updateButtons: function() 710 { 711 if( 1 < this.nbRequest ) 712 this.delRequestButton.enable(); 713 else 714 this.delRequestButton.disable(); 715 716 if( 9 <= this.nbRequest ) 717 this.addRequestButton.disable(); 718 else 719 this.addRequestButton.enable(); 720 720 } 721 721 722 723 /*,724 725 isEmpty: function(string){726 return (string.trim()=='');727 },728 729 730 isMail: function(email){731 return (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email));732 },733 734 735 isInt: function(number){736 return (/^[0-9]+$/.test(number));737 },738 739 740 isFloat: function(number){741 return (/^[0-9]+(\.[0-9]+)?$/.test(number));742 },743 744 745 isIP: function(ip){746 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));747 },748 749 750 751 isURL: function(string){752 return (/^(((ht|f)tp(s?))\:\/\/)([0-9a-zA-Z\-]+\.)+[a-zA-Z]{2,6}(\:[0-9]+)?(\/\S*)?$/.test(string.toLowerCase()));753 },754 755 isValidNum: function(number) {756 if (!this.isEmpty(number) && this.isFloat(number)) return true;757 else return false;758 }*/759 760 761 722 } ); 762 723 763 764 724 </script>
Note: See TracChangeset
for help on using the changeset viewer.