2016-07-02 16:48:47 +02:00
|
|
|
$(document).on 'turbolinks:load', ->
|
2014-09-26 22:30:54 +02:00
|
|
|
# Setup the graphical editor for event's description
|
|
|
|
tinyMCE.init
|
|
|
|
schema: 'html5',
|
2017-05-20 19:53:38 +02:00
|
|
|
height: '40em',
|
2017-05-06 16:11:24 +02:00
|
|
|
branding: false,
|
2014-09-26 22:30:54 +02:00
|
|
|
language: 'fr_FR',
|
2017-05-20 19:53:38 +02:00
|
|
|
selector: 'input.description',
|
2014-09-26 22:30:54 +02:00
|
|
|
content_css: '<%= asset_path 'application.css' %>',
|
|
|
|
entity_encoding : 'raw',
|
|
|
|
add_unload_trigger: true,
|
|
|
|
browser_spellcheck: true,
|
|
|
|
toolbar: [
|
2017-05-06 16:11:24 +02:00
|
|
|
' cut copy paste
|
2014-09-26 22:30:54 +02:00
|
|
|
| undo redo
|
|
|
|
| searchreplace
|
2017-05-06 16:11:24 +02:00
|
|
|
| link image media charmap table
|
|
|
|
| code visualblocks preview fullscreen',
|
|
|
|
' removeformat
|
|
|
|
| bold italic strikethrough
|
|
|
|
| superscript subscript
|
|
|
|
| bullist numlist
|
|
|
|
| alignleft aligncenter alignright alignjustify alignnone
|
|
|
|
| outdent indent'
|
2014-09-26 22:30:54 +02:00
|
|
|
],
|
|
|
|
plugins: 'lists, advlist, autolink, link, image, charmap, paste, print,
|
|
|
|
preview, table, fullscreen, searchreplace, media, insertdatetime,
|
2017-05-06 16:11:24 +02:00
|
|
|
visualblocks, wordcount, contextmenu, code'
|
2014-09-26 22:30:54 +02:00
|
|
|
|
2016-07-02 16:48:47 +02:00
|
|
|
$(document).on 'turbolinks:before-cache', ->
|
2014-09-26 22:30:54 +02:00
|
|
|
# Delete existing tinymce editors, very important in the turbolinks context!
|
|
|
|
tinymce.remove()
|