Changeset 2749 for TI05-delivery


Ignore:
Timestamp:
27/07/07 11:52:45 (12 years ago)
Author:
spascoe
Message:

Made ddc-vis.js compatible with IE6. Each form element needs it's own
onchange event in IE.

Location:
TI05-delivery/ows_framework/branches/ows_framework-ddp/ows_server/ows_server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/ows_framework/branches/ows_framework-ddp/ows_server/ows_server/lib/ddp_render.py

    r2747 r2749  
    140140         
    141141 
    142 def main(filename, grid_filename, output_prefix): 
     142def main(filename, grid_filename, output_prefix, vars=None): 
    143143 
    144144    bbox = (-16.5, 47.0, 4.5, 61.5) 
     
    168168    gridshape = None 
    169169 
     170    def init_plot(): 
     171        # Initialise the matplotlib figure 
     172        fig = pylab.figure() 
     173        # Make sure the aspect ratio of the figure is correct 
     174        fig_width = 8.0 
     175        fig_height = (ylim[1]-ylim[0])/(xlim[1]-xlim[0]) * fig_width 
     176        fig.set_size_inches(fig_width, fig_height) 
     177 
     178        # Initialise the matplotlib axes 
     179        ax = pylab.gca() 
     180        # Turn off anotations 
     181        ax.set_axis_off() 
     182        ax.set_frame_on(False) 
     183        ax.set_position((0,0,1,1)) 
     184 
     185        return ax 
     186 
    170187 
    171188    for variable in f.listvariables(): 
    172189 
     190        if vars and variable not in vars: 
     191            continue 
    173192 
    174193        # Only do variables with a grid (i.e. miss axes) 
     
    198217        minValue = min(var.flat) 
    199218        maxValue = max(var.flat) 
    200  
    201         def init_plot(): 
    202             # Initialise the matplotlib figure 
    203             fig = pylab.figure() 
    204             # Make sure the aspect ratio of the figure is correct 
    205             fig_width = 8.0 
    206             fig_height = (ylim[1]-ylim[0])/(xlim[1]-xlim[0]) * fig_width 
    207             fig.set_size_inches(fig_width, fig_height) 
    208  
    209             # Initialise the matplotlib axes 
    210             ax = pylab.gca() 
    211             # Turn off anotations 
    212             ax.set_axis_off() 
    213             ax.set_frame_on(False) 
    214             ax.set_position((0,0,1,1)) 
    215  
    216             return ax 
    217219 
    218220        # Loop over each time point 
     
    230232if __name__ == '__main__': 
    231233    import sys 
    232     (input_file, grid_file, out_prefix) = sys.argv[1:] 
     234    (input_file, grid_file, out_prefix) = sys.argv[1:4] 
     235    if len(sys.argv) > 4: 
     236        vars = sys.argv[4].split(',') 
     237    else: 
     238        vars = None 
    233239     
    234     main(input_file, grid_file, out_prefix) 
     240    main(input_file, grid_file, out_prefix, vars) 
  • TI05-delivery/ows_framework/branches/ows_framework-ddp/ows_server/ows_server/public/js/ddc-vis.js

    r2747 r2749  
    1515 
    1616        // DDP-specific form wiring 
    17         this.formElement = $(formDiv).getElementsByTagName('form')[0] 
    18         this.formElement.onchange = this.updateDdcLayer.bindAsEventListener(this); 
     17        this.formElement = $(formDiv).getElementsByTagName('form')[0]; 
     18        for (var i=0; i < this.formElement.elements.length; i++) { 
     19            this.formElement.elements[i].onchange = this.updateDdcLayer.bindAsEventListener(this); 
     20        } 
    1921 
    2022        this.selFormDiv = $(selFormDiv); 
Note: See TracChangeset for help on using the changeset viewer.