From 432a555b78fc55dbb5f477adbb8cb4267343d72d Mon Sep 17 00:00:00 2001 From: echarp Date: Wed, 16 Jul 2014 23:48:24 +0200 Subject: [PATCH] =?UTF-8?q?La=20gemme=20webshim=20est=20en=20place,=20offr?= =?UTF-8?q?ant=20un=20calendrier=20pour=20les=20datetime=20pour=20les=20na?= =?UTF-8?q?vigateurs=20ne=20le=20g=C3=A9rant=20pas=20eux=20m=C3=AAme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 1 + Gemfile.lock | 3 ++ app/assets/javascripts/application.js | 19 --------- app/assets/javascripts/application.js.coffee | 45 ++++++++++++++++++++ app/views/events/_form.html.haml | 3 +- config/tinymce.yml | 21 --------- 6 files changed, 50 insertions(+), 42 deletions(-) delete mode 100644 app/assets/javascripts/application.js create mode 100644 app/assets/javascripts/application.js.coffee delete mode 100644 config/tinymce.yml 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