Skip to content

Commit defd23c

Browse files
authored
Merge branch 'feature/8.4.0/DOC-3243' into feature/8.4.0/DOC-3243_TINY-13708
2 parents 1db919b + 69745dc commit defd23c

12 files changed

Lines changed: 179 additions & 6 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: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,21 @@ For information on the **<Open source plugin name>** plugin, see xref:<plugincod
5757

5858
The following premium plugin updates were released alongside {productname} {release-version}.
5959

60+
=== Full Page HTML
61+
62+
The {productname} {release-version} release includes an accompanying release of the **Full Page HTML** premium plugin.
63+
64+
**Full Page HTML** includes the following addition.
65+
66+
==== 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.
67+
// #TINY-13744
68+
69+
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.
70+
71+
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].
72+
73+
For information on the **Full Page HTML** plugin, see: xref:fullpagehtml.adoc[Full Page HTML].
74+
6075
=== Media Optimizer
6176

6277
The {productname} {release-version} release includes an accompanying release of the **Media Optimizer** premium plugin.
@@ -128,6 +143,12 @@ For information on using Enhanced Skins & Icon Packs, see: xref:enhanced-skins-a
128143

129144
// CCFR here.
130145

146+
=== New `view_show` option to display a specified view on initialization.
147+
// #TINY-11967
148+
149+
150+
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.
151+
131152

132153
[[changes]]
133154
== Changes
@@ -160,6 +181,19 @@ For information on using Enhanced Skins & Icon Packs, see: xref:enhanced-skins-a
160181
// #TINY-vwxyz1
161182

162183
// CCFR here.
184+
=== Directionality of Hebrew was incorrect
185+
// #TINY-13667
186+
187+
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.
188+
189+
In {productname} {release-version}, this issue has been addressed by ensuring that the directionality is correctly set for Hebrew in the language pack.
190+
191+
=== Bundled content CSS is now loaded into preview iframes
192+
// #TINY-13190
193+
194+
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.
195+
196+
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.
163197

164198

165199
[[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)