plugin release: ToDoTogglePlugin

5 views
Skip to first unread message

FND

unread,
Aug 15, 2008, 5:53:59 AM8/15/08
to TiddlyWiki
All,

Yesterday's hackathon[1] resulted in a simple plugin for handling tasks
within tiddlers. While this has been developed for the specific needs of
one of the attendants, it might still be of general use - so I thought
we'd share it here:
http://tinyurl.com/6gctpu
(http://svn.tiddlywiki.org/Trunk/contributors/FND/plugins/ToDoTogglePlugin.js)

Hopefully the documentation is clear enough to quickly get started
(though there's not much to it, really).
Note that this makes use of Eric's CheckboxPlugin[2], so you'll have to
install that as well.


-- F.


[1] http://twitter.com/osmosoft/statuses/878080192
[2] http://www.tiddlytools.com/#CheckboxPlugin

Peter Lazarev

unread,
Aug 15, 2008, 7:10:56 AM8/15/08
to Tiddl...@googlegroups.com
Wow, that is something i was looking for for a very long Time
now you can place todo Itemes just somewhere in the Text and have their
state saved.
Thanks a lot!

FND

unread,
Aug 15, 2008, 7:55:04 AM8/15/08
to Tiddl...@googlegroups.com
> Wow, that is something i was looking for for a very long Time

Glad to hear that.

FWIW, here's a quick demo document:
http://tinyurl.com/6qsg82
(http://fnd.lewcid.org/tmp/ToDoTogglePlugin.html#Tasks%20ToDoTogglePlugin)


-- F.

ccahua

unread,
Aug 15, 2008, 10:22:10 PM8/15/08
to TiddlyWiki
On Aug 15, 2:53 am, FND <F...@gmx.net> wrote:
> While this has been developed for the specific needs of
> one of the attendants, it might still be of general use - so I thought
> we'd share it here:
>      http://tinyurl.com/6gctpu
> (http://svn.tiddlywiki.org/Trunk/contributors/FND/plugins/ToDoTogglePl...)

Thanks for sharing!

I haven't been keeping up with all the gtd space productivity plugins,
but having tried various incarnations of these todo tagging toggling
tasking systems; this is wonderful in its direct simplicity without
the steep learning curve.

I added a custom new tiddler macro to my context tiddlers and that
saves keystrokes and now I'm really getting things 'done'!
<<newTiddler label:"new todo" accessKey:1 focus:title title:"new todo"
text:"[ ] " tag:todo home>>

Also happy to report, ToDoTogglePlugin beta along with Eric's
CheckboxPlugin dependency works in TW2.41 under Win2000/FF2 and MacOSX/
FF3. No problems so far.

Thanks again and please keep hacking!

Best,
tony

Tobias Beer

unread,
Aug 16, 2008, 7:52:38 AM8/16/08
to TiddlyWiki
Played with the demo you provided...
Changing tags doesn't seem to work in ie7.

FND

unread,
Aug 16, 2008, 2:14:05 PM8/16/08
to Tiddl...@googlegroups.com
> Changing tags doesn't seem to work in ie7.

You're right. ($#@% IE!)

Technical information:
This is because the event is not defined in IE.
However, the ToDoTogglePlugin needs that event check because the
CheckboxPlugin seems to call the onClickCheckbox function not only
onClick, but also when the respective checkbox element is rendered.
Eric, can you confirm this?


-- F.

Eric Shulman

unread,
Aug 16, 2008, 4:06:40 PM8/16/08
to TiddlyWiki
On Aug 16, 11:14 am, FND <F...@gmx.net> wrote:
> > Changing tags doesn't seem to work in ie7.
> You're right. ($#@% IE!)
> Technical information:
> This is because the event is not defined in IE.

note: instead of passing the 'event' parameter to the onclick handler
function, IE uses a global event object ("window.event").

> However, the ToDoTogglePlugin needs that event check because the
> CheckboxPlugin seems to call the onClickCheckbox function not only
> onClick, but also when the respective checkbox element is rendered.
> Eric, can you confirm this?

Although onClickCheckbox() declares an 'event' param, it is actually
unused within the function and is irrelevant to the onclick() handling
provided by CheckboxPlugin.

When CheckboxPlugin creates a checkbox element, the checked/unchecked
state of that element is initialized by invoking onClickCheckbox()
from within config.macros.checkbox.create(), via this code:
c.init=true; c.onclick(); c.init=false;
(where 'c' is the checkbox element being rendered).

Then, in onClickCheckbox(), the 'init' flag is checked order to ensure
that certain 'side-effect' processing will only be invoked in response
to an actual click and will not be triggtered during the initial
rendering of the checkbox.

Your hijacked version of onClickCheckbox can do the same... i.e.,
check the 'this.init' flag to ensure that the custom 'toggleStatus()'
processing is only performed when an actual click occurs. Thus,
instead of:
if(tiddler && event != undefined) {
you would write:
if(tiddler && !this.init) {
This change will allow you to completely avoid use the use of the
'event' parameter in any way, so that this IE7-specific problem will
simply go away!

enjoy,
-e

FND

unread,
Aug 17, 2008, 4:13:04 AM8/17/08
to Tiddl...@googlegroups.com
> note: instead of passing the 'event' parameter to the onclick handler
> function, IE uses a global event object ("window.event").

Ah, of course - thanks for the reminder!

> in onClickCheckbox(), the 'init' flag is checked order to ensure
> that certain 'side-effect' processing will only be invoked in response
> to an actual click and will not be triggtered during the initial
> rendering of the checkbox.

That makes sense now.
I've committed the fixed version and updated the demo:
http://tinyurl.com/6gctpu
(http://svn.tiddlywiki.org/Trunk/contributors/FND/plugins/ToDoTogglePlugin.js)
http://tinyurl.com/6qsg82
(http://fnd.lewcid.org/tmp/ToDoTogglePlugin.html#Tasks%20ToDoTogglePlugin)

Thanks for the clarification, Eric, and thanks to Tobias for reporting
this bug!


-- F.

Reply all
Reply to author
Forward
0 new messages