-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2071 from vrk-kpa/AV-2017_update_ckeditor_and_cus…
…tom_plugins AV-2017: Reimplement our custom CKEditor plugins for CKEditor5
- Loading branch information
Showing
64 changed files
with
12,117 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
## This module is modified from the [CKEditor 5 plugin development starter template](https://git.drupalcode.org/project/ckeditor5_dev/-/tree/1.0.3/ckeditor5_plugin_starter_template) | ||
|
||
To facilitate easier development of modules that provide CKEditor 5 plugins, | ||
developers may copy the contents of this directory to the root of their module | ||
directory. This provides the basic build tools and directory structure for | ||
creating CKEditor 5 plugins within a contributed module, as well as a basic | ||
working plugin based on the [CKEditor 5 block plugin tutorial](https://ckeditor.com/docs/ckeditor5/latest/framework/guides/tutorials/implementing-a-block-widget.html) | ||
but with additional documentation and minor changes for better integration | ||
with Drupal. | ||
|
||
When Drupal updates to use newer versions of CKEditor 5, it may be necessary to | ||
update any files copied from here to your module. | ||
|
||
Plugin source should be added to `src/{pluginNameDirectory}` and the build tools expect this directory to include an | ||
`index.js` file that exports one or more CKEditor 5 plugins. | ||
|
||
In the module directory, run `npm install` to set up the necessary assets. The | ||
initial run of `install` may take a few minutes, but subsequent builds will be | ||
faster. | ||
|
||
After installing dependencies, plugins can be built with `npm build`. | ||
They will be built to `js/{pluginNameDirectory}.js`. |
174 changes: 174 additions & 0 deletions
174
drupal/modules/avoindata-ckeditor5-plugins/avoindata_ckeditor5_plugins.ckeditor5.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
# Example from https://git.drupalcode.org/project/ckeditor5_dev/-/blob/1.0.3/ckeditor5_plugin_starter_template/MODULE_NAME.ckeditor5.yml | ||
# If using yml to configure plugins, rename this to {module_name}.ckeditor5.yml. | ||
# If using annotations, this file can be removed. | ||
# @see https://www.drupal.org/docs/drupal-apis/plugin-api/annotations-based-plugins | ||
# For information on using annotations to define plugins. | ||
# @see the CKEditor 5 module's README.md for more details regarding plugin | ||
# configuration options. | ||
# cSpell:ignore simplebox demobox | ||
|
||
#MODULE_NAME_demo_simplebox: | ||
# # Use the provider: property for this plugin to depend on another module. | ||
# | ||
# # Configuration that will be sent to CKEditor 5 JavaScript plugins. | ||
# ckeditor5: | ||
# plugins: | ||
# - demoPlugin.SimpleBox | ||
# # *Additional configuration properties* | ||
# # config: data sent to the constructor of any CKEditor 5 plugin | ||
# # editorPluginName: | ||
# # editorPluginProperty: editorPluginValue | ||
# | ||
# # Configuration that will be used directly by Drupal. | ||
# drupal: | ||
# label: Simple box demo | ||
# # The library loaded while using the editor. | ||
# library: MODULE_NAME/demobox | ||
# # The library loaded when configuring the text format using this plugin. | ||
# admin_library: MODULE_NAME/admin.demobox | ||
# toolbar_items: | ||
# # This should match the name of the corresponding plugin exported in the | ||
# # plugin's index.js. | ||
# simpleBox: | ||
# label: Simple box demo | ||
# # If the plugin does not provide elements, set this as | ||
# # `elements: false` | ||
# elements: | ||
# # Note that it necessary for elements to separately provide both the tag | ||
# # (f.e. `<h2>`) and the attribute being added to the tag | ||
# # (f.e. `<h2 class="simple-box-title">`). | ||
# - <h2> | ||
# - <h2 class="simple-box-title"> | ||
# - <div> | ||
# - <div class="simple-box-description"> | ||
# - <section> | ||
# - <section class="simple-box"> | ||
# # *Additional configuration properties* | ||
# # conditions: for setting additional criteria that must be met for the | ||
# # plugin to be active. | ||
# # class: Optional PHP class that makes it possible for the plugin to provide | ||
# # dynamic values, or a configuration UI. | ||
|
||
avoindata_ckeditor5_plugins_avoindataexternallink: | ||
ckeditor5: | ||
plugins: | ||
- avoindataExternalLink.AvoindataExternalLink | ||
config: | ||
link: | ||
decorators: | ||
isExternal: | ||
mode: manual | ||
label: Open in a new tab | ||
attributes: | ||
target: '_blank' | ||
aria-label: 'Leads to external site' | ||
classes: | ||
- 'external-link' | ||
drupal: | ||
label: Link | ||
library: avoindata_ckeditor5_plugins/avoindataExternalLink | ||
elements: | ||
- <a> | ||
- <a target="_blank"> | ||
- <a class="external-link"> | ||
- <a aria-label=""> | ||
- <i> | ||
- <i class="fas fa-external-link-alt"> | ||
|
||
avoindata_ckeditor5_plugins_avoindataexpander: | ||
ckeditor5: | ||
plugins: | ||
- avoindataExpander.AvoindataExpander | ||
drupal: | ||
label: Avoindata Expander | ||
library: avoindata_ckeditor5_plugins/avoindataExpander | ||
admin_library: avoindata_ckeditor5_plugins/toolbarIcons | ||
toolbar_items: | ||
avoindataExpander: | ||
label: Avoindata Expander | ||
elements: | ||
- <div> | ||
- <div class="avoindata-expander-header"> | ||
- <div class="avoindata-expander-title"> | ||
- <span> | ||
- <span class="icon-wrapper pull-right"> | ||
- <i> | ||
- <i class="fas fa-angle-down"> | ||
- <div class="avoindata-expander-content"> | ||
|
||
avoindata_ckeditor5_plugins_avoindatanote: | ||
ckeditor5: | ||
plugins: | ||
- avoindataNote.AvoindataNote | ||
drupal: | ||
label: Avoindata Note | ||
library: avoindata_ckeditor5_plugins/avoindataNote | ||
admin_library: avoindata_ckeditor5_plugins/toolbarIcons | ||
toolbar_items: | ||
avoindataNote: | ||
label: Avoindata Note | ||
elements: | ||
- <div> | ||
- <div class="avoindata-note"> | ||
- <div class="avoindata-note-header"> | ||
- <img> | ||
- <img class="avoindata-note-icon"> | ||
- <div class="avoindata-note-title"> | ||
- <div class="avoindata-note-content"> | ||
|
||
avoindata_ckeditor5_plugins_avoindatahint: | ||
ckeditor5: | ||
plugins: | ||
- avoindataHint.AvoindataHint | ||
drupal: | ||
label: Avoindata Hint | ||
library: avoindata_ckeditor5_plugins/avoindataHint | ||
admin_library: avoindata_ckeditor5_plugins/toolbarIcons | ||
toolbar_items: | ||
avoindataHint: | ||
label: Avoindata Hint | ||
elements: | ||
- <div> | ||
- <div class="avoindata-hint"> | ||
- <div class="avoindata-hint-header"> | ||
- <img> | ||
- <img class="avoindata-hint-icon"> | ||
- <div class="avoindata-hint-content"> | ||
|
||
avoindata_ckeditor5_plugins_avoindataexample: | ||
ckeditor5: | ||
plugins: | ||
- avoindataExample.AvoindataExample | ||
drupal: | ||
label: Avoindata Example | ||
library: avoindata_ckeditor5_plugins/avoindataExample | ||
admin_library: avoindata_ckeditor5_plugins/toolbarIcons | ||
toolbar_items: | ||
avoindataExample: | ||
label: Avoindata Example | ||
elements: | ||
- <div> | ||
- <div class="avoindata-example"> | ||
- <div class="avoindata-example-header"> | ||
- <div class="avoindata-example-title"> | ||
- <div class="avoindata-example-content"> | ||
|
||
avoindata_ckeditor5_plugins_avoindatasection: | ||
ckeditor5: | ||
plugins: | ||
- avoindataSection.AvoindataSection | ||
drupal: | ||
label: Avoindata Example | ||
library: avoindata_ckeditor5_plugins/avoindataSection | ||
admin_library: avoindata_ckeditor5_plugins/toolbarIcons | ||
toolbar_items: | ||
avoindataSection: | ||
label: Avoindata Section | ||
elements: | ||
- <div> | ||
- <div id> | ||
- <div class id> | ||
- <div class="avoindata-section"> | ||
- <div class="avoindata-section-id"> | ||
- <div class="avoindata-section-title"> | ||
- <div class="avoindata-section-content"> |
7 changes: 7 additions & 0 deletions
7
drupal/modules/avoindata-ckeditor5-plugins/avoindata_ckeditor5_plugins.info.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: Avoindata Drupal CKEditor5 plugins | ||
type: module | ||
description: Adds Expander, Note, Hint, Example and Section custom elements to CKEditor5. | ||
core_version_requirement: ^9 || ^10 | ||
package: Custom | ||
dependencies: | ||
- drupal:ckeditor5 |
62 changes: 62 additions & 0 deletions
62
drupal/modules/avoindata-ckeditor5-plugins/avoindata_ckeditor5_plugins.libraries.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# This adds the plugin JavaScript to the page. | ||
|
||
avoindataExternalLink: | ||
css: | ||
theme: | ||
css/styles.css: {} | ||
js: | ||
js/avoindataExternalLink.js: { preprocess: false, minified: true } | ||
dependencies: | ||
- core/ckeditor5 | ||
|
||
avoindataExpander: | ||
css: | ||
theme: | ||
css/styles.css: {} | ||
js: | ||
js/avoindataExpander.js: { preprocess: false, minified: false } | ||
dependencies: | ||
- core/ckeditor5 | ||
|
||
avoindataNote: | ||
css: | ||
theme: | ||
css/styles.css: {} | ||
js: | ||
js/avoindataNote.js: { preprocess: false, minified: false } | ||
dependencies: | ||
- core/ckeditor5 | ||
|
||
avoindataHint: | ||
css: | ||
theme: | ||
css/styles.css: {} | ||
js: | ||
js/avoindataHint.js: { preprocess: false, minified: false } | ||
dependencies: | ||
- core/ckeditor5 | ||
|
||
avoindataExample: | ||
css: | ||
theme: | ||
css/styles.css: {} | ||
js: | ||
js/avoindataExample.js: { preprocess: false, minified: false } | ||
dependencies: | ||
- core/ckeditor5 | ||
|
||
avoindataSection: | ||
css: | ||
theme: | ||
css/styles.css: {} | ||
js: | ||
js/avoindataSection.js: { preprocess: false, minified: false } | ||
dependencies: | ||
- core/ckeditor5 | ||
|
||
# Loaded in the text format configuration form to provide styling for the icon | ||
# used in toolbar config. | ||
toolbarIcons: | ||
css: | ||
theme: | ||
css/toolbar-icons.css: {} |
Oops, something went wrong.