Make images go to fullscreen mode if the browser has JavaScript.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 19 Nov 2015 20:19:58 +0000 (21:19 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 19 Nov 2015 20:19:58 +0000 (21:19 +0100)
perl/Sesse/pr0n/Index.pm

index 329aaed3cf02d3f0ce7bd13aa2c855856a144f3d..ad3af8fc088d86ecdb71b290965024de91c60fe5 100644 (file)
@@ -340,6 +340,12 @@ sub handler {
                                $imgsz = " width=\"$width\" height=\"$height\"";
                        }
 
+                       # Add fullscreen link.
+                       my %fssettings = %settings;
+                       $fssettings{'fullscreen'} = 1;
+                       $fssettings{'start'} = $img_num;
+                       my $fsquery = Sesse::pr0n::Common::get_query_string(\%fssettings, \%defsettings);
+
                        my $filename = $ref->{'filename'};
                        my $uri = $filename;
                        if (defined($xres) && defined($yres) && $xres != -1 && $xres != -2) {
@@ -358,7 +364,7 @@ sub handler {
                        } else {
                                $io->print("     ");
                        }
-                       $io->print("<a href=\"$prefix$uri\"><img src=\"$prefix${thumbxres}x${thumbyres}/$filename\" alt=\"\"$imgsz /></a>\n");
+                       $io->print("<a href=\"$prefix$uri\" onclick=\"location.href='$prefix$fsquery';return false;\"><img src=\"$prefix${thumbxres}x${thumbyres}/$filename\" alt=\"\"$imgsz /></a>\n");
                
                        if ($rot == 1) {
                                $io->print("      90 <input type=\"checkbox\" name=\"rot-" .