1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Browser Issue tinyMCE paste with dark style (Chrome)

Discussion in 'Resolved Bug Reports' started by dieketzer, Dec 6, 2010.

  1. dieketzer

    dieketzer Well-Known Member

    so i am having this annoying issue of having black text being pasted into tinyMCE, and then having that black text appear in posts against my nearly-black background.
    no doubt this color formatting can be stripped using a specific configuration of the paste plugin (id like to allow most formatting afterall). but before i get to far into this i just want to make sure i am not reinventing the wheel...
    is the paste plugin already present in xenforo?
    is there already some options/cfg tucked away somewhere waiting to be edited?
     
  2. dieketzer

    dieketzer Well-Known Member

    ok i have found the tinymce plugins, it appears it is installed, so thats half the task comepleted.
    i suppose this thread can be ignored!
     
  3. Mike

    Mike XenForo Developer Staff Member

    For reference, we had the paste plugin enabled, but it did all sorts of evil things to pasting within WebKit (and IE to an extent), so I removed it.

    You just need to load the plugin in the editor JS.
     
    dieketzer likes this.
  4. dieketzer

    dieketzer Well-Known Member

    well if you couldnt get the plugin to work in a satisfactory manner, i doubt i will have any success myself.
    is there perhaps some css voodoo that would over-ride any colour properties pasted into the editor? i would be quite happy to remove the colour button and whatnot as well as add some css, but the pasting of black text is what is really annoying me.
     
  5. Mike

    Mike XenForo Developer Staff Member

    I'll need to do some tests. What are you pasting from? Within the browser or from an external editor? What browser(s)?
     
    dieketzer likes this.
  6. dieketzer

    dieketzer Well-Known Member

    thx for the reply mike.
    i am not the person posting this. these are my users, copy and pasting things from websites, such as news articles and the like.
    i will ask some of these people which browsers they are using.
     
  7. dieketzer

    dieketzer Well-Known Member

    the culprit appears to be chrome.
     
  8. Kier

    Kier XenForo Developer Staff Member

    Pasting in Chrome is broken in so many ways, I can't believe Google haven't fixed it. Have you tried pasting into an <input type="text" /> that already has content?
     
    dieketzer likes this.
  9. dieketzer

    dieketzer Well-Known Member

    related to this:
    when using chrome, try the following:
    1. make a post and use bbcode 'php' and paste some code.
    2. go back and edit the post
    3. submit
    4. you will find that the bbcode php is now displaying the php-colour codes instead, breaking your pasted php code.
     
  10. dieketzer

    dieketzer Well-Known Member

    for example:
    bah now it wont do it. it was happening relentlessly on this thread, to the point i used general code to escape it
    PHP:
    <xen:if hascontent="true">
        <!-- 
    blocksidebar_online_staff -->
        <
    div class="section staffOnline avatarList">
            <
    div class="secondaryContent">
                <
    h3>{xen:phrase staff_online_now}</h3>
                <
    ul>
                    <
    xen:contentcheck>
                        <
    xen:foreach loop="$onlineUsers.records" value="$user">
                            <
    xen:if is="{$user.is_moderator} OR {$user.is_admin}">
                                <
    li>
                                    <
    xen:avatar user="$usersize="s" img="true" />
                                    <
    xen:username user="$userrich="true" />
                                    <
    div class="userTitle">{xen:helper userTitle$user}</div>
                                </
    li>
                            </
    xen:if>
                        </
    xen:foreach>
                    </
    xen:contentcheck>
                </
    ul>
            </
    div>
        </
    div>
        <!-- 
    end blocksidebar_online_staff -->
    </
    xen:if>
    edited
     
  11. Mike

    Mike XenForo Developer Staff Member

    The color tags in the linked example are annoying and have already been reported. It's mostly down to how Chrome does its pasting - remove formatting should sort it, or insert the code via the code button (as that will paste as plain text).

    I'm not sure how the PHP colors would actually be showing after an edit though, unless the PHP tag was somehow parsed.

    On a side note, you're using the PHP tag for something that technically isn't PHP. :)
     
  12. dieketzer

    dieketzer Well-Known Member

    heres the thing though, i copied from a text doc and pasted into the php code button popup thingo. there never was any colour formatting until the php bbcode added it. for some reason when editing the post this coloured code text is converted into nonparsed code.
    and looking back at it, it even did it to general code, and inserted the grey text colour code.

    i use the phpcode cos i like the syntax highlighting colours :)
     
  13. Brogan

    Brogan XenForo Moderator Staff Member

    The colour comes from the @contentText property.

    I've had it happen to me several times when editing posts with code boxes.
     
  14. dieketzer

    dieketzer Well-Known Member

    so this is really giving me the ****s.
    is there a way to completely disable all colour functionality in tinymce?
     
  15. Mike

    Mike XenForo Developer Staff Member

    Unfortunately no - it's actually how WebKit handles pasting into a contentEditable area. That said, I believe if you change the wysiwyg editor to use a similar color scheme to your posts (eg, light text on dark), it should be workable. Beta 6 has style properties for this, as right now it's hardcoded.
     
  16. dieketzer

    dieketzer Well-Known Member

    that could work if the dark style were the only style available.
    but the people causing this problem are those that elect to use the alternate light style. they never even realise the text they have pasted is colour formatted. they never see the problem they create.
     
  17. Erik

    Erik Well-Known Member

    You can change the formatting of the editor per style. I believe it's the editorcontents template (I changed it for my dark style, but I'm too lazy to go back and find the exact template name. :p)
     
  18. Shaun Mason

    Shaun Mason Active Member

    I need to do this...this is one of the few complaints my users have about XenForo.
     
  19. Brogan

    Brogan XenForo Moderator Staff Member

    I've made a few posts in response to questions on how to change the colour of certain parts of the editor.
    However, as Mike said it is now in the Style Properties from Beta 6 then I would recommend waiting until it is released.
     

Share This Page