On Monday, March 9, 2015 at 8:15:52 AM UTC-7, AlexHough wrote:
>
> Wow Alberto,
> Perfect!
> Is it something you use on your TW?
> I can't follow the code at all
>

Here's a quick breakout of the script parts...

This is the previous definition of the new button:
\define old()
...
\end
It will be used to show the normal "new tiddler" button when NOT searching 
or if the search term is already a tiddler

This is the modified "new button".  The change from the standard button is 
that, instead of the <$button> widget using $message="tm-new-tiddler", 
there is a separate <$action-sendmessage $message="tm-new-tiddler" 
title={{$:/temp/search}}/>, which sets the title for the new tiddler to the 
current search term.
\define new()
...
<$action-sendmessage $message="tm-new-tiddler" title={{$:/temp/search}}/>
...
\end


"if $:/temp/search is BLANK" (i.e., not currently searching), then just 
show the standard "New Tiddler" button
<$reveal state="$:/temp/search" type="match" text="">
<<old>>
</$reveal>

if $:/temp/search is NOT BLANK" (i.e., a search is "in progress")...
<$reveal state="$:/temp/search" type="nomatch" text="">

If the search term is already a tiddler (or shadow), show the standard 
button:
<$list filter="[all[tiddlers+shadows]title{$:/temp/search}is[tiddler]] 
[all[tiddlers+shadows]title{$:/temp/search}is[shadow]]">
<<old>>
</$list>

if the search term tiddler is not yet a tiddler (or shadow), show the "new 
tiddler with search" button:
<$list filter="[title{$:/temp/search}!is[tiddler]!is[shadow]]">
<<new>>
</$list>
</$reveal>

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

"Inside TiddlyWiki: The Missing Manual"
https://www.indiegogo.com/projects/inside-tiddlywiki-the-missing-manual/x/8816263
Note: the IndieGogo funding campaign has ended,
but direct fundraising continues below...

YOUR DONATIONS ARE VERY IMPORTANT!
HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...
   http://TiddlyTools.github.com/fundraising.html#MakeADonation

Professional TiddlyWiki Consulting Services...
Analysis, Design, and Custom Solutions:
   http://www.TiddlyTools.com/#Contact

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to