If we are showing a RAW image, show an extra download link.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 28 Nov 2015 10:29:24 +0000 (11:29 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 28 Nov 2015 10:29:24 +0000 (11:29 +0100)
files/pr0n-fullscreen.css
files/pr0n-fullscreen.js
templates/default/fullscreen-footer

index 16d52088f109908d767c9495569fe9ddcbd82973..d144f8fc09fa935f068646d72bcbe51b5aed7eac 100644 (file)
@@ -71,6 +71,10 @@ img, #text {
        height: 20px; */
 }
 
        height: 20px; */
 }
 
+#fulldownload {
+       display: none;
+}
+
 /* IE5/6 madness */
 html {
        overflow: hidden;
 /* IE5/6 madness */
 html {
        overflow: hidden;
index f9a2ebc3bf50eea1a92c2f252f07aa7d8c249c8c..7d5638adf06092cb07066de8905ab4df33face05 100644 (file)
@@ -143,6 +143,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;
                // 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) {
        }
 
        if (global_infobox) {
index 264d7bd4b2aa4a5268c76f2690d5e8e0f2ec1a26..7f50dc25da0e20abce39e03d30ad93d4e9ad4b3d 100644 (file)
@@ -12,7 +12,11 @@ var global_select = %SEL%;
       <img id="next" src="/next.png" alt="-&gt;" />
       <img id="close" src="/close.png" alt="x" />
       <img id="options" src="/options.png" alt="=" />
       <img id="next" src="/next.png" alt="-&gt;" />
       <img id="close" src="/close.png" alt="x" />
       <img id="options" src="/options.png" alt="=" />
-      <div id="optionmenu"><p><a id="origdownload">Download original image</a></p><p><a id="immersivetoggle" href="javascript:toggle_optionmenu();toggle_immersive();">Hide all decorations</a></p></div>
+      <div id="optionmenu">
+        <p><a id="origdownload">Download original image</a></p>
+        <p id="fulldownload"><a id="fulldownloadlink">Download full-resolution image</a></p>
+        <p><a id="immersivetoggle" href="javascript:toggle_optionmenu();toggle_immersive();">Hide all decorations</a></p>
+      </div>
     </div>
   </body>
 </html>
     </div>
   </body>
 </html>