Loading ...
Sorry, an error occurred while loading the content.
 

Re: [RTE] How to set RTE to do only code editing?

Expand Messages
  • danvdascalescu
    Hi, I m new to the RTE. I started digging into it today in order to build a code editor for our open-sourced project http://sourceforge.net/projects/rthree .
    Message 1 of 5 , Oct 1, 2008
      Hi,

      I'm new to the RTE. I started digging into it today in order to build
      a code editor for our open-sourced project
      http://sourceforge.net/projects/rthree .

      I've seen at
      http://tech.groups.yahoo.com/group/ydn-javascript/message/21826 that
      apparently a "source code" editing functionality has been released
      with version 2.4.0... however I didn't find any documentation for
      that. I did find the "Code Editor" example at
      http://developer.yahoo.com/yui/examples/editor/code_editor.html, which
      shows how to edit the HTML source, but that's a bit short of a real
      code editor:

      1. toolbar buttons don't work in "source code" mode (even if you
      comment out the line that disables them). It would be nice to be able
      to select some text in source mode, click "b", and have <b> and </b>
      inserted around it.

      2. there seems to be HTML pretty-printing and filtering against the
      <script> element. The former can be disabled apparently by not calling
      cleanHTML(), while the latter is addressed at
      http://tech.groups.yahoo.com/group/ydn-javascript/message/31167, but
      see #3

      3. If, in order to get a code editor, we escape <, > and & and load
      the text in the HTML editor, we'll have to disable toolbar buttons.
      But what if someone pastes rich text from another application? That
      will add bogus formatting.

      Hope I missed something and there is a "source code" editing mode like
      in FCKeditor (I haven't been through the entire docs yet).

      Thanks,
      Dan
    • Dav Glass
      Dan -- No, there is no official source editor in the RTE. There are issues in Safari and Opera that keep me from writing one. With the release of Safari 3 and
      Message 2 of 5 , Oct 1, 2008
        Dan --

        No, there is no official source editor in the RTE.
        There are issues in Safari and Opera that keep me from writing one.

        With the release of Safari 3 and Opera 9.5, it may be possible. I haven't looked into it in a while..

        Here is a prototype that I started working on a while ago:
        http://blog.davglass.com/files/yui/codeeditor/

        It's not ready, but the concept is where I would be going if it does make it on the roadmap.

        Dav

        Dav Glass
        dav.glass@...
        blog.davglass.com




        + Windows: n. - The most successful computer virus, ever. +
        + A computer without a Microsoft operating system is like a dog
        without bricks tied to its head +
        + A Microsoft Certified Systems Engineer is to computing what a
        McDonalds Certified Food Specialist is to fine cuisine +



        ----- Original Message ----
        > From: danvdascalescu <danvdascalescu@...>
        > To: ydn-javascript@yahoogroups.com
        > Sent: Wednesday, October 1, 2008 6:42:50 PM
        > Subject: [ydn-javascript] Re: [RTE] How to set RTE to do only code editing?
        >
        > Hi,
        >
        > I'm new to the RTE. I started digging into it today in order to build
        > a code editor for our open-sourced project
        > http://sourceforge.net/projects/rthree .
        >
        > I've seen at
        > http://tech.groups.yahoo.com/group/ydn-javascript/message/21826 that
        > apparently a "source code" editing functionality has been released
        > with version 2.4.0... however I didn't find any documentation for
        > that. I did find the "Code Editor" example at
        > http://developer.yahoo.com/yui/examples/editor/code_editor.html, which
        > shows how to edit the HTML source, but that's a bit short of a real
        > code editor:
        >
        > 1. toolbar buttons don't work in "source code" mode (even if you
        > comment out the line that disables them). It would be nice to be able
        > to select some text in source mode, click "b", and have and
        > inserted around it.
        >
        > 2. there seems to be HTML pretty-printing and filtering against the
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.