Text Changes Color While in Edit Mode

7 posts, 0 answers
  1. Christopher
    Christopher avatar
    17 posts
    Member since:
    Feb 2008

    Posted 07 Aug 2008 Link to this post

    Greetings,

    I've noticed while using the RadEditor, that if I copy text from a web page. (Say the text is blue) and then paste it into the rad editor, while in edit mode. The color pastes as black.

    The only thing I can tell is when I paste from a frontpage site, the text turns black in edit mode. If I copy and paste something from a WSS 3.0 site, to MOSS the color stays.

    Also after more digging, it might also be if a site uses style sheets for everything, the colors may not be applied?

    Thanks!
  2. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 08 Aug 2008 Link to this post

    Hi Christopher,

    The content that is pasted in the editor is controlled entirely by the browser and the OS clipboard. If the editor's StripFormattingOnPaste property is set to "NoneSupressCleanMessage" then the editor will not strip the formatting and modify the supplied by the clipboard content and you will see what type of HTML is supplied to the editor.

    The content area of RadEditor is a standard editable IFRAME element. In order to verify that the reported behavior is due to the browser Rich Text Editing engine that RadEditor uses, my suggestion is to perform the same test with a standard editable DIV or IFRAME. For your convenience I have attached two html pages containing editable IFRAME and DIV elements, which will help you to test the scenario.

    Best regards,
    Rumen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.

  3. Christopher
    Christopher avatar
    17 posts
    Member since:
    Feb 2008

    Posted 08 Aug 2008 Link to this post

    Thanks for your quick reply.

    When I pasted the frontpage html into the EditableIframe page, and then clicked "set content in iframe" SOME of the text color actually copied correctly, most did not however.

    When I pasted just straight text from the same frontpage site into the editable div, again some of the text color stayed, some didn't - depending on which paragraphs I copied. Which before I didn't test the whole page, so it just so happened that the text I picked didn't copy the color correctly.

    I did some more playing, and if I take one of those FP paragraphs that didn't copy correctly, and first copy it to MS Word, it will work.

    FP to Word to RadEditor - Works
    FP to RadEditor - Works sometimes
    WSS3.0 to MOSS/RadEditor - Works
  4. Christopher
    Christopher avatar
    17 posts
    Member since:
    Feb 2008

    Posted 08 Aug 2008 Link to this post

    Should I put in a ticket so I can send some screen shots?

    The only other thing I've noticed is that the text that does not bring the colors over use RGB whereas the text that does work is using hex. I didn't work on the frontpage sites we are copying from so I'm not sure how they are implemented.

    Anyone know if Word maybe is able to convert the RGB to hex, which is why from word it works?

  5. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 11 Aug 2008 Link to this post

    Hi Christopher,

    When you paste content in the EditableIFRAME.html page you should paste it directly in the IFRAME element (the element having a solid red border) because the element over the IFRAME is a TextArea (which is not an editable element and it does not use the Rich Text Editing engine of the browser).

    Additionally, it is important to notice that depending on the selection the content is copied with its parent tags and formatting.

    I am not sure whether Word support RGB to HEX conversion, but you can search in Google and hopefully find a solution.

    Best regards,
    Rumen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Christopher
    Christopher avatar
    17 posts
    Member since:
    Feb 2008

    Posted 13 Aug 2008 Link to this post

    I checked the full source on a frontpage site and compared it with a paragraph of text that wouldn't correctly copy styles into the radeditor, and one paragraph that would from the same site.

    The text that does correctly copy has inline <font> tags that define the color.
    The text that doesn't looks like it might pull from a frontpage style sheet. The inline of course overrides the style sheet.

    It still really weird that if you copy and paste the text that won't copy correctly into the iframe into word, word can somehow recognize what styles have been applied to it from the frontpage stylesheet, but the editor or iFrame can't.

    Oh well, now that I think I know what the problem is, I suppose I'll try to find some workaround.
  7. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 15 Aug 2008 Link to this post

    Hi Christopher,

    The information that you shared with our community is indeed useful and I updated your Telerik points.

    Please, let us know if you found a solution for the problem.

    Kind regards,
    Rumen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top