>
>
> With the following code, a JPEG image from a web location can be dragged 
> into an area marked "Drop JPEG Image Here", and a tiddler containing the 
> _canonical_uri of the image is automatically created:
>
> \define embedded-image-actions()
> <$wikify name="tiddlercontent2" mode="inline" text='<<actionTiddler>>'>
> <$action-createtiddler $basetitle="New Image" 
> _canonical_uri=<<tiddlercontent2>> type="image/jpeg"  $savetitle="Embed 
> JPEG!!tiddlertitle"/>
> <$action-navigate $to={{Embed JPEG!!tiddlertitle}}/>
> </$wikify>
> \end
>
> <$droppable actions=<<embedded-image-actions>>>
> <div style="height:2em;">
> <div style="border:1px dotted; 
> width:15em;padding:0.7em;border-radius:5px;text-align:center;">Drop JPEG 
> Image Here</div></div>
> </$droppable>
>
>
>
Hi @Stef ,

I believe this could make it work for more types: 

\define embedded-image-actions()
<$wikify name="tiddlercontent2" mode="inline" text='<<actionTiddler>>'>
<$vars imageType={{{ [<tiddlercontent2>>suffix[.jpg]addprefix[image/jpeg]
removesuffix<tiddlercontent2>] [<tiddlercontent2>>suffix[.jpeg]addprefix[
image/jpeg]removesuffix<tiddlercontent2>][<tiddlercontent2>>suffix[.png]
addprefix[image/png]removesuffix<tiddlercontent2>] }}}>
<$action-createtiddler $basetitle="New Image" _canonical_uri=<<
tiddlercontent2>> type=<<imageType>>  $savetitle="Embed JPEG!!tiddlertitle"
/>
<$action-navigate $to={{Embed JPEG!!tiddlertitle}}/>
</$vars>
</$wikify>
\end

<$droppable actions=<<embedded-image-actions>>>
<div style="height:2em;">
<div style="border:1px dotted; width:15em;padding:0.7em;
border-radius:5px;text-align:center;">Drop JPEG Image Here</div></div>
</$droppable>


-- 
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/3ea884a4-d943-4a80-9d78-f7d821a25206%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to