]> git.sesse.net Git - pr0n/commitdiff
Make the fullscreen view use the new box-only cache.
authorSteinar H. Gunderson <sesse@debian.org>
Mon, 26 May 2008 19:40:24 +0000 (21:40 +0200)
committerSteinar H. Gunderson <sesse@debian.org>
Mon, 26 May 2008 19:40:24 +0000 (21:40 +0200)
files/pr0n-fullscreen.js
perl/Sesse/pr0n/Common.pm

index 5d8bb48be873c7901e50c3c8397ecad7bde26ff5..bbc287a2f94d75b0a90eabf487896d5d34252175 100644 (file)
@@ -121,9 +121,8 @@ function pick_image_size(screen_size, image_size)
        return [ 80, 64 ];
 }
 
-function display_image(width, height, evt, filename, element_id)
+function replace_image_element(url, element_id, parent_node)
 {
-       var url = "http://" + global_vhost + "/" + evt + "/" + width + "x" + height + "/" + global_infobox + filename;
        var img = document.getElementById(element_id);
        if (img !== null) {
                img.src = "data:";
@@ -138,8 +137,24 @@ function display_image(width, height, evt, filename, element_id)
                img.src = url;
        }
        
+       parent_node.appendChild(img);
+       return img;
+}
+
+function display_image(width, height, evt, filename, element_id)
+{
+       var url = "http://" + global_vhost + "/" + evt + "/" + width + "x" + height + "/nobox/" + filename;
        var main = document.getElementById("iehack");
-       main.appendChild(img);
+       var img = replace_image_element(url, element_id, main);
+
+       if (global_infobox != 'nobox') {
+               var url = "http://" + global_vhost + "/" + evt + "/" + width + "x" + height + "/box/" + filename;
+               var boximg = replace_image_element(url, element_id + "_box", main);
+
+               boximg.style.position = "absolute";
+               boximg.style.left = "0px";
+               boximg.style.bottom = "-1px";
+       }
 
        return img;
 }
index e348d32297595b2ac01ba4a12038a349466a8193..dbf6a054bb9074ebde584c30b3ee03d6e66c68b2 100644 (file)
@@ -550,7 +550,6 @@ sub ensure_cached {
                # We don't care about @otherres since each of these images are
                # already pretty cheap to generate, but we need the exact width so we can make
                # one in the right size.
-               $r->log->warn("BOX: $infobox");
                if ($infobox eq 'box') {
                        my ($img, $width, $height);