X-Git-Url: https://git.sesse.net/?p=pr0n;a=blobdiff_plain;f=files%2Fpr0n-fullscreen.js;h=bbc287a2f94d75b0a90eabf487896d5d34252175;hp=5d8bb48be873c7901e50c3c8397ecad7bde26ff5;hb=e0d3b74068825a65a64513660cc53a403815403d;hpb=f7c70497096c80290e4a8d5d69fe8417d1aa931f 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; }