[tw] Re: [TW5] The $mangletags widget

2014-07-17 Thread Matabele
Hi

I found a small bug in the $mangletags widget, I suggest updating to the 
latest version: http://gwiz.tiddlyspot.com

My logic was faulty -- this effects only the find and replace option, and 
only when the 'tags' field of the target tiddler is empty. The tag in the 
'add=' attribute was added despite the absence of the tag in the 'find=' 
attribute. 

This is not a common occurrence and it took me a while to notice -- hope 
this didn't mess anyone around.

regards

On Friday, May 30, 2014 12:40:51 PM UTC+2, Matabele wrote:

 Hi

 I have added another widget at: http://gwiz.tiddlyspot.com/

 I needed to modify the tags in the template and the $maketid widget 
 overwrites the tags in the template tiddler. Whilst it is possible to do 
 this in some contexts with the $fieldmangler widget, the parameter to the 
 message is used to specify the tag, and according to my stacking mechanism, 
 the title of the target tiddler should be propagated with the parameter to 
 the message. Thus a whole new $mangletags widget and an associated 
 tw-mangle-tags message (to avoid confusions with the widget messages 
 associated with the $fieldmangler widget.)

 The $mangletags widget can be stacked around a button widget and can do 
 any of the following:
-- append a tag to the tags field of the target tiddler
-- find and remove a tag from the tags field of the target tiddler (if 
 present)
-- find and replace a tag from the tags field of the target tiddler (if 
 present)
-- send a different widget message.

 The unfamiliar attributes are 'add=' and 'find='
-- to add a tag, use only: add=tag-to-add
-- to remove a tag, use only: find=tag-to-remove
-- to find and replace a tag use: find=tag-to-be-replaced and 
 add=tag-to-substitute

 Hope this is of use -- there is a demo on the site to show what the widget 
 does. The logic is a little complicated -- hope my code works in all 
 contexts :-)

 regards


-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] The $mangletags widget

2014-06-19 Thread Matabele
Hi cmari

Sorry about the delay in responding -- I have been offline for a bit (one 
of the remaining places on earth with no internet.) 

I don't quite understand your question -- multiple substitutions of what 
with one button?

regards

On Saturday, June 7, 2014 9:48:37 PM UTC+2, cmari wrote:

 Multiple substitutions with a single button - did you ever find a way to 
 do this?  I'd be really interested!
 cmari

 On Friday, May 30, 2014 9:07:01 AM UTC-7, Matabele wrote:

 Hi 

 I have been experimenting -- the $mangletags widget can be used to 
 create a simple search and replace along with a $list widget:

 ul$list filter=[tag[tag-to-replace]]
 $mangletags find=tag-to-replace add=tag-to-substitute
 li$button message=tw-mangle-tags 
 class=btn-invisible{{!!title}}/$button/li
 /$mangletags/$list/ul

 Is there any way to automate the generation of the widget message in such 
 a way that all of the substitutions will take place with a single button 
 press? 

 regards

 On Friday, May 30, 2014 2:13:12 PM UTC+2, Danielo Rodríguez wrote:

 Wow!

 Another piece to the stack! Glad to see you so busy. Thank you for all 
 your widgets. Currently I have no need to try it out, but I will keep it in 
 my mind.

 Regards

 El viernes, 30 de mayo de 2014 12:40:51 UTC+2, Matabele escribió:

 Hi

 I have added another widget at: http://gwiz.tiddlyspot.com/

 I needed to modify the tags in the template and the $maketid widget 
 overwrites the tags in the template tiddler. Whilst it is possible to do 
 this in some contexts with the $fieldmangler widget, the parameter to 
 the 
 message is used to specify the tag, and according to my stacking 
 mechanism, 
 the title of the target tiddler should be propagated with the parameter to 
 the message. Thus a whole new $mangletags widget and an associated 
 tw-mangle-tags message (to avoid confusions with the widget messages 
 associated with the $fieldmangler widget.)

 The $mangletags widget can be stacked around a button widget and can 
 do any of the following:
-- append a tag to the tags field of the target tiddler
-- find and remove a tag from the tags field of the target tiddler 
 (if present)
-- find and replace a tag from the tags field of the target tiddler 
 (if present)
-- send a different widget message.

 The unfamiliar attributes are 'add=' and 'find='
-- to add a tag, use only: add=tag-to-add
-- to remove a tag, use only: find=tag-to-remove
-- to find and replace a tag use: find=tag-to-be-replaced and 
 add=tag-to-substitute

 Hope this is of use -- there is a demo on the site to show what the 
 widget does. The logic is a little complicated -- hope my code works in 
 all 
 contexts :-)

 regards



-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] The $mangletags widget

2014-06-19 Thread cmari
Sorry, I wasn't trying to be cryptic!  I was referring to your previous 
message, where I thought you were talking about clicking a single button to 
affect all the tiddlers that had been filtered by a list.  Here's what you 
wrote:

 I have been experimenting -- the $mangletags widget can be used to 
