Currently I'm reworking a format widget that modifies text in edit mode. The 
widgets I'm modifying use the following to get selected text but it means the 
ID had to be added to a core tiddler. I'd like to select the element by title 
instead of a Id if possible so that core tiddlers don't have to be overridden?

txt=document.getElementById("myTextarea");
  var startPos = txt.selectionStart;
  var endPos = txt.selectionEnd;
  var listtext= txt.value.substr(startPos, endPos -startPos);

Maybe with something like the following. I really wish I could figure this out:

var tiddler = this.getAttribute("tiddler",this.getVariable("currentTiddler"));

Or maybe some kind of getTargetElement by title? Help.

-- 
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/097a45eb-2574-4618-9e36-70a4da42bdfb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to