From: <fg...@us...> - 2014-10-22 13:38:48
|
Revision: 4600 http://openutils.svn.sourceforge.net/openutils/?rev=4600&view=rev Author: fgiust Date: 2014-10-22 13:38:45 +0000 (Wed, 22 Oct 2014) Log Message: ----------- add support for percentage in witdh/height Modified Paths: -------------- magnoliamodules/trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/media.tag magnoliamodules/trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/player-genericswfobject.tag magnoliamodules/trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/player-jwplayer5.tag magnoliamodules/trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/player.tag magnoliamodules/trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/swfobject.tag Modified: magnoliamodules/trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/media.tag =================================================================== --- magnoliamodules/trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/media.tag 2014-10-03 07:28:20 UTC (rev 4599) +++ magnoliamodules/trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/media.tag 2014-10-22 13:38:45 UTC (rev 4600) @@ -8,8 +8,8 @@ <jsp:directive.attribute name="node" required="false" rtexprvalue="true" type="java.lang.Object" description="the content object to use; if not specified, object 'content' will be used"/> <jsp:directive.attribute name="property" required="false" rtexprvalue="true" type="java.lang.String" description="the name of the nodeData storing the media uuid; if not specified, 'media' will be used"/> <jsp:directive.attribute name="player" required="false" rtexprvalue="true" type="java.lang.String" description="the swf file of the player (examples: player.swf (default), jwplayer4, jwplayer5, jwplayer5/player.swf, /.resources/media/players/jwplayer5/player.swf)"/> - <jsp:directive.attribute name="width" required="false" rtexprvalue="true" type="java.lang.Integer" description="image or player width"/> - <jsp:directive.attribute name="height" required="false" rtexprvalue="true" type="java.lang.Integer" description="image or player height"/> + <jsp:directive.attribute name="width" required="false" rtexprvalue="true" type="java.lang.Object" description="image or player width"/> + <jsp:directive.attribute name="height" required="false" rtexprvalue="true" type="java.lang.Object" description="image or player height"/> <jsp:directive.attribute name="useEm" required="false" rtexprvalue="true" type="java.lang.Boolean" description="if true, and ignoreDimensions is not true it will apply style attribute on img tags with sidth and height in 'em'. the em values will be computed using as width in pixel * emRatio (see next attribute)"/> <jsp:directive.attribute name="emRatio" required="false" rtexprvalue="true" type="java.lang.Float" description="float value to convert dimensions from px to em "/> <jsp:directive.attribute name="alt" required="false" rtexprvalue="true" description="alt / title on images. If not specified, the title of the media (if present) will be used"/> Modified: magnoliamodules/trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/player-genericswfobject.tag =================================================================== --- magnoliamodules/trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/player-genericswfobject.tag 2014-10-03 07:28:20 UTC (rev 4599) +++ magnoliamodules/trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/player-genericswfobject.tag 2014-10-22 13:38:45 UTC (rev 4600) @@ -10,9 +10,9 @@ description="media uuid or media content node " /> <jsp:directive.attribute name="playerPath" required="true" rtexprvalue="true" type="java.lang.String" description="the swf file of the player (examples: /.resources/media/players/someplayer/player.swf)" /> - <jsp:directive.attribute name="width" required="false" rtexprvalue="true" type="java.lang.Integer" + <jsp:directive.attribute name="width" required="false" rtexprvalue="true" type="java.lang.Object" description="image or player width" /> - <jsp:directive.attribute name="height" required="false" rtexprvalue="true" type="java.lang.Integer" + <jsp:directive.attribute name="height" required="false" rtexprvalue="true" type="java.lang.Object" description="image or player height" /> <jsp:directive.attribute name="ignoreDim" required="false" rtexprvalue="true" type="java.lang.Boolean" description="if true the img element will be rendered without width and height attributes " /> Modified: magnoliamodules/trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/player-jwplayer5.tag =================================================================== --- magnoliamodules/trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/player-jwplayer5.tag 2014-10-03 07:28:20 UTC (rev 4599) +++ magnoliamodules/trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/player-jwplayer5.tag 2014-10-22 13:38:45 UTC (rev 4600) @@ -9,9 +9,9 @@ description="Preview image url" /> <jsp:directive.attribute name="item" required="true" rtexprvalue="true" type="java.lang.Object" description="media uuid or media content node " /> - <jsp:directive.attribute name="width" required="false" rtexprvalue="true" type="java.lang.Integer" + <jsp:directive.attribute name="width" required="false" rtexprvalue="true" type="java.lang.Object" description="image or player width" /> - <jsp:directive.attribute name="height" required="false" rtexprvalue="true" type="java.lang.Integer" + <jsp:directive.attribute name="height" required="false" rtexprvalue="true" type="java.lang.Object" description="image or player height" /> <jsp:directive.attribute name="ignoreDim" required="false" rtexprvalue="true" type="java.lang.Boolean" description="if true the img element will be rendered without width and height attributes " /> @@ -50,8 +50,8 @@ controlbar: "${controlbar}", repeat: "${loop? 'always': 'none'}", icons: "${noPlayIcon? 'false': 'true'}", -width: ${width}, -height: ${height}, +width: "${width}", +height: "${height}", ]]> <c:if test="${not empty skin}">skin:"${skin}",</c:if> <c:if test="${thumbnail and !empty preview}"> image:"${preview}",</c:if> Modified: magnoliamodules/trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/player.tag =================================================================== --- magnoliamodules/trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/player.tag 2014-10-03 07:28:20 UTC (rev 4599) +++ magnoliamodules/trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/player.tag 2014-10-22 13:38:45 UTC (rev 4600) @@ -11,9 +11,9 @@ description="media uuid or media content node " /> <jsp:directive.attribute name="player" required="true" rtexprvalue="true" type="java.lang.String" description="the swf file of the player (examples: player.swf (default), jwplayer4, jwplayer5, jwplayer5/player.swf, /.resources/media/players/jwplayer5/player.swf)" /> - <jsp:directive.attribute name="width" required="false" rtexprvalue="true" type="java.lang.Integer" + <jsp:directive.attribute name="width" required="false" rtexprvalue="true" type="java.lang.Object" description="image or player width" /> - <jsp:directive.attribute name="height" required="false" rtexprvalue="true" type="java.lang.Integer" + <jsp:directive.attribute name="height" required="false" rtexprvalue="true" type="java.lang.Object" description="image or player height" /> <jsp:directive.attribute name="ignoreDim" required="false" rtexprvalue="true" type="java.lang.Boolean" description="if true the img element will be rendered without width and height attributes " /> @@ -42,26 +42,28 @@ <jsp:text>${pageContext.request.scheme}://${pageContext.request.serverName}</jsp:text> <c:if test="${(pageContext.request.scheme eq 'http' and pageContext.request.serverPort != 80)}">:${pageContext.request.serverPort}</c:if> </c:set> - <c:if test="${empty width or width eq 0 }"> + <c:if test="${!ignoreDim and (empty width or width eq '0')}"> <c:set var="width" value="${media:width(mediaNode)}" /> </c:if> - <c:if test="${empty height or height eq 0}"> + <c:if test="${!ignoreDim and (empty height or height eq '0')}"> <c:set var="height" value="${media:height(mediaNode)}" /> <c:if test="${(controlbar eq 'bottom' or controlbar eq 'top') and height gt 20}"> <!-- the control bar adds 20px --> <c:set var="height" value="${height + 20}" /> </c:if> </c:if> - <c:if test="${empty width or width eq 0 }"> + <c:if test="${!ignoreDim and (empty width or width eq '0')}"> <c:set var="width" value="320" /> </c:if> - <c:if test="${empty height or height eq 0}"> + <c:if test="${!ignoreDim and (empty height or height eq '0')}"> <c:set var="height" value="${mediaNode.type eq 'audio' ? 20 : 240}" /> </c:if> <c:set var="previewwidth" value="${width}" /> <c:set var="previewheight" value="${height}" /> - <c:if test="${previewheight gt 20 and (controlbar eq 'bottom' or controlbar eq 'top')}"> - <c:set var="previewheight" value="${previewheight - 20}" /> + <c:if test="${!ignoreDim}"> + <c:if test="${previewheight gt 20 and (controlbar eq 'bottom' or controlbar eq 'top')}"> + <c:set var="previewheight" value="${previewheight - 20}" /> + </c:if> </c:if> <c:if test="${thumbnail and empty preview}"> <c:choose> Modified: magnoliamodules/trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/swfobject.tag =================================================================== --- magnoliamodules/trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/swfobject.tag 2014-10-03 07:28:20 UTC (rev 4599) +++ magnoliamodules/trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/swfobject.tag 2014-10-22 13:38:45 UTC (rev 4600) @@ -4,8 +4,8 @@ xmlns:su="http://openutils.sf.net/openutils-stringutils"> <jsp:directive.tag pageEncoding="UTF-8" description="Renders the flash-content and the javascript for replacing it" /> <jsp:directive.attribute name="player" required="true" rtexprvalue="true" type="java.lang.String" description="the swf file of the player (examples: player.swf (default), jwplayer4, jwplayer5, jwplayer5/player.swf, /.resources/media/players/jwplayer5/player.swf)" /> - <jsp:directive.attribute name="width" required="false" rtexprvalue="true" type="java.lang.Integer" description="flash content width" /> - <jsp:directive.attribute name="height" required="false" rtexprvalue="true" type="java.lang.Integer" description="flash content height" /> + <jsp:directive.attribute name="width" required="false" rtexprvalue="true" type="java.lang.Object" description="flash content width" /> + <jsp:directive.attribute name="height" required="false" rtexprvalue="true" type="java.lang.Object" description="flash content height" /> <jsp:directive.attribute name="image" required="false" rtexprvalue="true" description="replacement image" /> <jsp:directive.attribute name="title" required="false" rtexprvalue="true" description="title/alt" /> <jsp:directive.tag dynamic-attributes="attrs" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |