Browser issue  tinyMCE paste with dark style (Chrome)

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?
 
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!
 
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.
 
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.
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.
 
I'll need to do some tests. What are you pasting from? Within the browser or from an external editor? What browser(s)?
 
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.
 
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?
 
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.
 
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">
    <!-- block: sidebar_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="$user" size="s" img="true" />
                                <xen:username user="$user" rich="true" />
                                <div class="userTitle">{xen:helper userTitle, $user}</div>
                            </li>
                        </xen:if>
                    </xen:foreach>
                </xen:contentcheck>
            </ul>
        </div>
    </div>
    <!-- end block: sidebar_online_staff -->
</xen:if>
edited
 
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. :)
 
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 :)
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. :)
 
The colour comes from the @contentText property.

I've had it happen to me several times when editing posts with code boxes.
 
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.
 
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.
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.
 
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.
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)
 
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.

I need to do this...this is one of the few complaints my users have about XenForo.
 
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.
 
Top Bottom