Author: cvrabie
Date: 2008-01-16 11:57:15 +0100 (Wed, 16 Jan 2008)
New Revision: 6860
Modified:
xwiki-products/curriki/trunk/web/src/main/webapp/skins/curriki8/macros.vm
Log:
CURRIKI-1193 The resize of the logo is now done with xwiki's internal resize
engine
Modified:
xwiki-products/curriki/trunk/web/src/main/webapp/skins/curriki8/macros.vm
===================================================================
--- xwiki-products/curriki/trunk/web/src/main/webapp/skins/curriki8/macros.vm
2008-01-16 07:33:44 UTC (rev 6859)
+++ xwiki-products/curriki/trunk/web/src/main/webapp/skins/curriki8/macros.vm
2008-01-16 10:57:15 UTC (rev 6860)
@@ -2070,15 +2070,29 @@
#set($logoheight = $xwiki.image.getHeight($srcdoc.fullName,$logofilename))
#else
#set($m_logo = $xwiki.getSkinFile("groups_default_logo.gif"))
- #set($logowidth = 120)
- #set($logoheight = 82)
+ ##set($logowidth = 120)
+ ##set($logoheight = 82)
#end
-#if($logowidth > 120)
- #set($logowidth = 120)
+##if($logowidth > 120)
+## #set($logowidth = 120)
+###end
+###if($logoheight > 82)
+## #set($logoheight = 82)
+###end
+
+## find out wich dimmension overflows the most
+#set( $image_resize = "" )
+#if( $logowidth > 120 || $logoheight > 82 )
+ #set( $ratio = $logowidth / $logoheight )
+ #set( $width_overflow = 80 * $ratio )
+ #set( $height_overflow = 120 / $ratio )
+ #if( $width_overflow > 120 )
+ #set( $image_resize = "?width=120")
+ #else
+ #set( $image_resize = "?height=82")
+ #end
+ $ratio $logowidth $logoheight $width_overflow $height_overflow
#end
-#if($logoheight > 82)
- #set($logoheight = 82)
-#end
#if("$!first_frame_done" == "") ## {
@@ -2098,7 +2112,8 @@
</div>
<div class="frame-inset-logo">
<a href="$s.getHomeURL()" title="$s.getDisplayTitle()"
alt="$s.getDisplayTitle()">
-<img src="$m_logo" width="$logowidth" height="$logoheight"
title="${s.getDisplayTitle()}" alt="${s.getDisplayTitle()}" />
+##<img src="$m_logo" width="$logowidth" height="$logoheight"
title="${s.getDisplayTitle()}" alt="${s.getDisplayTitle()}" />
+<img src="${m_logo}${image_resize}" title="${s.getDisplayTitle()}"
alt="${s.getDisplayTitle()}" />
</a>
</div>
<div class="frame-inset-description">
_______________________________________________
notifications mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/notifications