Skip to content

Commit 018adae

Browse files
Apply suggestions from code review
Co-authored-by: Shan <[email protected]>
1 parent 8951265 commit 018adae

File tree

1 file changed

+6
-81
lines changed

1 file changed

+6
-81
lines changed

modules/ROOT/pages/migration-from-7x.adoc

Lines changed: 6 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ The complete licensing documentation xref:license-key.adoc[License Key Managemen
7474

7575
**Key Migration Considerations**:
7676

77-
* *License Key Format Change:* Version 7 keys are:
78-
** Not compatible with {productname} {release-version}.
77+
* *License Key Format Change:*
78+
** Version 7 keys are: Not compatible with {productname} {release-version}.
7979
** New keys use the prefix `T8LK:` for commercial licenses or `GPL+T8LK:` for GPL with Premium Features.
8080
* *Mandatory Key Requirement:* Self-hosted deployments **now require** a valid license key; without one, the editor will be set to `readonly`.
8181
* *Commercial License Manager:* Self-hosted commercial deployments **require** the new License Key Manager addon.
@@ -266,81 +266,6 @@ If you have a custom skin, rebuild it using the {productname} {productmajorversi
266266

267267
**Code examples**
268268

269-
.Before: {productname} {productmajorversion}.
270-
[source,js]
271-
----
272-
tinymce.init({
273-
selector: 'textarea#custom-toolbar-split-button',
274-
toolbar: 'myButton',
275-
menubar: false,
276-
setup: (editor) => {
277-
editor.ui.registry.addSplitButton('myButton', {
278-
text: 'My Button',
279-
icon: 'info',
280-
tooltip: 'This is an example split-button',
281-
onAction: () => editor.insertContent('<p>You clicked the main button</p>'),
282-
onItemAction: (api, value) => editor.insertContent(value),
283-
fetch: (callback) => {
284-
const items = [
285-
{
286-
type: 'choiceitem',
287-
icon: 'notice',
288-
text: 'Menu item 1',
289-
value: '&nbsp;<em>You clicked menu item 1!</em>'
290-
},
291-
{
292-
type: 'choiceitem',
293-
icon: 'warning',
294-
text: 'Menu item 2',
295-
value: '&nbsp;<em>You clicked menu item 2!</em>'
296-
}
297-
];
298-
callback(items);
299-
}
300-
});
301-
},
302-
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:16px }'
303-
});
304-
----
305-
306-
.Migrating to {productname} {productmajorversion}
307-
[source,js]
308-
----
309-
tinymce.init({
310-
selector: 'textarea',
311-
toolbar: 'myButton',
312-
menubar: false,
313-
setup: (editor) => {
314-
editor.ui.registry.addSplitButton('myButton', {
315-
text: 'My Button',
316-
icon: 'info',
317-
tooltip: 'Execute my action',
318-
chevronTooltip: 'My Button menu options',
319-
onAction: () => editor.insertContent('<p>You clicked the main button</p>'),
320-
onItemAction: (api, value) => editor.insertContent(value),
321-
fetch: (callback) => {
322-
const items = [
323-
{
324-
type: 'choiceitem',
325-
icon: 'notice',
326-
text: 'Menu item 1',
327-
value: '&nbsp;<em>You clicked menu item 1!</em>'
328-
},
329-
{
330-
type: 'choiceitem',
331-
icon: 'warning',
332-
text: 'Menu item 2',
333-
value: '&nbsp;<em>You clicked menu item 2!</em>'
334-
}
335-
];
336-
callback(items);
337-
}
338-
});
339-
},
340-
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:16px }'
341-
});
342-
----
343-
344269

345270
== Core API Changes
346271

@@ -364,10 +289,10 @@ The `skipFocus` and `skip_focus` options for the `ToggleToolbarDrawer` command h
364289
[source, javascript]
365290
----
366291
// Old approach (Deprecated) in TinyMCE 8
367-
editor.execCommand('ToggleToolbarDrawer', { skip_focus: false }, { skipFocus: true });
292+
editor.execCommand('ToggleToolbarDrawer', false, { skipFocus: true })
368293
369294
// New approach (Recommended)
370-
editor.execCommand('ToggleToolbarDrawer', false, { skipFocus: true });
295+
editor.execCommand('ToggleToolbarDrawer', false, null, { skip_focus: true })
371296
----
372297

373298
**Migration checklist:**
@@ -398,13 +323,13 @@ console.log('documentBaseUrl', editor.documentBaseUrl);
398323
console.log('documentBaseURI', editor.documentBaseURI.getURI());
399324
----
400325

401-
TIP: Use `tinymce.activeEditor.documentBaseURI.getURI()` for all base URL operations.
326+
TIP: Use `editor.documentBaseURI.getURI()` for all base URL operations.
402327

403328
**Impact**: This change improves URL handling consistency by removing an undocumented API that was not aligned with the documented `documentBaseURI` property.
404329

405330
**Migration steps:**
406331

407-
To update all references of `documentBaseUrl` to the new API, replace any usage of `editor.documentBaseUrl` (or similar) with `tinymce.activeEditor.documentBaseURI.getURI()`. The property `documentBaseUrl` has been removed, and the correct way to access the document base URL is now through the `documentBaseURI` property, which is a URI object. You can then call `.getURI()` on it to get the string value of the URL.
332+
To update all references of `documentBaseUrl` to the new API, replace any usage of `editor.documentBaseUrl` (or similar) with `editor.documentBaseURI.getURI()`. The property `documentBaseUrl` has been removed, and the correct way to access the document base URL is now through the `documentBaseURI` property, which is a URI object. You can then call `.getURI()` on it to get the string value of the URL.
408333

409334
.For example, update this:
410335
[source, js]

0 commit comments

Comments
 (0)