MDL-76474 editor_tiny: Implement placeholder selector list
We created a list of placeholder selectors in placeholderSelectors option. The purpose of this list is to indicate the contents that are only shown in the editor and not to the users, by that way, we can decide to apply or not to apply rules, styles, etc... to these contents
This commit is contained in:
@@ -183,10 +183,24 @@ class editor extends \texteditor {
|
||||
'available' => get_string_manager()->get_list_of_languages()
|
||||
],
|
||||
|
||||
// Placeholder selectors.
|
||||
// Some contents (Example: placeholder elements) are only shown in the editor, and not to users. It is unrelated to the
|
||||
// real display. We created a list of placeholder selectors, so we can decide to or not to apply rules, styles... to
|
||||
// these elements.
|
||||
// The default of this list will be empty.
|
||||
// Other plugins can register their placeholder elements to placeholderSelectors list by calling
|
||||
// editor_tiny/options::registerPlaceholderSelectors.
|
||||
'placeholderSelectors' => [],
|
||||
|
||||
// Plugin configuration.
|
||||
'plugins' => $this->manager->get_plugin_configuration($context, $options, $fpoptions, $this),
|
||||
];
|
||||
|
||||
if (defined('BEHAT_SITE_RUNNING') && BEHAT_SITE_RUNNING) {
|
||||
// Add sample selectors for Behat test.
|
||||
$config->placeholderSelectors = ['.behat-tinymce-placeholder'];
|
||||
}
|
||||
|
||||
foreach ($fpoptions as $fp) {
|
||||
// Guess the draftitemid for the editor.
|
||||
// Note: This is the best we can do at the moment.
|
||||
|
||||
Reference in New Issue
Block a user