create a simple search and replace along with a $list widget:

ul$list filter=[tag[tag-to-replace]]
$mangletags find=tag-to-replace add=tag-to-substitute
li$button message=tw-mangle-tags 
class=btn-invisible{{!!title}}/$button/li
/$mangletags/$list/ul

 Is there any way to automate the generation of the widget message in such 
a way that all of the substitutions will take place with a single button 
press? 

cmari

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] The $mangletags widget

2014-06-07 Thread cmari
Multiple substitutions with a single button - did you ever find a way to do 
this?  I'd be really interested!
cmari

On Friday, May 30, 2014 9:07:01 AM UTC-7, Matabele wrote:

 Hi 

 I have been experimenting -- the $mangletags widget can be used to 
 create a simple search and replace along with a $list widget:

 ul$list filter=[tag[tag-to-replace]]
 $mangletags find=tag-to-replace add=tag-to-substitute
 li$button message=tw-mangle-tags 
 class=btn-invisible{{!!title}}/$button/li
 /$mangletags/$list/ul

 Is there any way to automate the generation of the widget message in such 
 a way that all of the substitutions will take place with a single button 
 press? 

 regards

 On Friday, May 30, 2014 2:13:12 PM UTC+2, Danielo Rodríguez wrote:

 Wow!

 Another piece to the stack! Glad to see you so busy. Thank you for all 
 your widgets. Currently I have no need to try it out, but I will keep it in 
 my mind.

 Regards

 El viernes, 30 de mayo de 2014 12:40:51 UTC+2, Matabele escribió:

 Hi

 I have added another widget at: http://gwiz.tiddlyspot.com/

 I needed to modify the tags in the template and the $maketid widget 
 overwrites the tags in the template tiddler. Whilst it is possible to do 
 this in some contexts with the $fieldmangler widget, the parameter to the 
 message is used to specify the tag, and according to my stacking mechanism, 
 the title of the target tiddler should be propagated with the parameter to 
 the message. Thus a whole new $mangletags widget and an associated 
 tw-mangle-tags message (to avoid confusions with the widget messages 
 associated with the $fieldmangler widget.)

 The $mangletags widget can be stacked around a button widget and can 
 do any of the following:
-- append a tag to the tags field of the target tiddler
-- find and remove a tag from the tags field of the target tiddler 
 (if present)
-- find and replace a tag from the tags field of the target tiddler 
 (if present)
-- send a different widget message.

 The unfamiliar attributes are 'add=' and 'find='
-- to add a tag, use only: add=tag-to-add
-- to remove a tag, use only: find=tag-to-remove
-- to find and replace a tag use: find=tag-to-be-replaced and 
 add=tag-to-substitute

 Hope this is of use -- there is a demo on the site to show what the 
 widget does. The logic is a little complicated -- hope my code works in all 
 contexts :-)

 regards



-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] The $mangletags widget

2014-06-03 Thread Matabele
Hi

With the latest version of the $mangletags widget, widgets may be stacked 
adjacent to one another like this:

$mangletags add=one
$mangletags add=two
$mangletags add=three
$button message=tw-mangle-tags param=TestAdd/$button
/$mangletags/$mangletags/$mangletags

regards

On Friday, May 30, 2014 12:40:51 PM UTC+2, Matabele wrote:

 Hi

 I have added another widget at: http://gwiz.tiddlyspot.com/

 I needed to modify the tags in the template and the $maketid widget 
 overwrites the tags in the template tiddler. Whilst it is possible to do 
 this in some contexts with the $fieldmangler widget, the parameter to the 
 message is used to specify the tag, and according to my stacking mechanism, 
 the title of the target tiddler should be propagated with the parameter to 
 the message. Thus a whole new $mangletags widget and an associated 
 tw-mangle-tags message (to avoid confusions with the widget messages 
 associated with the $fieldmangler widget.)

 The $mangletags widget can be stacked around a button widget and can do 
 any of the following:
-- append a tag to the tags field of the target tiddler
-- find and remove a tag from the tags field of the target tiddler (if 
 present)
-- find and replace a tag from the tags field of the target tiddler (if 
 present)
-- send a different widget message.

 The unfamiliar attributes are 'add=' and 'find='
-- to add a tag, use only: add=tag-to-add
-- to remove a tag, use only: find=tag-to-remove
-- to find and replace a tag use: find=tag-to-be-replaced and 
 add=tag-to-substitute

 Hope this is of use -- there is a demo on the site to show what the widget 
 does. The logic is a little complicated -- hope my code works in all 
 contexts :-)

 regards


-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] The $mangletags widget

2014-06-02 Thread Matabele
Hi Mans

I have added a prototype of a new $iftid widget 
at: http://gwiz.tiddlyspot.com/

