/[PLies]/burst.pl
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 /burst.pl

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

revision 1.9 by dpavlin, Sat May 5 19:48:33 2001 UTC revision 1.12 by dpavlin, Tue May 8 12:14:35 2001 UTC
# Line 189  my $sep = $/; Line 189  my $sep = $/;
189  $/ = undef;  $/ = undef;
190  open(ALL, $all) || die "Error: Cannot open file: $all";  open(ALL, $all) || die "Error: Cannot open file: $all";
191  my $buf = <ALL>;  my $buf = <ALL>;
192    $buf =~ s/\r//g;        # remove WINDOWS \r    
193  close(ALL);  close(ALL);
194  $/ = $sep;  $/ = $sep;
195    
# Line 232  Text::FastTemplate->defaults( Line 233  Text::FastTemplate->defaults(
233  Text::FastTemplate->preload( [  Text::FastTemplate->preload( [
234                  { file => 'slide.html', key => 'slide' },                  { file => 'slide.html', key => 'slide' },
235                  { file => 'overview.html', key => 'overview' },                  { file => 'overview.html', key => 'overview' },
236                    { file => 'title.html', key => 'title' },
237          ]);          ]);
238    
239  ## unroll relative anchors (#something) into links with slides  ## unroll relative anchors (#something) into links with slides
# Line 412  sub addTitle Line 414  sub addTitle
414          if ($nr % $toc_on_page == 0) {          if ($nr % $toc_on_page == 0) {
415                  my $toc_nr=int($nr/$toc_on_page);                  my $toc_nr=int($nr/$toc_on_page);
416    
417                  %item = (                  $item = {
418                          pre_html => $pre_ul,                          pre_html => $pre_ul,
419                          accesskey => " ",       # space                          accesskey => " ",       # space
420                          href => "index-toc$toc_nr.html",                          href => "index-toc$toc_nr.html",
421                          title => "...",                          title => "...",
422                          post_html => $post_ul,                          post_html => $post_ul,
423                          more => 1,      # use style for more pages link (...)                          more => 1,      # use style for more pages link (...)
424                  )                  };
425  #               push @toc_entries, %item;                  push @toc_entries, $item;
426    
427                  &closeOverview;                  &closeOverview;
428                    undef @toc_entries;
429                  &openOverview("$overview-toc$toc_nr");                  &openOverview("$overview-toc$toc_nr");
430                  $last_toc_title='';                  $last_toc_title='';
431          }          }
432    
433          $pre_ul=$post_ul='';          $pre_ul=$post_ul='';
434          if ($last_toc_title eq $title) {          if ($last_toc_title eq $title && $subtitle) {
435                  $title = $subtitle;                  $title = $subtitle;
436                  $pre_ul='<ul>';                  $pre_ul='<ul>';
437                  $post_ul='</ul>';                  $post_ul='</ul>';
# Line 450  sub addTitle Line 453  sub addTitle
453                  };                  };
454                  push @toc_entries,$item;                  push @toc_entries,$item;
455          } else {          } else {
456                  %item = (                  $item = {
457                          pre_html => $pre_ul,                          pre_html => $pre_ul,
458                          tabindex => "$nr",                          tabindex => "$nr",
459                          href => "slide$nr.html",                          href => "slide$nr.html",
460                          title => $title,                          title => $title,
461                          post_html => $post_ul,                          post_html => $post_ul,
462                  )                  };
463  #               push @toc_entries,\%item;                  push @toc_entries,$item;
464          }          }
465  }  }
466  ##  ##
# Line 530  sub createSlide Line 533  sub createSlide
533    
534          my $slide_html=make_progress_bar($nr,$total);          my $slide_html=make_progress_bar($nr,$total);
535    
536            # undefine body if no content is found (so that template can show
537            # only title and sub-title
538            if ($content !~ m/\S/g) {
539                    undef $content;
540            }
541    
542          %page_data = (          %page_data = (
543                  doctype => $doctype,                  doctype => $doctype,
544                  talkTitle => $talkTitle,                  talkTitle => $talkTitle,
# Line 567  sub createSlide Line 576  sub createSlide
576    
577          );          );
578    
579          my $page= new Text::FastTemplate key => 'slide';          my $page;
580            if ($content) {
581                    $page= new Text::FastTemplate key => 'slide';
582            } else {
583                    $page= new Text::FastTemplate key => 'title';
584            }
585          print SLIDE $page->output( \%page_data );          print SLIDE $page->output( \%page_data );
586    
587          close(SLIDE);          close(SLIDE);
# Line 627  sub verify_html { Line 641  sub verify_html {
641  # clean the html of the slide  # clean the html of the slide
642  # remove all <div class="comment">blabla</div>  # remove all <div class="comment">blabla</div>
643  sub clean_html {  sub clean_html {
644      $_[0] =~ s/<div\s+class\s*=\s*(?:comment[\s>]|\"comment\").*?<\/div>//igs;          my $tmp=$_[0];
645      return $_[0];          $tmp =~ s/<div\s+class\s*=\s*(?:comment[\s>]|\"comment\").*?<\/div>//igs;
646            $tmp =~ s,</*font[^>]+>,,ig;
647            return $tmp;
648  }  }
649    
650  ##############################################################################  ##############################################################################
# Line 672  sub make_progress_bar { Line 688  sub make_progress_bar {
688  ##############################################################################  ##############################################################################
689  # make slide progress bar  # make slide progress bar
690  sub remove_anchor {  sub remove_anchor {
691          my $foo = $_[0];          my $tmp = $_[0];
692          $foo=~s/(.*)<A[^>]*>(.*)<\/A>(.*)/$1$2$3/ig;          $tmp =~ s/(.*)<A[^>]*>(.*)<\/A>(.*)/$1$2$3/ig;
693          return $foo;          return $tmp;
694  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.26