Skip to content
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
5 changes: 3 additions & 2 deletions lib/tiny_mce/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/tiny_mce/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 += "});"
Expand All @@ -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 <script> tag for inclusion in the <head>
Expand Down