Opening a new tiddler in HTMLArea

10 views
Skip to first unread message

kilucas

unread,
Oct 15, 2008, 4:17:55 AM10/15/08
to TiddlyWiki
Bram Chen's HTMLArea is invoked automatically for any tiddler tagged
with "wysiwyg". In an otherwise standard TW, the new tiddler
rightsidebar option create an untagged tiddlert which therefore
invokes the standard editor. I have to tag the tiddler as "wysiwyg",
close it and then reopen it to see the HTMLArea editor.

Is there a way to create a tiddler which is already tagged and then
open it (in the HTMLARea editor) automatically perhaps?

I tried tagging the tiddler when it's created using:

<<newTiddler label:"new wysiwyg tiddler" tag:"wysiwyg" text:
{{store.getTiddlerText('WysiwygTemplate')}}>>

where WysiwygTemplate is a pre-existing empty tiddler, already tagged
with "wysiwyg". But this creates a new tiddler, correctly tagged, but
in the standard editor as if the tag has been applied too late.

(I was initially misled here. The normal tiddler creation option lets
you edit an as yet non-existent tiddler. If you cancel the editor no
such tiddler remains. But if I use the command above, the same process
generates a real tiddler called "New Tiddler" which DOES remain
afterwards, presumably because a tag was applied. Thereafter, any
attempt to use my command DOES open a tiddler in the HTMLArea editor
but only because New Tiddler already exists with the "wysiwyg" tag).

I wondered if I could invoke the CopyTiddlerPlugin but the Plugin
doesn't mention any parameters that I recognise and I can't for
example swap copyTiddler for newTiddler in the command above.

Is there some other way that I can open a new tiddler, tagged with
"wysiwyg" and that opens first time in the HTMLArea editor perhaps?

Thanks

Kevin

wolfgang

unread,
Oct 19, 2008, 7:37:26 PM10/19/08
to TiddlyWiki
Hi Kevin,

> Is there some other way that I can open a new tiddler, tagged with
> "wysiwyg" and that opens first time in the HTMLArea editor perhaps?
>

You could use NewSavedTiddlerPlugin, which creates new tiddlers but
they're opened in view mode, and would need only one additional 'Edit'
click to have them opened with HtmlArea editor:

http://monkeygtd.tiddlyspot.com/demo3.html#NewSavedTiddlerPlugin

Regards,

W.

kilucas

unread,
Oct 19, 2008, 8:21:26 PM10/19/08
to TiddlyWiki
Wolfgang

This idea sounds better to me than my current arrangement where a
tiddler of the right tag is opened but in the wrong editor. I have to
exit the editor and re-enter whereas your solution it least reduces
the number of steps.

I've imported the plugin but admit I haven't a clue what to do with it
as I couldn't find any documentation or comments on how to use it. It
shows up in my plugins but neither my search, Goto, or tiddler list
finds it.

Do you know how I'd use it in my TW perhaps? Given your description,
the idealfor me is to have a button below the standard "new tiddler"
button in the rightsidebar.

Many thanks for any clues you might have.

Kevin
Message has been deleted
Message has been deleted

BramChen

unread,
Oct 20, 2008, 12:45:02 AM10/20/08
to TiddlyWiki
> Is there some other way that I can open a new tiddler, tagged with
> "wysiwyg" and that opens first time in the HTMLArea editor perhaps?

You could create a tiddler, name it as 'htmlareaPluginAddon' and enter
the text
as below,
<<tiddler _dummy with: {{
window._newWysiwyg = function(title){
var tiddler = new Tiddler(title);
tiddler.tags.push('wysiwyg');
tiddler.modifier = config.options.txtUserName;
store.addTiddler(tiddler);
story.displayTiddler(null,title,DEFAULT_EDIT_TEMPLATE);
return false;
}
}}>><html><a class="button" href="javascript:;" title="$2"
onClick="_newWysiwyg.call(this,'$1')">$1</a></html>

usage of this scipt:
<<tiddler htmlareaPluginAddon with:"new wysiwyg" "Create a tiddler
tagged with 'wysiwyg'">>

(where the first one parameter is the button label, and the second is
tooltip)

wolfgang

unread,
Oct 20, 2008, 4:36:20 AM10/20/08
to TiddlyWiki
> usage of this scipt:
> <<tiddler htmlareaPluginAddon with:"new wysiwyg" "Create a tiddler
> tagged with 'wysiwyg'">>
>
> (where the first one parameter is the button label, and the second is
> tooltip)

The NewSavedTiddler macro works as the regular NewTiddler macro. You
simply can add label, tooltip text, tags, the content of a template
tiddler ...
(also see: http://tiddlywiki.org/wiki/NewTiddler_%28macro%29 for all
possible parameters).
An example from Monkeygtd:

<<newSavedTiddler title:'new Tickler' label:'+ tickler' tag:{{'Tickler
Once [['+config.macros.mgtdList.getRealm()+']]'}}>>

In your case you could simply write:

<<newSavedTiddler label:'new wysiwyg' tag:'wysiwyg'>>

Regards,

W.

kilucas

unread,
Oct 20, 2008, 4:06:46 PM10/20/08
to TiddlyWiki
Wolfgang

If I use <<newSavedTiddler label:'new wysiwyg' tag:'wysiwyg'>> then a
dialog box is offered for me to enter the new tiddler name but, on
clicking OK, no tiddler is presented for me to edit. Although I typed
a tiddler name into the box, no tiddler of that name is found by
search or goto either.

I tried including a title in the statement and that was repeated in
the text of the prompt box but it still behaved as before, accepting
an alterantive tiddler name but showing no subsequent tiddler.

Have I missed something important out of the statement perhaps?

Thanks

Kevin

On Oct 20, 9:36 am, wolfgang <wolfgangl...@gmail.com> wrote:
> > usage of this scipt:
> > <<tiddler htmlareaPluginAddon with:"new wysiwyg" "Create a tiddler
> > tagged with 'wysiwyg'">>
>
> > (where the first one parameter is the button label, and the second is
> > tooltip)
>
> The NewSavedTiddler macro works as the regular NewTiddler macro. You
> simply can add label, tooltip text, tags, the content of a template
> tiddler ...
> (also see:http://tiddlywiki.org/wiki/NewTiddler_%28macro%29for all
Reply all
Reply to author
Forward
0 new messages