Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for plugins config line double quote encoding issue. might be a problem for others too? #8

Open
wants to merge 4 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
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