Skip to content
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

[5.0] tinyMCE b/c fixes #40626

Merged
merged 30 commits into from
May 29, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
e11c82a
Fixes
dgrammatiko May 19, 2023
e69c0bb
update the menus replacements
dgrammatiko May 19, 2023
f0248bd
add the missing toolbar replacements
dgrammatiko May 19, 2023
93607e2
Update ToolbarPresets.php
dgrammatiko May 19, 2023
2844637
Update ToolbarPresets.php
dgrammatiko May 19, 2023
8aba00f
remove forced_root_block
dgrammatiko May 19, 2023
8f78410
Update KnownButtons.php
dgrammatiko May 19, 2023
d9d2c0a
Update KnownButtons.php
dgrammatiko May 19, 2023
aad46da
Update base.sql
dgrammatiko May 19, 2023
c3a740e
Update base.sql
dgrammatiko May 19, 2023
16747fa
- localize template plugin
dgrammatiko May 21, 2023
f6df416
Move the plugin around
dgrammatiko May 21, 2023
811e6fb
update the installation sql
dgrammatiko May 21, 2023
95f194c
Add a session check
dgrammatiko May 21, 2023
f0b9197
Add migration on update
richard67 May 20, 2023
77b927f
Add code comments
richard67 May 21, 2023
b7517b5
Fix misleading variable name
richard67 May 21, 2023
e67586e
Fix CS error
richard67 May 21, 2023
566cb36
Another CS fix
richard67 May 21, 2023
0c1e687
Fix undefined method
richard67 May 21, 2023
4bb2d83
Add "template" to "jtemplate" replacements
richard67 May 21, 2023
88fef6e
Alpha order by search strings
richard67 May 21, 2023
75a7e45
Remove the runtime b/c patches
dgrammatiko May 21, 2023
72ff624
Merge branch '5.0-dev' into 5.0-dev-tiny-fixes
richard67 May 21, 2023
819bf66
Update plugins/editors/tinymce/src/PluginTraits/DisplayTrait.php
dgrammatiko May 22, 2023
9e4027c
Update tinymce.es6.js
dgrammatiko May 22, 2023
2ce07d9
Update DisplayTrait.php
dgrammatiko May 22, 2023
6310b2d
Change the license to MIT
dgrammatiko May 22, 2023
9e36d8a
Update installation/sql/postgresql/base.sql
HLeithner May 27, 2023
bdf827e
Update installation/sql/mysql/base.sql
HLeithner May 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions plugins/editors/tinymce/src/PluginTraits/DisplayTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,14 @@ public function onDisplay(

// Merge the two toolbars for backwards compatibility
$toolbar = array_merge($toolbar1, $toolbar2);
// Rename old toolbar buttons for B/C
richard67 marked this conversation as resolved.
Show resolved Hide resolved
$toolbar = str_replace(['fontselect', 'fontsizeselect', 'formatselect', 'styleselect'], ['fontfamily', 'fontsize', 'blocks', 'styles'], $toolbar);
$menubar = empty($menubar) ? false : implode(' ', array_unique($menubar));

// Rename old menus for B/C
if (is_array($menubar)) {
$menubar = str_replace(['fontformats', 'fontsizes', 'blockformats', 'formats'], ['fontfamily', 'fontsize', 'blocks', 'styles'], $menubar);
}

// Build the final options set
$scriptOptions = array_merge(
Expand All @@ -430,7 +438,7 @@ public function onDisplay(
'end_container_on_empty_block' => true,

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

'plugins' => implode(',', array_unique($plugins)),
Expand Down Expand Up @@ -489,14 +497,13 @@ public function onDisplay(
if ($levelParams->get('newlines')) {
// Break
$scriptOptions['force_br_newlines'] = true;
$scriptOptions['forced_root_block'] = '';
} else {
// Paragraph
$scriptOptions['force_br_newlines'] = false;
$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
7 changes: 3 additions & 4 deletions plugins/editors/tinymce/src/PluginTraits/KnownButtons.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,14 @@ public static function getKnownButtons()

'cut' => ['label' => 'Cut'],
'copy' => ['label' => 'Copy'],
'paste' => ['label' => 'Paste', 'plugin' => 'paste'],
'pastetext' => ['label' => 'Paste as text', 'plugin' => 'paste'],
dgrammatiko marked this conversation as resolved.
Show resolved Hide resolved
'paste' => ['label' => 'Paste'],
'removeformat' => ['label' => 'Clear formatting'],

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

// Buttons from the plugins
'anchor' => ['label' => 'Anchor', 'plugin' => 'anchor'],
'hr' => ['label' => 'Horizontal line', 'plugin' => 'hr'],
'hr' => ['label' => 'Horizontal line'],
'ltr' => ['label' => 'Left to right', 'plugin' => 'directionality'],
'rtl' => ['label' => 'Right to left', 'plugin' => 'directionality'],
'code' => ['label' => 'Source code', 'plugin' => 'code'],
Expand All @@ -96,7 +95,7 @@ public static function getKnownButtons()
'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'],
'print' => ['label' => 'Print'],
'preview' => ['label' => 'Preview', 'plugin' => 'preview'],
'fullscreen' => ['label' => 'Fullscreen', 'plugin' => 'fullscreen'],
'template' => ['label' => 'Insert template', 'plugin' => 'template'],
Expand Down
6 changes: 3 additions & 3 deletions plugins/editors/tinymce/src/PluginTraits/ToolbarPresets.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static function getToolbarPreset()
'toolbar1' => [
'bold', 'italic', 'underline', 'strikethrough', '|',
'alignleft', 'aligncenter', 'alignright', 'alignjustify', '|',
'formatselect', '|',
'blocks', '|',
'bullist', 'numlist', '|',
'outdent', 'indent', '|',
'undo', 'redo', '|',
Expand All @@ -63,8 +63,8 @@ public static function getToolbarPreset()
'bold', 'italic', 'underline', 'strikethrough', '|',
'alignleft', 'aligncenter', 'alignright', 'alignjustify', '|',
'lineheight', '|',
'styleselect', '|',
'formatselect', 'fontfamily', 'fontsizeselect', '|',
'styles', '|',
'blocks', 'fontfamily', 'fontsize', '|',
'searchreplace', '|',
'bullist', 'numlist', '|',
'outdent', 'indent', '|',
Expand Down