I've figured out that I can pass everything in the text field in edit mode 
passing {{!!title}} as the param in a button and using in my widget

var text = $tw.wiki.getTiddlerText(event.param);


but what I want is only text that is selected within the text field in edit 
mode so that when I click a button in my format toolbar the event listener 
will trigger my widget to collect just the selected text. The following is 
just one of many that hasn't worked so far.

$tw.rootWidget.addEventListener("tm-selection", function (event) {
    var text = 
$tw.wiki.getTiddlerText(event.param).substring(this.selectionStart, 
this.selectionEnd);
    alert(text);
});


Anyone have any suggestions?

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" 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 https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/117ebcb1-727f-4d8b-8ae4-402f1a7a90c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to