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 May 15th, 2002, 10:00 PM
dgibson dgibson is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2002
Location: Urbana, MD, USA
Posts: 66 dgibson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 17
WYSIWYG in an inline DIV

OK, I've been playing with all sorts of MSHTML since reading your article and I was wondering what the best way is to show an entire document in edit-mode (unframed, no scroll like the Ilayer has by default). I've tried this in an inline div, and it seems pretty nice, but a few things need tweaking for their DOM references to work again. The advantage I found also is that I can use the onPaste event and filter (via functions) pasted text to get out some of that Word garbage code before allowing the paste to occur. I can't seem to get the event to work at all on the ILAYER.

Any help on either getting this to work or the ILAYER to stretch to the length of the document like the DIV does? Any other cool ideas to share with regards to the WYSIWYG editor?

Reply With Quote
  #2  
Old May 15th, 2002, 11:43 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
hmm, when using a iframe theirs some JS code that you sometimes have to use, but i cant remember it lol, its something like
document.body.iFame_name

something like that, is that what your trying???

hope it helps

Reply With Quote
  #3  
Old May 16th, 2002, 07:17 PM
mytch mytch is offline
Dev Articles Novice (500 - 999 posts)
 
Join Date: Apr 2002
Location: Sydney, Australia
Posts: 588 mytch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 17
hey,
i mainly work with MSHTML and iFrames, because i find them easier, but doesnt an ilayer have style.width, so you could use:

iLayer.style.width = '100%';

assuming that it's in a container that is as wide as the area you want it to fill...

Reply With Quote
  #4  
Old May 16th, 2002, 09:48 PM
dgibson dgibson is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2002
Location: Urbana, MD, USA
Posts: 66 dgibson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 17
Yeah, I've got the width right, but I want the LENGTH to be 100% of the document. This is how it works with a DIV with overflow: none; It lets you preview the content a lot easier, but of course does not work as well for really long docs. I am making my editor a CF custom tag, so I planned to omplement both an inline (div) and embedded (ilayer) field as an attribute in calling the custom tag.

If I could somehow get the ILAYER to expand with my document and also recognize an onPaste event, there would be no need for the DIV version, as it causes a few other problems itself.

Reply With Quote
  #5  
Old May 17th, 2002, 11:02 PM
dgibson dgibson is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2002
Location: Urbana, MD, USA
Posts: 66 dgibson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 17
Aha! I've scrapped the inline DIV now that I wrote a function to expand my IFRAME to the length of the document. I simply init the function in the main WYSIWYG init(). Then I added a window-title bar atop the editor with expand and restore functions that calls a resize function. In expanded mode, I set a setInterval that sets the Iframe height equal to the content scrollHeight like so:

document.all.#ATTRIBUTES.EDITPANE#.style.height=#A TTRIBUTES.EDITPANE#.document.body.scrollHeight+50;

Obviously if you're not using Cold Fusion, you need to sub out the variable in #'s with a proper object reference.

In case you're still wondering, the whole point of this exercise was to allow for the entire content to be viewable without a limited size IFRAME that requires scrolling. The toggle made it easier to handle with long content tho, as well.

Now if only I could get the onPaste event to fire in an IFRAME...

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingProgramming Tools > WYSIWYG in an inline DIV


Developer Shed Advertisers and Affiliates


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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap