Changeset 728


Ignore:
Timestamp:
01/18/13 15:45:15 (11 years ago)
Author:
vmipsl
Message:

data access

Location:
ether_iasi/trunk/web
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • ether_iasi/trunk/web/project/dataAccess.jsp

    r727 r728  
    4646 
    4747        <div class="containerAccess"> 
    48             <div class="title1"><spring:message code="label.access.level"/></div> 
     48            <div class="title1"><spring:message code="label.access.level"/></div><BR/> 
    4949            <div id="productLevel"></div> 
    5050            <div id="productLevelComment"></div> 
     
    5656 
    5757        <div id="temporal" class="containerAccess"> 
    58             <div class="title1"><spring:message code="label.access.temporal"/></div> 
     58            <div class="title1"><spring:message code="label.access.temporal"/></div><BR/> 
     59            <spring:message code="label.access.date.begin"/> : <input type="text" id="beginDate" size="15"/> 
     60            <spring:message code="label.access.date.end"/> : <input type="text" id="endDate" size="15"/> 
    5961        </div> 
    6062 
  • ether_iasi/trunk/web/project/dataAccess_script.jsp

    r727 r728  
    1717 
    1818            /** *********** VARIABLES *********** **/ 
    19  
     19            this.calendarFormat = "%Y-%m-%d %H:%i"; 
     20            this.beginDate = false; 
     21            this.endDate = false; 
     22            this.firstDate = formatDate( new Date() ); 
     23            this.lastDate = formatDate( addHoursToDate( new Date(), 1 ) ); 
    2024 
    2125            this.createTabs(); 
    2226            this.createProductLevels(); 
     27            this.createTemporal(); 
    2328        }, 
    2429 
     
    6671        }, 
    6772 
     73        createTemporal: function() 
     74        { 
     75            // Calendar 
     76            this.calendarConverter = new AnyTime.Converter( { format: this.calendarFormat } ); 
     77 
     78            AnyTime.picker( "beginDate", { format: this.calendarFormat, firstDOW: 1, 
     79                labelTitle: '<spring:message code="label.titlecalendar"/> :' , 
     80                labelYear:  '<spring:message code="label.yearcalendar"/> :' , 
     81                labelMonth:  '<spring:message code="label.monthcalendar"/> :', 
     82                labelDayOfMonth: '<spring:message code="label.daycalendar"/> :', 
     83                labelHour: '<spring:message code="label.hourcalendar"/> :', 
     84                labelMinute: '<spring:message code="label.minutecalendar"/> :', 
     85                methodToCall: jQuery.proxy( this.onClickBeginDate, this ) 
     86            } ); 
     87 
     88            AnyTime.picker( "endDate", { format: this.calendarFormat, firstDOW: 1, 
     89                labelTitle: '<spring:message code="label.titlecalendar"/> :' , 
     90                labelYear:  '<spring:message code="label.yearcalendar"/> :' , 
     91                labelMonth:  '<spring:message code="label.monthcalendar"/> :', 
     92                labelDayOfMonth: '<spring:message code="label.daycalendar"/> :', 
     93                labelHour: '<spring:message code="label.hourcalendar"/> :', 
     94                labelMinute: '<spring:message code="label.minutecalendar"/> :', 
     95                methodToCall: jQuery.proxy( this.onClickEndDate, this ), 
     96                idToUpdateEarliest: "beginDate" 
     97            } ); 
     98 
     99            $( "#beginDate" ).val( this.firstDate ); 
     100            $( "#endDate" ).val( this.lastDate ); 
     101            this.beginDate = this.calendarConverter.parse( $( "#beginDate" ).val() ).getTime(); 
     102            this.endDate = this.calendarConverter.parse( $( "#endDate" ).val() ).getTime(); 
     103 
     104            this.clearCalendarButton = new Button( {value:'<spring:message code="label.clear"/>', parent:this.containerTemporal, id:"button_clear_calendar", className:"small", onClick:jQuery.proxy( this.onClickClear, this )} ); 
     105        }, 
     106 
    68107        // REQUESTS ******************************************************** 
    69         requestQuickLooksBySelectValues: function() 
    70         { 
    71             $.ajax( { 
    72                 url: "project?methodName=getQuicklookByValues&satellite=" + this.selectSatellites.getValue() + "&projection=" + this.selectProjections.getValue() + "&species=" + this.selectSpecies.getValue() + "&date=" + this.beginDate, 
    73                 success:jQuery.proxy( this.handleQuickLooksBySelectValues, this ), 
    74                 error: jQuery.proxy( this.showErrors, this ) 
    75             } ); 
    76         }, 
     108//        requestQuickLooksBySelectValues: function() 
     109//        { 
     110//            $.ajax( { 
     111//                url: "project?methodName=getQuicklookByValues&satellite=" + this.selectSatellites.getValue() + "&projection=" + this.selectProjections.getValue() + "&species=" + this.selectSpecies.getValue() + "&date=" + this.beginDate, 
     112//                success:jQuery.proxy( this.handleQuickLooksBySelectValues, this ), 
     113//                error: jQuery.proxy( this.showErrors, this ) 
     114//            } ); 
     115//        }, 
    77116 
    78117 
    79118        // HANDLES ******************************************************** 
    80         handleQuickLooksBySelectValues: function( result ) 
    81         { 
    82  
    83             var plotName = jQuery.parseJSON( result ).plotNameResult; 
    84             this.containerQuickLookA.html( plotName ); 
    85         }, 
     119//        handleQuickLooksBySelectValues: function( result ) 
     120//        { 
     121// 
     122//            var plotName = jQuery.parseJSON( result ).plotNameResult; 
     123//            this.containerQuickLookA.html( plotName ); 
     124//        }, 
    86125 
    87126 
     
    109148        }, 
    110149 
     150        onClickClear: function() 
     151        { 
     152            $( "#beginDate" ).val( "" ); 
     153            this.beginDate = false; 
     154            $( "#endDate" ).val( "" ); 
     155            this.endDate = false; 
     156        }, 
     157 
     158        onClickBeginDate: function() 
     159        { 
     160            var oneHour = 60 * 60 * 1000; 
     161            var beginDateTime = this.calendarConverter.parse( $( "#beginDate" ).val() ).getTime(); 
     162            var endDateTime = null; 
     163            if( "" != $( "#endDate" ).val() ) 
     164                endDateTime = this.calendarConverter.parse( $( "#endDate" ).val() ).getTime(); 
     165            this.beginDateWithAnHourLater = new Date( beginDateTime + oneHour ); 
     166 
     167            if( null == endDateTime || endDateTime < beginDateTime ) 
     168                $( "#endDate" ).val( this.calendarConverter.format( this.beginDateWithAnHourLater ) ); 
     169 
     170            this.beginDate = this.calendarConverter.parse( $( "#beginDate" ).val() ).getTime(); 
     171            this.endDate = this.calendarConverter.parse( $( "#endDate" ).val() ).getTime(); 
     172        }, 
     173 
     174        onClickEndDate: function() 
     175        { 
     176            this.endDate = this.calendarConverter.parse( $( "#endDate" ).val() ).getTime(); 
     177        }, 
     178 
    111179        // OTHERS ******************************************************** 
    112180        showErrors: function( result ) 
  • ether_iasi/trunk/web/resources/css/iasi.css

    r727 r728  
    8989} 
    9090 
    91 #beginDate { 
     91#beginDate, #endDate { 
    9292    background-image: url("../../resources/icons/calendrier-icone-16x16.png"); 
    9393    background-position: right center; 
     
    100100} 
    101101 
    102 #productLevel { 
    103     margin-top: 10px; 
    104 } 
    105  
    106102#productLevelComment { 
    107103    margin: 10px; 
     
    109105    float: left; 
    110106    -moz-border-radius: 4px; 
    111     -moz-box-shadow: 0 0 2px rgba(0, 0, 0, 0.3); 
    112107    -webkit-border-radius: 4px; 
    113     -webkit-box-shadow: 0 0 2px rgba(0, 0, 0, 0.3); 
    114     box-shadow: 0 0 2px rgba(0, 0, 0, 0.3); 
    115     background: #3E647E; 
    116     color: white; 
     108    border: solid 1px #3E647E; 
     109    color: #3E647E; 
    117110    font-size: 11px; 
    118111} 
  • ether_iasi/trunk/web/resources/js/classesForJQuery/etherHelper.js

    r710 r728  
    7070} 
    7171 
     72// This method add days to a date 
     73function addDaysToDate( date, numberOfDays ) 
     74{ 
     75    var dayToMs = 24 * 60 * 60 * 1000; 
     76    var newDate = date.getTime() + numberOfDays * dayToMs; 
     77    return new Date( newDate ); 
     78} 
     79 
     80// This method add hours to a date 
     81function addHoursToDate( date, numberOfHours ) 
     82{ 
     83    var hourToMs = 60 * 60 * 1000; 
     84    var newDate = date.getTime() + numberOfHours * hourToMs; 
     85    return new Date( newDate ); 
     86} 
     87 
    7288// PAGINATION 
    7389function decrementPage( pageContainer, maxPageContainer ) 
  • ether_iasi/trunk/web/src/messages_en.properties

    r724 r728  
    2222label.monthcalendar=Month 
    2323label.daycalendar=Day 
     24label.hourcalendar=Hour 
     25label.minutecalendar=Minute 
    2426label.quicklook.button=Get quicklook 
    2527label.clear=Clear 
  • ether_iasi/trunk/web/src/messages_fr.properties

    r724 r728  
    2323label.monthcalendar=Mois 
    2424label.daycalendar=Jour 
     25label.hourcalendar=Heure 
     26label.minutecalendar=Minute 
    2527label.quicklook.button=Go quicklook 
    2628label.clear=Initialiser 
     
    4345label.access.satial=Spatiale 
    4446label.access.temporal=Temporel 
    45 label.access.date.begin=Date de Début 
    46 label.access.date.end=Date de Fin 
    47 label.access.time.begin=Heure de Départ (UTC) 
    48 label.access.time.end=Heure de Fin (UTC) 
     47label.access.date.begin=Date de Début (UTC) 
     48label.access.date.end=Date de Fin (UTC) 
    4949label.access.get=GO DONNEES 
Note: See TracChangeset for help on using the changeset viewer.