/[Frey]/trunk/lib/Frey/Action.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/Frey/Action.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 940 by dpavlin, Tue Jan 6 13:18:43 2009 UTC revision 950 by dpavlin, Tue Jan 6 23:42:59 2009 UTC
# Line 116  sub params_form { Line 116  sub params_form {
116          warn "# $class config = ",dump( $params_config ) if $self->debug;          warn "# $class config = ",dump( $params_config ) if $self->debug;
117    
118          my $form;          my $form;
119            my $form_id = $class;
120            $form_id =~ s{\W+}{_}g;
121    
122          sub select_values {          sub select_values {
123                  my ( $name, $attr_type, $values ) = @_;                  my ( $name, $attr_type, $values ) = @_;
124    
125                    $attr_type ||= '?' and warn "$name doesn't have attr_type";
126    
127                  my $max_value_len = 0;                  my $max_value_len = 0;
128                  my @values;                  my @values;
129                  my $html = '';                  my $html = '';
# Line 160  sub params_form { Line 164  sub params_form {
164                                                  $delimiter                                                  $delimiter
165                                  |) } @values                                  |) } @values
166                          );                          );
167                            if ( $radio ) {
168                                    
169                                    my $size = int( $max_value_len / $self->input_step_size ) + 1;
170                                    $size = 5 if $size > 5;
171                                    $size *= $self->input_step_size;
172                                    $radio .= qq|
173                                            <span>
174                                            <input type="radio" name="$name" value=" " onclick="document.getElementById('new-$name').focus();" >
175                                            <input type="text" name="new-$name" id="new-$name" onchange="clear_radio('$form_id','$name'); this.disable = false;" onblur="this.disable = true;" title="enter new value" size="$size">
176                                            </span>
177                                    |;
178                            }
179                          $html = qq|<div style="display: block;">$radio</div>|;                          $html = qq|<div style="display: block;">$radio</div>|;
180                  }                  }
181    
# Line 168  sub params_form { Line 184  sub params_form {
184                          $html                          $html
185          }          }
186    
187    
188          foreach my $checkbox ( split(/\s+/, $default->{'frey-checkboxes'} ) ) {          foreach my $checkbox ( split(/\s+/, $default->{'frey-checkboxes'} ) ) {
189                  next if defined $default->{ $checkbox };                  next if defined $default->{ $checkbox };
190    
# Line 234  sub params_form { Line 251  sub params_form {
251          }          }
252          $form .= qq|<input type="hidden" name="frey-checkboxes" value="| . join(' ', @checkboxes) . qq|">| if @checkboxes;          $form .= qq|<input type="hidden" name="frey-checkboxes" value="| . join(' ', @checkboxes) . qq|">| if @checkboxes;
253    
254            $self->add_js('static/Frey/Action.js');
255    
256          $self->add_css(qq|          $self->add_css(qq|
257                  label,input {                  label,input {
258                          display: block;                          display: block;
# Line 241  sub params_form { Line 260  sub params_form {
260                          margin-bottom: 10px;                          margin-bottom: 10px;
261                  }                  }
262    
263                    input:focus {
264                            border-color: #cc0;
265                    }
266    
267                  label {                  label {
268                          text-align: right;                          text-align: right;
269                          width: ${label_width}ex;                          width: ${label_width}ex;
# Line 259  sub params_form { Line 282  sub params_form {
282    
283          $html = qq|          $html = qq|
284                  <h1>$class params</h1>                  <h1>$class params</h1>
285                  <form method="post">                  <form name="$form_id" id="$form_id" method="post">
286                  $form                  $form
287                  <input type="submit" value="Run $class">                  <input type="submit" value="Run $class">
288                  </form>                  </form>

Legend:
Removed from v.940  
changed lines
  Added in v.950

  ViewVC Help
Powered by ViewVC 1.1.26