Skip to content

Commit

Permalink
Use the new option names (#21)
Browse files Browse the repository at this point in the history
* Use the new option names

* Update KnownButtons.php

* Update ToolbarPresets.php
  • Loading branch information
dgrammatiko authored and laoneo committed Aug 29, 2022
1 parent d702f76 commit 0ce9557
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 109 deletions.
32 changes: 16 additions & 16 deletions plugins/editors/tinymce/src/PluginTraits/DisplayTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ public function onDisplay(
}

// Convert pt to px in dropdown
$scriptOptions['fontsize_formats'] = '8px 10px 12px 14px 18px 24px 36px';
$scriptOptions['font_size_formats'] = '8px 10px 12px 14px 18px 24px 36px';

// select the languages for the "language of parts" menu
if (isset($extraOptions->content_languages) && $extraOptions->content_languages)
Expand Down Expand Up @@ -444,32 +444,32 @@ public function onDisplay(
$scriptOptions = array_merge(
$scriptOptions,
[
'suffix' => JDEBUG ? '' : '.min',
'baseURL' => Uri::root(true) . '/media/vendor/tinymce',
'directionality' => $language->isRtl() ? 'rtl' : 'ltr',
'language' => $langPrefix,
'suffix' => JDEBUG ? '' : '.min',
'baseURL' => Uri::root(true) . '/media/vendor/tinymce',
'directionality' => $language->isRtl() ? 'rtl' : 'ltr',
'language' => $langPrefix,
'autosave_restore_when_empty' => false,
'skin' => $skin,
'theme' => $theme,
'schema' => 'html5',
'skin' => $skin,
'theme' => $theme,
'schema' => 'html5',

// Toolbars
'menubar' => empty($menubar) ? false : implode(' ', array_unique($menubar)),
'menubar' => empty($menubar) ? false : implode(' ', array_unique($menubar)),
'toolbar' => empty($toolbar) ? null : 'jxtdbuttons ' . implode(' ', $toolbar),

'plugins' => implode(',', array_unique($plugins)),
// Plugins
'plugins' => implode(',', array_unique($plugins)),

// Quickbars
'quickbars_image_toolbar' => false,
'quickbars_insert_toolbar' => false,
'quickbars_selection_toolbar' => 'bold italic underline | H2 H3 | link blockquote',

// Cleanup/Output
'browser_spellcheck' => true,
'entity_encoding' => $levelParams->get('entity_encoding', 'raw'),
'verify_html' => !$ignore_filter,
'paste_as_text' => (bool) $levelParams->get('paste_as_text', false),

'browser_spellcheck' => true,
'entity_encoding' => $levelParams->get('entity_encoding', 'raw'),
'verify_html' => !$ignore_filter,
'paste_as_text' => (bool) $levelParams->get('paste_as_text', false),
'valid_elements' => $valid_elements,
'extended_valid_elements' => implode(',', $elements),
'invalid_elements' => $invalid_elements,
Expand Down Expand Up @@ -522,7 +522,7 @@ public function onDisplay(
$scriptOptions['forced_root_block'] = 'p';
}

$scriptOptions['rel_list'] = [
$scriptOptions['link_rel_list'] = [
['title' => 'None', 'value' => ''],
['title' => 'Alternate', 'value' => 'alternate'],
['title' => 'Author', 'value' => 'author'],
Expand Down
58 changes: 29 additions & 29 deletions plugins/editors/tinymce/src/PluginTraits/KnownButtons.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ public static function getKnownButtons()
'italic' => ['label' => 'Italic'],
'underline' => ['label' => 'Underline'],
'strikethrough' => ['label' => 'Strikethrough'],
'styleselect' => ['label' => Text::_('PLG_TINY_TOOLBAR_BUTTON_STYLESELECT'), 'text' => 'Formats'],
'formatselect' => ['label' => Text::_('PLG_TINY_TOOLBAR_BUTTON_FORMATSELECT'), 'text' => 'Paragraph'],
'fontselect' => ['label' => Text::_('PLG_TINY_TOOLBAR_BUTTON_FONTSELECT'), 'text' => 'Font Family'],
'fontsizeselect' => ['label' => Text::_('PLG_TINY_TOOLBAR_BUTTON_FONTSIZESELECT'), 'text' => 'Font Sizes'],
'styles' => ['label' => Text::_('PLG_TINY_TOOLBAR_BUTTON_STYLESELECT'), 'text' => 'Formats'],
'blocks' => ['label' => Text::_('PLG_TINY_TOOLBAR_BUTTON_FORMATSELECT'), 'text' => 'Paragraph'],
'fontfamily' => ['label' => Text::_('PLG_TINY_TOOLBAR_BUTTON_FONTSELECT'), 'text' => 'Font Family'],
'fontsize' => ['label' => Text::_('PLG_TINY_TOOLBAR_BUTTON_FONTSIZESELECT'), 'text' => 'Font Sizes'],

'alignleft' => ['label' => 'Align left'],
'aligncenter' => ['label' => 'Align center'],
Expand Down Expand Up @@ -80,29 +80,29 @@ public static function getKnownButtons()

'language' => ['label' => 'Language'],

// Buttons from the plugins
'anchor' => ['label' => 'Anchor', 'plugin' => 'anchor'],
'hr' => ['label' => 'Horizontal line', 'plugin' => 'hr'],
'ltr' => ['label' => 'Left to right', 'plugin' => 'directionality'],
'rtl' => ['label' => 'Right to left', 'plugin' => 'directionality'],
'code' => ['label' => 'Source code', 'plugin' => 'code'],
'codesample' => ['label' => 'Insert/Edit code sample', 'plugin' => 'codesample'],
'table' => ['label' => 'Table', 'plugin' => 'table'],
'charmap' => ['label' => 'Special character', 'plugin' => 'charmap'],
'visualchars' => ['label' => 'Show invisible characters', 'plugin' => 'visualchars'],
'visualblocks' => ['label' => 'Show blocks', 'plugin' => 'visualblocks'],
'nonbreaking' => ['label' => 'Nonbreaking space', 'plugin' => 'nonbreaking'],
'emoticons' => ['label' => 'Emoticons', 'plugin' => 'emoticons'],
'media' => ['label' => 'Insert/edit video', 'plugin' => 'media'],
'image' => ['label' => 'Insert/edit image', 'plugin' => 'image'],
'pagebreak' => ['label' => 'Page break', 'plugin' => 'pagebreak'],
'print' => ['label' => 'Print', 'plugin' => 'print'],
'preview' => ['label' => 'Preview', 'plugin' => 'preview'],
'fullscreen' => ['label' => 'Fullscreen', 'plugin' => 'fullscreen'],
'template' => ['label' => 'Insert template', 'plugin' => 'template'],
'searchreplace' => ['label' => 'Find and replace', 'plugin' => 'searchreplace'],
'insertdatetime' => ['label' => 'Insert date/time', 'plugin' => 'insertdatetime'],
'help' => ['label' => 'Help', 'plugin' => 'help'],
];
}
// Buttons from the plugins
'anchor' => ['label' => 'Anchor', 'plugin' => 'anchor'],
'hr' => ['label' => 'Horizontal line', 'plugin' => 'hr'],
'ltr' => ['label' => 'Left to right', 'plugin' => 'directionality'],
'rtl' => ['label' => 'Right to left', 'plugin' => 'directionality'],
'code' => ['label' => 'Source code', 'plugin' => 'code'],
'codesample' => ['label' => 'Insert/Edit code sample', 'plugin' => 'codesample'],
'table' => ['label' => 'Table', 'plugin' => 'table'],
'charmap' => ['label' => 'Special character', 'plugin' => 'charmap'],
'visualchars' => ['label' => 'Show invisible characters', 'plugin' => 'visualchars'],
'visualblocks' => ['label' => 'Show blocks', 'plugin' => 'visualblocks'],
'nonbreaking' => ['label' => 'Nonbreaking space', 'plugin' => 'nonbreaking'],
'emoticons' => ['label' => 'Emoticons', 'plugin' => 'emoticons'],
'media' => ['label' => 'Insert/edit video', 'plugin' => 'media'],
'image' => ['label' => 'Insert/edit image', 'plugin' => 'image'],
'pagebreak' => ['label' => 'Page break', 'plugin' => 'pagebreak'],
'print' => ['label' => 'Print', 'plugin' => 'print'],
'preview' => ['label' => 'Preview', 'plugin' => 'preview'],
'fullscreen' => ['label' => 'Fullscreen', 'plugin' => 'fullscreen'],
'template' => ['label' => 'Insert template', 'plugin' => 'template'],
'searchreplace' => ['label' => 'Find and replace', 'plugin' => 'searchreplace'],
'insertdatetime' => ['label' => 'Insert date/time', 'plugin' => 'insertdatetime'],
'help' => ['label' => 'Help', 'plugin' => 'help'],
];
}
}
128 changes: 64 additions & 64 deletions plugins/editors/tinymce/src/PluginTraits/ToolbarPresets.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,68 +21,68 @@
*/
trait ToolbarPresets
{
/**
* Return toolbar presets
*
* @return array
*
* @since 4.1.0
*/
public static function getToolbarPreset()
{
return [
'simple' => [
'menu' => [],
'toolbar1' => [
'bold', 'underline', 'strikethrough', '|',
'undo', 'redo', '|',
'bullist', 'numlist', '|',
'pastetext', 'jxtdbuttons',
],
'toolbar2' => [],
],
'medium' => [
'menu' => ['edit', 'insert', 'view', 'format', 'table', 'tools', 'help'],
'toolbar1' => [
'bold', 'italic', 'underline', 'strikethrough', '|',
'alignleft', 'aligncenter', 'alignright', 'alignjustify', '|',
'formatselect', '|',
'bullist', 'numlist', '|',
'outdent', 'indent', '|',
'undo', 'redo', '|',
'link', 'unlink', 'anchor', 'code', '|',
'hr', 'table', '|',
'subscript', 'superscript', '|',
'charmap', 'pastetext', 'preview', 'jxtdbuttons',
],
'toolbar2' => [],
],
'advanced' => [
'menu' => ['edit', 'insert', 'view', 'format', 'table', 'tools', 'help'],
'toolbar1' => [
'bold', 'italic', 'underline', 'strikethrough', '|',
'alignleft', 'aligncenter', 'alignright', 'alignjustify', '|',
'lineheight', '|',
'styleselect', '|',
'formatselect', 'fontselect', 'fontsizeselect', '|',
'searchreplace', '|',
'bullist', 'numlist', '|',
'outdent', 'indent', '|',
'undo', 'redo', '|',
'link', 'unlink', 'anchor', 'image', '|',
'code', '|',
'forecolor', 'backcolor', '|',
'fullscreen', '|',
'table', '|',
'subscript', 'superscript', '|',
'charmap', 'emoticons', 'media', 'hr', 'ltr', 'rtl', '|',
'cut', 'copy', 'paste', 'pastetext', '|',
'visualchars', 'visualblocks', 'nonbreaking', 'blockquote', 'template', '|',
'print', 'preview', 'codesample', 'insertdatetime', 'removeformat', 'jxtdbuttons',
'language',
],
'toolbar2' => [],
]
];
}
/**
* Return toolbar presets
*
* @return array
*
* @since 4.1.0
*/
public static function getToolbarPreset()
{
return [
'simple' => [
'menu' => [],
'toolbar1' => [
'bold', 'underline', 'strikethrough', '|',
'undo', 'redo', '|',
'bullist', 'numlist', '|',
'pastetext', 'jxtdbuttons',
],
'toolbar2' => [],
],
'medium' => [
'menu' => ['edit', 'insert', 'view', 'format', 'table', 'tools', 'help'],
'toolbar1' => [
'bold', 'italic', 'underline', 'strikethrough', '|',
'alignleft', 'aligncenter', 'alignright', 'alignjustify', '|',
'formatselect', '|',
'bullist', 'numlist', '|',
'outdent', 'indent', '|',
'undo', 'redo', '|',
'link', 'unlink', 'anchor', 'code', '|',
'hr', 'table', '|',
'subscript', 'superscript', '|',
'charmap', 'pastetext', 'preview', 'jxtdbuttons',
],
'toolbar2' => [],
],
'advanced' => [
'menu' => ['edit', 'insert', 'view', 'format', 'table', 'tools', 'help'],
'toolbar1' => [
'bold', 'italic', 'underline', 'strikethrough', '|',
'alignleft', 'aligncenter', 'alignright', 'alignjustify', '|',
'lineheight', '|',
'styleselect', '|',
'formatselect', 'fontfamily', 'fontsizeselect', '|',
'searchreplace', '|',
'bullist', 'numlist', '|',
'outdent', 'indent', '|',
'undo', 'redo', '|',
'link', 'unlink', 'anchor', 'image', '|',
'code', '|',
'forecolor', 'backcolor', '|',
'fullscreen', '|',
'table', '|',
'subscript', 'superscript', '|',
'charmap', 'emoticons', 'media', 'hr', 'ltr', 'rtl', '|',
'cut', 'copy', 'paste', 'pastetext', '|',
'visualchars', 'visualblocks', 'nonbreaking', 'blockquote', 'template', '|',
'print', 'preview', 'codesample', 'insertdatetime', 'removeformat', 'jxtdbuttons',
'language',
],
'toolbar2' => [],
]
];
}
}

0 comments on commit 0ce9557

Please sign in to comment.