This widget tests for the existence of a specified tiddler, then sends 
alternate messages to the stack depending upon whether this tiddler exists. 
I'm not sure if the messaging is all OK, but seems to work in simple cases. 
if the test is true and you have nothing further to do -- send a dummy 
message as the value for the 'then=' attribute to prevent spurious messages 
flying around. In the case that the tiddler does not exist, send a 
tw-new-tiddler message (the default) as the value of the 'else=' 
attribute, and add a $maketid widget to create your new tiddler (the 
title for the new tiddler must be specified in the $maketid widget.)

Give the widget a try for your application.

regards

On Sunday, June 1, 2014 8:20:23 PM UTC+2, Matabele wrote:

 Hi Mans

 OK - I have an idea for a new widget -- should solve your problem whilst 
 helping out with my messaging problem in the stack.

 Give me a little time as the change will likely mean I have to modify my 
 other widgets a little to make them compatible.

 regards

 On Sunday, June 1, 2014 2:55:10 PM UTC+2, Måns wrote:

 Hi Matabele


 Now I'd love to combine $mangletags with $maketid via 
 $edit-text tiddler=temp field=teacher/  
 $edit-text tiddler=temp field=task/ so it would:

 1) create a new task tiddler *only* if it doesn't already exist.
 2) create a new teacher tiddler *only* if it doesn't already exist.



-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] The $mangletags widget

2014-06-02 Thread Måns
Hi Matabele

Than you very much :-P

I tried to create first half of a combi button which should create a 
teacher and/or a task which didn't already exist - I didn't succeed ... - 
have to try again when I get some more toime on my hands ..

This was my first (half) attempt:

$reveal type=nomatch state=!!state1 text=show
$mangletags tiddler={{temp!!task}} add={{temp!!teacher}}
$setfield message=tw-mangle-tags
$mangletags tiddler={{temp!!teacher}} add={{temp!!task}} 
message=tw-set-field
$maketid title={{temp!!teacher}} tags={{temp!!task}} 
message=tw-mangle-tags edit=show
$iftid tiddler={{temp!!teacher}} then=tw-set-field else=tw-new-tiddler
$maketid title={{temp!!task}} tags={{temp!!teacher}} 
message=tw-mangle-tags edit=show
$iftid tiddler={{temp!!task}} then=tw-set-field else=tw-new-tiddler
$button set=!!state1 setTo=show message=tw-if-tiddler 
param={{temp!!teacher}}Assign/Create/Assign/$button
/$iftid
/$maketid
/$iftid
/$maketid
/$mangletags
/$setfield
/$mangletags
/$reveal

Second half of the button should start here ...

Cheers Måns Mårtensson

Den mandag den 2. juni 2014 14.52.43 UTC+2 skrev Matabele:

 Hi Mans

 I have added a prototype of a new $iftid widget at: 
 http://gwiz.tiddlyspot.com/

 This widget tests for the existence of a specified tiddler, then sends 
 alternate messages to the stack depending upon whether this tiddler exists. 
 I'm not sure if the messaging is all OK, but seems to work in simple cases. 
 if the test is true and you have nothing further to do -- send a dummy 
 message as the value for the 'then=' attribute to prevent spurious messages 
 flying around. In the case that the tiddler does not exist, send a 
 tw-new-tiddler message (the default) as the value of the 'else=' 
 attribute, and add a $maketid widget to create your new tiddler (the 
 title for the new tiddler must be specified in the $maketid widget.)

 Give the widget a try for your application.

 regards

 On Sunday, June 1, 2014 8:20:23 PM UTC+2, Matabele wrote:

 Hi Mans

 OK - I have an idea for a new widget -- should solve your problem whilst 
 helping out with my messaging problem in the stack.

 Give me a little time as the change will likely mean I have to modify my 
 other widgets a little to make them compatible.

 regards

 On Sunday, June 1, 2014 2:55:10 PM UTC+2, Måns wrote:

 Hi Matabele


 Now I'd love to combine $mangletags with $maketid via 
 $edit-text tiddler=temp field=teacher/  
 $edit-text tiddler=temp field=task/ so it would:

 1) create a new task tiddler *only* if it doesn't already exist.
 2) create a new teacher tiddler *only* if it doesn't already exist.



-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] The $mangletags widget

2014-06-02 Thread Måns
Baah - My attempt doesn't even add the task to an existing teacher - I'll 
have to try some more ...

- I guess it will take some time before I get back  have loads of work all 
week - and tonight..

Thanks again

Cheers Måns Mårtensson

