Hi Jed

The filters themselves don't impose uniqueness -- items are, however, 
dominantly appended. If I wish to add an item, and an instance of that item 
already occurs in the list, then that instance will be removed the moment 
the second 'copy' gets added. Don't know if this is due only to 
the  $tw.utils.stringifyList function. Anyway, this must be fixed 
elsewhere, and has nothing to do with my widget, or the filters themselves.

I also had thoughts toward providing a separate parameter to add/remove 
items -- however, in the interests of avoiding complexity, new items could 
only be appended to the tail of the list (the filter mechanism could be 
applied afterward to manipulate the amended list.) 

regards

On Friday, 16 October 2015 23:27:02 UTC+2, Jed Carty wrote:
>
> Ahh, it looks like what you have made can do everything (or almost 
> everything, I don't know if it can make lists of non-unique items) what I 
> made can do and is probably more flexible. I think our motivations are very 
> different, I started from the idea that fields should be polymorphic and 
> whatever is interacting with them should determine how they act. So I was 
> trying to make the tags field just another field. So in the sense that both 
> allow any field to act the same way as the tags field they are pretty much 
> equivalent.
>
> Looking at the code you have a much more elegant solution, although I 
> would like a way to use it that is more consistent with the other action 
> widgets, for example I think that filters may not be appropriate for add or 
> remove actions.
> It looks like the filtering doesn't impose uniqueness so if we do update 
> $tw.utils.stringifyList that should take care of that objection.
>
> I don't think it would be too difficult to make inputs like $add=foo that 
> would create the proper filter to add foo to the list, with some other 
> similar options that have special filters associated with them.
> That way it could keep the flexibility from the filters and still have a 
> way to give arguments that is consistent with the other action widgets.
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" 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/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/efe980b4-e665-4325-8eeb-0690ed69be27%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to