agenda-libre-ruby/app/assets/javascripts/setup_tinymce.coffee.erb

33 lines
1.1 KiB
Plaintext

$(document).on 'turbolinks:load', ->
# Setup the graphical editor for event's description
tinyMCE.init
width: '100%'
height: '40em'
menubar: false
branding: false
language: 'fr_FR'
selector: 'input.description'
content_css: '<%= asset_path 'application.css' %>'
relative_urls: false
entity_encoding: 'raw'
document_base_url: '/'
add_unload_trigger: true
browser_spellcheck: true
style_formats_autohide: true
toolbar: [
' cut copy paste
| undo redo
| link image media charmap table
| code visualblocks searchreplace',
' removeformat bold italic strikethrough superscript subscript
| bullist numlist outdent indent
| alignleft aligncenter alignright alignjustify alignnone'
]
plugins: 'lists advlist autolink link image charmap paste print
preview table fullscreen searchreplace media insertdatetime
visualblocks wordcount code'
$(document).on 'turbolinks:before-cache', ->
# Delete existing tinymce editors, very important in the turbolinks context!
tinymce.remove()