Den mandag den 2. juni 2014 17.59.06 UTC+2 skrev Måns:

 Hi Matabele

 Than you very much :-P

 I tried to create first half of a combi button which should create a 
 teacher and/or a task which didn't already exist - I didn't succeed ... - 
 have to try again when I get some more toime on my hands ..

 This was my first (half) attempt:

 $reveal type=nomatch state=!!state1 text=show
 $mangletags tiddler={{temp!!task}} add={{temp!!teacher}}
 $setfield message=tw-mangle-tags
 $mangletags tiddler={{temp!!teacher}} add={{temp!!task}} 
 message=tw-set-field
 $maketid title={{temp!!teacher}} tags={{temp!!task}} 
 message=tw-mangle-tags edit=show
 $iftid tiddler={{temp!!teacher}} then=tw-set-field 
 else=tw-new-tiddler
 $maketid title={{temp!!task}} tags={{temp!!teacher}} 
 message=tw-mangle-tags edit=show
 $iftid tiddler={{temp!!task}} then=tw-set-field else=tw-new-tiddler
 $button set=!!state1 setTo=show message=tw-if-tiddler 
 param={{temp!!teacher}}Assign/Create/Assign/$button
 /$iftid
 /$maketid
 /$iftid
 /$maketid
 /$mangletags
 /$setfield
 /$mangletags
 /$reveal

 Second half of the button should start here ...

 Cheers Måns Mårtensson

 Den mandag den 2. juni 2014 14.52.43 UTC+2 skrev Matabele:

 Hi Mans

 I have added a prototype of a new $iftid widget at: 
 http://gwiz.tiddlyspot.com/

 This widget tests for the existence of a specified tiddler, then sends 
 alternate messages to the stack depending upon whether this tiddler exists. 
 I'm not sure if the messaging is all OK, but seems to work in simple cases. 
 if the test is true and you have nothing further to do -- send a dummy 
 message as the value for the 'then=' attribute to prevent spurious messages 
 flying around. In the case that the tiddler does not exist, send a 
 tw-new-tiddler message (the default) as the value of the 'else=' 
 attribute, and add a $maketid widget to create your new tiddler (the 
 title for the new tiddler must be specified in the $maketid widget.)

 Give the widget a try for your application.

 regards

 On Sunday, June 1, 2014 8:20:23 PM UTC+2, Matabele wrote:

 Hi Mans

 OK - I have an idea for a new widget -- should solve your problem whilst 
 helping out with my messaging problem in the stack.

 Give me a little time as the change will likely mean I have to modify my 
 other widgets a little to make them compatible.

 regards

 On Sunday, June 1, 2014 2:55:10 PM UTC+2, Måns wrote:

 Hi Matabele


 Now I'd love to combine $mangletags with $maketid via 
 $edit-text tiddler=temp field=teacher/  
 $edit-text tiddler=temp field=task/ so it would:

 1) create a new task tiddler *only* if it doesn't already exist.
 2) create a new teacher tiddler *only* if it doesn't already exist.



-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] The $mangletags widget

2014-06-02 Thread Matabele
Hi Mans

On Monday, June 2, 2014 5:59:06 PM UTC+2, Måns wrote:

 Hi Matabele

 Than you very much :-P

 I tried to create first half of a combi button which should create a 
 teacher and/or a task which didn't already exist - I didn't succeed ... - 
 have to try again when I get some more toime on my hands ..


It will need some fiddling around with to work -- the stack messaging is 
still not always predictable, especially with long stacks :-( 
  


 This was my first (half) attempt:


I appear to have fixed the $mangletags widget to the extent that two may 
be used adjacent to one another without the need for the dummy $setfield 
widget.

I have found that it pays to send a nonsense message (message=dummy) 
whenever the message is not being used (for example the outer message in 
the stack) -- this appears to reduce the number of extraneous messages 
bouncing around. 

I still don't seem to have this messaging figured out :-/

regards

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] The $mangletags widget

2014-06-01 Thread Måns
Hi Matabele

In my case all teachers and tasks are created/predefined - so a 
 listboxplugin providing an ability to choose teachers/tasks from a dropdown 
 would be very useful.


Birthe C. told me that Stephan Hradek published a ListSelect Widget on 
http://tiddlystuff.tiddlypot.com . 
I use it like this in combination with your mangletags demo:

;Teacher:$listselect
  filter=[tag[teacher]!prefix[$]] -[[teacher]]
  value=tag
  tiddler=temp
  field=teacher/

;Task:$listselect
  filter=[tag[task]!prefix[$]] -[[task]]
  value=tag
  tiddler=temp
  field=task/

$mangletags tiddler={{temp!!task}} add={{temp!!teacher}}
$setfield message=tw-mangle-tags
$mangletags tiddler={{temp!!teacher}} add={{temp!!task}} 
message=tw-set-field
$button  message=tw-mangle-tags param={{temp!!teacher}}Set/$button
/$mangletags/$setfield/$mangletags


$mangletags tiddler={{temp!!task}} find={{temp!!teacher}}
$setfield message=tw-mangle-tags
$mangletags tiddler={{temp!!teacher}} find={{temp!!task}} 
message=tw-set-field
$button  message=tw-mangle-tags param={{temp!!teacher}}Reset/$button
/$mangletags/$setfield/$mangletags

