Hi
On Wednesday, 4 November 2015 09:38:14 UTC+2, Philip Dyer wrote:
The $action-listops widget is all new and aimed at manipulating a list in any field or data index, using a subfilter expression The $x-mangletags widget was an evolution from my old $mangletags widget, which was designed to do a search/replace on the tags field.
I first tried an approach similar to this, using an increasing number of widget attributes to manipulate the string (an evolution from the $x-mangletags widget.) This proved difficult as it seemed impossible to guess all of the uses to which lists might be put, and write attributes to cover all of the necessary operations. I then tried the technique adopted in the $action-listops widget -- applying a subfilter expression to the string.
The advantage is that the widget is simple and never needs to change -- subfilter expressions can be built using any combination of filter operators to achieve the desired result. In the event that an operation is missing, a new filter operator may be written. If you need a new filter operator, please let me know and I'll andeavour to write one.
The only advantage of Jed's list $action-editlist is in the case that your application requires multiple instances of a single item (this was one of the design considerations for his widget.) Although none of my filters enforce single instances of items, several of the core filter operators do so (including the +[] and -[] operators -- in practice, therefore, my widget manipulates sets.)
One question, if I set the title field to something not unique, will $x-maketid correct that and append a number? The tm-newtiddler message will not do that.
The $x-maketid widget will create a unique name using an appended integer -- repeated clicks of the button will, therefore, create a number of tiddlers with different names. A date/time may also be appended to the title -- this tends to generate a unique name without the need for appending an integer (if two are created in quick succession, an integer will be appended to the second title.)
The $x-maketid widget can create tiddlers in the background, or navigate to the new tiddler without opening for editing, or will navigate to and open the tiddler for editing -- whatever you require.
regards