/[suikacvs]/test/html-webhacc/WebHACC/Output.pm
Suika

Diff of /test/html-webhacc/WebHACC/Output.pm

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

revision 1.11 by wakaba, Sun Aug 10 11:49:43 2008 UTC revision 1.12 by wakaba, Thu Aug 14 07:19:44 2008 UTC
# Line 138  sub start_section ($%) { Line 138  sub start_section ($%) {
138    if (defined $opt{id}) {    if (defined $opt{id}) {
139      my $id = $self->input->id_prefix . $opt{id};      my $id = $self->input->id_prefix . $opt{id};
140      $self->html (' id="' . $htescape->($id) . '">');      $self->html (' id="' . $htescape->($id) . '">');
141      if ($self->{section_rank} == 2) {      if ($self->{section_rank} == 2 or defined $opt{parent_id}) {
142        my $st = $opt{short_title} || $opt{title};        my $st = $opt{short_title} || $opt{title};
143        push @{$self->{nav}},        push @{$self->{nav}},
144            [$id => $st => $opt{text}];            [$id => $st => $opt{text}];
# Line 147  sub start_section ($%) { Line 147  sub start_section ($%) {
147        $self->html (qq[ addSectionLink ('] . $self->input->id_prefix .        $self->html (qq[ addSectionLink ('] . $self->input->id_prefix .
148                       qq[$id', ']);                       qq[$id', ']);
149        $self->nl_text ($st, text => $opt{text});        $self->nl_text ($st, text => $opt{text});
150          if (defined $opt{parent_id}) {
151            $self->html (q[', '] . $opt{parent_id});
152          }
153        $self->html (q[') ]);        $self->html (q[') ]);
154        $self->end_tag ('script');        $self->end_tag ('script');
155      }      }
# Line 454  sub generate_input_section ($$) { Line 457  sub generate_input_section ($$) {
457    my $options = sub ($) {    my $options = sub ($) {
458      my $context = shift;      my $context = shift;
459    
460      $out->html (q[<div class=details><p class=legend onclick="nextSibling.style.display = nextSibling.style.display == 'none' ? 'block' : 'none'">]);      $out->html (q[<div class="details default"><p class=legend onclick="nextSibling.style.display = nextSibling.style.display == 'block' ? 'none' : 'block'; parentNode.className = nextSibling.style.display == 'none' ? 'details' : 'details open'">]);
461      $out->nl_text (q[Options]);      $out->nl_text (q[Options]);
462      $out->start_tag ('div');      $out->start_tag ('div');
463    
# Line 532  sub generate_input_section ($$) { Line 535  sub generate_input_section ($$) {
535    }; # $options    }; # $options
536    
537    $out->start_section (id => 'input', title => 'Input');    $out->start_section (id => 'input', title => 'Input');
538      $out->html (q[<script> insertNavSections ('input') </script>]);
539    
540    $out->start_section (id => 'input-url', title => 'By URL');    $out->start_section (id => 'input-url', title => 'By URL',
541                           parent_id => 'input');
542    $out->start_tag ('form', action => './#result-summary',    $out->start_tag ('form', action => './#result-summary',
543                     'accept-charset' => 'utf-8',                     'accept-charset' => 'utf-8',
544                     method => 'get');                     method => 'get');
# Line 549  sub generate_input_section ($$) { Line 554  sub generate_input_section ($$) {
554                     value => $cgi->get_parameter ('uri'));                     value => $cgi->get_parameter ('uri'));
555    $out->end_tag ('label');    $out->end_tag ('label');
556    
   $options->('url');  
   
557    $out->start_tag ('p');    $out->start_tag ('p');
558    $out->start_tag ('button', type => 'submit');    $out->start_tag ('button', type => 'submit');
559    $out->nl_text ('Check');    $out->nl_text ('Check');
560      $out->end_tag ('button');
561    
562      $options->('url');
563    
564    $out->end_tag ('form');    $out->end_tag ('form');
565    $out->end_section;    $out->end_section;
# Line 562  sub generate_input_section ($$) { Line 568  sub generate_input_section ($$) {
568    
569    ## TODO: File upload    ## TODO: File upload
570    
571    $out->start_section (id => 'input-text', title => 'By direct input');    $out->start_section (id => 'input-text', title => 'By direct input',
572                           parent_id => 'input');
573    $out->start_tag ('form', action => './#result-summary',    $out->start_tag ('form', action => './#result-summary',
574                     'accept-charset' => 'utf-8',                     'accept-charset' => 'utf-8',
575                     method => 'post');                     method => 'post');
# Line 580  sub generate_input_section ($$) { Line 587  sub generate_input_section ($$) {
587    $out->end_tag ('textarea');    $out->end_tag ('textarea');
588    $out->end_tag ('label');    $out->end_tag ('label');
589    
   $options->('text');  
   
590    $out->start_tag ('p');    $out->start_tag ('p');
591    $out->start_tag ('button', type => 'submit',    $out->start_tag ('button', type => 'submit',
592                     onclick => 'form.method = form.s.value.length > 512 ? "post" : "get"');                     onclick => 'form.method = form.s.value.length > 512 ? "post" : "get"');
593    $out->nl_text ('Check');    $out->nl_text ('Check');
594    $out->end_tag ('button');    $out->end_tag ('button');
595    
596      $options->('text');
597    
598    $out->end_tag ('form');    $out->end_tag ('form');
599    $out->end_section;    $out->end_section;
600    
601      $out->script (q[
602        if (!document.webhaccNavigated &&
603            document.getElementsByTagName ('textarea')[0].value.length > 0) {
604          showTab ('input-text');
605          document.webhaccNavigated = false;
606        }
607      ]);
608    
609    $out->end_section;    $out->end_section;
610  } # generate_input_section  } # generate_input_section
611    

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24