Module: Alchemy::Tinymce

Defined in:
lib/alchemy/tinymce.rb

Constant Summary collapse

@@plugins =
%w(alchemy_link anchor autoresize charmap code directionality fullscreen hr link paste tabfocus table)
@@languages =
['en', 'de']
@@init =
{
  skin: 'alchemy',
  width: '100%',
  resize: true,
  autoresize_min_height: '105',
  autoresize_max_height: '480',
  menubar: false,
  statusbar: true,
  toolbar: [
    'bold italic underline | strikethrough subscript superscript | numlist bullist indent outdent | removeformat | fullscreen',
    'pastetext charmap hr | undo redo | alchemy_link unlink anchor | code'
  ],
  fix_list_elements: true,
  convert_urls: false,
  entity_encoding: 'raw',
  paste_as_text: true,
  element_format: 'html'
}

Class Method Summary collapse

Class Method Details

.custom_config_contents(page = nil) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
# File 'lib/alchemy/tinymce.rb', line 37

def self.custom_config_contents(page = nil)
  if page
    definitions = content_definitions_from_elements(page.element_definitions)
  else
    definitions = content_definitions_from_elements(Element.definitions)
  end
  if definitions.any? { |d| contains_old_tinymce_toolbar_config?(d['settings']) }
    warn_about_deprecation!
  end
  definitions
end

.initObject



33
34
35
# File 'lib/alchemy/tinymce.rb', line 33

def self.init
  @@init
end

.init=(settings) ⇒ Object



26
27
28
29
30
31
# File 'lib/alchemy/tinymce.rb', line 26

def self.init=(settings)
  if contains_old_tinymce_toolbar_config?('tinymce' => settings.stringify_keys)
    warn_about_deprecation!
  end
  @@init.merge!(settings)
end