module Alchemy
module Admin
module PagesHelper
def tinymce_javascript_tags
init = Alchemy::Tinymce.init
if init.is_a?(Hash)
init = HashWithIndifferentAccess.new(init)
init = init.keys.sort.collect(&:to_s).sort.collect do |key|
[key, init[key]]
end
end
init = init.collect { |key, value| "#{key} : #{value.to_json}" }.join(', ')
setup = "init.setup = #{Alchemy::Tinymce.setup};" if Alchemy::Tinymce.setup
tinymce_javascript_string = "
"
if Alchemy::Tinymce.custom_config_contents.any?
(tinymce_javascript_string + custom_tinymce_javascript_tags).html_safe
else
tinymce_javascript_string.html_safe
end
end
def custom_tinymce_javascript_tags
custom_config_string = "
"
custom_config_string.html_safe
end
end
end
end