-
Notifications
You must be signed in to change notification settings - Fork 4.3k
[SE-3381] Allows adding new tinymce plugins through platform configuration #25695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ormsbee
merged 1 commit into
openedx:master
from
open-craft:nizar/tinymce-easy-plugin-modification
Jan 11, 2021
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,65 @@ | ||
| TinyMCE (Visual Text/HTML Editor) Plugins | ||
| ----------------------------------------- | ||
|
|
||
| The flexibility of the TinyMCE Visual Text and HTML editor makes it possible to configure and extend the editor using different plugins. In order to make use of that modularity in Studio, you'll need to follow two different steps. | ||
|
|
||
| Installing Plugins | ||
| ================== | ||
|
|
||
| Initially, we'll need to specify which plugins need to install so that they can be bundled with the static assets. | ||
|
|
||
| There's a decent `guide on installing the plugins through the edX configuration`_, specifically using the ``TINYMCE_ADDITIONAL_PLUGINS_LIST`` configuration variable. | ||
|
|
||
| Enabling Plugins | ||
| ================ | ||
|
|
||
| Enabling the plugins requires adding a Studio environment setting which the JavaScript code can access, ``JS_ENV_EXTRA_CONFIG``. It is simply a dictionary which would contain different extra JavaScript configurations. | ||
|
|
||
| The extra JavaScript configuration that's responsible for enabling TinyMCE plugins is ``TINYMCE_ADDITIONAL_PLUGINS``. This is a list of different TinyMCE plugins which you would want to enable. | ||
|
|
||
| Each TinyMCE plugin has the following attributes. | ||
|
|
||
| .. list-table:: | ||
| :header-rows: 1 | ||
| :widths: 15 10 75 | ||
|
|
||
| * - attribute | ||
| - type | ||
| - description | ||
| * - ``name`` | ||
| - string | ||
| - The name of the TinyMCE plugin which would be included in the editor's list of plugins. | ||
| * - ``toolbar`` | ||
| - boolean | ||
| - Indicates whether this plugin should be displayed in the toolbar or not. | ||
| * - ``extra_settings`` | ||
| - object | ||
| - Specifies the extra plugin settings that need to be added to the TinyMCE editor's configuration. | ||
|
|
||
| Here's an example: | ||
|
|
||
| .. code:: yaml | ||
|
|
||
| EDXAPP_CMS_ENV_EXTRA: | ||
| JS_ENV_EXTRA_CONFIG: | ||
| TINYMCE_ADDITIONAL_PLUGINS: | ||
| - name: adsklink | ||
| toolbar: true | ||
| extra_settings: | ||
| linktypes: | ||
| - Download | ||
| - Offer | ||
| filetypes: | ||
| - ZIP | ||
| - Video | ||
| - Design | ||
| orientations: | ||
| - Vertical | ||
| - Horizontal | ||
| styles: | ||
| - Primary | ||
| - Normal | ||
| - Secondary | ||
|
|
||
| .. _guide on installing the plugins through the edX configuration: https://github.com/edx/configuration/blob/master/playbooks/roles/tinymce_plugins/README.rst |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.