r3530 - in trunk/pollen-ui-struts2/src/main/webapp: WEB-INF/jsp/poll img js
Author: sletellier Date: 2012-06-19 16:09:37 +0200 (Tue, 19 Jun 2012) New Revision: 3530 Url: http://chorem.org/repositories/revision/pollen/3530 Log: - refs #562 : improve choice layout - add image to represent choosed images - put image path in tooltip - fix open image in hidden file chooser on chromium Added: trunk/pollen-ui-struts2/src/main/webapp/img/7terOk.jpg Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/createPoll_choices.jsp trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayImageChoice.jsp trunk/pollen-ui-struts2/src/main/webapp/js/createPoll.js Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/createPoll_choices.jsp =================================================================== --- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/createPoll_choices.jsp 2012-06-19 13:22:34 UTC (rev 3529) +++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/createPoll_choices.jsp 2012-06-19 14:09:37 UTC (rev 3530) @@ -175,10 +175,11 @@ alt="<s:property value='name'/>" title="<s:property value='name'/>" src="<s:property value='imageUrl'/>" - class="fright choiceImage"> + class="fleft choiceImage"> <s:file key='imageChoice[%{#choiceNumber}]' label='' theme="simple" - cssClass="nameField fleft" cssStyle="margin-left:50px;"/> + class="fright" + cssStyle="opacity: 0;"/> </s:if> <s:else> <%--New image--%> @@ -188,9 +189,10 @@ alt="<s:text name='pollen.image.not.loaded'/>" title="<s:text name='pollen.image.not.loaded'/>" src="<s:property value='imageUrl'/>" width="100px" - height="75px" class="fright choiceImage"> + height="75px" class="fleft choiceImage"> <s:file key='imageChoice[%{#choiceNumber}]' label='' theme="simple" - cssClass="hidden"/> + class="fright" + cssStyle="opacity: 0;"/> </s:else> </div> Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayImageChoice.jsp =================================================================== --- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayImageChoice.jsp 2012-06-19 13:22:34 UTC (rev 3529) +++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayImageChoice.jsp 2012-06-19 14:09:37 UTC (rev 3530) @@ -45,10 +45,11 @@ alt="<s:text name='pollen.image.not.loaded'/>" title="<s:text name='pollen.image.not.loaded'/>" src="<s:property value='imageUrl'/>" width="100px" height="75" - class="fright choiceImage"> + class="fleft choiceImage"> <s:file key='%{#prefix2}' label='' theme="simple" - cssClass="hidden"/> + class="fright" + cssStyle="opacity: 0;"/> </div> </div> <div class="fright"> Added: trunk/pollen-ui-struts2/src/main/webapp/img/7terOk.jpg =================================================================== (Binary files differ) Property changes on: trunk/pollen-ui-struts2/src/main/webapp/img/7terOk.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/pollen-ui-struts2/src/main/webapp/js/createPoll.js =================================================================== --- trunk/pollen-ui-struts2/src/main/webapp/js/createPoll.js 2012-06-19 13:22:34 UTC (rev 3529) +++ trunk/pollen-ui-struts2/src/main/webapp/js/createPoll.js 2012-06-19 14:09:37 UTC (rev 3530) @@ -354,9 +354,21 @@ getAllChoices(containerId).each(function (index) { var imageChoice = $('[name="imageChoice_' + index + '.thumb"]'); - imageChoice.click(function(){ - $('#registerForm_imageChoice_' + index + '_').click(); + var data = {imageIndex:index}; + imageChoice.click(data, function(evt){ + var index = evt.data['imageIndex']; + var inputImageChoice = $('[name="imageChoice[' + index + ']"]'); + inputImageChoice.trigger('click'); }); + + var inputImageChoice = $('[name="imageChoice[' + index + ']"]'); + inputImageChoice.change(data, function(evt) { + var index = evt.data['imageIndex']; + var imageChoice = $('[name="imageChoice_' + index + '.thumb"]'); + imageChoice.attr("src", "/pollen/img/7terOk.jpg"); + imageChoice.attr("title", this.value); + imageChoice.attr("alt", this.value); + }); }); } updateUpdownActions(containerId);
participants (1)
-
sletellier@users.chorem.org