checkbox widget tag check/inversion

70 views
Skip to first unread message

James Anderson

unread,
Jun 7, 2015, 6:21:39 PM6/7/15
to tiddly...@googlegroups.com
TL;DR: I would like to be able to specify the lack of a tag to check a checkbox widget i.e. <$checkbox !tag="incomplete">  or to be able to simply invert the checked value <$checkbox tag="incomplete" invert="true">

I had a couple of helper tiddlers and buttons for generating task lists by topic. They were

GenericTaskListComplete
<$list filter="[!has[draft.of]tag{!!title}tag[task]tag[complete]sort[created]]">
<$checkbox tag="complete"><$link to={{!!title}}><$view field="title"/></$link></$checkbox>
<br/>
</$list>


GenericTaskListIncomplete
<$list filter="[!has[draft.of]tag{!!title}tag[task]!tag[complete]sort[created]]">
<$checkbox tag="complete"> <$link to={{!!title}}><$view field="title"/></$link></$checkbox>
<br/>
</$list>


Articles (for example)

!Read Me
{{||GenericTaskListIncomplete}}
!Read
{{||GenericTaskListComplete}}
!Other
{{||GenericList}} //<-- anything that is not tagged as a task

Which was good...Except when I wanted to stop the tiddler from being a task and i'd have to remove both the "task" and "complete" tags. Also "complete" tags end up littering up my TW. I would rather that incomplete tasks stood out and that i only had to remove one tag on completed tasks :)

So I would prefer to do it this way:

If something is tagged as a "task" and "incomplete" it should be unchecked and once completed the "incomplete" tag removed and have it checked. this is mostly possible aside from the checked boxes being inverted.

GenericTaskListComplete
<$list filter="[!has[draft.of]tag{!!title}tag[task]!tag[incomplete]sort[created]]">
<$checkbox tag="incomplete"><$link to={{!!title}}><$view field="title"/></$link></$checkbox>
<br/>
</$list>


GenericTaskListIncomplete
<$list filter="[!has[draft.of]tag{!!title}tag[task]tag[incomplete]sort[created]]">
<$checkbox tag="incomplete"> <$link to={{!!title}}><$view field="title"/></$link></$checkbox>
<br/>
</$list>

Obviously i could just make a checkbox1 widget and maintain that, but would there be any possibility of getting something like a "tag doesn't contain" parameter into the checkbox core? In fact a simple "invert=`true`" param would be even easier.

Thanks,

James

Jeremy Ruston

unread,
Jun 9, 2015, 1:39:33 PM6/9/15
to TiddlyWikiDev
Hi James

Adding an "invert" attribute to the checkbox widget is reasonable. It would be more consistent with existing widgets for the text to be "invert='yes'".

The other possibility is to avoid using the checkbox widget at all, and use the reveal widget to flip between Unicode checkboxes.

Best wishes

Jeremy.


On Sun, Jun 7, 2015 at 11:21 PM, James Anderson <james.w....@gmail.com> wrote:
TL;DR: I would like to be able to specify the lack of a tag to check a checkbox widget i.e. <$checkbox !tag="incomplete"> 

--
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 tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/f53e1396-e0ac-4adb-a316-d4e0e15ee597%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Jeremy Ruston
mailto:jeremy...@gmail.com

Eric Shulman

unread,
Jun 9, 2015, 3:00:19 PM6/9/15
to tiddly...@googlegroups.com, jeremy...@gmail.com
...flip between Unicode checkboxes.

Instead of Unicode, I've used actual HTML checkboxes as content:
   <input type="checkbox">
and
   <input type="checkbox" checked="true">

This has the advantage of exactly matching whatever checkbox styles your browser normally uses, as well as responding to CSS customizations.  Note that this is NOT the <$checkbox> widget.  It is just literal HTML; and, because the <input> control isn't actually connected to anything, it's *just* a checkbox, without any effect. A direct click on the checkbox falls through to the <$button>, allowing the underlying button click handler to do the work (e.g., toggle a setting)

-e
 

Felix Küppers

unread,
Jun 9, 2015, 3:15:17 PM6/9/15
to tiddly...@googlegroups.com
Hi,

I once wanted to do a PR for this feature but then solved it in a different way...

@James maybe have a look at: https://github.com/Jermolene/TiddlyWiki5/issues/1109

-Felix
Reply all
Reply to author
Forward
0 new messages