/[webpac]/trunk2/lib/WebPAC/Tree.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 /trunk2/lib/WebPAC/Tree.pm

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

revision 575 by dpavlin, Mon Nov 1 18:00:26 2004 UTC revision 583 by dpavlin, Tue Nov 2 17:17:51 2004 UTC
# Line 328  sub unroll { Line 328  sub unroll {
328    
329                          $log->debug("$code -> $v900 : $term [$mfn]");                          $log->debug("$code -> $v900 : $term [$mfn]");
330    
331                          my ($link_start,$link_end) = ('','');                          my ($link_start,$link_end,$level_el) = ('','','ul');
332                    
333                          my $have_children = $tree->[$level]->{'have_children'}->($code,$v900);                          my $have_children = $tree->[$level]->{'have_children'}->($code,$v900);
334    
# Line 347  sub unroll { Line 347  sub unroll {
347                                          my $url = $self->{'nodes_dir'} || $log->logdie("no nodes_dir?");                                          my $url = $self->{'nodes_dir'} || $log->logdie("no nodes_dir?");
348                                          $url .= "/${mfn}.html";                                          $url .= "/${mfn}.html";
349                                          $link_start = qq{<a href="#mfn$mfn" onClick="iframe_load('i$mfn','$url'); return toggle_display('id$mfn');">};                                          $link_start = qq{<a href="#mfn$mfn" onClick="iframe_load('i$mfn','$url'); return toggle_display('id$mfn');">};
350                                            $level_el = 'div';
351                                  }                                  }
352                          }                          }
353    
# Line 372  sub unroll { Line 373  sub unroll {
373                          my $style = $tree->[$level]->{'style'};                          my $style = $tree->[$level]->{'style'};
374    
375                          $html .= " " x $level .                          $html .= " " x $level .
376                                  qq{<ul id="id$mfn"}.                                  qq{<$level_el id="id$mfn"}.
377                                  ($style ? ' style="'.$style.'"' : '').                                  ($style ? ' style="'.$style.';"' : '').
378                                  qq{>\n};                                  qq{>\n};
379    
380                          if ($style) {                          if ($style) {
# Line 395  sub unroll { Line 396  sub unroll {
396    
397                                  # unroll to separate file                                  # unroll to separate file
398                                  $self->{'node_html'}->{$mfn} = $self->unroll($next_level, $have_children, $self->{'iframe_base'});                                  $self->{'node_html'}->{$mfn} = $self->unroll($next_level, $have_children, $self->{'iframe_base'});
399                                    $html .= " " x $level . qq{<span id="w$mfn" style="display: none;">Učitavanje podataka...</span>\n};
400    
401                                  $html .= " " x $level .                                  $html .= " " x $level .
402                                  qq{<iframe id="i$mfn" name="i$mfn" width="100%" height="0" frameborder="0" border="0" onLoad="iframe_resize(this.name);"></iframe>};                                  qq{<iframe id="i$mfn" name="i$mfn" width="100%" height="0" marginwidth="0" marginheight="0" style="margin: 0;" frameborder="0" border="0" onLoad="iframe_resize(this.name);"></iframe>\n};
403                                  @{$self->{'iframe_mfn'}->{$mfn}} = @{$self->{'mfn_arr'}};                                  @{$self->{'iframe_mfn'}->{$mfn}} = @{$self->{'mfn_arr'}};
404    
405                          } else {                          } else {
# Line 404  sub unroll { Line 407  sub unroll {
407                                  $html .= $self->unroll($next_level, $have_children, $base_path);                                  $html .= $self->unroll($next_level, $have_children, $base_path);
408                          }                          }
409    
410                          $html .= " " x $level . qq{</ul>\n};                          $html .= " " x $level . qq{</$level_el>\n};
411    
412                  }                  }
413          }          }
# Line 438  sub generate_js { Line 441  sub generate_js {
441          print JS "var show = ['",join("','",@{$self->{'show_ids'}}),"'];\n";          print JS "var show = ['",join("','",@{$self->{'show_ids'}}),"'];\n";
442          print JS "var hide = ['",join("','",@{$self->{'hide_ids'}}),"'];\n";          print JS "var hide = ['",join("','",@{$self->{'hide_ids'}}),"'];\n";
443    
444          print JS "var mfn_iframe = [\n";          my @mfn_iframe;
445    
446          foreach my $if (keys %{$self->{'iframe_mfn'}}) {          foreach my $if (keys %{$self->{'iframe_mfn'}}) {
447  #               print JS " ",join(",",map { "[$_:$if]" } @{$self->{'iframe_mfn'}->{$if}}),",\n";                  push @mfn_iframe, join(",", map { "$_:$if" } @{$self->{'iframe_mfn'}->{$if}});
448          }          }
449          print JS " null\n]\n";          
450            print JS "var mfn_iframe = {\n",join(",\n",@mfn_iframe),"\n};\n";
451    
452          close(JS);          close(JS);
453    

Legend:
Removed from v.575  
changed lines
  Added in v.583

  ViewVC Help
Powered by ViewVC 1.1.26