You are not logged in.
Pages: 1
Hi
I have a Plugin with which I can insert Tags (Such like ###EMAIL###, ###FIRSTNAME### and so on).
Thre are Tags which can be used for a Link or eMail.
My Idea ist:
If the user selected a word the plugin wraps a linktag arround the selected word.
If the selected word is already a link, the plugin edit the href-attribute.
My problem:
I don't know how to find out if there is wrapped.
I know how to get the word (editor.getSelection() ) So I can wrap a normal Word.
hope somebody can help me ^^'
Offline
You can look at the CreateLink module to see how to do this:
http://trac.xinha.org/browser/trunk/mod … ds.js#L147
Your plugin should copy that method. Then you can call it in your plugin -- it will either return the Anchor tag that wraps the current selection, or nothing.
Offline
Aaaaaah thx
I looked into the CreateLink - Plugin before, but i didn't found the line where 'a' was declared so I was a little bit confused
Big thx to you. Now I know how to expand the selection, too (when the user selected only a part of the link).
Offline
Pages: 1