From 75f165804bc9e144b2686ebcf634211d3a2eee81 Mon Sep 17 00:00:00 2001 From: echarp Date: Sat, 12 Jul 2014 12:21:39 +0200 Subject: [PATCH] =?UTF-8?q?Int=C3=A9gration=20de=20tiny=20mce=204=20pour?= =?UTF-8?q?=20l'=C3=A9dition=20visuelle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 4 ++++ Gemfile.lock | 23 ++++++++++++++--------- app/assets/javascripts/application.js | 1 + app/assets/stylesheets/events.css.sass | 3 +++ app/views/events/_form.html.haml | 5 +++-- config/tinymce.yml | 21 +++++++++++++++++++++ 6 files changed, 46 insertions(+), 11 deletions(-) create mode 100644 config/tinymce.yml diff --git a/Gemfile b/Gemfile index cf0041ec..0aa254fe 100644 --- a/Gemfile +++ b/Gemfile @@ -72,6 +72,10 @@ gem 'actionview-encoded_mail_to' # Carte openstreetmap gem 'openlayers-rails' +# Tiny MCE integration +gem 'tinymce-rails' +gem 'tinymce-rails-langs' + group :development do gem 'guard-livereload' gem 'guard-bundler' diff --git a/Gemfile.lock b/Gemfile.lock index 237a7dd0..7787315b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: git://github.com/gregbell/active_admin.git - revision: 2ae0a9e09bf9fab7fd95e245b6c46d5c7fc2a953 + revision: 063e00b533d4d6c83052b04e7f9cfd86fb68f8fe specs: activeadmin (1.0.0.pre) arbre (~> 1.0) @@ -9,7 +9,7 @@ GIT formtastic (~> 2.3.0.rc3) inherited_resources (~> 1.4.1) jquery-rails - jquery-ui-rails + jquery-ui-rails (~> 5.0) kaminari (~> 0.15) rails (>= 3.2, < 4.2) ransack (~> 1.0) @@ -79,17 +79,16 @@ GEM coffee-rails (4.0.1) coffee-script (>= 2.2.0) railties (>= 4.0.0, < 5.0) - coffee-script (2.2.0) + coffee-script (2.3.0) coffee-script-source execjs - coffee-script-source (1.7.0) + coffee-script-source (1.7.1) compass (0.12.6) chunky_png (~> 1.2) fssm (>= 0.2.7) sass (~> 3.2.19) - compass-rails (1.1.7) + compass-rails (2.0.0) compass (>= 0.12.2) - sprockets (<= 2.11.0) devise (3.2.4) bcrypt (~> 3.0) orm_adapter (~> 0.1) @@ -146,11 +145,11 @@ GEM highline (1.6.21) hike (1.2.3) http_parser.rb (0.6.0) - i18n (0.6.9) + i18n (0.6.11) inherited_resources (1.4.1) has_scope (~> 0.6.0.rc) responders (~> 1.0.0.rc) - jbuilder (2.1.1) + jbuilder (2.1.2) activesupport (>= 3.0.0, < 5) multi_json (~> 1.2) jquery-rails (3.1.1) @@ -176,7 +175,7 @@ GEM treetop (~> 1.4.8) method_source (0.8.2) mime-types (1.25.1) - minitest (5.3.5) + minitest (5.4.0) modernizr-rails (2.7.1) multi_json (1.10.1) mysql2 (0.3.16) @@ -269,6 +268,10 @@ GEM thread_safe (0.3.4) tilt (1.4.1) timers (1.1.0) + tinymce-rails (4.1.0) + railties (>= 3.1.1) + tinymce-rails-langs (4.20140129) + tinymce-rails (~> 4.0) treetop (1.4.15) polyglot polyglot (>= 0.3.1) @@ -318,6 +321,8 @@ DEPENDENCIES simple_calendar spring therubyracer + tinymce-rails + tinymce-rails-langs turbolinks uglifier webrick (>= 1.3.1) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index e834774a..3dea4f83 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -12,6 +12,7 @@ // //= require jquery //= require jquery_ujs +//= require tinymce-jquery //= require jquery.turbolinks //= require turbolinks //= require modernizr diff --git a/app/assets/stylesheets/events.css.sass b/app/assets/stylesheets/events.css.sass index d503e2cf..208002ed 100644 --- a/app/assets/stylesheets/events.css.sass +++ b/app/assets/stylesheets/events.css.sass @@ -174,5 +174,8 @@ sidebar#lug-list margin-left: 6.75em margin-bottom: 10px + .mce-tinymce * + @include transition-duration(0) + .description text-align: left diff --git a/app/views/events/_form.html.haml b/app/views/events/_form.html.haml index b4bd1b93..e01cc315 100644 --- a/app/views/events/_form.html.haml +++ b/app/views/events/_form.html.haml @@ -21,7 +21,7 @@ :markdown #{t '.title_helper'} = f.label :title - = f.text_field :title, required: true, size: 70 + = f.text_field :title, required: true ,size: 70 .field = f.label Event.human_attribute_name :start_time = f.datetime_select :start_time, required: true @@ -33,7 +33,8 @@ :markdown #{t '.description_helper'} = f.label Event.human_attribute_name :description - = f.text_area :description, required: true, rows: 29, cols: 80 + = f.text_area :description, required: true, class: 'tinymce', rows: 29, cols: 80 + = tinymce language: 'fr_FR' .field = f.label Event.human_attribute_name :city diff --git a/config/tinymce.yml b/config/tinymce.yml new file mode 100644 index 00000000..0cc43266 --- /dev/null +++ b/config/tinymce.yml @@ -0,0 +1,21 @@ +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