Results 1 to 3 of 3

Thread: Can someone provide me a theory

  1. #1
    Join Date
    Jul 2008
    Posts
    102
    Thanks
    36
    Thanked 6 Times in 6 Posts

    Lightbulb Can someone provide me a theory

    Hi,

    I'm wanting to create a WYSIWYG editor (I dont mean BBCode) but I cant get my head around the theory.

    Can someone explain how it works (This is not a code request!)?


    my understanding so far is that I am to hide a textarea behind a div but that fails straight away as I cant get selectionStart and selectionEnd values from text highlighting or cursor key positioning from a div!

    Can someone point me in the right direction please?

    Thanks
    Kind regards
    Dal
    Programmers are tools used to convert Caffeine to code

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    They're mostly done by applying the contentEditable attribute to an <iframe>. It's quite browser-dependent.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. The Following User Says Thank You to Twey For This Useful Post:

    Dal (10-02-2008)

  4. #3
    Join Date
    Jul 2008
    Posts
    102
    Thanks
    36
    Thanked 6 Times in 6 Posts

    Default

    Thanks for the reply.

    I had a look at the iframe and the attribute and it works quite well but as far as getting ahold of carot position and mouse selections are concerned I can't seem to get them values.

    I would be looking to get it working under the lastest Gecko engine only so hope that narrows down the theory a little. I've had a look at existing WYSIWYG editors and they have extensive code to try and pull apart so I wanted to theory to tackle it from a different point of view (and build my own code). I see a code comment in one that states it inserts the iframe INTO a HTML TextArea - is this possible?

    Kind regards
    Dal
    Programmers are tools used to convert Caffeine to code

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •