[TW5] ActionListopsWidget questions

107 views
Skip to first unread message

infurnoape

unread,
Jan 12, 2016, 6:41:31 PM1/12/16
to tiddl...@googlegroups.com
Is there already any funtionality for passing selected text in the text field in edit mode as the marker to the operator of the ActionListopsWidget? Please forgive me if I am using wrong terminology. New marvelous toys bring new learning curves. I'm working on a format toolbar and this new widget sounds like it may be able to do what I was trying to do with monkey hacked widgets.



Happy Connecting. Sent from my Sprint Samsung Galaxy S® 5

Matabele

unread,
Jan 12, 2016, 10:18:24 PM1/12/16
to TiddlyWiki

Hi Andrew

My initial reaction: I don't think the ActionListops widget is suitable. Its primary purpose was to:
-- take the contents of a target field/index
-- manipulate the contents
-- and save the modified contents back to the same target 

It can also take its input from one target, and save the modified contents to another target. 

But I can't see how to identify only the selected text as input -- this needs some way of (dynamically) saving any selected text to a target field, from which the ActionListops widget can take its input. 

If anyone can come up with a filter operator to achieve this -- then this filter could be employed with the widget.

regards

Tobias Beer

unread,
Jan 13, 2016, 5:52:06 AM1/13/16
to tiddl...@googlegroups.com
Hi Matabele,
 
If anyone can come up with a filter operator to achieve this -- then this filter could be employed with the widget.

I don't think this is a filter operator, but rather an extension to the EditTextWidget whereas the current selection is bound to a state. Would we have the convention that states are tiddlers (which we don't, unfortunately), then we could have stuffed that state into some field of the same state tiddler. But since we don't, we have the problem of what to do, if the state was a field or index of some tiddler.

Possibly the EditTextWidget could have a selection attribute that qualifies a state tiddler where a reference to the current selection is stored. If the selection attribute did not contain any value, it could be interpreted as meaning "save into field tc-selection of the already defined state tiddler". However, encoding that selection so that whatever code knows to pick it back up would need a bit of fiddling, possibly similar to the PopupMechanism.

Best wishes,

Tobias.

infurnoape

unread,
Jan 13, 2016, 7:44:07 AM1/13/16
to tiddl...@googlegroups.com
I found http://www.javascriptkit.com/javatutors/copytoclipboard.shtml but it is going to be another couple months before I pick it apart. I'm thinking of a widget to return selected as the marked param. Something like <<marked>>.

Happy Connecting. Sent from my Sprint Samsung Galaxy S® 5


-------- Original message --------
From: Matabele <matabe...@gmail.com>
Date: 01/12/2016 8:18 PM (GMT-07:00)
To: TiddlyWiki <tiddl...@googlegroups.com>
Subject: [tw] Re: [TW5] ActionListopsWidget questions


Hi Andrew

My initial reaction: I don't think the ActionListops widget is suitable. Its primary purpose was to:
-- take the contents of a target field/index
-- manipulate the contents
-- and save the modified contents back to the same target 

It can also take its input from one target, and save the modified contents to another target. 

But I can't see how to identify only the selected text as input -- this needs some way of (dynamically) saving any selected text to a target field, from which the ActionListops widget can take its input. 

If anyone can come up with a filter operator to achieve this -- then this filter could be employed with the widget.

regards

On Wednesday, 13 January 2016 01:41:31 UTC+2, Andrew wrote:
Is there already any funtionality for passing selected text in the text field in edit mode as the marker to the operator of the ActionListopsWidget? Please forgive me if I am using wrong terminology. New marvelous toys bring new learning curves. I'm working on a format toolbar and this new widget sounds like it may be able to do what I was trying to do with monkey hacked widgets.



Happy Connecting. Sent from my Sprint Samsung Galaxy S® 5

--
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+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/dae451f1-1367-4333-81c1-d280856a1e31%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

infurnoape

unread,
Jan 15, 2016, 8:08:30 AM1/15/16
to tiddl...@googlegroups.com
Thank you for suggestions. Still trying to decide on a direction to go. Widget that returns selected so it can be used as the marker in ActionListops or hijacking ActionListops to create another operator? I've come across http://www.javascriptkit.com/javatutors/copytoclipboard.shtml but not sure if compatible with Tiddlywiki 5 archetecture. Any suggestions welcome.

Matabele

unread,
Jan 15, 2016, 1:16:46 PM1/15/16
to TiddlyWiki
Hi Andrew

A quick look through the code suggests that it may be possible to implement this in the form of a widget -- perhaps an event listener, triggering a widget message that passes the selected text to a listener in an enclosing  widget (which then deals with the contents of the message.)

regards

infurnoape

unread,
Jan 15, 2016, 2:54:10 PM1/15/16
to tiddl...@googlegroups.com
Thank you for your suggestion. A Widget sounds like the best direction to go, but would it have to be an event listener? Couldn't it just be returned via module-type macro and just return it from a macro call and then just use it as the marker in an ActionListopWidget entry. I want to try to get away from expensive event listeners. I have 20 different events that I want to call using buttons on my format toolbar. I think you have helped guide me though. It's tough trying to figure out what to do with new stuff when there aren't enough examples.



Happy Connecting. Sent from my Sprint Samsung Galaxy S® 5






-------- Original message --------
From: Matabele <matabe...@gmail.com>
Date: 01/15/2016 11:16 AM (GMT-07:00)
To: TiddlyWiki <tiddl...@googlegroups.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+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

infurnoape

unread,
Jan 19, 2016, 8:46:42 PM1/19/16
to tiddl...@googlegroups.com
Is there any place in Tiddlywiki with handles on selectionStart or selectionEnd? I'm still searching for something in edit mode.

Tobias Beer

unread,
Jan 20, 2016, 1:39:07 AM1/20/16
to tiddl...@googlegroups.com
Hi Andrew,
 
Is there any place in Tiddlywiki with handles on selectionStart or selectionEnd? I'm still searching for something in edit mode.

I don't think there is. So, it boils down to you wanting to:
  1. not only do something quite specific with the selection
  2. possibly have some result effect whatever the selection was to begin with
It sounds a bit like this requires for some EditXXXWidget to support some new action-selectedtext widget that does some voodoo with a given selected text based on some criteria... and then possibly replaces the selection with whatever was returned.

I think, if you want to move ahead with this, you really need to go to the drawing board and sketch in every detail where you are headed.

Best wishes,

Tobias.
Reply all
Reply to author
Forward
0 new messages