Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
Forum Search
Google Site Search
 All Forums
 Technical
 PHP (Unix / Linux / Apache) versions
 Froala editor - force plain text paste?
Author « Topic »  

EllenD
Advanced Member

United Kingdom
434 Posts

Posted - 01/27/2022 :  07:25:58  
Hi, I have just switched to the Froala editor. Is there a config file or similar way to set up the editor? In particular, I would love to be able to force a 'plain text' paste. Looking at their docs, there seems to be a option "pastePlain" but I do not know how to invoke this. Any help appreciated!
https://froala.com/wysiwyg-editor/docs/options/#pastePlain

Thank you
Ellen

ITZAP
Ecommerce Template Guru

Australia
1022 Posts

Pre-sales questions only
(More Details...)

Posted - 01/27/2022 :  17:17:58  
On PC the keyboard shortcut to paste plain text is "Ctrl + Shift + V"

Gary
[img]https://itzap.com.au/pics/logo/itzap-website-design-works-mini-logo.png[/img]

EllenD
Advanced Member

United Kingdom
434 Posts

Posted - 01/28/2022 :  02:37:35  
Thanks Gary, unfortunately users often don't do this and the product descriptions get really messy when they paste from Word etc. It would be great to have the editor use the 'pastePlain' behaviour by default. With CKeditor there is config.js where you can put such things. I need to move to Froala for other reasons though, so was hoping to find the place where Froala is invoked, or where config options can be specified. Any ideas?

The example code given on the link I gave is this:

new FroalaEditor('.selector', {

pastePlain: true

});

There is another useful looking property "pasteAllowedStyleProps" which could be used to specify the list of allowed CSS attributes to be used for tags on paste.

Thank you
Ellen

Edited by - EllenD on 01/28/2022 02:39:19

ITZAP
Ecommerce Template Guru

Australia
1022 Posts

Pre-sales questions only
(More Details...)

Posted - 03/25/2024 :  19:14:12  
Ellen's example code to force Froala to paste 'plain text' is correct.

This is how to implement:

1) In your favourite code editing software, open file "[font=Courier New]vsadmin/froala/js/froala_editor.min.js[/font=Courier New]"
2) I actually unminify the javascript to make the code readable and re-save. But this is optional.
3) CTRL+F to find: [purple][font=Courier New]pastePlain:!1[/font=Courier New][/purple]
4) Replace that entry with: [red][font=Courier New]pastePlain:true[/font=Courier New][/red]
5) Save the file "[font=Courier New]vsadmin/froala/js/froala_editor.min.js[/font=Courier New]" and Upload to server.

It works

Gary
[img]https://itzap.com.au/pics/logo/itzap-website-design-works-mini-logo.png[/img]

EllenD
Advanced Member

United Kingdom
434 Posts

Posted - 04/05/2024 :  01:26:12  
That's great, just what I needed to know. Thank you for posting it Gary
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.02 seconds. Snitz Forums 2000