|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
WYSIWYG editors (feel free to post your own Q's on this thread)
Hi, I've got a function on my editor that surrounds text in an iFrame, the problem is, it treats the script as text only, and any formatting is lost, what went wrong??
Code:
// the var is along these lines: var sel = root.selection.createRange().text; what do i change '.text' to?? |
|
#2
|
|||
|
|||
|
More Info.
Now, at first, it keeps the main formatting, like my indenter: example:
I type (code): -TEXT-<img src="..."> I use the indent function, it becomes: <blockquote>-TEXT-</Blockquote> You can use the blockquote as many times, and the text is never lost, nor the previous blockquote, this is an example of a surrounding function: I type: -TEXT- I surround with(code) and it becomes: <a href="...">hello</a>-TEXT-<a href="...">hello</a> so that's good so far, two different formatting types there, but now if i do it again, it becomes (code): <A href="javascript:document.location.pathname">hello</A><A href="javascript:document.location.pathname">hello-TEXT-hello</A><A href="javascript:document.location.pathname">hello</A> So its lost all but the link formatting, what has gone wrong. Its probably this variable that is surrounded by the next text: var sel=root.selection.createRange().text; // root is a link to a variable containing the path to the page being edited (document.iFrame.document), that's not the thing wrong with it) it must be that it keeps only the start of the formatting, what do i replace 'create Range().text' with to allow multiple formatting?? |
![]() |
| Viewing: Dev Articles Community Forums > Programming > Programming Tools > WYSIWYG editors (feel free to post your own Q's on this thread) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|