%TOC{depth="2"}% ---++ Documentation %STARTSECTION{name="documentation" type="section"}% This function renders a selection widget to chose an icon ---+++++ Parameters * VALUE: which icon is preselected * SOURCE: topic that has got a set of icons attached to it, defaults to Applications.ClassificationApp.IconSet %ENDSECTION{name="documentation" type="section"}% ---++ Implementation <verbatim class="tml"> %STARTINCLUDE%<!-- render photo selector --> <div class="clsIconSelector"> %ATTACHMENTS{ topic="%IF{"defined SOURCE" then="%SOURCE%" else="Applications.ClassificationApp.IconSet"}%" name=".*\.(jpe?g|JPE?G|gif|GIF|png|PNG)$" sort="name" format="<div class='clsIconContainer $percntIF{\"$VALUE='$name'\" then=\"selected\"}$percnt '> <input type='radio' class='foswikiRadioButton clsIconInput ' id='clsIconInput$index' name='Icon' value='$name' $percntIF{\"$VALUE='$name'\" then=\" checked='checked'\"}$percnt /> <label for='clsIconInput$index' class='foswikiLabel'> <img class='clsIcon $percntIF{\"'%VALUE%'='$name'\" then=\" selected orig\"}$percnt' src='$urlpath' alt='$name' title='$name' height='16px' /> </label></div>" }% %CLEAR% <input type="hidden" name="Icon" value="" /> </div> <literal> <script> jQuery(function($) { // click handler for icons $("input.clsIconInput").change(function() { var $this = $(this); var $container = $this.parent(); $(".clsIconContainer").removeClass("selected"); $container.addClass("selected"); }); }); </script> </literal> %STOPINCLUDE% </verbatim> ---++ Test %DBCALL{"%TOPIC%" VALUE="%URLPARAM{"Icon"}%"}% %DBCALL{"Applications.RenderFunctionCallers"}% ---++ Copyright © 2008-2013 Michael Daum http://michaeldaumconsulting.com %DBCALL{"Applications.GnuGeneralPublicLicense" section="notice"}% </verbatim>
ApplicationTopic
edit
TopicType
DocuTopic
,
TopicFunction
TopicTitle
Summary
Renders a widget to select a photo
WikiApplication
ClassificationApp
This topic: Applications/ClassificationApp
>
TopicType
>
TopicFunction
>
RenderIconSelector
Topic revision:
07 Jan 2013,
ProjectContributor
(raw view)
Das Urheberrecht © liegt bei den mitwirkenden Autoren. Alle Inhalte dieser Kollaborations-Plattform sind Eigentum der Autoren.