Programming Tools
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingProgramming Tools

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old December 15th, 2005, 05:07 PM
Techno-Freak Techno-Freak is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 28 Techno-Freak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 5 m 43 sec
Reputation Power: 0
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??

Reply With Quote
  #2  
Old December 18th, 2005, 10:24 AM
Techno-Freak Techno-Freak is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 28 Techno-Freak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 5 m 43 sec
Reputation Power: 0
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??

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingProgramming Tools > WYSIWYG editors (feel free to post your own Q's on this thread)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT