Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

TinyMCE-rails v5 support #146

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions app/views/shared/editor_engines/_tiny_mce.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@

<script>
$(function () {
/* Inject each textarea id with .tinymce class required for TinyMCE 4 */
/* Inject each textarea id with .tinymce class required for TinyMCE 5 */
$('<%= raw ids.each.map{|id| "textarea##{id}" }.join(", ") %>').addClass('tinymce');
});

$(document).ready(function () {
$('<%= raw ids.each.map{|id| "textarea##{id}" }.join(", ") %>').tinymce(
<%= raw TinyMCE::Rails.configuration.options.to_json %>);
});
</script>

<%= tinymce %>

<style type="text/css">
/* Reset TinyMCE menu styles */
.mce-tinymce button {
Expand All @@ -21,4 +18,4 @@
.mce-tinymce button:hover {
background-color: inherit !important;
}
</style>
</style>
2 changes: 1 addition & 1 deletion spree_editor.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Gem::Specification.new do |s|
s.add_dependency 'spree_backend', spree_version
s.add_dependency 'spree_extension'
s.add_dependency 'ckeditor', '~> 4.2.0'
s.add_dependency 'tinymce-rails', '~> 4.2.5'
s.add_dependency 'tinymce-rails', '~> 5.0'

s.add_development_dependency 'i18n-spec', '>= 0.5.0'
s.add_development_dependency 'guard-rspec'
Expand Down