Skip to content

Commit 62e21ef

Browse files
authored
Merge branch 'feature/8.4.0/DOC-3243' into feature/8.4.0/DOC-3243_TINY-12224
2 parents 59673e0 + 5a76d84 commit 62e21ef

12 files changed

Lines changed: 196 additions & 13 deletions

modules/ROOT/examples/live-demos/custom-view/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ tinymce.init({
1919
text: 'Save code',
2020
buttonType: 'primary',
2121
onAction: () => {
22-
const codeContent = document.querySelector('.tox-view__pane_panel').value;
22+
const codeContent = document.querySelector('.my-textarea').value;
2323
ed.setContent(codeContent);
2424
ed.execCommand('ToggleView', false, 'code');
2525
console.log('save');
@@ -28,12 +28,12 @@ tinymce.init({
2828
],
2929
onShow: (api) => {
3030
const editorContent = ed.getContent();
31-
api.getContainer().innerHTML = `
31+
const container = api.getContainer();
32+
container.innerHTML = `
3233
<div style="height: 100%">
33-
<textarea class="tox-view__pane_panel" style="width: 100%; height: 100%; resize: none; padding: 0.5em">
34-
${editorContent}
35-
</textarea>
36-
</div>`.replace(/\s+/g, '');
34+
<textarea class="my-textarea" style="width: 100%; height: 100%; resize: none; padding: 0.5em"></textarea>
35+
</div>`;
36+
container.querySelector('.my-textarea').value = editorContent;
3737
},
3838
onHide: (api) => {
3939
console.log('Deactivate code', api.getContainer());

modules/ROOT/pages/8.4.0-release-notes.adoc

Lines changed: 51 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,43 @@ For information on the **<Open source plugin name>** plugin, see xref:<plugincod
5656
== Accompanying Premium plugin changes
5757

5858
The following premium plugin updates were released alongside {productname} {release-version}.
59-
=== <Premium plugin name 1> <Premium plugin name 1 version>
6059

61-
The {productname} {release-version} release includes an accompanying release of the **<Premium plugin name 1>** premium plugin.
60+
=== Media Optimizer
6261

63-
**<Premium plugin name 1>** <Premium plugin name 1 version> includes the following <fixes, changes, improvements>.
62+
The {productname} {release-version} release includes an accompanying release of the **Media Optimizer** premium plugin.
6463

65-
==== <Premium plugin name 1 change 1>
64+
**Media Optimizer** includes the following addition.
6665

67-
// CCFR here.
66+
==== SVG images can now be uploaded.
67+
// #TINY-13708
68+
69+
Previously, SVG images could not be uploaded through the Media Optimizer plugin because Uploadcare placed restrictions on SVG file handling. Users who needed to include SVG graphics in content were unable to upload them directly.
70+
71+
In {productname} {release-version}, SVG images can now be uploaded through the Media Optimizer plugin. Some CDN operations may have limitations on SVG files; for details, see the link:https://uploadcare.com/docs/cdn-operations/#limits[Uploadcare documentation on CDN operation limits].
72+
73+
For information on the **Media Optimizer** plugin, see: xref:uploadcare.adoc[Media Optimizer].
74+
75+
=== Full Page HTML
76+
77+
The {productname} {release-version} release includes an accompanying release of the **Full Page HTML** premium plugin.
78+
79+
**Full Page HTML** includes the following fixes.
80+
81+
==== Pasting an HTML document was vulnerable to XSS attacks
82+
// #TINY-13673
83+
84+
A cross-site scripting (XSS) vulnerability was discovered in the Full Page HTML plugin. Previously, malicious code within the document `<head>` was able to be executed when pasted.
85+
86+
This vulnerability has been patched in {productname} {release-version} by ensuring that content in the document `<head>` is properly encoded.
87+
88+
==== New argument `fullpagehtml` to `editor.getContent()` and `editor.setContent()` APIs to only get/set the body of the content while the full page plugin is active.
89+
// #TINY-13744
6890

69-
For information on the **<Premium plugin name 1>** plugin, see: xref:<plugincode>.adoc[<Premium plugin name 1>].
91+
Previously, setting and getting the editor content while the Full Page HTML plugin was active could be troublesome due to the presence of the full HTML document on all API calls, even when not needed. Attempting to get and act only on the body content (for example, for saving) was undocumented and required workarounds.
92+
93+
In {productname} {release-version}, the `fullpagehtml` option has been added to the `editor.getContent()` and `editor.setContent()` APIs. When set to `false`, this option allows getting and setting only the body content while the Full Page HTML plugin is active, without interfering with the full document structure. The document is now more resistant to accidental changes, and content can be retrieved or updated without including the full HTML document. For details, see xref:fullpagehtml.adoc#fullpagehtml-getcontent-setcontent[`fullpagehtml` option for getContent/setContent].
94+
95+
For information on the **Full Page HTML** plugin, see: xref:fullpagehtml.adoc[Full Page HTML].
7096

7197
=== Comments
7298

@@ -83,7 +109,6 @@ In {productname} {release-version}, the save logic now resets the saving state t
83109

84110
For information on the **Comments** plugin, see: xref:introduction-to-tiny-comments.adoc[Comments].
85111

86-
87112
[[accompanying-premium-plugin-end-of-life-announcement]]
88113
== Accompanying Premium plugin end-of-life announcement
89114

@@ -139,6 +164,12 @@ For information on using Enhanced Skins & Icon Packs, see: xref:enhanced-skins-a
139164

140165
// CCFR here.
141166

167+
=== New `view_show` option to display a specified view on initialization.
168+
// #TINY-11967
169+
170+
171+
In {productname} {release-version}, the new xref:custom-view.adoc#view_show[`+view_show+`] option allows specifying which view to display when the editor is initialized. The option behaves similarly to `+sidebar_show+` but takes precedence for views; both sidebars and views can be configured to show on init.
172+
142173

143174
[[changes]]
144175
== Changes
@@ -171,6 +202,19 @@ For information on using Enhanced Skins & Icon Packs, see: xref:enhanced-skins-a
171202
// #TINY-vwxyz1
172203

173204
// CCFR here.
205+
=== Directionality of Hebrew was incorrect
206+
// #TINY-13667
207+
208+
Previously, right-to-left (RTL) directionality was not correctly set for Hebrew in the language pack. This caused the editor to render the wrong directionality when Hebrew was set as the language.
209+
210+
In {productname} {release-version}, this issue has been addressed by ensuring that the directionality is correctly set for Hebrew in the language pack.
211+
212+
=== Bundled content CSS is now loaded into preview iframes
213+
// #TINY-13190
214+
215+
Previously, when the editor content CSS was bundled, it was not loaded into preview iframes. This caused a visual mismatch between the editor content area and what users saw in the Preview dialog, Suggested Edits view and Revision History view.
216+
217+
In {productname} {release-version}, the fix checks if the content CSS is available as a bundled resource and applies it to the Preview Iframe through style tags. Bundled content CSS is now correctly loaded in the Preview Iframe.
174218

175219

176220
[[security-fixes]]

modules/ROOT/pages/advcode.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ include::partial$configuration/advcode_prettify_getcontent.adoc[leveloffset=+1]
6666

6767
include::partial$configuration/advcode_prettify_editor.adoc[leveloffset=+1]
6868

69+
include::partial$plugins/advcode-open-view.adoc[]
70+
6971
include::partial$misc/advcode-shortcuts.adoc[]
7072

7173
include::partial$misc/plugin-toolbar-button-id-boilerplate.adoc[]

modules/ROOT/pages/custom-view.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ To query the state of the custom view (whether it is currently visible or hidden
5757
editor.queryCommandValue('ToggleView') == 'myCustomView';
5858
----
5959

60+
== Options
61+
62+
include::partial$configuration/view_show.adoc[leveloffset=+1]
63+
6064
== Interactive example
6165

6266
This example shows how to integrate a custom view using the `addView` API.

modules/ROOT/pages/fullpagehtml.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ include::partial$configuration/fullpagehtml-default-body-style.adoc[leveloffset=
109109

110110
include::partial$configuration/fullpagehtml-hide-in-source-view.adoc[leveloffset=+1]
111111

112+
include::partial$configuration/fullpagehtml-getcontent-setcontent.adoc[leveloffset=+1]
113+
112114
include::partial$misc/plugin-toolbar-button-id-boilerplate.adoc[]
113115

114116
include::partial$toolbar-button-ids/{plugincode}-toolbar-buttons.adoc[leveloffset=+1]

modules/ROOT/pages/revisionhistory.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ include::partial$configuration/revisionhistory_css_url.adoc[leveloffset=+1]
121121

122122
include::partial$configuration/revisionhistory_diff_classes.adoc[leveloffset=+1]
123123

124+
include::partial$plugins/revisionhistory-open-view.adoc[]
125+
124126
include::partial$misc/plugin-toolbar-button-id-boilerplate.adoc[]
125127

126128
include::partial$misc/plugin-menu-item-id-boilerplate.adoc[]

modules/ROOT/pages/suggestededits.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ include::partial$configuration/suggestededits_access.adoc[leveloffset=+1]
127127

128128
include::partial$configuration/suggestededits_auto_approve.adoc[leveloffset=+1]
129129

130+
include::partial$plugins/suggestededits-open-view.adoc[]
131+
130132
include::partial$configuration/user_id.adoc[leveloffset=+1]
131133

132134
include::partial$configuration/fetch_users.adoc[leveloffset=+1]
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[[fullpagehtml-getcontent-setcontent]]
2+
== `+fullpagehtml+` option for `+getContent()+` and `+setContent()+`
3+
4+
When the {pluginname} plugin is active, `editor.getContent()` and `editor.setContent()` return and accept the full HTML document by default. The `fullpagehtml` option allows getting and setting only the body content when needed.
5+
6+
Pass `fullpagehtml: false` in the options object to bypass full-page processing and work with body content only:
7+
8+
* `editor.getContent({ fullpagehtml: false })` — Returns only the `<body>` content.
9+
* `editor.setContent(content, { fullpagehtml: false })` — Sets only the body content without modifying the document head.
10+
11+
This option is useful when saving or loading body content separately (for example, when storing content in a database or when integrating with systems that expect body-only HTML). Unlike `fullpagehtml_hide_in_source_view`, which affects only the source code view display, the `fullpagehtml` option affects API behavior and requires no configuration.
12+
13+
=== Example: getting and setting body content
14+
15+
[source,js]
16+
----
17+
// Get only the body content for saving
18+
const bodyContent = editor.getContent({ fullpagehtml: false });
19+
20+
// Set only the body content (preserves document head)
21+
editor.setContent(newBodyContent, { format: 'html', fullpagehtml: false });
22+
----
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
[[view_show]]
2+
== `+view_show+`
3+
4+
This option allows the specified view to be displayed on editor initialization. It behaves similarly to xref:customsidebar.adoc#sidebar_show[`+sidebar_show+`] but applies to views and takes precedence when both are configured. Views and sidebars can both be set to show on init, with the sidebar shown once the view is closed.
5+
6+
The value must match the name of a registered view. Premium plugins that register views include:
7+
8+
* xref:suggestededits.adoc[Suggested Edits] (`+suggestededits+`)
9+
* xref:revisionhistory.adoc[Revision History] (`+revision+`)
10+
* xref:advcode.adoc[Enhanced Code Editor] (`+code+`)
11+
12+
Custom views registered via xref:custom-view.adoc[`+addView+`] can also be specified.
13+
14+
include::partial$misc/admon-iframe-only.adoc[]
15+
16+
*Type:* `+String+`
17+
18+
=== Example: using `+view_show+` with a premium plugin
19+
20+
[source,js]
21+
----
22+
tinymce.init({
23+
selector: 'textarea', // change this value according to your HTML
24+
plugins: 'suggestededits',
25+
toolbar: 'suggestededits',
26+
view_show: 'suggestededits',
27+
// ... other Suggested Edits options (suggestededits_model, user_id, fetch_users)
28+
});
29+
----
30+
31+
=== Example: using `+view_show+` with a custom view
32+
33+
[source,js]
34+
----
35+
tinymce.init({
36+
selector: 'textarea', // change this value according to your HTML
37+
menubar: false,
38+
toolbar: 'view',
39+
view_show: 'view',
40+
setup: (editor) => {
41+
const toggleView = () => editor.execCommand('ToggleView', false, 'view');
42+
editor.ui.registry.addView('view', {
43+
onShow: (api) => {
44+
api.getContainer().innerHTML = '<p>You opened the view!</p>';
45+
},
46+
onHide: (api) => {
47+
api.getContainer().innerHTML = '';
48+
},
49+
buttons: [{
50+
type: 'button',
51+
text: 'Close',
52+
onAction: toggleView
53+
}]
54+
});
55+
editor.ui.registry.addButton('view', {
56+
text: 'Open view',
57+
onAction: toggleView
58+
});
59+
}
60+
});
61+
----
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
== Show view on editor load
2+
3+
The xref:custom-view.adoc#view_show[`+view_show+`] option can be used to show the {pluginname} view when the editor is loaded.
4+
5+
.For example:
6+
[source,js]
7+
----
8+
tinymce.init({
9+
selector: 'textarea', // change this value according to your HTML
10+
plugins: 'advcode',
11+
toolbar: 'code',
12+
view_show: 'code',
13+
});
14+
----

0 commit comments

Comments
 (0)