From: Steinar H. Gunderson Date: Mon, 26 May 2008 19:40:24 +0000 (+0200) Subject: Make the fullscreen view use the new box-only cache. X-Git-Url: https://git.sesse.net/?p=pr0n;a=commitdiff_plain;h=e0d3b74068825a65a64513660cc53a403815403d Make the fullscreen view use the new box-only cache. --- diff --git a/files/pr0n-fullscreen.js b/files/pr0n-fullscreen.js index 5d8bb48..bbc287a 100644 --- a/files/pr0n-fullscreen.js +++ b/files/pr0n-fullscreen.js @@ -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; } diff --git a/perl/Sesse/pr0n/Common.pm b/perl/Sesse/pr0n/Common.pm index e348d32..dbf6a05 100644 --- a/perl/Sesse/pr0n/Common.pm +++ b/perl/Sesse/pr0n/Common.pm @@ -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);