That is *very* close to what I wanted in the first place :-P

Now I'd love to combine $mangletags with $maketid via 
$edit-text tiddler=temp field=teacher/  
$edit-text tiddler=temp field=task/ so it would:

1) create a new task tiddler *only* if it doesn't already exist.
2) create a new teacher tiddler *only* if it doesn't already exist.

Is this kind of combination possible already - or would it need another 
version of $maketid?

Cheers Måns Mårtensson 

 

 I already have setup a system where you can click tag pills from auto 
 generated lists of teachers (in tasks) or tasks (in teachers)  - I will see 
 if $mangletags can find it's way into the system - it *is* getting pretty 
 hairy/complicated already :-)

 Cheers Måns Mårtensson


 - 


-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] The $mangletags widget

2014-06-01 Thread Matabele
Hi Mans

On Sunday, June 1, 2014 2:55:10 PM UTC+2, Måns wrote:

 Hi Matabele

 Birthe C. told me that Stephan Hradek published a ListSelect Widget on 
 http://tiddlystuff.tiddlypot.com . 
 I use it like this in combination with your mangletags demo:


Nice :-)  You might prefer to stick the two buttons into a toggle like this:

$reveal type=nomatch state=!!state1 text=show
$mangletags tiddler={{temp!!task}} add={{temp!!teacher}}
$setfield message=tw-mangle-tags
$mangletags tiddler={{temp!!teacher}} add={{temp!!task}} 
message=tw-set-field
$button  set=!!state1 setTo=show message=tw-mangle-tags 
param={{temp!!teacher}}Set/$button
/$mangletags/$setfield/$mangletags
/$reveal
$reveal type=match state=!!state1 text=show
$mangletags tiddler={{temp!!task}} find={{temp!!teacher}}
$setfield message=tw-mangle-tags
$mangletags tiddler={{temp!!teacher}} find={{temp!!task}} 
message=tw-set-field
$button  set=!!state1 setTo=hide message=tw-mangle-tags 
param={{temp!!teacher}}Reset/$button
/$mangletags/$setfield/$mangletags
/$reveal
 

 Now I'd love to combine $mangletags with $maketid via 
 $edit-text tiddler=temp field=teacher/  
 $edit-text tiddler=temp field=task/ so it would:

 1) create a new task tiddler *only* if it doesn't already exist.
 2) create a new teacher tiddler *only* if it doesn't already exist.

 Is this kind of combination possible already - or would it need another 
 version of $maketid?


The $maketid widget could easily be adapted to halt if a tiddler with the 
specified title exists (instead of revising the title) -- however, this 
should be possible to determine before calling the widge. I suppose an 
attribute could be added to toggle this behaviour (particularly if I drop 
the set and setTo attributes.)

Would this feature be of general use? I aim to keep the widget generic and 
don't want the widget to get overly confusing to use.

regards

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] The $mangletags widget

2014-05-31 Thread Måns
Hi Matabele

I was wondering...

Can we create a tagger which would tag the current tiddler with tag name 
you click AND tag the the tag-tiddler with the name of the current 
tiddler all at once?

Obviously the reversed action should be possible too Remove a tag from 
the current tiddler and at the same time remove the current tiddlers title 
(as a tag) from the tag-tiddler at the same time...

I know this sounds overly complicated, however I've setup a system where I 
can tag teachers with tasks and tasks with teachers - and as it works now I 
have to do it in two steps like described above:

I tag teacher A with a task B

Now I have to find and open task B and tag it with the teacher to make both 
types of lists work...

Same thing applies when I tag a task B with the name of teacher A - I will 
have to find and open teacher A to tag him/her with task B...

Again - when I want to remove a teacher from a task or a task from a 
teacher - I will have to do it in two steps...

*NB : You migt want to skip the rest of this this feature request because 
it is so interwoven with one of my TW-projects that it is too complicated 
for me to create a simple minimal testcase for my examples - sorry... 

Here's my tag a teacher with a task (subcategory SmallTask) template. It 
is tagged with $:/tags/ViewTemplate  and it will show up in all tiddlers 
tagged with teacher.


\define tag-styles()
background-color:$(backgroundColor)$;
\end
\define slider(caption,state,text)
$button popup=$state$$caption$/$button
$reveal type=nomatch state=$state$ text=
$text$
/$reveal
\end

$list filter=[is[current]tag[teacher]!prefix[$]] -[[teacher]]

Choose a task from the category//(click on tasks to add them to this tiddler)//:
$fieldmangler
$linkcatcher set=$:/NewTagName setTo= message=tw-add-tag

