diff --git a/editors/ckeditor.inc b/editors/ckeditor.inc
index 80c9fff..6cc9c0f 100644
--- a/editors/ckeditor.inc
+++ b/editors/ckeditor.inc
@@ -149,6 +149,12 @@ function wysiwyg_ckeditor_settings_form(&$form, &$form_state) {
'allowedContent' => TRUE,
);
+ if (version_compare($installed_version, '3.1.0', '>=')) {
+ // Enabled by default.
+ $ckeditor_defaults['pasteFromWordRemoveFontStyles'] = TRUE;
+ $ckeditor_defaults['pasteFromWordRemoveStyles'] = TRUE;
+ }
+
if (version_compare($installed_version, '3.2.1', '>=')) {
$ckeditor_defaults['stylesSet'] = '';
}
@@ -182,7 +188,7 @@ function wysiwyg_ckeditor_settings_form(&$form, &$form_state) {
$form['paste'] = array(
'#type' => 'fieldset',
'#title' => t('Paste plugin'),
- '#description' => t('Settings for the paste plugin.'),
+ '#description' => t('Settings for the @plugin plugin.', array('@plugin' => 'paste', '@url' => url('http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-forcePasteAsPlainText'))),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#group' => 'advanced',
@@ -193,9 +199,48 @@ function wysiwyg_ckeditor_settings_form(&$form, &$form_state) {
'#title' => t('Force paste as plain text'),
'#default_value' => !empty($settings['forcePasteAsPlainText']),
'#return_value' => 1,
- '#description' => t('If enabled, all pasting operations insert plain text into the editor, loosing any formatting information possibly available in the source text. Note: Paste from Word is not affected by this setting.') . ' ' . t('Uses the @setting setting internally.', array('@setting' => 'forcePasteAsPlainText', '@url' => url('http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-forcePasteAsPlainText'))),
+ '#description' => t('If enabled, all pasting operations insert plain text into the editor, losing any formatting information possibly available in the source text. Note: Paste from Word is not affected by this setting.'),
);
+ if (version_compare($installed_version, '3.1.0', '>=')) {
+ $form['paste']['pasteFromWord'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Paste from Word'),
+ );
+
+ $form['paste']['pasteFromWord']['pasteFromWordNumberedHeadingToList'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Numbered heading to list'),
+ '#default_value' => !empty($settings['pasteFromWordNumberedHeadingToList']),
+ '#return_value' => 1,
+ '#description' => t('If enabled, transforms MS Word outline numbered headings into lists.'),
+ );
+
+ $form['paste']['pasteFromWord']['pasteFromWordPromptCleanup'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Prompt on cleanup'),
+ '#default_value' => !empty($settings['pasteFromWordPromptCleanup']),
+ '#return_value' => 1,
+ '#description' => t('If enabled, prompts the user about the clean up of content being pasted from MS Word.'),
+ );
+
+ $form['paste']['pasteFromWord']['pasteFromWordRemoveFontStyles'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Remove font styles'),
+ '#default_value' => !empty($settings['pasteFromWordRemoveFontStyles']),
+ '#return_value' => 1,
+ '#description' => t('If enabled, removes all font related formatting styles, including font size, font family, font foreground/background color.'),
+ );
+
+ $form['paste']['pasteFromWord']['pasteFromWordRemoveStyles'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Remove styles'),
+ '#default_value' => !empty($settings['pasteFromWordRemoveStyles']),
+ '#return_value' => 1,
+ '#description' => t('If enabled, removes element styles that can not be managed with the editor, other than font specific styles.'),
+ );
+ }
+
if (version_compare($installed_version, '4.1.0', '>=')) {
$form['output']['acf'] = array(
'#type' => 'fieldset',
@@ -414,6 +459,10 @@ function wysiwyg_ckeditor_settings($editor, $config, $theme) {
$check_if_set = array(
'forcePasteAsPlainText',
'language',
+ 'pasteFromWordNumberedHeadingToList',
+ 'pasteFromWordPromptCleanup',
+ 'pasteFromWordRemoveFontStyles',
+ 'pasteFromWordRemoveStyles',
'simple_source_formatting',
'toolbarLocation',
);
diff --git a/editors/fckeditor.inc b/editors/fckeditor.inc
index 672e6d1..ef47fb3 100644
--- a/editors/fckeditor.inc
+++ b/editors/fckeditor.inc
@@ -120,6 +120,7 @@ function wysiwyg_fckeditor_settings_form(&$form, &$form_state) {
'#maxlength' => 250,
'#description' => t('Semicolon separated list of HTML block formats. Possible values: @format-list
.', array('@format-list' => 'p;h1;h2;h3;h4;h5;h6;div;address;pre')) . ' ' . t('Uses the @setting setting internally.', array('@setting' => 'FontFormats', '@url' => url('http://docs.cksource.com/FCKeditor_2.x/Developers_Guide/Configuration/Configuration_Options/FontFormats'))),
);
+
$form['paste'] = array(
'#type' => 'fieldset',
'#title' => t('Paste plugin'),
@@ -181,17 +182,16 @@ function wysiwyg_fckeditor_settings($editor, $config, $theme) {
if (isset($config['FontFormats'])) {
$settings['FontFormats'] = preg_replace('@\s+@', '', $config['FontFormats']);
}
- if (isset($config['FormatOutput'])) {
- $settings['FormatOutput'] = $config['FormatOutput'];
- }
- if (isset($config['FormatSource'])) {
- $settings['FormatSource'] = $config['FormatSource'];
- }
- if (isset($config['ForcePasteAsPlainText'])) {
- $settings['ForcePasteAsPlainText'] = $config['ForcePasteAsPlainText'];
- }
- if (isset($config['AutoDetectPasteFromWord'])) {
- $settings['AutoDetectPasteFromWord'] = $config['AutoDetectPasteFromWord'];
+ $check_if_set = array(
+ 'AutoDetectPasteFromWord',
+ 'ForcePasteAsPlainText',
+ 'FormatOutput',
+ 'FormatSource',
+ );
+ foreach ($check_if_set as $setting_name) {
+ if (isset($config[$setting_name])) {
+ $settings[$setting_name] = $config[$setting_name];
+ }
}
if (isset($config['css_setting'])) {
diff --git a/editors/tinymce.inc b/editors/tinymce.inc
index 3316aa2..2464985 100644
--- a/editors/tinymce.inc
+++ b/editors/tinymce.inc
@@ -138,14 +138,21 @@ function wysiwyg_tinymce_settings_form(&$form, &$form_state) {
$settings += array(
'apply_source_formatting' => FALSE,
// Also available, but buggy in TinyMCE 2.x: blockquote,code,dt,dd,samp.
- 'theme_advanced_blockformats' => 'p,address,pre,h2,h3,h4,h5,h6,div',
'convert_fonts_to_spans' => TRUE,
'paste_auto_cleanup_on_paste' => TRUE,
- 'theme_advanced_styles' => '',
- 'theme_advanced_statusbar_location' => 'bottom',
+ 'paste_convert_middot_lists' => TRUE,
+ 'paste_max_consecutive_linebreaks' => 2,
+ 'paste_retain_style_properties' => 'none',
+ 'paste_remove_styles' => TRUE,
+ 'paste_remove_styles_if_webkit' => TRUE,
+ 'paste_strip_class_attributes' => 'mso',
+ 'paste_text_linebreaktype' => 'combined',
'preformatted' => FALSE,
'remove_linebreaks' => TRUE,
+ 'theme_advanced_blockformats' => 'p,address,pre,h2,h3,h4,h5,h6,div',
'theme_advanced_resizing' => TRUE,
+ 'theme_advanced_statusbar_location' => 'bottom',
+ 'theme_advanced_styles' => '',
'theme_advanced_toolbar_align' => 'left',
'theme_advanced_toolbar_location' => 'top',
'verify_html' => TRUE,
@@ -250,17 +257,138 @@ function wysiwyg_tinymce_settings_form(&$form, &$form_state) {
$form['paste'] = array(
'#type' => 'fieldset',
'#title' => t('Paste plugin'),
- '#description' => t('Settings for the paste plugin.'),
+ '#description' => t('Settings for the @plugin plugin.', array('@plugin' => 'paste', '@url' => url('http://www.tinymce.com/wiki.php/Plugin3x:paste'))),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#group' => 'advanced',
);
+
$form['paste']['paste_auto_cleanup_on_paste'] = array(
'#type' => 'checkbox',
'#title' => t('Process contents on paste'),
'#default_value' => !empty($settings['paste_auto_cleanup_on_paste']),
'#return_value' => 1,
- '#description' => t('If enabled, contents will be automatically processed when you paste using Ctrl+V or similar methods. Cleaning up contents from MS Word or pasting as plain text will not work without this.') . ' ' . t('Uses the @setting setting internally.', array('@setting' => 'paste_auto_cleanup_on_paste', '@url' => url('http://www.tinymce.com/wiki.php/Plugin3x:paste'))),
+ '#description' => t('If enabled, contents will be automatically processed when you paste using Ctrl+V or similar methods. Cleaning up contents from MS Word or pasting as plain text will not work without this.'),
+ );
+
+ $form['paste']['paste_block_drop'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Block drag/drop'),
+ '#default_value' => !empty($settings['paste_block_drop']),
+ '#return_value' => 1,
+ '#description' => t('If enabled, blocks drag/drop from/to the editor and inside it.'),
+ );
+
+ $form['paste']['paste_retain_style_properties'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Retain style properties'),
+ '#default_value' => $settings['paste_retain_style_properties'],
+ '#description' => t('Comma separated list of style properties to retain during the paste operation from Word. For example: "font-size,color". If you want to remove all style properties use an empty string "" or "none". If you want to keep all style properties, use "all" or "*".'),
+ );
+
+ $form['paste']['paste_strip_class_attributes'] = array(
+ '#type' => 'select',
+ '#title' => t('Strip class attributes'),
+ '#options' => array(
+ 'none' => t('None'),
+ 'all' => t('All'),
+ 'mso' => t('MS Office'),
+ ),
+ '#default_value' => $settings['paste_strip_class_attributes'],
+ '#description' => t('Enables you to strip the class attributes when pasted.'),
+ );
+
+ $form['paste']['paste_remove_spans'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Remove spans'),
+ '#default_value' => !empty($settings['paste_remove_spans']),
+ '#return_value' => 1,
+ '#description' => t('If enabled, removes all span elements when pasting.'),
+ );
+
+ $form['paste']['paste_remove_styles'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Remove styles'),
+ '#default_value' => !empty($settings['paste_remove_styles']),
+ '#return_value' => 1,
+ '#description' => t('If enabled, removes all style information when pasting, regardless of browser type. Pasting from Word 2000 will cause TinyMCE to error.'),
+ );
+
+ $form['paste']['paste_remove_styles_if_webkit'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Remove styles in WebKit'),
+ '#default_value' => !empty($settings['paste_remove_styles_if_webkit']),
+ '#return_value' => 1,
+ '#description' => t('If enabled, removes all style information when pasting in WebKit since it has a serious paste bug.'),
+ );
+
+ $form['paste']['paste_convert_middot_lists'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Convert Word lists'),
+ '#default_value' => !empty($settings['paste_convert_middot_lists']),
+ '#return_value' => 1,
+ '#description' => t('If enabled, the paste plugin tries to convert Word lists into semantic XHTML list elements.'),
+ );
+
+ $form['paste']['paste_convert_headers_to_strong'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Convert headers to strong'),
+ '#default_value' => !empty($settings['paste_convert_headers_to_srong']),
+ '#return_value' => 1,
+ '#description' => t('If enabled, the paste plugin tries to convert Word headers to strong tags.'),
+ );
+
+ $form['paste']['paste_max_consecutive_linebreaks'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Max consecutive linebreaks'),
+ '#size' => 5,
+ '#maxlength' => '10',
+ '#default_value' => !empty($settings['paste_max_consecutive_linebreaks']),
+ '#description' => t('The maximum number of consecutive linebreaks to use.'),
+ );
+
+ $form['paste']['paste_text_use_dialog'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Use dialog'),
+ '#default_value' => !empty($settings['paste_text_use_dialog']),
+ '#return_value' => 1,
+ '#description' => t('If enabled, uses legacy mode for the Paste as Text button. Will use a dialog instead of treating the button as a toggle.'),
+ );
+
+ $form['paste']['paste_text_sticky'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Sticky "Paste text" button'),
+ '#default_value' => !empty($settings['paste_text_sticky']),
+ '#return_value' => 1,
+ '#description' => t('If enabled, keeps the "Paste text" button selected after pasting. Requires the "Paste text" button and "Process contents on paste" to be enabled.'),
+ );
+
+ $form['paste']['paste_text_sticky_default'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Paste as plain text by default'),
+ '#default_value' => !empty($settings['paste_text_sticky_default']),
+ '#return_value' => 1,
+ '#description' => t('If enabled, the "Paste text" button is selected when the editor starts. Requires the "Paste text" button and "Process contents on paste" to be enabled.'),
+ );
+
+ $form['paste']['paste_text_notifyalways'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Always notify when pasting plain text'),
+ '#default_value' => !empty($settings['paste_text_notifyalways']),
+ '#return_value' => 1,
+ '#description' => t('If enabled, users will be notified each time plain text pasting mode is enabled.'),
+ );
+
+ $form['paste']['paste_text_linebreaktype'] = array(
+ '#type' => 'select',
+ '#title' => t('Linebreak type'),
+ '#options' => array(
+ 'combined' => t('Combined'),
+ 'p' => t('
'),
+ 'br' => t('
'),
+ ),
+ '#default_value' => $settings['paste_text_linebreaktype'],
+ '#description' => t('Converts plain text linebreaks to br or p elements.'),
);
}
@@ -346,6 +474,20 @@ function wysiwyg_tinymce_settings($editor, $config, $theme) {
'convert_fonts_to_spans',
'language',
'paste_auto_cleanup_on_paste',
+ 'paste_block_drop',
+ 'paste_convert_middot_lists',
+ 'paste_convert_headers_to_strong',
+ 'paste_max_consecutive_linebreaks',
+ 'paste_remove_spans',
+ 'paste_remove_styles',
+ 'paste_remove_styles_if_webkit',
+ 'paste_retain_style_properties',
+ 'paste_strip_class_attributes',
+ 'paste_text_linebreaktype',
+ 'paste_text_notifyalways',
+ 'paste_text_use_dialog',
+ 'paste_text_sticky',
+ 'paste_text_sticky_default',
'preformatted',
'remove_linebreaks',
'theme_advanced_blockformats',
@@ -355,6 +497,7 @@ function wysiwyg_tinymce_settings($editor, $config, $theme) {
$settings[$setting_name] = $config[$setting_name];
}
}
+
if (isset($config['verify_html'])) {
// TinyMCE performs a type-agnostic comparison on this particular setting.
$settings['verify_html'] = (bool) $config['verify_html'];