X-Git-Url: https://git.sesse.net/?p=pr0n;a=blobdiff_plain;f=files%2Fpr0n-fullscreen.js;h=49d20bd577968f0af1ee63c0b2c81e5d2438974a;hp=f9a2ebc3bf50eea1a92c2f252f07aa7d8c249c8c;hb=5e3db0119518c865c40c5b96ab543dfefb6b2e90;hpb=a58ea26b2871cd936760fa59c1b7aa44dbfa581e diff --git a/files/pr0n-fullscreen.js b/files/pr0n-fullscreen.js index f9a2ebc..49d20bd 100644 --- a/files/pr0n-fullscreen.js +++ b/files/pr0n-fullscreen.js @@ -26,6 +26,9 @@ function find_dpr() * pick_image_size, below. */ var fixed_sizes = [ + [ 3840, 2880 ], + [ 3200, 2400 ], + [ 2800, 2100 ], [ 2304, 1728 ], [ 2048, 1536 ], [ 1920, 1440 ], @@ -122,7 +125,7 @@ function rename_element(old_name, new_name) function display_image(width, height, evt, filename, element_id) { var url = window.location.origin + "/" + evt + "/" + width + "x" + height + "/" + filename; - var main = document.getElementById("iehack"); + var main = document.getElementById("main"); var preload = document.getElementById("preload"); var dpr = find_dpr(); var img; @@ -143,6 +146,18 @@ function display_image(width, height, evt, filename, element_id) // Update the "download original" link. var original_url = window.location.origin + "/" + evt + "/original/" + filename; document.getElementById("origdownload").href = original_url; + + // If it's a raw image, show a JPEG link. + var fulldownload = document.getElementById("fulldownload"); + if (filename.match(/\.(nef|cr2)$/i)) { + fulldownload.style.display = "block"; + var full_url = window.location.origin + "/" + evt + "/" + filename; + document.getElementById("fulldownloadlink").href = full_url; + origdownload.innerHTML = "Download original image (RAW)"; + } else { + fulldownload.style.display = "none"; + origdownload.innerHTML = "Download original image"; + } } if (global_infobox) { @@ -366,7 +381,7 @@ function fade_text(opacity) if (opacity < 0.0) { opacity = 0.0; } - setTimeout("fade_text(" + opacity + ")", 30); + setTimeout(function() { fade_text(opacity); }, 30); } else { var text = document.getElementById("text"); if (text !== null) { @@ -388,7 +403,7 @@ function select_image(evt, filename, selected) req.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); req.send("event=" + evt + "&filename=" + filename + "&selected=" + selected); - setTimeout("fade_text(0.99)", 30); + setTimeout(function() { fade_text(0.99); }, 30); } function key_down(which) @@ -473,8 +488,8 @@ window.onload = function() { var body = document.body; body.onresize = function() { relayout(); }; - body.onkeydown = function() { key_down(event.keyCode); }; - body.onkeyup = function() { key_up(event.keyCode); }; + body.onkeydown = function(evt) { key_down(evt.keyCode); }; + body.onkeyup = function(evt) { key_up(evt.keyCode); }; body.onhashchange = function() { check_for_hash_change(); }; body.onclick = function() { check_for_hash_change(); };