$count filter=[is[current]tagging[]tag[SmallTask]sort[title]]/$count 
{{SmallTasks||$:/core/ui/TagTemplate}} has been choosen. $button 
class=btn-invisible popup=$:/SmallTasksPopupStateChoose some more: 
{{$:/core/images/new-button}}
/$button

$reveal type=nomatch state=$:/SmallTasksPopupState text=

div class=tw-drop-down threecolumns medium

$list filter='[tag[task]tag[SmallTasks]] -[all[current]tags[]] 
-[[task]]'$link$set name='backgroundColor' value={{!!color}}span 
style=tag-stylesclass='tw-tag-label'$view field='title' 
format='text'//span/$set/$link/$list
/div

/$reveal 
  /$linkcatcher
/$fieldmangler

/$list


A matching template for tasks looks like this:

\define tag-styles()
background-color:$(backgroundColor)$;
\end

$list filter=[is[current]tag[opgave]!prefix[$]] -[[opgave]]

div class=tw-edit-tags
$fieldmangler
$list filter=[all[current]tags[]sort[title]] -[[opgave]] 
storyview=pop$set name=backgroundColor value={{!!color}}span 
style=tag-styles class=tw-tag-label
$view field=title format=text /
$button message=tw-remove-tag param={{!!title}} class=btn-invisible 
tw-remove-tag-buttontimes;/$button/span
/$set
/$list

$list filter=[is[current]tag[task]!prefix[$]] -[[task]]



@@float:right;

|borderless small|k
||| [[Teacher(s)|Teachers]] |h
||| $list 
filter=[is[current]tagging[]tag[teacher]sort[title]]$link$view 
field=title//$link,nbsp;/$list |
| Start:| $edit-text field=start tag=input type=date format= MM 
DD /$edit-text|$transclude field=start/ |
| End:| $edit-text field=slut tag=input type=date format= MM DD 
/$edit-text|$transclude field=slut/ |

@@

Choose teacher:br
$fieldmangler
$linkcatcher set=$:/NewTagName setTo= message=tw-add-tag
$list filter=[tag[teacher]!prefix[$]] -[all[current]tags[]] 
-[[teacher]]
$link
$set name=backgroundColor value={{!!color}}
span style=tag-styles class=tw-tag-label
$view field=title format=text/
/span
/$set
/$link
/$list
/$linkcatcher
/$fieldmangler
/$list

I made two templates one which allows removing teachers from tasks and 
another one which will remove tasks from teachers:

div class=tw-edit-tags
$fieldmangler
$list filter=[all[current]tags[]sort[title]] -[[teacher]] 
storyview=pop$set name=backgroundColor value={{!!color}}span 
style=tag-styles class=tw-tag-label
$view field=title format=text / 
$button message=tw-remove-tag param={{!!title}} class=btn-invisible 
tw-remove-tag-buttontimes;/$button/span
 /$fieldmangler 

and a similar one for removing teachers from tasks:

div class=tw-edit-tags
$fieldmangler
$list filter=[all[current]tags[]sort[title]] -[[task]] storyview=pop$set 
name=backgroundColor value={{!!color}}span style=tag-styles 
class=tw-tag-label
$view field=title format=text /
$button message=tw-remove-tag param={{!!title}} class=btn-invisible 
tw-remove-tag-buttontimes;/$button/span
/$set
/$list
 /$fieldmangler

 
My practical example is here: http://opgavefordeling.tiddlyspot.com/

It is not upgraded from 10 to 12 - because vsjs needs 

[tw] Re: [TW5] The $mangletags widget

2014-05-31 Thread Matabele
Hi Mans

This should have been easy using a pair of $mangletags widgets -- except 
there's a bug in my $mangletags widget. When I stack two $mangletags 
widgets around a button, I don't get the results expected. I think this may 
be due to faulty updating of the objects between the inner and outer 
instances of the widget -- still trying to track down what's wrong.

I will get back to you when (if) I manage to solve the problem. The widget 
worked when I had three separate handlers for an 'add' 'remove' and 
'replace', but this meant using three different widget messages. In the 
process of combining this into one handler, somethings gone wrong :-(

regards

On Saturday, May 31, 2014 12:27:55 PM UTC+2, Måns wrote:

 Hi Matabele

 I was wondering...

 Can we create a tagger which would tag the current tiddler with tag name 
 you click AND tag the the tag-tiddler with the name of the current 
 tiddler all at once?

 Obviously the reversed action should be possible too Remove a tag from 
 the current tiddler and at the same time remove the current tiddlers title 
 (as a tag) from the tag-tiddler at the same time...




-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] The $mangletags widget

2014-05-31 Thread Matabele
Hi

I seem to have messages flying all over the place when more than two 
$mangletags widgets are used in the same stack (same applies to two 
$maketid widgets) -- until I find a remedy, using more than one of either 
of these widgets in one stack will give unpredictable results.

regards

On Friday, May 30, 2014 12:40:51 PM UTC+2, Matabele wrote:

 Hi

 I have added another widget at: http://gwiz.tiddlyspot.com/



