Changeset 490 for tapas/web


Ignore:
Timestamp:
04/26/12 15:42:13 (12 years ago)
Author:
rboipsl
Message:

ajout onglets

Location:
tapas/web
Files:
11 edited
1 copied

Legend:

Unmodified
Added
Removed
  • tapas/web/init.jsp

    r481 r490  
    2020            <div id="errors"><spring:message code="${errors}"/></div> 
    2121        </c:if> 
    22                             Home 
     22 
     23 
     24 
    2325    </tiles:put> 
    2426 
  • tapas/web/project/formTapas.jsp

    r489 r490  
    2323        <ether:htmlJsp jspFile="formTapas_script"/> 
    2424        <ether:htmlJs jsFile="tools/controls"/> 
     25        <ether:htmlJs jsFile="classesForJQuery/Tab"/> 
    2526    </tiles:put> 
    2627 
     
    3536    <tiles:put name="body" type="string"> 
    3637 
     38        <div class="containerTabs" id="tab"></div> 
     39 
    3740        <div class="containerForm" id="formulaire"></div> 
    3841 
    39         <div id="errors"></div> 
     42        <div id="errForm" class="errorsForm"></div> 
    4043 
    4144        <script type="text/javascript"> 
     
    4346 
    4447            tapasTexts["label.submitButton"] = '<spring:message code="label.submitButton"/>'; 
     48            tapasTexts["label.addButton"] = '<spring:message code="label.addButton"/>'; 
     49 
    4550            tapasTexts["<%=WebException.WebCode.ERROR_JSON_TAPAS_IS_NULL%>"] = "<spring:message code="error.ERROR_JSON_TAPAS_IS_NULL"/>"; 
    4651            tapasTexts["<%=SpectralUnit.NM_STANDARD%>"] = "<spring:message code="label.spectralUnit.NM_STANDARD"/>"; 
     
    8388            tapasTexts["label.eo3"]="<spring:message code="label.eo3"/>"; 
    8489            tapasTexts["text.select"]="<spring:message code="text.select"/>"; 
     90            tapasTexts["text.toselect"]="<spring:message code="text.toselect"/>"; 
    8591 
    8692 
     
    9096            tapasTexts["text.badvalue"]="<spring:message code="text.badvalue"/>"; 
    9197 
     98            tapasTexts["label.requete"]="<spring:message code="label.requete"/>"; 
     99 
     100            tapasTexts["label.delButton"]="<spring:message code="label.delButton"/>"; 
    92101 
    93102 
    94103 
    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}); 
    96109 
    97110        </script> 
  • tapas/web/project/formTapas_script.jsp

    r489 r490  
    1  
    21<script type="text/javascript"> 
    32 
    43 
    5  
    64var InterfaceTapas = Class.create( { 
    75 
    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 ) 
    98    { 
    109        /** *********** CONTAINERS *********** **/ 
    1110        this.containerForm = $( "#formulaire" ); 
    12         this.containerErrors = $( "#errors" ); 
     11        //this.containerErrors = $( "#errors" ); 
     12        this.containerErrors = $( "#errForm" ); 
    1313        this.containerCenter = $( "#containerCenter" ); 
     14        this.containerTabs = $( "#tab" ); 
    1415 
    1516        this.jSonFileFormats = jsonFileFormats || null; 
    1617        this.jSonYesNos = jsonYesNos || null; 
    17         this.jSonObservatories = jsonObservatories || null; 
     18        //this.jSonObservatories = jsonObservatories || false; 
     19        this.jSonObservatories = false; 
    1820        this.jSonSpectralUnits = jsonSpectralUnits || null; 
    1921        this.jSonInstrumentalFunctions = jsonInstrumentalFunctions || null; 
    2022        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(); 
    2433 
    2534        this.createForm(); 
     35        this.tabActive = this.createTab(); 
    2636 
    2737    }, 
     
    2939 
    3040    // 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 ) 
    3252    { 
    3353        // Create input for date text 
    34         var inputDateId = "iobservation_date"; 
    3554        var tr = $( document.createElement( "tr" ) ); 
    3655        var td1 = $( document.createElement( "td" ) ); 
     
    4564 
    4665 
    47          td2.attr({colspan:4}); 
     66        td2.attr( {colspan:4} ); 
    4867        td2.append( inputDate ); 
    4968        tr.append( td2 ); 
     
    6079 
    6180        var currentDate = new Date(); 
    62         $( "#iobservation_date" ).val( this.calendarConverter.format( currentDate ) ); 
     81        $( "#" + inputDateId ).val( this.calendarConverter.format( currentDate ) ); 
     82        $( "#" + inputDateId ).addClass( "calendar" ); 
     83 
    6384    }, 
    6485 
    6586 
    6687    // CREATES ******************************************************** 
    67     createTime: function( containerCalendar, texte, input ) 
     88    createTime: function( containerCalendar, texte, inputDateId ) 
    6889    { 
    6990        // Create input for date text 
    70         var inputDateId = input; 
    7191        var tr = $( document.createElement( "tr" ) ); 
    7292        var td1 = $( document.createElement( "td" ) ); 
     
    81101 
    82102 
    83         td2.attr({colspan:3}); 
     103        td2.attr( {colspan:3} ); 
    84104        td2.append( inputDate ); 
    85105        tr.append( td2 ); 
    86106        containerCalendar.append( tr ); 
    87107 
    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, 
    93114            labelTitle: "Select hour", labelHour: "Hour", labelMinute: "Minute", labelSecond: "Second" 
    94115        } ); 
    95116 
    96         $( "#"+inputDateId ).val( "00:00:00" ); 
    97     }, 
     117 
     118        $( "#" + inputDateId ).val( "00:00:00" ); 
     119        $( "#" + inputDateId ).addClass( "time" ); 
     120    }, 
     121 
    98122 
    99123    createTr: function( texte, inputId, container, textesup ) 
     
    134158        return selectYesNos; 
    135159    }, 
     160 
    136161 
    137162 
     
    154179        td3.html( texte2 ); 
    155180        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"} ); 
    159184 
    160185        td2.append( input1 ); 
     
    171196 
    172197 
     198 
    173199    createTrList: function( texte, inputId, container, type ) 
    174200    { 
     
    184210 
    185211        tr.append( td1 ); 
    186         if( type == 'format' ) this.displayFileFormats( td2 ); 
     212        if( type == 'format' ) this.displayFileFormats( td2, inputId ); 
    187213        else if( type == 'yesno' ) 
    188214        { 
    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 ); 
    194220        } 
    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 ); 
    198225            //td2.attr({colspan:3}); 
    199226        } 
    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 ); 
    205231        } 
    206232 
    207         td2.attr({colspan:3}); 
     233        td2.attr( {colspan:3} ); 
    208234        tr.append( td2 ); 
    209235        container.append( tr ); 
    210236    }, 
    211  
    212  
    213  
    214237 
    215238 
     
    230253    }, 
    231254 
     255 
    232256    // HANDLES ******************************************************** = retours ajax 
    233257    handleCreateXML: function( result ) 
     
    241265    onClickSubmit: function() 
    242266    { 
    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               } 
    248354            } 
     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 
    249367        } 
    250368    }, 
    251369 
    252370 
     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 
    253388    // OTHERS ******************************************************** 
    254     displayFileFormats: function( container ) 
     389    displayFileFormats: function( container, id ) 
    255390    { 
    256391        var paramSelect = new Object(); 
    257         paramSelect.id = "select_formats"; 
     392        paramSelect.id = "select_" + id; 
    258393        paramSelect.parent = container; 
    259394        this.selectFormats = new Select( paramSelect ); 
     
    266401 
    267402 
    268     displayObservatories: function( container ) 
     403    displayObservatories: function( container, id ) 
    269404    { 
    270405        var paramSelect = new Object(); 
    271         paramSelect.id = "select_observatory"; 
     406        paramSelect.id = "select_" + id; 
    272407        paramSelect.parent = container; 
    273408        this.selectObservatories = new Select( paramSelect ); 
    274409        //ajouter select vide avec add 
    275         this.selectObservatories.add( "-1", "-- "+tapasTexts["text.select"]+" --" ); 
     410        this.selectObservatories.add( "-1", "-- " + tapasTexts["text.select"] + " --" ); 
    276411        jQuery.each( this.jSonObservatories, jQuery.proxy( function ( i, jsonObservatory ) 
    277412        { 
     
    282417 
    283418 
    284     displaySpectralUnits: function( container ) 
     419    displaySpectralUnits: function( container, id ) 
    285420    { 
    286421        var paramSelect = new Object(); 
    287         paramSelect.id = "select_spectral_unit"; 
     422        paramSelect.id = "select_" + id; 
    288423        paramSelect.parent = container; 
    289424        this.selectSpectralUnits = new Select( paramSelect ); 
    290425        //ajouter select vide avec add 
    291         this.selectSpectralUnits.add( "-1", "-- "+tapasTexts["text.select"]+" --" ); 
     426        this.selectSpectralUnits.add( "-1", "-- " + tapasTexts["text.select"] + " --" ); 
    292427        jQuery.each( this.jSonSpectralUnits, jQuery.proxy( function ( i, jsonSpectralUnit ) 
    293428        { 
     
    298433    }, 
    299434 
    300     displayInstrumentalFunctions: function( container ) 
     435    displayInstrumentalFunctions: function( container, id ) 
    301436    { 
    302437        var paramSelect = new Object(); 
    303         paramSelect.id = "select_instrumental_function"; 
     438        paramSelect.id = "select_" + id; 
    304439        paramSelect.parent = container; 
    305440        this.selectInstrumentalFunctions = new Select( paramSelect ); 
     
    313448 
    314449 
    315     displayClimatoReferences: function( container ) 
     450    displayClimatoReferences: function( container, id ) 
    316451    { 
    317452        var paramSelect = new Object(); 
    318         paramSelect.id = "select_climato_reference"; 
     453        paramSelect.id = "select_" + id; 
    319454        paramSelect.parent = container; 
    320455        this.selectClimatoReferences = new Select( paramSelect ); 
     
    330465    showErrors: function( result ) 
    331466    { 
    332         this.containerErrors.show(); 
    333         this.containerErrors.html( tapasTexts[result.responseText] ); 
     467        //this.containerErrors.show(); 
     468        // this.containerErrors.html( tapasTexts[result.responseText] ); 
    334469    }, 
    335470 
     
    338473    createForm: function() 
    339474    { 
    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 
    341484        var divPreference = $( document.createElement( "div" ) ); 
    342485        var tabPreference = $( document.createElement( "table" ) ); 
    343         tabPreference.attr({cellspacing:3}); 
     486        tabPreference.attr( {cellspacing:3} ); 
    344487 
    345488        var divObservation = $( document.createElement( "div" ) ); 
    346489        var tabObservation = $( document.createElement( "table" ) ); 
    347490        //tabObservation.attr({border:1}); 
    348         tabObservation.attr({cellspacing:3}); 
     491        tabObservation.attr( {cellspacing:3} ); 
    349492 
    350493 
     
    354497 
    355498        var fieldSetObservation = $( document.createElement( "fieldset" ) ); 
    356         fieldSetObservation.addClass("cfs1"); 
    357         divObservation.append(fieldSetObservation); 
     499        fieldSetObservation.addClass( "cfs1" ); 
     500        divObservation.append( fieldSetObservation ); 
    358501 
    359502        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" ); 
    363506 
    364507        var fieldSetPreference = $( document.createElement( "fieldset" ) ); 
    365         fieldSetPreference.addClass("cfs2"); 
    366         divPreference.append(fieldSetPreference); 
     508        fieldSetPreference.addClass( "cfs2" ); 
     509        divPreference.append( fieldSetPreference ); 
    367510 
    368511        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 
    376520 
    377521        divAtmosphere.append( tabAtmosphere ); 
     
    381525 
    382526        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 ); 
    385532        //this.tabInput = new Array(3); 
    386533 
    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 ); 
    396543 
    397544        //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" ); 
    400547 
    401548        //fonction instrumentale 
    402         this.createTrList( tapasTexts["label.ifunction"], "ifunction", tabObservation, "ilsf" ); 
     549        this.createTrList( tapasTexts["label.ifunction"], "ifunction_" + this.nbRequest, tabObservation, "ilsf" ); 
    403550        //reference climato 
    404551        //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" ); 
    406553 
    407554 
    408555        //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] &deg;" ); 
    411         this.createTr( tapasTexts["label.iza"], "iza", tabObservation, "[0,90] &deg;" ); 
    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] &deg;" ); 
     558        this.createTr( tapasTexts["label.iza"], "iza_" + this.nbRequest, tabObservation, "[0,90] &deg;" ); 
     559 
     560        this.createTr( tapasTexts["label.resolution"], "irp_" + this.nbRequest, tabObservation, "" ); 
     561        this.createTr( tapasTexts["label.ratio"], "isr_" + this.nbRequest, tabObservation, "" ); 
     562 
    415563 
    416564        //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 )} ); 
    418565 
    419566    }, 
     
    423570    createTapasObject: function() 
    424571    { 
    425         // PREFERENCE 
    426         var preference = new Object(); 
    427  
    428         preference.format = new Object(); 
    429         //toutes les valeurs possibles 
    430         preference.format.firstValue = this.selectFormats.getValuesInString(); 
    431  
    432         //la valeur selectionnee 
    433         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         // OBSERVATION 
    459         var observatory = new Object(); 
    460  
    461         observatory.id = this.selectObservatories.getValue(); 
    462  
    463         // Los 
    464         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         // Instrument 
    475         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         // ATMOSPHERE 
    504         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         // REQUEST 
    512         var request = new Object(); 
    513         request.id = 1; 
    514         request.preference = preference; 
    515         request.observation = observation; 
    516         request.atmosphere = atmosphere; 
    517572 
    518573        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        } 
    520676 
    521677        // TAPAS 
     
    525681 
    526682        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                ) 
    527696    } 
    528697 
     698 
    529699    /*, 
    530700 
    531     isEmpty: function(string){ 
    532         return (string.trim()==''); 
    533     }, 
    534  
    535  
    536     isMail: function(email){ 
    537         return (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email)); 
    538     }, 
    539  
    540  
    541     isInt: function(number){ 
    542         return (/^[0-9]+$/.test(number)); 
    543     }, 
    544  
    545  
    546     isFloat: function(number){ 
    547         return (/^[0-9]+(\.[0-9]+)?$/.test(number)); 
    548     }, 
    549  
    550  
    551     isIP: function(ip){ 
    552             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)); 
    553     }, 
    554  
    555  
    556  
    557     isURL: function(string){ 
    558         return (/^(((ht|f)tp(s?))\:\/\/)([0-9a-zA-Z\-]+\.)+[a-zA-Z]{2,6}(\:[0-9]+)?(\/\S*)?$/.test(string.toLowerCase())); 
    559     }, 
    560  
    561     isValidNum: function(number) { 
    562         if (!this.isEmpty(number) && this.isFloat(number)) return true; 
    563         else return false; 
    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     }*/ 
    565735 
    566736 
  • tapas/web/resources/css/button.css

    r480 r490  
    140140button.red_button { 
    141141    background-color: #574176; 
    142     height: 39px; 
     142    height: 40px; 
    143143    float: right; 
    144144    margin-right: 0; 
  • tapas/web/resources/css/tapas.css

    r489 r490  
    1616/** ********************** CONTAINER ******************** **/ 
    1717/** ***************************************************** **/ 
    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; 
     18button.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; 
    2760} 
    2861 
    2962.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} 
    4173 
    4274.containerForm { 
    4375 
    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; 
    4686 
    4787} 
    4888 
    4989.divPreference { 
    50     margin-top:20px; 
    51     float:left; 
     90    margin-top: 20px; 
     91    float: left; 
    5292} 
    5393 
    5494#button_submit { 
    55     margin-right:30px; 
     95    margin-right: 30px; 
    5696 
    5797} 
    5898 
    5999.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; 
    64104} 
    65105 
     
    93133    font-size: 12px; 
    94134    color: #574176; 
    95    // float: left; 
    96     //margin-top: 10px; 
     135/ / float : left; 
     136/ / margin-top : 10 px; 
    97137    padding-left: 0px; 
    98     //width:100px; 
     138/ / width : 100 px; 
    99139 
    100140} 
     
    104144    color: white; 
    105145    font-weight: bold; 
    106     //margin-bottom: 10px; 
     146/ / margin-bottom : 10 px; 
    107147    padding-left: 20px; 
    108     text-align:right; 
     148    text-align: right; 
    109149} 
    110150 
     
    113153    color: white; 
    114154    font-weight: bold; 
    115     //margin-bottom: 10px; 
    116     //padding-left: 20px; 
    117 } 
    118  
     155/ / margin-bottom : 10 px; 
     156/ / padding-left : 20 px; 
     157} 
    119158 
    120159.containerLabel3 { 
     
    123162    font-weight: bold; 
    124163 
    125     text-align:center; 
    126 } 
    127  
     164    text-align: center; 
     165} 
    128166 
    129167.containerTapas { 
     
    186224    padding-left: 10px; 
    187225    font-size: 11px; 
    188     top:12px; 
     226    top: 12px; 
    189227} 
    190228 
     
    215253    float: left; 
    216254    position: relative; 
    217     width: 800px; 
     255    width: 150px; 
    218256    height: 26px; 
    219257    color: white; 
     
    221259    padding-left: 10px; 
    222260    padding-top: 4px; 
    223     top:19px; 
    224     text-decoration:underline; 
     261    top: 23px; 
     262    margin-right:600px; 
     263    text-decoration: underline; 
    225264 
    226265} 
     
    229268    color: white; 
    230269    font-weight: bold; 
    231     font-size:14px; 
     270    font-size: 14px; 
    232271} 
    233272 
     
    237276    background: -moz-linear-gradient(#574176, #bfafd6); 
    238277    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*/ 
    240279    filter: progid:DXImageTransform.Microsoft.gradient(GradientType = 0, startColorstr = 'white', endColorstr = '#574176'); /*For IE7-8-9*/ 
    241280    min-height: 400px; 
     
    249288.containerBottom { 
    250289    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);*/ 
    253291    background: -ms-linear-gradient(white, #574176) repeat scroll 0 0 transparent; /*For IE10*/ 
    254292    filter: progid:DXImageTransform.Microsoft.gradient(GradientType = 0, startColorstr = 'white', endColorstr = '#574176'); /*For IE7-8-9*/ 
     
    275313} 
    276314 
     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 
    277329.containerErrors { 
    278330    display: none; 
     
    293345/** ************************ OTHER ********************** **/ 
    294346/** ***************************************************** **/ 
     347#button_submit { 
     348    height: 27px; 
     349} 
     350 
    295351#tools .complexButton { 
    296352    float: right; 
     
    372428/** ************ CALENDAR ************** **/ 
    373429/** ************************************ **/ 
    374 #iobservation_date { 
     430.calendar { 
    375431    background-image: url("../../resources/icons/calendrier-icone-16x16.png"); 
    376432    background-position: right center; 
     
    378434} 
    379435 
    380  
    381 #ira { 
     436.time { 
    382437    background-image: url("../../resources/icons/icone_heure.png"); 
    383     background-position:bottom right; 
     438    background-position: bottom right; 
    384439    background-repeat: no-repeat; 
    385440 
    386  
    387  
    388 } 
     441} 
  • tapas/web/resources/js/classesForJQuery/LoginButton.js

    r416 r490  
    251251        if( this.anotherOnClickLogout ) 
    252252            this.anotherOnClickLogout(); 
     253 
     254        document.location.href = "project?methodName=home"; 
     255 
    253256    }, 
    254257 
  • tapas/web/resources/js/classesForJQuery/Tab.js

    r469 r490  
    11//******************************************************** 
    2 // Class Button 
    3 // Display a button 
     2// Class Tab 
     3// Display a tab 
    44// 
    55// use JQuery 
     
    1212//******************************************************** 
    1313 
    14 var Button = Class.create( { 
     14var Tab = Class.create( { 
    1515    initialize: function( param ) 
    1616    { 
    1717        // Init 
     18        this.numTab=param.numTab? param.numTab : 1; 
    1819        this.id = param.id ? param.id : ""; 
    1920        this.parent = param.parent ? param.parent : false; 
     
    2122        this.title = param.title ? param.title : false; 
    2223        this.className = param.className ? param.className : false; 
    23         this.classNameText = param.classNameText ? param.classNameText : false; 
    2424        this.callbackOnClick = param.onClick ? param.onClick : false; 
    25         this.callbackOnMouseOver = param.onMouseOver ? param.onMouseOver : false; 
    26         this.callbackOnMouseOut = param.onMouseOut ? param.onMouseOut : false; 
    2725        this.contextToSave = param.contextToSave ? param.contextToSave : false; 
    28         this.boolDisabled = false; 
    29         this.boolSelected = false; 
    30         this.boolDisplayed = false; 
    3126 
    32         // Create button elements 
    33         this.divContainer = $( document.createElement( "button" ) ); 
     27        // Create tab elements 
     28        this.divContainer = $( document.createElement( "div" ) ); 
    3429        if( this.className ) 
    3530            this.divContainer.addClass( this.className ); 
     
    3833        else 
    3934            this.divContainer.attr( {id:this.id} ); 
     35 
     36        this.divContainer.html( this.value ); 
     37 
    4038        if( this.parent ) 
    4139            this.parent.append( this.divContainer ); 
    4240 
    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 ); 
    4841 
    4942        // Define button events 
    5043        if( this.contextToSave ) 
    51             this.divContainer.bind( 'click', [this, this.contextToSave], this.onClick ); 
     44            this.divContainer.bind( 'click', [this, this.contextToSave], this.onClickEvent ); 
    5245        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 
    5649    }, 
    5750 
    5851    // Getter / Setter ******************************************************** 
    59  
    6052    getContainer: function() 
    6153    { 
    6254        return this.divContainer; 
    63     }, 
    64  
    65     isDisable : function() 
    66     { 
    67         return this.boolDisabled; 
    68     }, 
    69  
    70     isSelected: function() 
    71     { 
    72         return this.boolSelected; 
    7355    }, 
    7456 
     
    8567 
    8668    // Actions ******************************************************** 
    87     disable : function() 
     69    active : function() 
    8870    { 
    89         this.boolDisabled = true; 
    90         this.divContainer.addClass( "disable" ); 
     71        this.divContainer.addClass( "activated" ); 
    9172    }, 
    9273 
    93     enable : function() 
     74    inactive : function() 
    9475    { 
    95         this.boolDisabled = false; 
    96         this.divContainer.removeClass( "disable" ); 
     76        this.divContainer.removeClass( "activated" ); 
    9777    }, 
    9878 
    99     select : function( value ) 
     79    remove : function() 
    10080    { 
    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(); 
    10782 
    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(); 
    11883    }, 
    11984 
    12085    // Events ******************************************************** 
    121     onClick : function( event ) 
     86    onClickEvent : function( event ) 
    12287    { 
    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    } 
    13092 
    131         if( !contextButton.isDisable() && (undefined == event.detail || 1 == event.detail) && contextButton.callbackOnClick ) 
    132             if( isContextToPut ) 
    133                 contextButton.callbackOnClick( event.data[1] ); 
    134             else 
    135                 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     } 
    15193} ); 
  • tapas/web/resources/js/tools/controls.js

    r489 r490  
    22 * Created by IntelliJ IDEA. 
    33 * User: rboipsl 
    4  * Date: 18/04/12 
     4 * Date: 18/04/12                                     * 
    55 * Time: 11:26 
    66 */ 
    77 
    88function isEmpty(string){ 
     9 
    910    return (string.trim()==''); 
    1011} 
     
    2829 
    2930function 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))) { 
    3133        alert(champ+' : '+texte); 
    32         return true; 
     34        return false; 
    3335    } 
    3436    else { 
    35         return false; 
     37        return true; 
    3638    } 
    3739} 
     
    4446function isDeg(val,champ,texte){ 
    4547    //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)){ 
    4749        alert(champ+' : '+texte); 
    4850        return false; 
     
    6870 
    6971function isValidNum(number,champ,texte){ 
     72    //alert(number); 
    7073    if (!isEmpty(number) && isFloat(number,champ,texte)) return true; 
     74    else { 
     75        alert(champ+' : '+texte); 
     76        this.dive 
     77        return false; 
     78    } 
     79} 
     80 
     81function 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 
     91function isDiff(val,badvalue,champ,texte) { 
     92 
     93    if (val != badvalue) return true; 
    7194    else { 
    7295        alert(champ+' : '+texte); 
     
    7497    } 
    7598} 
     99 
     100function 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 
     110function 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  
    3131 
    3232            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 )} ); 
    3334            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 )} ); 
    3435            //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  
    1616import java.io.IOException; 
    1717import java.util.ArrayList; 
     18import java.util.Date; 
    1819import java.util.List; 
    1920import java.util.Properties; 
     
    3738     * @throws WebException 
    3839     */ 
    39     @ControllerMethod(view = VIEW_FORM_TAPAS, loginMandatory = true, defaultView = VIEW_INDEX) 
     40    @ControllerMethod(view = VIEW_FORM_TAPAS, loginMandatory = false, defaultView = VIEW_INDEX) 
    4041    public JSONObject viewForm() 
    4142            throws WebException 
    4243    { 
    43         try 
    44         { 
    45             final List<Observatory> allObservatories = getTapasService().getAllObservatories(); 
     44        /*try 
     45        { */ 
     46            //final List<Observatory> allObservatories = getTapasService().getAllObservatories(); 
    4647 
    4748            final JSONObject jsonObject = new JSONObject(); 
    4849            jsonObject.put( "jSonFileFormats", getJSONFileFormat() ); 
    4950            jsonObject.put( "jSonYesNos", getJSONYesNo() ); 
    50             jsonObject.put( "jSonObservatories", allObservatories ); 
     51            //jsonObject.put( "jSonObservatories", allObservatories ); 
    5152            jsonObject.put( "jSonSpectralUnits", getJSONSpectralUnit() ); 
    5253            jsonObject.put( "jSonInstrumentalFunctions", getJSONInstrumentalFunction() ); 
    5354            jsonObject.put( "jSonClimatoReferences", getJSONClimatoReference() ); 
    5455            return jsonObject; 
    55         } 
    56         catch( ServiceException e ) 
     56        //} 
     57        /*catch( ServiceException e ) 
    5758        { 
    5859            throw new WebException( WebException.WebCode.ERROR_NO_OBSERVATORY_FOUND, e ); 
    59         } 
     60        } */ 
    6061 
    6162    } 
     
    7374     * @throws WebException 
    7475     */ 
    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 ) 
    7780            throws WebException 
    7881    { 
     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 
    7992        if( null == javaTapas ) 
    8093            throw new WebException( WebException.WebCode.ERROR_JSON_TAPAS_IS_NULL, "Serialization error : jsonTapas is null", WebException.getExceptionThrowable() ); 
     
    115128        try 
    116129        { 
    117             getTapasService().execAppelQSub( user, prop ); 
     130            getTapasService().execAppelQSub( "popo", user, prop ); 
    118131        } 
    119132        catch( ServiceException e ) 
  • tapas/web/src/messages_en.properties

    r489 r490  
    3030text.NONE=None 
    3131text.badvalue=bad value 
     32text.toselect=must be selected 
    3233 
     34label.delButton=CANCEL 
    3335 
    3436 
     
    5557error.ERROR_JSON_TAPAS_IS_NULL=Error to create the form 
    5658 
    57 label.submitButton=RUN 
     59label.submitButton=EXECUTE 
     60label.addButton=ADD REQUEST 
    5861label.confirm=ARE YOU SURE YOU WANT TO SEND THIS REQUEST ? 
     62label.requete=Request 
    5963 
    6064label.spectralUnit.NM_STANDARD=Standard Wavelength (nm) 
  • tapas/web/src/messages_fr.properties

    r489 r490  
    2727label.preferences=Préférences 
    2828 
     29label.delButton=ANNULER 
     30 
    2931text.validnum=doit être numérique 
    3032text.select=Sélectionnez 
    3133text.badvalue=mauvaise valeur 
    3234text.NONE=Aucune 
     35text.toselect=à sélectionner 
    3336 
    3437 
     
    4144 
    4245title.home=Accueil 
    43 title.form=Formulaire reqête 
     46title.form=Formulaire requête 
    4447title.legals=Mentions légales 
    4548 
     
    5861 
    5962label.submitButton=EXECUTER 
     63label.addButton=ENREGISTRER 
     64label.requete=Requete 
    6065 
    6166label.spectralUnit.NM_STANDARD=Standard Wavelength (nm) 
Note: See TracChangeset for help on using the changeset viewer.