MyBB Community Forums
Problem with copied/pasted text - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Themes (https://community.mybb.com/forum-103.html)
+---- Forum: Theme Support (https://community.mybb.com/forum-10.html)
+---- Thread: Problem with copied/pasted text (/thread-227964.html)



Problem with copied/pasted text - tamarajeep - 2020-05-24

Hello All, I moved a jeep forum last year from phpBB to myBB. A lot of users liked to use edit the text with color, bold, increase size etc. When I moved to myBB, after a couple of months I noticed when people copied/pasted text from a previous post it would show the code. We are a Jeep club, we do a sign-up list for events, we ask members to copy/paste last list and add their name to their post. At first I thought it was a tapatalk issue, pin pointed its the myBB code option in the themes. It would be impossible to ask members to copy/paste as plain text. Most claim that the forum is hard enough to use (thanks facebook). 

I turned off the MyBB option for a while. I was asked if it could be turned back on recently. I did this week, having a problem with it only in themes. When I delete any theme, it works fine when using the MyBBMaster Style. If had Emerald, tried Flatty, and MyResponsive. 
I do not know too much about the details of the code. 
Would someone point me to the right direction on how to fix this problem when using themes? I'll keep the default, but wanted to provide a couple of other options. 
I am attaching a screenshot how it looks like when text is copied/pasted to a new post.

Thanks.


RE: Problem with copied/pasted text - panayot - 2020-05-24

To remove all formatting when pasting in the visual editor, you need to use a plugin for the editor (https://www.sceditor.com/documentation/plugins/plaintext/ ). You need to take following steps to make it work:

1. Download https://raw.githubusercontent.com/samclarke/SCEditor/master/src/plugins/plaintext.js to your jscripts/sceditor/plugins folder

2. Edit Ungrouped Templatescodebuttons template and add this line at the beginning:

<script type="text/javascript" src="{$mybb->asset_url}/jscripts/sceditor/plugins/plaintext.js?ver=1821"></script>

Also in this template find the line:

plugins: "undo",

and change it to 

plugins: "undo,plaintext",



RE: Problem with copied/pasted text - tamarajeep - 2020-05-25

I thought I followed your steps. I put the line, <script type="text/javascript" src="{$mybb->asset_url}/jscripts/sceditor/plugins/plaintext.js?ver=1821"></script>
a couple of lines under the first one. didnt work. i put it in the beginning and it seems to work from my test.


RE: Problem with copied/pasted text - nixer55 - 2020-05-25

Related post - https://community.mybb.com/thread-223638-post-1346298.html#pid1346298

Same here, followed steps, hard refreshed - no change.


RE: Problem with copied/pasted text - panayot - 2020-05-25

Yes, it should be at the beginning of the template. Also Mybb version should be very recent, otherwise it will not work.

To check if file is uploaded correctly you can request www.yourforumurl.com/jscripts/sceditor/plugins/plaintext.js in your browser and see if the javascript file is loading without errors.


RE: Problem with copied/pasted text - RealDrDoob - 2020-08-05

(2020-05-25, 08:29 PM)panayot Wrote: Yes, it should be at the beginning of the template. Also Mybb version should be very recent, otherwise it will not work.

To check if file is uploaded correctly you can request www.yourforumurl.com/jscripts/sceditor/plugins/plaintext.js in your browser and see if the javascript file is loading without errors.

Hey, thanks for this. Only issue I've been having is it doesnt seem to work with clients using Microsoft Edge.


RE: Problem with copied/pasted text - Keatons - 2021-05-11

(2020-05-24, 05:51 PM)panayot Wrote: To remove all formatting when pasting in the visual editor, you need to use a plugin for the editor (https://www.sceditor.com/documentation/plugins/plaintext/ ). You need to take following steps to make it work:

1. Download https://raw.githubusercontent.com/samclarke/SCEditor/master/src/plugins/plaintext.js to your jscripts/sceditor/plugins folder

2. Edit Ungrouped Templatescodebuttons template and add this line at the beginning:

<script type="text/javascript" src="{$mybb->asset_url}/jscripts/sceditor/plugins/plaintext.js?ver=1821"></script>

Also in this template find the line:

plugins: "undo",

and change it to 

plugins: "undo,plaintext",

Did all of this, and the error is saying sceditor on line 59 (the last line) is undefined:
}(sceditor));

Any idea of a solution?