This is an interesting one. The context in which I've given this some
thought in the past is the idea of supporting checkboxes like GitHub
Flavoured MarkDown:

[ ] This is a checkbox

The [ ] would display as an unchecked checkbox with an event handler that
reaches back into the tiddler text to change it to [x], which would be
displayed as a checked checkbox.

With some refinements to the core, this could be implemented in TW5. The
refinements would be to retain the character offset in the original source
of each parsed wikitext node. However, I think the implementation would be
brittle.

Anyhow, a more serious problem is that once we've got an embedded checkbox
in a block of text, then we're going to want to refer to that checkbox
state elsewhere; for instance to pull together all the unchecked tasks.
That takes us back down the path of some xpath-like syntax for referencing
nodes of the parse tree.

Meanwhile, the current approach of modelling a checkbox state as a tag on a
tiddler means that the checkbox state is a first class citizen and can be
referred to and used easily elsewhere.

So, I think this ends up being another case where the price of an
apparently attractive feature is having to open the can of worms of
developing an intra-tiddler algebra, as well as the inter-tiddler algebra
that TiddlyWiki is founded on.

Anyhow, an alternative for your scenario might be to store the attribute as
a field of the tiddler. Then you can write things like <div
attr={{!!myfield}}>, and <$edit field="myfield"/>

Best wishes

Jeremy



On Wed, Sep 18, 2013 at 8:13 PM, David Johnston <[email protected]>wrote:

> One of my widget plugins allows some degree of user interaction via HTML
> form elements. The initial settings for the plugin are derived from
> attributes set in the widgets tag.
>
> Is it possible as various element forms are adjusted by the user - check
> boxes ticked for instance, to alter the tiddler text, specifically the
> attributes of the tag the user ticked upon.
>
> So for instance, as a checkbox is clicked on by the user, an event is
> triggered, which alters or adds an attribute to the widget tag which
> generated the checkbox in the first place. I have a working version which
> does most of this, the only problem is if the user closes that tiddler, the
> "state" of the tiddler is lost. I wish to record the state basically, but
> not necessarily force a save for the tiddler.
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "TiddlyWikiDev" 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 http://groups.google.com/group/tiddlywikidev.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Jeremy Ruston
mailto:[email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" 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 http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to