Jump to content

Featured Replies

Posted

Hello,

 

When i copy info from the internet and paste in my IP forum, the layout is completely messed up when using Dark and light theme.

See screens:

posting on Dark theme

 

Could contain: Person, Human, Text, Menu

Same post, switched to Light theme :

Could contain: Page, Text, Person, Human, Envelope, Postcard, Mail

 

Completely messed up post on Dark theme.

Could contain: Text, Mobile Phone, Electronics, Phone, Cell Phone, Menu, Page

 

How can i fix this ? I moved from XF to IPB and never had this issue before.

Waiting for your reply.

  • Author

Thanks, if i use this, all urls are also plain text and the images copied dont appear.

The above would indeed be your only option there. The issue is that the source you are copying from has a background and text colour set, and so its pasting exactly what was copied there

It would not paste images, as you are now pasting plain text. 

  • Author
Just now, Marc Stridgen said:

The above would indeed be your only option there. The issue is that the source you are copying from has a background and text colour set, and so its pasting exactly what was copied there

Is IPS going to edit this in the editor in a new version ?

XF and VB dont copy the background. And i dont want to go back to those companies. I love IP

It’s always been this way ever since there were HTML posts.

It’s not just background colors: if you copy raw HTML from one website to another, there could be dozens of styling declarations that could break a layout. 

As mentioned above, this would happen in any editor

  • Author
Just now, Marc Stridgen said:

As mentioned above, this would happen in any editor

I understand but we used this copy paste in our previous forum software without these issues.

Always nice layout and not like not visible or blocks there.

Unfortunately, there isnt really much I can add to what has already been said here. Its pasting exactly what has been copied. So is a background has explicitly been set in code, it would indeed add that

  • Author

What is the CSS code to force all posts in white color, regardless of the original color ?

Can someone help me with this ?

As mentioned in your other topic, there is no code that would force it to do so

3 hours ago, Denniz38 said:

When i copy info from the internet and paste in my IP forum, the layout is completely messed up when using Dark and light theme.

I found your topic here too. As I said earlier on Ehren's forum different browser might be a workaround:

Quote

Chromium browsers preserve background unlike Firefox:

image.png.f6a3ebda28bede61cc1d99ea20a2c29e.png

The only "solutions" to prevent such issue is either using Firefox for copying or globally disabling Rich text:

ACP > Customization > Editor > Settings > Always paste as plain text

 

Perhaps editing a CKEditor config file will help:

your site folder > applications > core > interface > ckeditor > ckeditor > ckeditor.js

See Filtering Pasted and Dropped Content + pasteFilter documentations.

Possibly something similar to this:

CKEDITOR.config.pasteFilter = '*[color]; *{color, background-color, text-decoration}';

 

While you may be able to do that, there is no guarantee that there will be no consequences to doing so.

  • Author
19 hours ago, Luuuk said:

Perhaps editing a CKEditor config file will help:

your site folder > applications > core > interface > ckeditor > ckeditor > ckeditor.js

See Filtering Pasted and Dropped Content + pasteFilter documentations.

Possibly something similar to this:

CKEDITOR.config.pasteFilter = '*[color]; *{color, background-color, text-decoration}';

 

What is the best way to place this line in the ckeditor.js file?

  • Author
5 hours ago, Nathan Explosion said:

 

Thanks but does this mean can or can’t be done ?

It means that if you want to make a change to the CKEDITOR config then that is the best way to do it.

In short...

  1. Edit your globalTemplate template in your theme.
  2. At the bottom, before closing </body>, add the following and then save the template
<script>
if(typeof CKEDITOR != 'undefined'){
	CKEDITOR.config.pasteFilter = '<WHATEVER>'
}
</script>

Edited by Nathan Explosion

  • Author
2 minutes ago, Nathan Explosion said:

It means that if you want to make a change to the CKEDITOR config then that is the best way to do it.

Which program to use to edit the .js file, i use text editor and notepad but the view is not good of the files 

You are not editing a JS file - you should be editing the globalTemplate in your theme.

 

  • Author

Thank you so much ! 

  • Author
14 hours ago, Nathan Explosion said:

You are not editing a JS file - you should be editing the globalTemplate in your theme.

 

I have placed this in the GlobalTemplate but no difference.

Could contain: Text, Menu

 

The posts are exactly the same as without this code.

When i use the remove formatting button on the post, thats the way it should look like.

 

 

I helped you with this bit:

21 hours ago, Denniz38 said:

What is the best way to place this line in the ckeditor.js file?

I didn't help you with this bit:

On 9/7/2022 at 3:09 PM, Luuuk said:

Perhaps editing a CKEditor config file will help:

your site folder > applications > core > interface > ckeditor > ckeditor > ckeditor.js

See Filtering Pasted and Dropped Content + pasteFilter documentations.

Possibly something similar to this:

CKEDITOR.config.pasteFilter = '*[color]; *{color, background-color, text-decoration}';

 

<WHATEVER> is a placeholder for your actual configuration...

  • Author
8 minutes ago, Nathan Explosion said:

I helped you with this bit:

I didn't help you with this bit:

<WHATEVER> is a placeholder for your actual configuration...

Thanks but still confused, im not a coder.

Could contain: Text

my background is black and my font is white on my website.

How to place in the code ?

Edited by Denniz38

Maybe @Luuuk can help you, as they suggested that functionality as an option.

But be aware that this won't have any effect on already existing content - it would be processed on new content pasted in.

Edited by Nathan Explosion

Recently Browsing 0

  • No registered users viewing this page.