Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • issue/ckeditor5_plugin_pack-3446546
  • project/ckeditor5_plugin_pack
  • issue/ckeditor5_plugin_pack-3443601
  • issue/ckeditor5_plugin_pack-3447365
  • issue/ckeditor5_plugin_pack-3459095
  • issue/ckeditor5_plugin_pack-3449245
  • issue/ckeditor5_plugin_pack-3453170
  • issue/ckeditor5_plugin_pack-3459285
  • issue/ckeditor5_plugin_pack-3461841
  • issue/ckeditor5_plugin_pack-3456402
  • issue/ckeditor5_plugin_pack-3457362
  • issue/ckeditor5_plugin_pack-3469035
  • issue/ckeditor5_plugin_pack-3468926
  • issue/ckeditor5_plugin_pack-3476936
  • issue/ckeditor5_plugin_pack-3478108
  • issue/ckeditor5_plugin_pack-3469207
  • issue/ckeditor5_plugin_pack-3472777
  • issue/ckeditor5_plugin_pack-3484613
  • issue/ckeditor5_plugin_pack-3477626
  • issue/ckeditor5_plugin_pack-3491958
  • issue/ckeditor5_plugin_pack-3472711
  • issue/ckeditor5_plugin_pack-3494274
22 results
Show changes
Commits on Source (4)
......@@ -43,6 +43,7 @@ ckeditor5_plugin_pack_font__font_size:
class: Drupal\ckeditor5_plugin_pack_font\Plugin\CKEditor5Plugin\FontSize
elements:
- <span>
- <span class>
toolbar_items:
fontSize:
label: Font size
......
......@@ -22,3 +22,6 @@ ckeditor5.plugin.ckeditor5_plugin_pack_font__font_color:
use_default_colors:
type: boolean
label: Use default colors
use_colorpicker:
type: boolean
label: Use colorpickers
......@@ -32,6 +32,7 @@ class FontColor extends CKEditor5PluginDefault implements CKEditor5PluginConfigu
return [
'colors' => [],
'use_default_colors' => TRUE,
'use_colorpicker' => TRUE,
];
}
......@@ -46,6 +47,14 @@ class FontColor extends CKEditor5PluginDefault implements CKEditor5PluginConfigu
'#description' => $this->t('Default CKEditor5 colors will be available with custom added colors.'),
'#default_value' => $this->configuration['use_default_colors'] ?? TRUE,
];
$form['use_colorpicker'] = [
'#type' => 'checkbox',
'#title' => $this->t('Use CKEditor5 color picker'),
'#description' => $this->t('Allow editors to define their own colors'),
'#default_value' => $this->configuration['use_colorpicker'] ?? TRUE,
];
$form['custom_colors_wrapper'] = [
'#type' => 'fieldset',
'#id' => 'custom-colors-wrapper',
......@@ -176,6 +185,11 @@ class FontColor extends CKEditor5PluginDefault implements CKEditor5PluginConfigu
}
}
if (empty($customColors) && empty($values['use_default_colors'])) {
$element = $form['use_colorpicker'];
$form_state->setError($element, $this->t('Use CKEditor5 default colors or add custom colors to disable the color picker'));
}
}
/**
......@@ -185,6 +199,7 @@ class FontColor extends CKEditor5PluginDefault implements CKEditor5PluginConfigu
$values = $form_state->cleanValues()->getValues();
$this->configuration['colors'] = $values['custom_colors_wrapper'] ?? [];
$this->configuration['use_default_colors'] = (bool) $values['use_default_colors'];
$this->configuration['use_colorpicker'] = (bool) $values['use_colorpicker'];
}
/**
......@@ -192,6 +207,7 @@ class FontColor extends CKEditor5PluginDefault implements CKEditor5PluginConfigu
*/
public function getDynamicPluginConfig(array $static_plugin_config, EditorInterface $editor): array {
$colors = $this->configuration['colors'];
$use_colorpicker = $this->configuration['use_colorpicker'];
$fontColors = array_filter($colors, fn($color) => !empty($color['type']['font']));
$backgroundColors = array_filter($colors, fn($color) => !empty($color['type']['background']));
......@@ -210,7 +226,13 @@ class FontColor extends CKEditor5PluginDefault implements CKEditor5PluginConfigu
$static_plugin_config['fontBackgroundColor']['colors'] = array_values($backgroundColors);
}
$static_plugin_config['fontColor']['colorPicker']['format'] = 'hex';
if ($use_colorpicker) {
$static_plugin_config['fontColor']['colorPicker']['format'] = 'hex';
}
else {
$static_plugin_config['fontColor']['colorPicker'] = FALSE;
$static_plugin_config['fontBackgroundColor']['colorPicker'] = FALSE;
}
return $static_plugin_config;
}
......
......@@ -280,7 +280,7 @@ class Highlight extends CKEditor5PluginDefault implements CKEditor5PluginConfigu
public function submitConfigurationForm(array &$form, FormStateInterface $form_state): void {
$values = $form_state->cleanValues()->getValues();
$this->configuration['options'] = $values['custom_marker_wrapper'] ?? [];
$this->configuration['use_default_markers'] = $values['use_default_markers'] ?? TRUE;
$this->configuration['use_default_markers'] = (bool) $values['use_default_markers'];
}
/**
......
......@@ -62,7 +62,7 @@ class Template extends CKEditor5PluginDefault implements CKEditor5PluginInterfac
if ($definitions) {
$static_plugin_config[$plugin]['definitions'] = $definitions;
}
$static_plugin_config['licenseKey'] = 'mvjCLVz5pGxH8MTs8i7JeAe1NRFhSje+KTnvnv+MNvIFS/H2KaXFCAHbGdmv5Tt5Zc+vWE/714QzFE2qSvJuIB4cFKpVEOQ+sUsK8FuAjTsgn26GXvFc49LJCZBdyUFpbS1Yh075A8Co0NNufa7JZAKvhfUpHpkorj75V7+EdblTVB8H14PcQDk0CJ60bng0i/Mdh8GA4SE1Ox1OLg/LisJif2HJ82eSFxAeVlg94bvYWzGkNWfPa+oEYo4Mzjo=';
$static_plugin_config['licenseKey'] = 'ZmlrcG1PM0RWMUU2Z2hvSEQ4eWViVEswTkxBRkFoWUxqUEpsS1JwT2o2YnhNREJvTmNPekE1TmRxL2VJa0I2OUVJZDM2ajF0WVIrWFRUY0tPZERYanoxdnRJUjljV3RkR0RhTHFSV3dQVkJtMzNLdjJNWWpVVmlSQ0pKcjVuUWpJaWpYNGhqTzYxZ0ZKbzIyVkNqRWQweEtMUXJxSzU2K1dFMGtSYVNVeXVja1FxNGtLZFJ5R3ZaSFd2REN1aWFaQmNFRUhzZUtTR01SV1Ira2NUR29iTmJ1Vi9IUFMxWWxHRkFtN3F6T0VLTnBqd1dNTTQ3V1lFVGUwSmI4bXBJPS1NakF5TlRFeE1UTT0=';
return $static_plugin_config;
}
......