-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] The $mangletags widget

2014-05-31 Thread Matabele
Hi Mans

I have a workaround for the bug in my $mangletags widget -- this will 
enable you to get the gist of my idea to see if this might be what you are 
looking for (hopefully, I will fix the bug and the dummy $setfield will 
no longer be required.) I have used three tiddlers to explain the idea (and 
a fourth 'temp' tiddler to store variables) -- you may choose to include 
the buttons in either the 'teacher' tiddler or the 'task' tiddler for your 
application.

1. Create a tiddler with the title Joe Bloggs -- to represent a teacher
2. Create a tiddler with the title Sport -- to represent a task
3. Put this code into a third tiddler:

;Teacher:$edit-text tiddler=temp field=teacher/
;Task:$edit-text tiddler=temp field=task/

$mangletags tiddler={{temp!!task}} add={{temp!!teacher}}
$setfield message=tw-mangle-tags
$mangletags tiddler={{temp!!teacher}} add={{temp!!task}} message=
tw-set-field
$button  message=tw-mangle-tags param={{temp!!teacher}}Set/$button
/$mangletags/$setfield/$mangletags


$mangletags tiddler={{temp!!task}} find={{temp!!teacher}}
$setfield message=tw-mangle-tags
$mangletags tiddler={{temp!!teacher}} find={{temp!!task}} message=
tw-set-field
$button  message=tw-mangle-tags param={{temp!!teacher}}Reset/$button
/$mangletags/$setfield/$mangletags

4. Save the tiddler
5. Enter Joe Bloggs into the Teacher input box (this creates a variable 
'teacher' in the tiddler 'temp' for the widgets to read)
6. Enter Sport into the Task input box (this creates a variable 'task' in 
the tiddler 'temp' for the widgets to read)
5. Play with the buttons

regards


On Saturday, May 31, 2014 12:27:55 PM UTC+2, Måns wrote:

 Hi Matabele

 I was wondering...

 Can we create a tagger which would tag the current tiddler with tag name 
 you click AND tag the the tag-tiddler with the name of the current 
 tiddler all at once?

 Obviously the reversed action should be possible too Remove a tag from 
 the current tiddler and at the same time remove the current tiddlers title 
 (as a tag) from the tag-tiddler at the same time...




-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] The $mangletags widget

2014-05-31 Thread Matabele
Hi Mans

Sorry, it had slipped my mind that I found a careless mistake in my 
$mangletags widget - this has been fixed and I am currently trying to 
upload the revised widget (the internet here has crawled to a stop.) This 
does not fix the bug and the dummy $setfield is still required.) 

I have posted the demo for you on the site, and I suggest updating your 
$mangletags widget before trying this at home :-)

regards

On Saturday, May 31, 2014 7:08:57 PM UTC+2, Matabele wrote:

 Hi Mans

 I have a workaround for the bug in my $mangletags widget -- this will 
 enable you to get the gist of my idea to see if this might be what you are 
 looking for (hopefully, I will fix the bug and the dummy $setfield will 
 no longer be required.) I have used three tiddlers to explain the idea (and 
 a fourth 'temp' tiddler to store variables) -- you may choose to include 
 the buttons in either the 'teacher' tiddler or the 'task' tiddler for your 
 application.

 1. Create a tiddler with the title Joe Bloggs -- to represent a teacher
 2. Create a tiddler with the title Sport -- to represent a task
 3. Put this code into a third tiddler:

 ;Teacher:$edit-text tiddler=temp field=teacher/
 ;Task:$edit-text tiddler=temp field=task/

 $mangletags tiddler={{temp!!task}} add={{temp!!teacher}}
 $setfield message=tw-mangle-tags
 $mangletags tiddler={{temp!!teacher}} add={{temp!!task}} message=
 tw-set-field
 $button  message=tw-mangle-tags param={{temp!!teacher}}Set/$button
 /$mangletags/$setfield/$mangletags


 $mangletags tiddler={{temp!!task}} find={{temp!!teacher}}
 $setfield message=tw-mangle-tags
 $mangletags tiddler={{temp!!teacher}} find={{temp!!task}} message=
 tw-set-field
 $button  message=tw-mangle-tags param={{temp!!teacher}}Reset/$button
 /$mangletags/$setfield/$mangletags

 4. Save the tiddler
 5. Enter Joe Bloggs into the Teacher input box (this creates a variable 
 'teacher' in the tiddler 'temp' for the widgets to read)
 6. Enter Sport into the Task input box (this creates a variable 'task' 
 in the tiddler 'temp' for the widgets to read)
 5. Play with the buttons

 regards


 On Saturday, May 31, 2014 12:27:55 PM UTC+2, Måns wrote:

 Hi Matabele

 I was wondering...

 Can we create a tagger which would tag the current tiddler with tag 
 name you click AND tag the the tag-tiddler with the name of the current 
 tiddler all at once?

 Obviously the reversed action should be possible too Remove a tag 
 from the current tiddler and at the same time remove the current tiddlers 
 title (as a tag) from the tag-tiddler at the same time...




