On Wednesday, May 23, 2018 at 10:40:27 PM UTC+2, [email protected] wrote:
>
>
>
> Downside: I believe that a separate tiddler/drop area needs to be created 
> for other image types, e.g. PNG. 
>
>
> Here is an updated version of my code which allows users to pre-select a 
file type (GIF, JPEG, PNG or SVG) before importing an image:

\define embedded-image-actions()
<$wikify name="tiddlercontent2" mode="inline" text='<<actionTiddler>>'>
<$action-createtiddler $basetitle="New Image" _canonical_uri=<<
tiddlercontent2>> type={{Embed Image}} $savetitle="Embed 
Image!!tiddlertitle"/>
<$action-navigate $to={{Embed Image!!tiddlertitle}}/>
</$wikify>
\end


<$droppable actions=<<embedded-image-actions>>>
<div style="float:left;margin-right:1em;">
<div style="border:1px dotted; 
width:15em;padding:0.8em;border-radius:5px;text-align:center;">Drop image 
(<$list filter="[[Embed 
Image]get[text]]+[removeprefix[image/]]">{{!!title}}</$list>) here</div></
div>
</$droppable> 
<div style="height:2.5em;">
Image type: <br/>
<$select tiddler='Embed Image'>
<option value='image/gif'>GIF</option>
<option value='image/jpeg'>JPEG</option>
<option value='image/png'>PNG</option>
<option value='image/svg+xml'>SVG</option>
</$select></div>

Of course, automatic detection would be preferable.

Cheers,

Stef

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/e3c1a4b4-2506-4dc4-81e0-6b5aa767c732%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to