TinyMCE - how to with LS 3?

More
4 months 1 week ago #170679 by achstil
achstil created the topic: TinyMCE - how to with LS 3?
I would like to use a rich text editor with options to paste 'sensible' from word. TinyMCE is the candidate. This answer details how TinyMCE can be used - but the answer is four years old and LS3 has changed a lot. How would I do this today?

Please Log in or Create an account to join the conversation.

More
4 months 1 week ago #170801 by achstil
achstil replied the topic: TinyMCE - how to with LS 3?
I am the only one who is faced with "paste from word" requirement? - Or should it be trivial to integrete TinyMCE as per the instructions above?

Please Log in or Create an account to join the conversation.

More
4 months 6 days ago - 4 months 6 days ago #170839 by tpartner
tpartner replied the topic: TinyMCE - how to with LS 3?
TinyMCE from a CDN (what they call 'Cloud') is not free any more but if you have a plan, you can add something like this to your custom.js file:

$(document).on('ready pjax:scriptcomplete',function(){
	$.getScript('https://cloud.tinymce.com/stable/tinymce.min.js', function(data, textStatus, jqxhr) {
		tinymce.init({
			selector: '.text-item textarea',
			menubar: false,
			setup: function (editor) {
				editor.on('change', function () {
					tinymce.triggerSave();
				});
			},
			plugins: [
				'advlist autolink lists link image charmap print preview anchor textcolor',
				'searchreplace visualblocks code fullscreen',
				'insertdatetime media table contextmenu paste code help wordcount'
			],
			toolbar: 'insert | undo redo |  formatselect | bold italic backcolor forecolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | code paste removeformat | help',
			content_css: [
				'//fonts.googleapis.com/css?family=Lato:300,300i,400,400i',
				'//www.tinymce.com/css/codepen.min.css'
			]
		});
	});
});

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last Edit: 4 months 6 days ago by tpartner.

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!