-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] The $mangletags widget

2014-05-31 Thread Måns
Hi Matabele

I have posted the demo for you on the site


Thank you very, very much!
And it even works in TW5.0.10 :-)

I see many use cases with this widget!

If it was combined with $maketid it would be possible to create all 
teachers, tasks and relations from scrap just using your simple input 
Demo...

In my case all teachers and tasks are created/predefined - so a 
listboxplugin providing an ability to choose teachers/tasks from a dropdown 
would be very useful.

I already have setup a system where you can click tag pills from auto 
generated lists of teachers (in tasks) or tasks (in teachers)  - I will see 
if $mangletags can find it's way into the system - it *is* getting pretty 
hairy/complicated already :-)

Cheers Måns Mårtensson


- 

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] The $mangletags widget

2014-05-30 Thread Danielo Rodríguez
Wow!

Another piece to the stack! Glad to see you so busy. Thank you for all your 
widgets. Currently I have no need to try it out, but I will keep it in my 
mind.

Regards

El viernes, 30 de mayo de 2014 12:40:51 UTC+2, Matabele escribió:

 Hi

 I have added another widget at: http://gwiz.tiddlyspot.com/

 I needed to modify the tags in the template and the $maketid widget 
 overwrites the tags in the template tiddler. Whilst it is possible to do 
 this in some contexts with the $fieldmangler widget, the parameter to the 
 message is used to specify the tag, and according to my stacking mechanism, 
 the title of the target tiddler should be propagated with the parameter to 
 the message. Thus a whole new $mangletags widget and an associated 
 tw-mangle-tags message (to avoid confusions with the widget messages 
 associated with the $fieldmangler widget.)

 The $mangletags widget can be stacked around a button widget and can do 
 any of the following:
-- append a tag to the tags field of the target tiddler
-- find and remove a tag from the tags field of the target tiddler (if 
 present)
-- find and replace a tag from the tags field of the target tiddler (if 
 present)
-- send a different widget message.

 The unfamiliar attributes are 'add=' and 'find='
-- to add a tag, use only: add=tag-to-add
-- to remove a tag, use only: find=tag-to-remove
-- to find and replace a tag use: find=tag-to-be-replaced and 
 add=tag-to-substitute

 Hope this is of use -- there is a demo on the site to show what the widget 
 does. The logic is a little complicated -- hope my code works in all 
 contexts :-)

 regards


-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] The $mangletags widget

2014-05-30 Thread Matabele
Hi 

I have been experimenting -- the $mangletags widget can be used to create 
a simple search and replace along with a $list widget:

ul$list filter=[tag[tag-to-replace]]
$mangletags find=tag-to-replace add=tag-to-substitute
li$button message=tw-mangle-tags 
class=btn-invisible{{!!title}}/$button/li
/$mangletags/$list/ul

Is there any way to automate the generation of the widget message in such a 
way that all of the substitutions will take place with a single button 
press? 

regards

On Friday, May 30, 2014 2:13:12 PM UTC+2, Danielo Rodríguez wrote:

 Wow!

 Another piece to the stack! Glad to see you so busy. Thank you for all 
 your widgets. Currently I have no need to try it out, but I will keep it in 
 my mind.

 Regards

 El viernes, 30 de mayo de 2014 12:40:51 UTC+2, Matabele escribió:

 Hi

 I have added another widget at: http://gwiz.tiddlyspot.com/

 I needed to modify the tags in the template and the $maketid widget 
 overwrites the tags in the template tiddler. Whilst it is possible to do 
 this in some contexts with the $fieldmangler widget, the parameter to the 
 message is used to specify the tag, and according to my stacking mechanism, 
 the title of the target tiddler should be propagated with the parameter to 
 the message. Thus a whole new $mangletags widget and an associated 
 tw-mangle-tags message (to avoid confusions with the widget messages 
 associated with the $fieldmangler widget.)

 The $mangletags widget can be stacked around a button widget and can do 
 any of the following:
-- append a tag to the tags field of the target tiddler
-- find and remove a tag from the tags field of the target tiddler (if 
 present)
-- find and replace a tag from the tags field of the target tiddler 
 (if present)
-- send a different widget message.

 The unfamiliar attributes are 'add=' and 'find='
-- to add a tag, use only: add=tag-to-add
-- to remove a tag, use only: find=tag-to-remove
-- to find and replace a tag use: find=tag-to-be-replaced and 
 add=tag-to-substitute

 Hope this is of use -- there is a demo on the site to show what the 
 widget does. The logic is a little complicated -- hope my code works in all 
 contexts :-)

 regards



-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.