braintwister: combining the select with the list widget....

35 views
Skip to first unread message

Jan

unread,
Mar 2, 2017, 7:20:03 AM3/2/17
to TiddlyWiki
Hello,
I got a task which is a bit of a braintwister:
For the slideshowplugin I am working on, I want to build a button for
the EditToolbar which sets two tags around a string
<sli$(slidenr)$> Slide</sli$(slidenr)$>

The $(slidenr)$ should be choosen with a select-widget, which should
display the numbers from 01 to 10 and omit those who are already in the
draft of the actual tiddlertext in the form displayed above (eg <sli01>)
This is how i tried to solve this so far:


\define choosenumber()
<span title="Select a Number"><$select tiddler="$:/Temp/Slidenumber"
field="text" placeholder='choos number'>
<option value="">set a number</option>
<$list filter=[all[current]has[draft]!search:text[sli01]]><option
value="01"> 01</option></$list>
<$list filter=[all[current]has[draft]!search:text[sli02]]><option
value="02"> 02</option></$list>
</$select></span>
\end

\define pref() <sli$(slidenr)$>
\define suff() </sli$(slidenr)$>
\define setslide-actions()
<$button>
<$vars slidenr="""{{$:/Temp/Slidenumber}}""">
<$action-sendmessage
$message="tm-edit-text-operation"
$param="wrap-selection"
prefix=<<pret>>
suffix=<<suff>>
/>


My attempt for the dropdown is at
slidesnstories.tiddlyspot.com#%24%3A%2Fcore%2Fui%2FEditorToolbar%2Fslide-dropdown

I guess to perform the action directly by clicking on the number I also
would need to use something like the linkcatcher.

Can anyone help...

Thanks a lot

Yours Jan
Reply all
Reply to author
Forward
0 new messages