Skip to content

Commit

Permalink
Merge pull request #48 from open-y-subprojects/ckeditor5
Browse files Browse the repository at this point in the history
feat: Enable CKEditor5. No Upgrade Path
  • Loading branch information
podarok authored Jul 3, 2023
2 parents 4de616f + 57c9bf8 commit 5209baa
Show file tree
Hide file tree
Showing 5 changed files with 181 additions and 56 deletions.
8 changes: 8 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,16 @@
"drupal/core": "^9.5 || ^10",
"drupal/rabbit_hole": "^1.0@beta || ^1.0",
"drupal/ctools": ">=3.13",
"drupal/ckeditor5_font": "^1.1@beta",
"drupal/google_analytics": "^4.0.2"
},
"extra": {
"patches": {
"drupal/ckeditor5_font": {
"Issue #3350333: TypeError: array_filter(): Argument #1 ($array) must be of type array.": "https://www.drupal.org/files/issues/2023-04-21/3350333-5.patch"
}
}
},
"license": "GPL-2.0+",
"minimum-stability": "dev"
}
107 changes: 55 additions & 52 deletions openy_editor/config/install/editor.editor.full_html.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,63 +4,66 @@ dependencies:
config:
- filter.format.full_html
module:
- ckeditor
- ckeditor5
format: full_html
editor: ckeditor
editor: ckeditor5
settings:
toolbar:
rows:
-
-
name: Formatting
items:
- Bold
- Italic
- Underline
- Strike
- JustifyLeft
- JustifyCenter
- JustifyRight
- JustifyBlock
- TextColor
- BGColor
- Outdent
- Indent
- Format
-
name: Links
items:
- DrupalLink
- DrupalUnlink
-
name: Lists
items:
- BulletedList
- NumberedList
-
name: Media
items:
- Blockquote
- embed_video
- embed_local_video
- embed_image
- embed_document
-
name: Tools
items:
- Table
- Source
- SpecialChar
- Maximize
- Language
- btbutton
items:
- bold
- italic
- underline
- strikethrough
- alignment
- fontColor
- fontBackgroundColor
- outdent
- indent
- heading
- '|'
- link
- '|'
- bulletedList
- numberedList
- '|'
- blockQuote
- drupalMedia
- '|'
- insertTable
- sourceEditing
- specialCharacters
- textPartLanguage
plugins:
language:
ckeditor5_alignment:
enabled_alignments:
- center
- justify
- left
- right
ckeditor5_heading:
enabled_headings:
- heading2
- heading3
- heading4
- heading5
- heading6
ckeditor5_language:
language_list: un
stylescombo:
styles: ''
colorbutton:
colors: '5c2e91,92278f,c6168d,0060af,0089d0,00aeef,006b6b,01a490,20bdbe,dd5828,f47920,fcaf17,a92b31,ed1c24,f15922'
ckeditor5_list:
reversed: true
startIndex: true
ckeditor5_sourceEditing:
allowed_tags: { }
editor_advanced_link_link:
enabled_attributes:
- aria-label
- class
- id
- rel
- target
- title
media_media:
allow_view_mode_override: false
image_upload:
status: false
scheme: public
Expand Down
95 changes: 94 additions & 1 deletion openy_editor/config/install/filter.format.full_html.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ langcode: en
status: true
dependencies:
module:
- blazy
- editor
- entity_embed
- media
- slick
- token_filter
name: 'Full HTML'
format: full_html
Expand Down Expand Up @@ -78,4 +81,94 @@ filters:
provider: token_filter
status: true
weight: -47
settings: { }
settings:
replace_empty: '0'
blazy_filter:
id: blazy_filter
provider: blazy
status: false
weight: 3
settings:
media_switch: ''
hybrid_style: ''
box_style: ''
box_caption: ''
filter_tags:
img: img
iframe: iframe
use_data_uri: '0'
media_embed:
id: media_embed
provider: media
status: true
weight: 100
settings:
default_view_mode: default
allowed_view_modes:
default: default
article_image: article_image
calc_preview: calc_preview
calc_summary: calc_summary
embedded_full: embedded_full
embedded_half: embedded_half
embedded_link: embedded_link
event_image: event_image
featured: featured
full: full
full_without_blazy: full_without_blazy
half_without_blazy: half_without_blazy
icon: icon
media_library: media_library
node_blog: node_blog
node_blog_teaser: node_blog_teaser
node_news: node_news
node_news_teaser: node_news_teaser
node_program_header: node_program_header
node_program_subcategory_teaser: node_program_subcategory_teaser
prgf_banner: prgf_banner
prgf_gallery: prgf_gallery
prgf_small_banner: prgf_small_banner
prgf_teaser: prgf_teaser
related_content: related_content
slick: slick
teaser: teaser
teaser_image: teaser_image
thumbnail_for_preview: thumbnail_for_preview
token: token
allowed_media_types:
document: document
image: image
video: video
video_local: video_local
slick_filter:
id: slick_filter
provider: slick
status: false
weight: 4
settings:
optionset: default
layout: ''
skin: ''
background: false
loading: ''
preload: false
responsive_image_style: ''
image_style: ''
media_switch: ''
ratio: ''
thumbnail_style: ''
overridables:
arrows: '0'
autoplay: '0'
dots: '0'
draggable: '0'
infinite: '0'
mouseWheel: '0'
randomize: '0'
variableWidth: '0'
optionset_thumbnail: ''
skin_thumbnail: ''
thumbnail_caption: ''
thumbnail_effect: ''
thumbnail_position: ''
override: false
10 changes: 7 additions & 3 deletions openy_editor/openy_editor.info.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
name: Open Y Editor
description: Stores an editor and text filters configuration.
type: module
core_version_requirement: ^8.8 || ^9 || ^10
core_version_requirement: ^9 || ^10
package: Open Y
version: 8.x-1.1
version: 2.0.0
dependencies:
- colorbutton:colorbutton
- ckeditor_bootstrap_buttons:ckeditor_bootstrap_buttons
- drupal:ckeditor
- drupal:ckeditor5
- drupal:ckeditor5_font
- drupal:editor
- ckeditor_font:ckeditor_font
- drupal:filter
- entity_embed:entity_embed
- token_filter:token_filter
- drupal:blazy
- drupal:media
- drupal:slick
17 changes: 17 additions & 0 deletions openy_editor/openy_editor.install
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,20 @@ function openy_editor_update_8004() {
$active_config->set('settings.plugins', $active_config->get('settings.plugins'));
$active_config->save(TRUE);
}

/**
* Add the fontColor and the fontBackgroundColor buttons for CKEditor 5.
*/
function openy_editor_update_8005() {
$active_config = \Drupal::configFactory()->getEditable('editor.editor.full_html');
$settings = $active_config->get('settings');
if (empty($settings['toolbar']['rows'])) {
return;
}
// Place these buttons in a specific place.
array_splice($settings['toolbar']['items'], 3, 0, 'fontColor');
array_splice($settings['toolbar']['items'], 4, 0, 'fontBackgroundColor');
$active_config->set('settings', $settings);
$active_config->set('settings.plugins', $active_config->get('settings.plugins'));
$active_config->save(TRUE);
}

0 comments on commit 5209baa

Please sign in to comment.