*** /e/www/twiki-dakar-4.0.2/lib/TWiki/Plugins/SlideShowPlugin/SlideShow.pm.v1 Sun Nov 19 18:20:16 2006 --- /e/www/twiki-dakar-4.0.2/lib/TWiki/Plugins/SlideShowPlugin/SlideShow.pm Sun Nov 19 19:18:14 2006 *************** *** 52,62 **** $text =~ s/%SLIDESHOW/%SLIDESHOW/g; my $query = TWiki::Func::getCgiQuery(); if( $query && $query->param( 'slideshow' ) ) { # in presentation mode $textPre .= "\n#StartPresentation\n"; ! $textPre .= renderSlideNav( $theWeb, $theTopic, 1, 1, "e" ); my $slideMax = 0; --- 52,74 ---- $text =~ s/%SLIDESHOW/%SLIDESHOW/g; my $query = TWiki::Func::getCgiQuery(); + # Find URL parameters + my $query = TWiki::Func::getCgiQuery(); + my @qparams = (); + foreach my $name ( $query->param ) { + next if ($name eq 'keywords'); + next if ($name eq 'topic'); + next if ($name eq 'slideshow'); + next if ($name eq 'skin'); + next if ($name eq '#'); + push @qparams, $name => $query->param($name); + } + if( $query && $query->param( 'slideshow' ) ) { # in presentation mode $textPre .= "\n#StartPresentation\n"; ! $textPre .= renderSlideNav( $theWeb, $theTopic, 1, 1, "e", \@qparams ); my $slideMax = 0; *************** *** 92,103 **** $slideText =~ s/%SLIDETEXT%/$slideBody/go; $slideText =~ s/%SLIDENUM%/$slideNum/go; $slideText =~ s/%SLIDEMAX%/$slideMax/go; ! $slideText =~ s/%SLIDENAV%/renderSlideNav( $theWeb, $theTopic, $slideNum, $slideMax, "f p n" )/geo; ! $slideText =~ s/%SLIDENAVALL%/renderSlideNav( $theWeb, $theTopic, $slideNum, $slideMax, "f p n l" )/geo; ! $slideText =~ s/%SLIDENAVFIRST%/renderSlideNav( $theWeb, $theTopic, $slideNum, $slideMax, "f" )/geo; ! $slideText =~ s/%SLIDENAVPREV%/renderSlideNav( $theWeb, $theTopic, $slideNum, $slideMax, "p" )/geo; ! $slideText =~ s/%SLIDENAVNEXT%/renderSlideNav( $theWeb, $theTopic, $slideNum, $slideMax, "n" )/geo; ! $slideText =~ s/%SLIDENAVLAST%/renderSlideNav( $theWeb, $theTopic, $slideNum, $slideMax, "l" )/geo; $text .= "\n\n-----\n#GoSlide$slideNum\n$slideText"; unless( $text =~ s/%SLIDECOMMENT%/\n$slideComment\n/go ) { $text .= "\n$slideComment\n\n" if( $slideComment ); --- 104,115 ---- $slideText =~ s/%SLIDETEXT%/$slideBody/go; $slideText =~ s/%SLIDENUM%/$slideNum/go; $slideText =~ s/%SLIDEMAX%/$slideMax/go; ! $slideText =~ s/%SLIDENAV%/renderSlideNav( $theWeb, $theTopic, $slideNum, $slideMax, "f p n", \@qparams )/geo; ! $slideText =~ s/%SLIDENAVALL%/renderSlideNav( $theWeb, $theTopic, $slideNum, $slideMax, "f p n l", \@qparams )/geo; ! $slideText =~ s/%SLIDENAVFIRST%/renderSlideNav( $theWeb, $theTopic, $slideNum, $slideMax, "f", \@qparams )/geo; ! $slideText =~ s/%SLIDENAVPREV%/renderSlideNav( $theWeb, $theTopic, $slideNum, $slideMax, "p", \@qparams )/geo; ! $slideText =~ s/%SLIDENAVNEXT%/renderSlideNav( $theWeb, $theTopic, $slideNum, $slideMax, "n", \@qparams )/geo; ! $slideText =~ s/%SLIDENAVLAST%/renderSlideNav( $theWeb, $theTopic, $slideNum, $slideMax, "l", \@qparams )/geo; $text .= "\n\n-----\n#GoSlide$slideNum\n$slideText"; unless( $text =~ s/%SLIDECOMMENT%/\n$slideComment\n/go ) { $text .= "\n$slideComment\n\n" if( $slideComment ); *************** *** 105,116 **** $text .= "%BR%\n\n" x 20; $slideNum++; } ! $text =~ s/%TOC(?:\{.*?\})*%/renderSlideToc( $theWeb, $theTopic, @titles )/geo; $text .= "\n#GoSlide$slideNum\n%BR%\n"; } $text = "$textPre\n$text\n"; ! $text .= renderSlideNav( $theWeb, $theTopic, $slideMax + 1, $slideMax, "f p e" ); $text .= "\n"; $text .= "%BR%\n\n" x 30; $text =~ s/%BR%/
/go; --- 117,128 ---- $text .= "%BR%\n\n" x 20; $slideNum++; } ! $text =~ s/%TOC(?:\{.*?\})*%/renderSlideToc( $theWeb, $theTopic, \@qparams, @titles )/geo; $text .= "\n#GoSlide$slideNum\n%BR%\n"; } $text = "$textPre\n$text\n"; ! $text .= renderSlideNav( $theWeb, $theTopic, $slideMax + 1, $slideMax, "f p e", \@qparams ); $text .= "\n"; $text .= "%BR%\n\n" x 30; $text =~ s/%BR%/
/go; *************** *** 126,132 **** $text =~ s/([\n\r]\-\-\-+$level\!*) ([^\n\r]+)/"$1 Slide " . $slideNum++ . ": $2"/ges; } $text = "$textPre \n#StartPresentation\n" ! . renderSlideNav( $theWeb, $theTopic, 1, 1, "s" ) . "\n$text $textPost"; } --- 138,144 ---- $text =~ s/([\n\r]\-\-\-+$level\!*) ([^\n\r]+)/"$1 Slide " . $slideNum++ . ": $2"/ges; } $text = "$textPre \n#StartPresentation\n" ! . renderSlideNav( $theWeb, $theTopic, 1, 1, "s", \@qparams ) . "\n$text $textPost"; } *************** *** 134,150 **** } sub renderSlideNav { ! my( $theWeb, $theTopic, $theNum, $theMax, $theButtons ) = @_; my $prev = $theNum - 1 || 1; my $next = $theNum + 1; my $text = ''; ! my $viewUrl = "%SCRIPTURLPATH%/view%SCRIPTSUFFIX%/$theWeb/$theTopic"; if( $theButtons =~ /f/ ) { # first slide button if( $theButtons =~ / f/ ) { $text .= " "; } ! $text .= "" . "\"First"; } --- 146,163 ---- } sub renderSlideNav { ! my( $theWeb, $theTopic, $theNum, $theMax, $theButtons, $qparams ) = @_; my $prev = $theNum - 1 || 1; my $next = $theNum + 1; my $text = ''; ! if( $theButtons =~ /f/ ) { # first slide button if( $theButtons =~ / f/ ) { $text .= " "; } ! my $viewUrl = TWiki::Func::getScriptUrl( $theWeb, $theTopic, 'view', 'slideshow'=>'on', 'skin'=>'print', '#'=>'GoSlide1', @$qparams ); ! $text .= "" . "\"First"; } *************** *** 153,159 **** if( $theButtons =~ / p/ ) { $text .= " "; } ! $text .= "" . "\"Previous\""; } --- 166,173 ---- if( $theButtons =~ / p/ ) { $text .= " "; } ! my $viewUrl = TWiki::Func::getScriptUrl( $theWeb, $theTopic, 'view', 'slideshow'=>'on', 'skin'=>'print', '#'=>"GoSlide$prev", @$qparams ); ! $text .= "" . "\"Previous\""; } *************** *** 162,168 **** if( $theButtons =~ / n/ ) { $text .= " "; } ! $text .= "" . "\"Next\""; } --- 176,183 ---- if( $theButtons =~ / n/ ) { $text .= " "; } ! my $viewUrl = TWiki::Func::getScriptUrl( $theWeb, $theTopic, 'view', 'slideshow'=>'on', 'skin'=>'print', '#'=>"GoSlide$next", @$qparams ); ! $text .= "" . "\"Next\""; } *************** *** 171,177 **** if( $theButtons =~ / l/ ) { $text .= " "; } ! $text .= "" . "\"Last"; } --- 186,193 ---- if( $theButtons =~ / l/ ) { $text .= " "; } ! my $viewUrl = TWiki::Func::getScriptUrl( $theWeb, $theTopic, 'view', 'slideshow'=>'on', 'skin'=>'print', '#'=>"GoSlide$theMax", @$qparams ); ! $text .= "" . "\"Last"; } *************** *** 180,186 **** if( $theButtons =~ / e/ ) { $text .= " "; } ! $text .= "" . "\"End"; } --- 196,203 ---- if( $theButtons =~ / e/ ) { $text .= " "; } ! my $viewUrl = TWiki::Func::getScriptUrl( $theWeb, $theTopic, 'view', '#'=>'StartPresentation', @$qparams ); ! $text .= "" . "\"End"; } *************** *** 189,195 **** if( $theButtons =~ / s/ ) { $text .= " "; } ! $text .= "" . "\"Start"; } --- 206,213 ---- if( $theButtons =~ / s/ ) { $text .= " "; } ! my $viewUrl = TWiki::Func::getScriptUrl( $theWeb, $theTopic, 'view', 'slideshow'=>'on', 'skin'=>'print', '#'=>'GoSlide1', @$qparams ); ! $text .= "" . "\"Start"; } *************** *** 198,211 **** } sub renderSlideToc { ! my( $theWeb, $theTopic, @theTitles ) = @_; my $slideNum = 1; my $text = ''; my $viewUrl = "%SCRIPTURLPATH%/view%SCRIPTSUFFIX%/$theWeb/$theTopic"; foreach( @theTitles ) { $text .= "\t\* "; ! $text .= ""; $text .= " $_ \n"; $slideNum++; } --- 216,230 ---- } sub renderSlideToc { ! my( $theWeb, $theTopic, $qparams, @theTitles ) = @_; my $slideNum = 1; my $text = ''; my $viewUrl = "%SCRIPTURLPATH%/view%SCRIPTSUFFIX%/$theWeb/$theTopic"; foreach( @theTitles ) { $text .= "\t\* "; ! my $viewUrl = TWiki::Func::getScriptUrl( $theWeb, $theTopic, 'view', 'slideshow'=>'on', 'skin'=>'print', '#'=>"GoSlide$slideNum", @$qparams ); ! $text .= ""; $text .= " $_ \n"; $slideNum++; }