[TW5] What widgets that trigger actions can we use in TW5?

170 views
Skip to first unread message

sini-Kit

unread,
Jan 26, 2016, 5:39:02 AM1/26/16
to TiddlyWiki
"Action widgets are a special type of widget that perform an action such as sending a message, navigating to a tiddler, or changing the value of a tiddler. They are used in association with other widgets that trigger those actions (for example, the ButtonWidget)."

I use only $button (onclick)  and don't know about others. For example can we make trigger "oninput" ? or onmouseover?

Tobias Beer

unread,
Jan 26, 2016, 5:56:37 PM1/26/16
to tiddl...@googlegroups.com
Hi sini-Kit,

I was experimenting with a generic EventWidget
and if any new features should be welcome in the next release
I am really hoping to see something like this be part of it.

Best wishes,

Tobias.

Matabele

unread,
Jan 27, 2016, 12:37:08 AM1/27/16
to TiddlyWiki
Hi Tobias

Would be particularly handy to have buttons which invoked a different set of actions on: 'click'/'right-click' (set/reset.) No need then for complex $reveal widgets :-)

regards

Tobias Beer

unread,
Jan 27, 2016, 1:32:58 AM1/27/16
to TiddlyWiki
 Hi Matabele,
 
Would be particularly handy to have buttons which invoked a different set of actions on: 'click'/'right-click' (set/reset.) No need then for complex $reveal widgets :-)

There isn't even a "button"... there's only a context for which events are registered. Could be a button, could be something else entirely. So, a range of core widgets could cater for binding / and triggering unique events with their event-ids... the id-uniqueness requirements being about as complex as those for states, but then in the context of rendering / doing / firing stuff the moment a registered event fires.

Best wishes,

Tobias.

Matabele

unread,
Jan 27, 2016, 1:44:47 AM1/27/16
to TiddlyWiki
Hi Tobias

Yep -- I noticed that the event widget is general purpose -- and modification of the action widgets looks to be straightforward :-)

Simply pointing out one limitation I've often come up against.

regards 

sini-Kit

unread,
Jan 28, 2016, 4:20:07 AM1/28/16
to tiddl...@googlegroups.com
I like your widget, Tobias. But I cant make it work. for example with oninput any key (a, b, c .....)  I want to make two actions

<$action-listops $field="myfield" $subfilter=$key$/>
<$action-listops $field="myfield" $subfilter="then"/>

so while I input letters I want to see in myfield "a then b then c  ......" 

so it will be a kind of log of all keys I put to input

среда, 27 января 2016 г., 1:56:37 UTC+3 пользователь Tobias Beer написал:

Matabele

unread,
Jan 28, 2016, 4:46:04 AM1/28/16
to TiddlyWiki
Hi sini-Kit

The action widgets need slight modifications to work with Tobias's widget -- the $action-setfield in the demo has been modified, but the $action-listops from v.5.1.10 has no such modification. I'll have  look at it sometime soon.

In the meantime, play around with the version of $action-setfield from the demo.

regards

sini-Kit

unread,
Jan 28, 2016, 10:50:42 AM1/28/16
to tiddl...@googlegroups.com
\define filparn(name)
<br>
min: <$list filter="[is[current]tagging[]tag[$:/Note]!tag[$:/hide]!list[$:/temp/_HideStoryList!!list]nsort[$name$]limit[1]]">  <$view field="$name$" /> </$list>{{$:/temp/_valuta}} max: <$list filter="[is[current]tagging[]tag[$:/Note]!tag[$:/hide]!list[$:/temp/_HideStoryList!!list]!nsort[$name$]limit[1]]">  <$view field="$name$" /> </$list> {{$:/temp/_valuta}}
from <$edit-text tiddler="$:/temp/state/filpar/_$name$FROM" tag="input"  type="text" placeholder="From " default="" size=6  oninput="setTimeout(function() { document.getElementsByClassName('input_$name$')[0].click(); }, 500);" />  to <$edit-text tiddler="$:/temp/state/filpar/_$name$TO" tag="input"  type="text" placeholder="to " default="" size=6   oninput="setTimeout(function() { document.getElementsByClassName('input_$name$')[0].click(); }, 500);" />  {{$:/temp/_valuta}}
<div style="display:none">
<$button class="input_$name$"  >
<$action-listops  $tiddler="$:/temp/_HideStoryList" $field="list_$name$" $filter="[[]]"/>
<$list filter="[is[current]tagging[]tag[$:/Note]!greaterthan:$name${$:/temp/state/filpar/_$name$FROM}][is[current]tagging[]tag[$:/Note]greaterthan:$name${$:/temp/state/filpar/_$name$TO}]" variable="add">
<$action-listops  $tiddler="$:/temp/_HideStoryList" $field="list_$name$" $subfilter="[<add>]"/>
</$list>
<<ListCombainDel>>
result
</$button>
</div>
\end
select price
<<filparn stoimost>>


I dont like to modify core of TW5. But...... I can modify http://novye-podarki.ru/empty35_.html#%24%3A%2Fcore%2Fmodules%2Fwidgets%2Fedit-text.js and put two lines of code to add oninput value (so I did it)
after it I can put any javascript code to my $edit-text widget. For example I put code that push $button with class="oninput"   and my $button make make all $action I want. ( I hide button with display:none)
 code of my macros is at the beginning. Demo of oninput working you can see here http://novye-podarki.ru/empty35_.html#%D0%A6%D0%B2%D0%B5%D1%82%D1%8B%20%D0%BB%D1%8E%D0%B1%D0%B8%D0%BC%D0%BE%D0%B9


sini-Kit

unread,
Jan 28, 2016, 11:59:01 AM1/28/16
to TiddlyWiki
here http://novye-podarki.ru/empty36_.html#Figures is the demo of all my filpar macros (on left side). we add special field selpar: with parameters we want to sort. it can be number (price) or text.
 


четверг, 28 января 2016 г., 12:46:04 UTC+3 пользователь Matabele написал:
Reply all
Reply to author
Forward
0 new messages