On Apr 18, 3:58 am, David Ker <[email protected]> wrote:
> have a button to click on that would embed any media file.
> it would allow me to insert something like this:
> <html><embed src="+fn" autoplay="false"></embed></html>

QuickEdit buttons can be easily copied and modified to create whatever
customized handling you like.

1) Start by copying the entire definition from [[QuickEdit_image]] and
pasting into into a new tiddler called [[QuickEdit_embed]].

2) Then modify that new tiddler to change the display text and
formatted output.
Something like this:

<html><hide linebreaks><a href="javascript:;" class="tiddlyLink"
        title="embed a media file"
        onclick="var fn=config.quickEdit.promptForFilename(
                'Enter/select a media file',
                getLocalPath(document.location.href),'');
        if (!fn) return false;  /* cancelled by user */
        var out='<html><embed src=\"'+fn+'\" autoplay=\"false\"></embed></
html>';
        return config.quickEdit.setSelection(this,out);"
>embed</a></html>

3) Lastly, add "<<tiddler QuickEdit_embed>>" to the
[[QuickEditToolbar]] definition (put it wherever it makes sense).

That's it.  You just written your own QuickEdit button that does
exactly what you want!

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/TiddlyWiki?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to