Module: ActiveScaffold::Bridges::TinyMce::Helpers::FormColumnHelpers
- Defined in:
- lib/active_scaffold/bridges/tiny_mce/helpers.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
11 12 13 |
# File 'lib/active_scaffold/bridges/tiny_mce/helpers.rb', line 11 def self.included(base) base.alias_method_chain :onsubmit, :tiny_mce end |
Instance Method Details
#active_scaffold_input_text_editor(column, options) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/active_scaffold/bridges/tiny_mce/helpers.rb', line 15 def active_scaffold_input_text_editor(column, ) [:class] = "#{[:class]} mceEditor #{column.[:class]}".strip settings = { :theme => 'simple' }.merge(column.[:tinymce] || {}) settings = settings.to_s.gsub(/:(.+?)\=\>/, '\1:') settings = "tinyMCE.settings = #{settings};" html = [] html << send(override_input(:textarea), column, ) html << javascript_tag(settings + "tinyMCE.execCommand('mceAddControl', false, '#{[:id]}');") if request.xhr? || params[:iframe] html.join "\n" end |
#onsubmit_with_tiny_mce ⇒ Object
28 29 30 31 |
# File 'lib/active_scaffold/bridges/tiny_mce/helpers.rb', line 28 def onsubmit_with_tiny_mce submit_js = 'tinyMCE.triggerSave();jQuery(\'textarea.mceEditor\').each(function(index, elem) { tinyMCE.execCommand(\'mceRemoveControl\', false, jQuery(elem).attr(\'id\')); });' [onsubmit_without_tiny_mce, submit_js].compact.join ';' end |