source: ether_iasi/trunk/web/project/quicklook_script.jsp @ 720

Last change on this file since 720 was 720, checked in by cbipsl, 11 years ago

Mise à jour interface quicklook

File size: 5.8 KB
Line 
1<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
2
3<script type="text/javascript">
4
5    var InterfaceIasi = Class.create( {
6        initialize: function()
7        {
8            /** *********** CONTAINERS *********** **/
9            this.parent = $( "#pageWrapper" );
10            this.containerTools = $( "#containerTools" );
11            this.containerQuickLookA = $( "#containerQuickLookA" );
12            this.containerQuickLookB = $( "#containerQuickLookB" );
13            this.containerErrors = $( "#errors" );
14
15            /** *********** VARIABLES *********** **/
16
17
18            this.createTools();
19        },
20
21
22        // CREATES AND BINDS ********************************************************
23        createTools: function()
24        {
25            this.createSelectSatellites();
26            this.createSelectProjections();
27            this.createSelectSpecies();
28            this.createCalendar();
29
30
31            var quickLookButton = new Button( {id:"quickLookButton", value:"<spring:message code="label.quicklook.button"/>", parent:this.containerTools, className: "small", onClick:jQuery.proxy( this.onClickButton, this )} );
32        },
33
34        createSelectSatellites: function()
35        {
36            var div = $( document.createElement( "div" ) );
37            div.html( '<spring:message code="label.satellite"/> :' );
38            div.addClass( "selectTools" );
39            this.containerTools.append( div );
40
41            var paramSelect = new Object();
42            paramSelect.id = "selectSatellites";
43            paramSelect.parent = div;
44            this.selectSatellites = new Select( paramSelect );
45            this.selectSatellites.add( "A", "MetOp-A" );
46            this.selectSatellites.add( "B", "MetOp-B" );
47            this.selectSatellites.add( "AB", '<spring:message code="label.either"/>' );
48            this.selectSatellites.selectFirst();
49        },
50
51        createSelectProjections: function()
52        {
53            var div = $( document.createElement( "div" ) );
54            div.html( '<spring:message code="label.projection"/> :' );
55            div.addClass( "selectTools" );
56            this.containerTools.append( div );
57
58            var paramSelect = new Object();
59            paramSelect.id = "selectProjections";
60            paramSelect.parent = div;
61            this.selectProjections = new Select( paramSelect );
62            this.selectProjections.add( "GL", '<spring:message code="label.globe"/>' );
63            this.selectProjections.add( "EU", '<spring:message code="label.europe"/>' );
64            this.selectProjections.add( "PN", '<spring:message code="label.pole.north"/>' );
65            this.selectProjections.add( "PS", '<spring:message code="label.pole.south"/>' );
66            this.selectProjections.selectFirst();
67        },
68
69        createSelectSpecies: function()
70        {
71            var div = $( document.createElement( "div" ) );
72            div.html( '<spring:message code="label.species"/> :' );
73            div.addClass( "selectTools" );
74            this.containerTools.append( div );
75
76            var paramSelect = new Object();
77            paramSelect.id = "selectSpecies";
78            paramSelect.parent = div;
79            this.selectSpecies = new Select( paramSelect );
80            this.selectSpecies.add( "CO", 'CO' );
81            this.selectSpecies.add( "H2O",'H2O' );
82            this.selectSpecies.add( "TS",'Temp. Surf.' )
83            this.selectSpecies.selectFirst();
84        },
85
86        createCalendar: function()
87        {
88            this.calendarFormat = "%Y-%m-%d";
89            this.calendarConverter = new AnyTime.Converter( { format: this.calendarFormat } );
90
91            AnyTime.picker( "beginDate", { format: this.calendarFormat, firstDOW: 1,
92                labelTitle: '<spring:message code="label.titlecalendar"/> :' ,
93                labelYear:  '<spring:message code="label.yearcalendar"/> :' ,
94                labelMonth:  '<spring:message code="label.monthcalendar"/> :',
95                labelDayOfMonth: '<spring:message code="label.daycalendar"/> :',
96
97                methodToCall: jQuery.proxy( this.onClickBeginDate, this )
98            } );
99
100
101
102//        $( "#beginDate" ).val( this.firstDate );
103//        $( "#endDate" ).val( this.lastDate );
104//        this.beginDate = this.calendarConverter.parse( $( "#beginDate" ).val() ).getTime();
105//        this.endDate = this.calendarConverter.parse( $( "#endDate" ).val() ).getTime();
106
107//        this.clearCalendarButton = new Button( {value:interfaceTexts["visualization.button.clear"], parent:this.containerOptionCalendar, id:"button_clear_calendar", className:"small", onClick:jQuery.proxy( this.onClickClear, this )} );
108
109        },
110
111        // REQUESTS ********************************************************
112        requestQuickLooksBySelectValues: function()
113        {
114            $.ajax( {
115                url: "statistic?methodName=searchMainStatisticsByProject&name=" + this.selectedLogo.id,
116                success:jQuery.proxy( this.handleQuickLooksBySelectValues, this ),
117                error: jQuery.proxy( this.showErrors, this )
118            } );
119        },
120
121
122        // HANDLES ********************************************************
123        handleQuickLooksBySelectValues: function( result )
124        {
125//        this.displaySummary();
126        },
127
128
129        // EVENTS ********************************************************
130        onClickButton: function()
131        {
132            alert( "paf : " + this.selectProjections.getValue() + ",  " + this.selectSatellites.getValue() );
133        },
134
135        onClickBeginDate: function()
136        {
137            this.beginDate = this.calendarConverter.parse( $( "#beginDate" ).val() ).getTime();
138        },
139
140        // OTHERS ********************************************************
141        showErrors: function( result )
142        {
143            this.containerErrors.show();
144            this.containerErrors.html( result );
145        }
146
147    } );
148
149</script>
Note: See TracBrowser for help on using the repository browser.