diff --git a/Gemfile b/Gemfile index c832863a..da5721b1 100644 --- a/Gemfile +++ b/Gemfile @@ -50,6 +50,7 @@ gem 'haml-rails' gem 'compass-rails' gem 'modernizr-rails' gem 'activeadmin', github: 'gregbell/active_admin' +gem 'webshims-rails' gem 'devise' gem 'devise-i18n' diff --git a/Gemfile.lock b/Gemfile.lock index 4fa45f26..54e499fa 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -285,6 +285,8 @@ GEM warden (1.2.3) rack (>= 1.0) webrick (1.3.1) + webshims-rails (1.14.4) + rails (> 3.1.0) PLATFORMS ruby @@ -326,3 +328,4 @@ DEPENDENCIES turbolinks uglifier webrick (>= 1.3.1) + webshims-rails diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js deleted file mode 100644 index 3dea4f83..00000000 --- a/app/assets/javascripts/application.js +++ /dev/null @@ -1,19 +0,0 @@ -// This is a manifest file that'll be compiled into application.js, which will include all the files -// listed below. -// -// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, -// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. -// -// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the -// compiled file. -// -// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details -// about supported directives. -// -//= require jquery -//= require jquery_ujs -//= require tinymce-jquery -//= require jquery.turbolinks -//= require turbolinks -//= require modernizr -//= require_tree . diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee new file mode 100644 index 00000000..a928041e --- /dev/null +++ b/app/assets/javascripts/application.js.coffee @@ -0,0 +1,45 @@ +# This is a manifest file that'll be compiled into application.js, which will include all the files +# listed below. +# +# Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, +# or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. +# +# It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +# compiled file. +# +# Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details +# about supported directives. +# +#= require jquery +#= require jquery_ujs +#= require jquery.turbolinks +#= require turbolinks +#= require tinymce +#= require modernizr +#= require webshims/polyfiller +#= require_tree . + +# Setup polyfills, so that older browsers can also take advanage of html5! +$.webshims.setOptions('basePath', '/assets/webshims/shims/') +$.webshims.polyfill('es5 forms forms-ext mediaelement') + +$(document).ready -> + $(this).updatePolyfill() + + tinyMCE.init { + selector: 'textarea', + language: 'fr_FR', + menubar : false, + toolbar: [ + ' bold italic strikethrough + | bullist numlist outdent indent + | alignleft aligncenter alignright alignjustify + | link media insertdatetime charmap table + | undo redo + | searchreplace spellchecker + | code visualblocks preview fullscreen' + ], + plugins: 'lists, advlist, autolink, link, charmap, paste, print, preview, + table, fullscreen, searchreplace, media, insertdatetime, visualblocks, + visualchars, wordcount, contextmenu, code, spellchecker' + } diff --git a/app/views/events/_form.html.haml b/app/views/events/_form.html.haml index be4cdcd4..5e34ace0 100644 --- a/app/views/events/_form.html.haml +++ b/app/views/events/_form.html.haml @@ -33,8 +33,7 @@ :markdown #{t '.description_helper'} = f.label :description - = f.text_area :description, required: true, class: 'tinymce', rows: 29, cols: 80 - = tinymce language: 'fr_FR' + = f.text_area :description, required: true, rows: 29, cols: 80 .field = f.label :city diff --git a/config/tinymce.yml b/config/tinymce.yml deleted file mode 100644 index 0cc43266..00000000 --- a/config/tinymce.yml +++ /dev/null @@ -1,21 +0,0 @@ -toolbar: - - undo redo | bold italic strikethrough | bullist numlist outdent indent | alignleft aligncenter alignright alignjustify | link media insertdatetime charmap table | searchreplace | code visualblocks preview fullscreen -plugins: - - lists - - advlist - - autolink - - link - - charmap - - paste - - print - - preview - - table - - fullscreen - - searchreplace - - media - - insertdatetime - - visualblocks - - visualchars - - wordcount - - contextmenu - - code