changeset 730:c71948773f03

Add preliminary preview zoom function.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 18 Nov 2014 23:37:46 +0200
parents 0d064dcef03e
children 4ac3d5f07178
files ajax.js pages/vote.inc.php
diffstat 2 files changed, 19 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ajax.js	Tue Nov 18 23:00:57 2014 +0200
+++ b/ajax.js	Tue Nov 18 23:37:46 2014 +0200
@@ -188,3 +188,20 @@
   }
 }
 
+
+function jsShowPreviewImage(file)
+{
+  var nitem = document.getElementById("messageBox");
+  if (nitem)
+  {
+    nitem.innerHTML = "<img src='"+file+"' alt='"+file+"' /><br />"+
+      "<div class='messageBoxControls'>"+
+      "<input id='messageBoxClose' type='button' value=' Close '>"+
+      "</div>";
+
+    var elem = document.getElementById("messageBoxClose");
+    elem.onclick = function () { jsCloseMessageBox(0, 0); }
+
+    nitem.style.display = "block";
+  }
+}
--- a/pages/vote.inc.php	Tue Nov 18 23:00:57 2014 +0200
+++ b/pages/vote.inc.php	Tue Nov 18 23:37:46 2014 +0200
@@ -164,7 +164,8 @@
               else
               {
                 echo
-                  "<a href=\"".ihentities($pdata["previewURL"])."\">".
+                  "<a href=\"".ihentities($pdata["previewURL"]).
+                  "\" onClick=\"jsShowPreviewImage('".ihentities($pdata["previewURL"])."')\">".
                   "<img class=\"imagePreview\" src=\"".ihentities($pdata["thumbURL"]).
                   "\" alt=\"Preview\" /></a>";
               }