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

RTE too agressive in cleanup

Expand Messages
  • Brian McCullough
    Folks, and probably Dav, I am still working on my web app, and after the great help on RTE that I received last week, have moved on to another issue. The
    Message 1 of 9 , Aug 23, 2008
    • 0 Attachment
      Folks, and probably Dav,

      I am still working on my web app, and after the great help on RTE that I
      received last week, have moved on to another issue.


      The Editor ( SimpleEditor ) is used as part of a report generator, in
      that there is a template ( which contains HTML ) which is processed to
      insert variables and other data, inserted into the textarea, and then
      the Editor is called, to allow the user to make edits and add comments.
      When the "close" button, actually Submit, on the Editor is clicked, the
      contents of the textarea field, after the POST, is e-mailed to the user.

      Unfortunately, by the time the user sees this report, ALL of the HTML
      has been stripped, not just tags like "<html>" and "<body>", which were
      in the template, but also "<center>", "<b>", and even "<br >". While in
      the Editor, all of this markup is obviously there, after the submit, it
      is all gone.


      I went hunting through documentation and the archives, and found
      "handleSubmit," which doesn't really seem to be needed, and, finally,
      the default settings for cleanHTML.

      I followed Dav's comments in an old message from the Spring, and added
      "deletes" for "reportEditor.invalidHTML.html", "body" and "link", but
      this seems to have had no effect on the output. I looked at the rest of
      the list shown in that message, but didn't think any of the others were
      relevant.


      The JS code that defines the Editor is as follows:


      var reportEditor = new YAHOO.widget.SimpleEditor('reportbody', {
      height: '300px',
      width: '522px',
      handleSubmit: true,
      dompath: true //Turns on the bar at the bottom
      // animate: true //Animates the opening, closing and moving of
      // Editor windows
      });

      // remove unwanted HTML "cleanups"
      delete reportEditor.invalidHTML.html ;
      delete reportEditor.invalidHTML.body ;
      delete reportEditor.invalidHTML.link ;

      reportEditor.on('afterRender', function() {
      reportEditor.hide();
      });

      reportEditor.render();



      Any suggestions?


      Thank you,
      Brian
    • Dav Glass
      Brian -- I think what you are saying is that you have content like this in the textarea: <center>This is centered</center> And inside the Editor
      Message 2 of 9 , Aug 23, 2008
      • 0 Attachment
        Brian --

        I think what you are saying is that you have content like this in the textarea:

        &lt;center&gt;This is centered&lt;/center&gt;

        And inside the Editor you are expecting them to see this:
        <center>This is centered</center>

        Currently you can't do that by default (as in the Editor auto adding the content to the Editor)

        You can do this by placing the content that you want added to the Editor into a Javascript variable, then using the setEditorHTML method to place it into the Editor.

        The issue is (I haven't found a way around it yet) that the browser is unencoding the data in the textarea so the Editor never sees the encoded html. It always converts it to regular HTML..

        Does that make sense?
        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: Brian McCullough <bdmc@...>
        To: ydn-javascript@yahoogroups.com
        Sent: Saturday, August 23, 2008 11:41:51 AM
        Subject: [ydn-javascript] RTE too agressive in cleanup


        Folks, and probably Dav,

        I am still working on my web app, and after the great help on RTE that I
        received last week, have moved on to another issue.


        The Editor ( SimpleEditor ) is used as part of a report generator, in
        that there is a template ( which contains HTML ) which is processed to
        insert variables and other data, inserted into the textarea, and then
        the Editor is called, to allow the user to make edits and add comments.
        When the "close" button, actually Submit, on the Editor is clicked, the
        contents of the textarea field, after the POST, is e-mailed to the user.

        Unfortunately, by the time the user sees this report, ALL of the HTML
        has been stripped, not just tags like "<html>" and "<body>", which were
        in the template, but also "<center>", "<b>", and even "<br >".  While in
        the Editor, all of this markup is obviously there, after the submit, it
        is all gone.


        I went hunting through documentation and the archives, and found
        "handleSubmit," which doesn't really seem to be needed, and, finally,
        the default settings for cleanHTML.

        I followed Dav's comments in an old message from the Spring, and added
        "deletes" for "reportEditor.invalidHTML.html", "body" and "link", but
        this seems to have had no effect on the output.  I looked at the rest of
        the list shown in that message, but didn't think any of the others were
        relevant.


        The JS code that defines the Editor is as follows:


        var reportEditor = new YAHOO.widget.SimpleEditor('reportbody', {
            height: '300px',
            width: '522px',
            handleSubmit: true,
            dompath: true //Turns on the bar at the bottom
            // animate: true //Animates the opening, closing and moving of
            // Editor windows
            });

            // remove unwanted HTML "cleanups"
            delete reportEditor.invalidHTML.html ;
            delete reportEditor.invalidHTML.body ;
            delete reportEditor.invalidHTML.link ;

            reportEditor.on('afterRender', function() {
                reportEditor.hide();
            });

            reportEditor.render();



        Any suggestions?


        Thank you,
        Brian


        ------------------------------------

        Yahoo! Groups Links

        <*> To visit your group on the web, go to:
            http://groups.yahoo.com/group/ydn-javascript/

        <*> Your email settings:
            Individual Email | Traditional

        <*> To change settings online go to:
            http://groups.yahoo.com/group/ydn-javascript/join
            (Yahoo! ID required)

        <*> To change settings via email:
            mailto:ydn-javascript-digest@yahoogroups.com
            mailto:ydn-javascript-fullfeatured@yahoogroups.com

        <*> To unsubscribe from this group, send an email to:
            ydn-javascript-unsubscribe@yahoogroups.com

        <*> Your use of Yahoo! Groups is subject to:
            http://docs.yahoo.com/info/terms/

      • Brian McCullough
        ... True. ... No. I AM seeing the words This is centered , centered in the Editor window, which is what is expected. However, when the text is sent back to
        Message 3 of 9 , Aug 23, 2008
        • 0 Attachment
          On Sat, Aug 23, 2008 at 12:09:19PM -0700, Dav Glass wrote:
          > Brian --
          >
          > I think what you are saying is that you have content like this in the textarea:
          >
          > <center>This is centered</center>

          True.



          > And inside the Editor you are expecting them to see this:
          > <center>This is centered</center>

          No. I AM seeing the words "This is centered", centered in the Editor
          window, which is what is expected.


          However, when the text is sent back to the server, by way of the Submit
          process, ALL of that HTML markup ( even things that have been added
          manually in the Editor ) has been removed, and all of the text is
          left-justified and "normal". No Bold, different Fonts, or anything has
          been preserved.


          Thanks,
          Brian
        • Brian McCullough
          ... Oops. No, what is in the textarea is This is centered . Sorry, Brian
          Message 4 of 9 , Aug 23, 2008
          • 0 Attachment
            On Sat, Aug 23, 2008 at 12:09:19PM -0700, Dav Glass wrote:
            > Brian --
            >
            > I think what you are saying is that you have content like this in the textarea:
            >
            > <center>This is centered</center>


            Oops.

            No, what is in the textarea is "<center>This is centered</center>".



            Sorry,
            Brian
          • Dav Glass
            Brian -- Can you post a link to an example so I can see it? Dav Dav Glass dav.glass@yahoo.com blog.davglass.com + Windows: n. - The most successful computer
            Message 5 of 9 , Aug 24, 2008
            • 0 Attachment
              Brian --

              Can you post a link to an example so I can see it?

              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: Brian McCullough <bdmc@...>
              To: ydn-javascript@yahoogroups.com
              Sent: Saturday, August 23, 2008 2:26:25 PM
              Subject: Re: [ydn-javascript] RTE too agressive in cleanup

              On Sat, Aug 23, 2008 at 12:09:19PM -0700, Dav Glass wrote:
              > Brian --
              >
              > I think what you are saying is that you have content like this in the textarea:
              >
              > &lt;center&gt;This is centered&lt;/center&gt;


              Oops. 

              No, what is in the textarea is "<center>This is centered</center>".



              Sorry,
              Brian



              ------------------------------------

              Yahoo! Groups Links

              <*> To visit your group on the web, go to:
                  http://groups.yahoo.com/group/ydn-javascript/

              <*> Your email settings:
                  Individual Email | Traditional

              <*> To change settings online go to:
                  http://groups.yahoo.com/group/ydn-javascript/join
                  (Yahoo! ID required)

              <*> To change settings via email:
                  mailto:ydn-javascript-digest@yahoogroups.com
                  mailto:ydn-javascript-fullfeatured@yahoogroups.com

              <*> To unsubscribe from this group, send an email to:
                  ydn-javascript-unsubscribe@yahoogroups.com

              <*> Your use of Yahoo! Groups is subject to:
                  http://docs.yahoo.com/info/terms/

            • Brian McCullough
              ... Hmmm. A bit complicated, but I ll send a more detailed message directly. Brian
              Message 6 of 9 , Aug 24, 2008
              • 0 Attachment
                On Sun, Aug 24, 2008 at 09:30:52AM -0700, Dav Glass wrote:
                > Brian --
                >
                > Can you post a link to an example so I can see it?


                Hmmm. A bit complicated, but I'll send a more detailed message
                directly.


                Brian
              • Brian McCullough
                ... Dav, Not to nag for an answer, but I sometimes have problems with e-mail delivery. Did you receive the messages that I sent you? Thank you, Brian
                Message 7 of 9 , Aug 25, 2008
                • 0 Attachment
                  On Sun, Aug 24, 2008 at 09:30:52AM -0700, Dav Glass wrote:
                  > Brian --
                  >
                  > Can you post a link to an example so I can see it?


                  Dav,

                  Not to nag for an answer, but I sometimes have problems with e-mail
                  delivery. Did you receive the messages that I sent you?


                  Thank you,
                  Brian



                  > Dav
                  >
                  > Dav Glass
                  > dav.glass@...
                  > blog.davglass.com
                • Dav Glass
                  Brian -- Sorry for not replying sooner, I am a bit busy this morning. I ll take a look at it as soon as I can ;) Dav Dav Glass dav.glass@yahoo.com
                  Message 8 of 9 , Aug 25, 2008
                  • 0 Attachment
                    Brian --

                    Sorry for not replying sooner, I am a bit busy this morning. I'll take a look at it as soon as I can ;)

                    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: Brian McCullough <bdmc@...>
                    To: ydn-javascript@yahoogroups.com
                    Sent: Monday, August 25, 2008 9:51:54 AM
                    Subject: Re: [ydn-javascript] RTE too agressive in cleanup

                    On Sun, Aug 24, 2008 at 09:30:52AM -0700, Dav Glass wrote:
                    > Brian --
                    >
                    > Can you post a link to an example so I can see it?


                    Dav,

                    Not to nag for an answer, but I sometimes have problems with e-mail
                    delivery.  Did you receive the messages that I sent you?


                    Thank you,
                    Brian



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

                    ------------------------------------

                    Yahoo! Groups Links

                    <*> To visit your group on the web, go to:
                        http://groups.yahoo.com/group/ydn-javascript/

                    <*> Your email settings:
                        Individual Email | Traditional

                    <*> To change settings online go to:
                        http://groups.yahoo.com/group/ydn-javascript/join
                        (Yahoo! ID required)

                    <*> To change settings via email:
                        mailto:ydn-javascript-digest@yahoogroups.com
                        mailto:ydn-javascript-fullfeatured@yahoogroups.com

                    <*> To unsubscribe from this group, send an email to:
                        ydn-javascript-unsubscribe@yahoogroups.com

                    <*> Your use of Yahoo! Groups is subject to:
                        http://docs.yahoo.com/info/terms/

                  • Brian McCullough
                    ... Not a problem at all. I know that you are doing me a favour, so I don t expect any particular deadline. Thanks, Brian
                    Message 9 of 9 , Aug 25, 2008
                    • 0 Attachment
                      On Mon, Aug 25, 2008 at 10:21:44AM -0700, Dav Glass wrote:
                      > Brian --
                      >
                      > Sorry for not replying sooner, I am a bit busy this morning. I'll take a look at it as soon as I can ;)


                      Not a problem at all. I know that you are doing me a favour, so I don't
                      expect any particular deadline.


                      Thanks,
                      Brian
                    Your message has been successfully submitted and would be delivered to recipients shortly.