request to extend createTagButton

1 view
Skip to first unread message

Tobias Beer

unread,
Sep 4, 2010, 5:59:18 AM9/4/10
to TiddlyWikiDev
Hi everyone (@Osmosoft),

I think it were beneficial if tag buttons would indicate whether a tag
is being used or not...

function createTagButton(place,tag,excludeTiddler,title,tooltip)
{
var btn = createTiddlyButton(place,title||tag,(tooltip||
config.views.wikified.tag.tooltip).format([tag]),onClickTag);

//NEW CODE

addClass(btn,store.getTaggedTiddlers(tag).length>0?'hastags':'hasnotags');
//DONE

btn.setAttribute("tag",tag);
if(excludeTiddler)
btn.setAttribute("tiddler",excludeTiddler);
return btn;
}


Cheers, Tobias.

FND

unread,
Sep 20, 2010, 5:34:28 AM9/20/10
to tiddly...@googlegroups.com
> I think it were beneficial if tag buttons would indicate whether a tag
> is being used or not...
> [...]
> function createTagButton(place,tag,excludeTiddler,title,tooltip)
> [...]
> addClass(btn,store.getTaggedTiddlers(tag).length>0?'hastags':'hasnotags');

Two concerns:
a) performance - we'd need to do some profiling to ensure there's no
significant impact here
b) each such button would have to be refreshed when any tiddler is modified

None of these seem like deal breakers, but it needs some investigation.
Can you raise a ticket on Trac?


-- F.

Jeremy Ruston

unread,
Sep 22, 2010, 11:30:16 AM9/22/10
to tiddly...@googlegroups.com
> Two concerns:
> a) performance - we'd need to do some profiling to ensure there's no
> significant impact here

I share these concerns; store.getTaggedTiddlers() executes slowly if
there are a lot of tiddlers.

> b) each such button would have to be refreshed when any tiddler is modified

This could be done in the same way that tiddler links get refreshed
when they switch from italic to normal depending on the existence of
the target tiddler. You would need to add a new member to
config.refreshers that knows how to refresh tag links.

Cheers

Jeremy

> None of these seem like deal breakers, but it needs some investigation.
> Can you raise a ticket on Trac?
>
>
> -- F.
>

> --
> You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
> To post to this group, send email to tiddly...@googlegroups.com.
> To unsubscribe from this group, send email to tiddlywikide...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/tiddlywikidev?hl=en.
>
>

--
Jeremy Ruston
mailto:jer...@osmosoft.com
http://www.tiddlywiki.com

Tobias Beer

unread,
Sep 23, 2010, 4:14:59 AM9/23/10
to TiddlyWikiDev
Will raise a ticket ...and patiently wait to see what happens. In the
meantime I will turn this into what Eric calls a "core hack" and
hopefully get to take some more time to figure out where and how to
finally aggregate my codebits.

Cheers, Tobias.

On 22 Sep., 17:30, Jeremy Ruston <jeremy.rus...@gmail.com> wrote:
> > Two concerns:
> > a) performance - we'd need to do some profiling to ensure there's no
> > significant impact here
>
> I share these concerns; store.getTaggedTiddlers() executes slowly if
> there are a lot of tiddlers.
>
> > b) each such button would have to be refreshed when any tiddler is modified
>
> This could be done in the same way that tiddler links get refreshed
> when they switch from italic to normal depending on the existence of
> the target tiddler. You would need to add a new member to
> config.refreshers that knows how to refresh tag links.
>
> Cheers
>
> Jeremy
>
> > None of these seem like deal breakers, but it needs some investigation.
> > Can you raise a ticket on Trac?
>
> > -- F.
>
> > --
> > You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
> > To post to this group, send email to tiddly...@googlegroups.com.
> > To unsubscribe from this group, send email to tiddlywikide...@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/tiddlywikidev?hl=en.

Tobias Beer

unread,
Sep 23, 2010, 5:16:25 AM9/23/10
to TiddlyWikiDev
Here's a link to the ticket... http://trac.tiddlywiki.org/ticket/1252

Cheers, Tobias.
Reply all
Reply to author
Forward
0 new messages