Thank you Jed, Tobias, and BJ,I guess it is over my head. All of your
suggestions may actually work but I cant figure out how to use them. In it's
half unfinished state I was working on http://www.format.tiddlyspot.com if
anyone would like to have a look. It has problems of overriding core tiddlers
which I want to change but cant figure out how. I wish anyone could work on it
directly.
Happy Connecting. Sent from my Sprint Samsung Galaxy S® 5
-------- Original message --------
From: BJ <[email protected]>
Date: 02/08/2016 12:16 AM (GMT-07:00)
To: TiddlyWikiDev <[email protected]>
Subject: [twdev] Re: [TW5] How get target tiddler by title in widget
you could do it like this:
var element = window.focusedElement;
if(element) {// only allow input[type=text]/textarea
if (element.tagName === "TEXTAREA" ||(element.tagName === "INPUT"
&& element.type === "text")) {
return
element.value.substring(element.selectionStart,element.selectionEnd);
}
}
On Saturday, February 6, 2016 at 1:01:46 AM UTC, Andrew wrote: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/7f44c313-8fd4-4049-8957-e9477af3da95%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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/66ecjvb3p5v4qhio0oq4sxxj.1455021847526%40email.android.com.
For more options, visit https://groups.google.com/d/optout.