diff --git a/core/modules/ckeditor/src/CKEditorPluginButtonsInterface.php b/core/modules/ckeditor/src/CKEditorPluginButtonsInterface.php index 11d142a..55912bb 100644 --- a/core/modules/ckeditor/src/CKEditorPluginButtonsInterface.php +++ b/core/modules/ckeditor/src/CKEditorPluginButtonsInterface.php @@ -48,6 +48,10 @@ * - internal_button: Identifier of internal button. * - image_internal_has_rtl: Flag indicating whether there's RTL version * available. + * - image_alternative: If this button does not render as an image, specify + * an HTML string representing the contents of this button. + * - image_alternative_rtl: Similar to image_alternative, but a + * right-to-left version. * - attributes: An array of HTML attributes which should be added to this * button when rendering the button in the administrative section for * assembling the toolbar. diff --git a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Internal.php b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Internal.php index e2d6e73..4e219ae 100644 --- a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Internal.php +++ b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Internal.php @@ -100,6 +100,7 @@ public function getConfig(Editor $editor) { 'resize_dir' => 'vertical', 'justifyClasses' => array('text-align-left', 'text-align-center', 'text-align-right', 'text-align-justify'), 'entities' => FALSE, + 'image_alternative' => '', ); // Add the allowedContent setting, which ensures CKEditor only allows tags diff --git a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/StylesCombo.php b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/StylesCombo.php index f2f9721..79dc2e4 100644 --- a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/StylesCombo.php +++ b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/StylesCombo.php @@ -62,6 +62,7 @@ public function getButtons() { 'button_text' => t('Styles'), 'internal_button' => 'styles', 'is_dropdown' => TRUE, + 'image_alternative' => '' . t('Styles') . '', ), ); } diff --git a/core/modules/ckeditor/src/Tests/CKEditorLanguageDirectionTest.php b/core/modules/ckeditor/src/Tests/CKEditorLanguageDirectionTest.php index 99999d4..53126e6 100644 --- a/core/modules/ckeditor/src/Tests/CKEditorLanguageDirectionTest.php +++ b/core/modules/ckeditor/src/Tests/CKEditorLanguageDirectionTest.php @@ -68,7 +68,8 @@ public function testLanguageDirectionChange() { $edit = array('site_default_language' => 'ar'); $this->drupalPostForm('admin/config/regional/settings', $edit, t('Save configuration')); - // Once the default language is changed, go to the tested text format configuration page. + // Once the default language is changed, go to the tested text format + // configuration page. $this->drupalGet('admin/config/content/formats/manage/full_html'); $this->assertPattern('|cke_rtl|', 'Correct language direction classes are being added.'); } diff --git a/core/modules/ckeditor/templates/ckeditor-settings-toolbar.html.twig b/core/modules/ckeditor/templates/ckeditor-settings-toolbar.html.twig index cdadccf..f9cd7ee 100644 --- a/core/modules/ckeditor/templates/ckeditor-settings-toolbar.html.twig +++ b/core/modules/ckeditor/templates/ckeditor-settings-toolbar.html.twig @@ -3,12 +3,15 @@ * @file * Default theme implementation for the CKEditor settings toolbar. * - * This template uses Twig macro to create the CKEditor buttons. + * This template uses Twig macro to generate the HTML for internal buttons + * (those included with CKEditor) - we can't use regular image URLs here because + * these images are part of a sprite. By generating the correct HTML, we can use + * the images in that sprite, just like actual CKEditor instances. * @see http://twig.sensiolabs.org/doc/tags/macro.html * * Available variables: * - button: A list containing the CKEditor buttons. - * - internal_button: Indentifier of internal button. + * - internal_button: Identifier of internal button. * - is_dropdown: Flag for showing a dropdown type button (Optional). If the * value is true then a dropdown button is generated. * - is_separator: Flag for showing a separator "button" (Optional). If the