Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

TinyMCE - how to with LS 3?

  • achstil
  • achstil's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 9 months ago #170679 by achstil
TinyMCE - how to with LS 3? was created by achstil
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?
The topic has been locked.
  • achstil
  • achstil's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 9 months ago #170801 by achstil
Replied by achstil on 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?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 9 months ago - 5 years 9 months ago #170839 by tpartner
Replied by tpartner on 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:

Code:
$(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: 5 years 9 months ago by tpartner.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose