diff --git a/lib/tiny_mce/configuration.rb b/lib/tiny_mce/configuration.rb index 5fb93d4..7097e8e 100644 --- a/lib/tiny_mce/configuration.rb +++ b/lib/tiny_mce/configuration.rb @@ -82,7 +82,7 @@ def to_json when String, Symbol, Fixnum "'#{value.to_s}'" when Array - '"' + value.join(',') + '"' + "'" + value.join(',') + "'" when TrueClass 'true' when FalseClass @@ -111,7 +111,8 @@ def valid?(option) end def uses_jquery? - Rails.version.to_i >= 3 && ActionView::Helpers::AssetTagHelper.javascript_expansions[:defaults].detect{|x| x == "jquery"} + true + #Rails.version.to_i >= 3 && ActionView::Helpers::AssetTagHelper.javascript_expansions[:defaults].detect{|x| x == "jquery"} end end diff --git a/lib/tiny_mce/helpers.rb b/lib/tiny_mce/helpers.rb index 582bcf8..ab72ce4 100644 --- a/lib/tiny_mce/helpers.rb +++ b/lib/tiny_mce/helpers.rb @@ -21,7 +21,7 @@ def raw_tiny_mce_init(options = {}, raw_options = nil) if uses_jquery? #TODO: Use dynamic editor_selector from configuration - tinymce_js += "$(function(){ $('textarea.mceEditor').tinymce(" + tinymce_js += "jQuery(function(){ jQuery('textarea.mceEditor').tinymce(" tinymce_js += configuration.to_json tinymce_js += ");" tinymce_js += "});" @@ -33,7 +33,7 @@ def raw_tiny_mce_init(options = {}, raw_options = nil) end - tinymce_js + tinymce_js.html_safe end # Form the raw JS and wrap in in a