##
## $Source: /usr/cvsroot/melati/melati/src/main/java/org/melati/templets/html/org.melati.poem.StringPoemType-URI.wm,v $
## $Revision: 1.3 $
##
## Copyright (C) 2009 Tim Pizey
##
## Part of Melati (http://melati.org), a framework for the rapid
## development of clean, maintainable web applications.
##
##
## Render a URI either with a link or a thumbnail with a popup if an image.
##
$ml.inputAs($object, "org.melati.poem.StringPoemType")

#if ($field.RawString.equals("")) #begin
(No URL set)
#end #else #begin
 #if ($field.RawString.toLowerCase().endsWith(".jpg") ) #begin 

<a id="zoomOut_$ml.escaped($field.Name)"
   target="ZoomOut_$ml.escaped($field.Name)" 
   title="Click to view full size image"
   onClick="popupImage_$ml.escaped($field.Name)(); return false;"
   href="$field.RawString"
><img src="$field.RawString" 
   width="60" 
   name="$ml.escaped($field.Name)" 
   align="top" 
   alt="Uploaded image thumbnail"
   title="Uploaded image thumbnail"
   border="0" /></a>


<script language="JavaScript1.2" type="text/javascript">
function popupImage_$ml.escaped($field.Name)() { 
  popup = window.open(imageURL,'ZoomOut_$ml.escaped($field.Name)','scrollbars=yes,width=650,height=450');
  popup.focus();
  return false;
}
</script>
 #end #else #begin
<a id="zoomOut_$ml.escaped($field.Name)"
   target="ZoomOut_$ml.escaped($field.Name)" 
   title="Click to view page in new window"
   href="$ml.Attr.rendered($field.RawString)">Follow</a>
 #end
#end



