Changes to the tinymce editor

This commit is contained in:
echarp 2017-05-06 16:11:24 +02:00
parent 053a94198e
commit 3485a9b9c9
6 changed files with 90124 additions and 8 deletions

View File

@ -1,8 +1,9 @@
$(document).on 'turbolinks:load', ->
# Setup the graphical editor for event's description
tinyMCE.init
width: 'auto',
schema: 'html5',
menubar: false,
branding: false,
language: 'fr_FR',
selector: 'textarea.description',
content_css: '<%= asset_path 'application.css' %>',
@ -10,17 +11,21 @@ $(document).on 'turbolinks:load', ->
add_unload_trigger: true,
browser_spellcheck: true,
toolbar: [
' bold italic strikethrough
| bullist numlist outdent indent
| alignleft aligncenter alignright alignjustify
| link image media insertdatetime charmap table
' cut copy paste
| undo redo
| searchreplace
| code visualblocks preview fullscreen'
| link image media charmap table
| code visualblocks preview fullscreen',
' removeformat
| bold italic strikethrough
| superscript subscript
| bullist numlist
| alignleft aligncenter alignright alignjustify alignnone
| outdent indent'
],
plugins: 'lists, advlist, autolink, link, image, charmap, paste, print,
preview, table, fullscreen, searchreplace, media, insertdatetime,
visualblocks, visualchars, wordcount, contextmenu, code'
visualblocks, wordcount, contextmenu, code'
$(document).on 'turbolinks:before-cache', ->
# Delete existing tinymce editors, very important in the turbolinks context!

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,22 @@
(function() {
$(document).on('turbolinks:load', function() {
return tinyMCE.init({
width: 'auto',
schema: 'html5',
branding: false,
language: 'fr_FR',
selector: 'textarea.description',
content_css: '/assets/application-74c16b3b8c70a0ee2d3bc48bb2acbb9925fc52b1cd41171d7cb5063cd119ba3a.css',
entity_encoding: 'raw',
add_unload_trigger: true,
browser_spellcheck: true,
toolbar: [' cut copy paste | undo redo | searchreplace | link image media charmap table | code visualblocks preview fullscreen', ' removeformat | bold italic strikethrough | superscript subscript | bullist numlist | alignleft aligncenter alignright alignjustify alignnone | outdent indent'],
plugins: 'lists, advlist, autolink, link, image, charmap, paste, print, preview, table, fullscreen, searchreplace, media, insertdatetime, visualblocks, wordcount, contextmenu, code'
});
});
$(document).on('turbolinks:before-cache', function() {
return tinymce.remove();
});
}).call(this);