From 42be84ae4c1e83d89893e3e5c28c44e27a585a4a Mon Sep 17 00:00:00 2001 From: MitchCTiny Date: Fri, 14 Nov 2025 18:48:36 +1000 Subject: [PATCH 1/6] TINY: Update demos to TinyMCE 8 --- cool-demos/conditional-blocks.html | 2 +- cool-demos/expand-editor-and-show-toolbar.html | 6 +++--- cool-demos/slash-commands.html | 4 ++-- ...rketing-email-inline-mode-fixed-toolbar.html | 4 ++-- email/marketing-email-inline-mode.html | 4 ++-- email/webmail-rich-text-editor.html | 12 ++++++------ images/image-alt-text-context-form.html | 4 ++-- images/toggle-image-size-context-toolbar.html | 4 ++-- tables/customizing-the-table-toolbar.html | 4 ++-- tables/table-row-templates.html | 4 ++-- templates-and-layout/advanced-placeholder.html | 6 +++--- .../locked-down-template-inline-bordered.html | 17 +++++------------ ...d-down-template-inline-context-toolbars.html | 4 ++-- .../locked-down-template-inline-default.html | 4 ++-- ...cked-down-template-inline-fixed-toolbar.html | 10 +++++----- .../multiple-columns-using-css-columns.html | 4 ++-- tinymce-basics/badges.html | 4 ++-- tinymce-basics/bootstrap-rich-text-form.html | 4 ++-- ...toolbar-button-menu-and-context-toolbar.html | 4 ++-- tinymce-basics/fonts.html | 4 ++-- tinymce-basics/format-link-as-button.html | 4 ++-- .../right-aligned-toolbar-button.html | 4 ++-- .../useful_styles_for_content_css.html | 8 ++++---- ...webapp-description-comment-reply-editor.html | 8 ++++---- tokens/span-based-token.html | 2 +- tokens/text-based-token.html | 2 +- tokens/web-component-token.html | 2 +- 27 files changed, 66 insertions(+), 73 deletions(-) diff --git a/cool-demos/conditional-blocks.html b/cool-demos/conditional-blocks.html index 8c4e23a..36181ad 100644 --- a/cool-demos/conditional-blocks.html +++ b/cool-demos/conditional-blocks.html @@ -15,7 +15,7 @@ Conditional blocks - + + + diff --git a/email/marketing-email-inline-mode-fixed-toolbar.html b/email/marketing-email-inline-mode-fixed-toolbar.html index 528b020..f258924 100644 --- a/email/marketing-email-inline-mode-fixed-toolbar.html +++ b/email/marketing-email-inline-mode-fixed-toolbar.html @@ -19,7 +19,7 @@ Marketing email editor using inline mode and fixed toolbar - + + + + + + + + + + + + + + + + + + + + + + + + From 6c6c4a35c1cc6e2bd7fadfcfcc5394d88b7dce67 Mon Sep 17 00:00:00 2001 From: Fredrik Danielsson Date: Wed, 19 Nov 2025 00:35:32 +0100 Subject: [PATCH 3/6] * Updated license tinymce-basics/useful_styles_for_content_css.html * Fixed invalid css * Re-added "hr" in the content * Removed `noneditable` plugin * Updated all documentation links tinymce-basics/badges.html * Removed `noneditable` plugin * Updated all documentation links tinymce-basics/custom-toolbar-button-menu-and-context-toolbar.html * Removed `noneditable` plugin * Updated all documentation links tinymce-basics/webapp-description-comment-reply-editor.html * Correctly use text pattern feature * Removed text pattern plugin * Updated all documentation links * Added markdown plugin tinymce-basics/bootstrap-rich-text-form.html * Updated all documentation links tinymce-basics/right-aligned-toolbar-button.html * Removed demo because we now have various badges showing up here tinymce-basics/format-link-as-button.html * Updated all documentation links tinymce-basics/fonts.html * Updated all documentation links * replaced font_formats with font_family_formats to make custom fonts show up images/toggle-image-size-context-toolbar.html * Updated all documentation links images/image-alt-text-context-form.html * Updated all documentation links tables/customizing-the-table-toolbar.html * Updated all documentation links * TODO: Commented out the cut/copy/paste row & column buttons preventing the menu from working, waiting for someone more talented to fix them using the new fake clipboard api: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.fakeclipboard/ tables/table-row-templates.html * TODO: someone needs to update the copy paste row using the new fake clipboard api: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.fakeclipboard/ otherwise the whole premise of the demo is gone * Updated all documentation links templates-and-layout/advanced-placeholder.html * Removed demo because the new enhanced templates plugin does not have the same features as the template plugin it replaced, and cannot be used with this demo, therefore the premise of the demo is lost. templates-and-layout/multiple-columns-using-css-columns.html * Removed demo because using css this way is not something TinyMCE supports very well, and I feel it is unwise to lead someone down this route. templates-and-layout/locked-down-template-inline-default.html * Updated all documentation links templates-and-layout/locked-down-template-inline-context-toolbars.html * Updated all documentation links templates-and-layout/locked-down-template-inline-context-toolbars.html * Updated all documentation links templates-and-layout/locked-down-template-inline-bordered.html * Updated all documentation links * Re-added the borderless skin to fix broken toolbar visuals email/webmail-rich-text-editor.html * Switched to naked skin because the outside skin had the editor outline on top of the bottom toolbar * Updated all documentation links email/marketing-email-inline-mode.html * Updated all documentation links email/marketing-email-inline-mode-fixed-toolbar.html * Updated all documentation links email/marketing-email.html * Updated the demo to use the mergetags plugin * Updated all documentation links cool-demos/expand-editor-and-show-toolbar.html * Fixed invalid CSS * Updated all documentation links * Note that toolbar bottom with the new tooltips makes it almost impossible to use the toolbar cool-demos/conditional-blocks.html * Updated all documentation links * Removed `noneditable` plugin cool-demos/slash-commands.html * Added the `tableofcontents` plugin * Updated all documentation links --- README.md | 2 +- cool-demos/conditional-blocks.html | 48 ++- .../expand-editor-and-show-toolbar.html | 36 +- cool-demos/slash-commands.html | 25 +- cool-demos/wordprocessor.html | 14 +- ...eting-email-inline-mode-fixed-toolbar.html | 26 +- email/marketing-email-inline-mode.html | 25 +- email/marketing-email.html | 264 ++++++------- email/webmail-rich-text-editor.html | 42 ++- images/image-alt-text-context-form.html | 30 +- images/toggle-image-size-context-toolbar.html | 42 +-- index.html | 62 +--- package.json | 4 +- tables/customizing-the-table-toolbar.html | 116 +++--- tables/table-row-templates.html | 37 +- templates-and-layout/README.md | 2 +- .../advanced-placeholder.html | 351 ------------------ .../locked-down-template-inline-bordered.html | 33 +- ...down-template-inline-context-toolbars.html | 12 +- .../locked-down-template-inline-default.html | 8 +- ...ed-down-template-inline-fixed-toolbar.html | 36 +- .../multiple-columns-using-css-columns.html | 114 ------ tinymce-basics/badges.html | 37 +- tinymce-basics/bootstrap-rich-text-form.html | 28 +- ...olbar-button-menu-and-context-toolbar.html | 38 +- tinymce-basics/fonts.html | 8 +- tinymce-basics/format-link-as-button.html | 12 +- .../right-aligned-toolbar-button.html | 83 ----- .../useful_styles_for_content_css.html | 12 +- ...bapp-description-comment-reply-editor.html | 46 +-- tokens/README.md | 5 - tokens/span-based-token.html | 100 ----- tokens/text-based-token.html | 103 ----- tokens/web-component-token.html | 210 ----------- 34 files changed, 481 insertions(+), 1530 deletions(-) delete mode 100644 templates-and-layout/advanced-placeholder.html delete mode 100644 templates-and-layout/multiple-columns-using-css-columns.html delete mode 100644 tinymce-basics/right-aligned-toolbar-button.html delete mode 100644 tokens/README.md delete mode 100644 tokens/span-based-token.html delete mode 100644 tokens/text-based-token.html delete mode 100644 tokens/web-component-token.html diff --git a/README.md b/README.md index cdf9ae1..0e4912e 100644 --- a/README.md +++ b/README.md @@ -17,4 +17,4 @@ You can download and run these demos locally. Some demos uses premium plugins so ## License The files in this repository are licensed under an MIT license. -TinyMCE is licensed under a LGPL or commercial license. +TinyMCE is available under a commercial license and a subset of the features are open source under the GNU General Public License Version 2 or later. diff --git a/cool-demos/conditional-blocks.html b/cool-demos/conditional-blocks.html index 36181ad..9ba6a4d 100644 --- a/cool-demos/conditional-blocks.html +++ b/cool-demos/conditional-blocks.html @@ -22,45 +22,54 @@ selector: '#editor', // Tip! To make TinyMCE leaner, only include the plugins you actually need. - plugins: 'autoresize advcode link lists noneditable', + plugins: 'autoresize advcode link lists mergetags', // We have put our custom insert conditional block button last. - toolbar: 'bold italic strikethrough backcolor | bullist numlist link | conditionalblock | code', + toolbar: 'bold italic strikethrough backcolor | bullist numlist link mergetags | conditionalblock | code', // "Thin" is a premium icon pack you get wth the cloud essential plan. // See https://www.tiny.cloud for more details and purchasing options // You can also create your own icon packs for TinyMCE - // https://www.tiny.cloud/docs/advanced/creating-an-icon-pack/ + // https://www.tiny.cloud/docs/tinymce/latest/enhanced-skins-and-icon-packs/ + // https://www.tiny.cloud/docs/tinymce/latest/creating-an-icon-pack/ icons: 'thin', // "Naked" is a premium icon pack you get wth the cloud essential plan // See https://www.tiny.cloud for more details and purchasing options // You can also create your own skins for TinyMCE - // https://www.tiny.cloud/docs/advanced/creating-a-skin/ + // https://www.tiny.cloud/docs/tinymce/latest/creating-a-skin/ skin: 'naked', // If we don't need the menubar we can hide it - // https://www.tiny.cloud/docs/configure/editor-appearance/#menubar + // https://www.tiny.cloud/docs/tinymce/latest/menus-configuration-options/#menubar menubar: false, + // Easily configure replacement values using merge tags plugin + // https://www.tiny.cloud/docs/tinymce/latest/mergetags/ + mergetags_list: [ + { title: "first_name", value: "first_name" }, + { title: "number_of_people", value: "number_of_people" }, + { title: "agent_first_name", value: "agent_first_name" }, + ], + // Tell TinyMCE that conditional-block is a valid element. - // https://www.tiny.cloud/docs/configure/content-filtering/#custom_elements + // https://www.tiny.cloud/docs/tinymce/latest/content-filtering/#custom_elements custom_elements: 'conditional-block', setup: (editor) => { // Instead of defining a custom icon pack, we can register individual // icons using the API. - // https://www.tiny.cloud/docs/api/tinymce.editor.ui/tinymce.editor.ui.registry/#addicon + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editor.ui.registry/#addicon editor.ui.registry.addIcon('conditional-block', ''); // The preinit event is fired after the editor is loaded but before // the content is loaded - // https://www.tiny.cloud/docs/advanced/events/#editorcoreevents + // https://www.tiny.cloud/docs/tinymce/latest/events/ editor.on('PreInit', () => { // Get the iframe window object and the iframes document object // and call our setup function that creates the web component - // https://www.tiny.cloud/docs/api/tinymce/tinymce.editor/#getwin - // https://www.tiny.cloud/docs/api/tinymce/tinymce.editor/#getdoc + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editor/#getWin + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editor/#getDoc const win = editor.getWin(); const doc = editor.getDoc(); setupWebComponent(win, doc, editor); @@ -71,7 +80,7 @@ // to be saved with the content. We therefore need to filter out the attribute // upon serlialization (which happens on "save", view sourcecode and preview // among others). - // https://www.tiny.cloud/docs/api/tinymce.dom/tinymce.dom.serializer/#addnodefilter + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.dom.serializer/#addNodeFilter editor.serializer.addNodeFilter('conditional-block', (nodes) => { // Iterate through all filtered nodes and remove the contenteditable attribute // as well as the wrapper
we add when creating the custom element @@ -81,7 +90,7 @@ node.attr('contenteditable', null); // Traverse into the first child which would be the
// and use unwrap to remove the
but keep the children. - // https://www.tiny.cloud/docs/api/tinymce.html/tinymce.html.node/#unwrap + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.html.node/#unwrap node.firstChild.unwrap(); } }); @@ -89,7 +98,7 @@ }); // Register a custom toolbar menu button to insert the conditional block - // https://www.tiny.cloud/docs/ui-components/typesoftoolbarbuttons/#menubutton + // https://www.tiny.cloud/docs/tinymce/latest/custom-toolbarbuttons/#menubutton editor.ui.registry.addButton('conditionalblock', { icon: 'conditional-block', tooltip: 'Insert conditional block', @@ -104,8 +113,8 @@ // In a real world scenario, with much more custom styles for headings // links, tables, images etc, it's recommended to use the content_css // option to load a separate CSS file. Makes editing easier too. - // https://www.tiny.cloud/docs/configure/content-appearance/#content_style - // https://www.tiny.cloud/docs/configure/content-appearance/#content_css + // https://www.tiny.cloud/docs/tinymce/latest/add-css-options/#content_style + // https://www.tiny.cloud/docs/tinymce/latest/add-css-options/#content_css content_style: ` /* We remove the default selected outline because it doesn't follow the * border radius and reintroduce it as a box-shadow. @@ -307,8 +316,7 @@ const dialogManager = (conditionalBlock, editor) => { // Open a TinyMCE modal where the user can set the badge's // background and text color. - // https://www.tiny.cloud/docs/ui-components/dialog/ - // https://www.tiny.cloud/docs/ui-components/dialogcomponents/ + // https://www.tiny.cloud/docs/tinymce/latest/dialog/ editor.windowManager.open({ title: 'Insert/edit Conditional block', body: { @@ -368,13 +376,13 @@ // Check if a block is edited or a new block is to be inserted if (!conditionalBlock) { // Insert content at the location of the cursor. - // https://www.tiny.cloud/docs/api/tinymce/tinymce.editor/#insertcontent + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editor/#insertContent editor.insertContent(`

Write conditional text here

`); } else { // Working directly with the DOM often requires manually adding // the actions to the undo stack. - // https://www.tiny.cloud/docs/api/tinymce/tinymce.undomanager/ + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.undomanager/ editor.undoManager.transact(() => { // Update the data-attributes on the conditional-block element conditionalBlock.dataset.property = data.property; @@ -383,7 +391,7 @@ }); // Tell TinyMCE that the ui has been updated. - // https://www.tiny.cloud/docs/api/tinymce/tinymce.editor/#nodechanged + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editor/#nodeChanged editor.nodeChanged(); } diff --git a/cool-demos/expand-editor-and-show-toolbar.html b/cool-demos/expand-editor-and-show-toolbar.html index 4123aa8..cb9f63a 100644 --- a/cool-demos/expand-editor-and-show-toolbar.html +++ b/cool-demos/expand-editor-and-show-toolbar.html @@ -1,7 +1,7 @@ @@ -23,27 +23,27 @@ icons: 'thin', // Enable inline mode - // https://www.tiny.cloud/docs/configure/editor-appearance/#inline + // https://www.tiny.cloud/docs/tinymce/latest/use-tinymce-inline/ inline: true, // Render the toolbar in this container. - // https://www.tiny.cloud/docs/configure/editor-appearance/#fixed_toolbar_container + // https://www.tiny.cloud/docs/tinymce/latest/menus-configuration-options/#fixed_toolbar_container fixed_toolbar_container: '#editor-toolbar', // Makes menus move upwards - // https://www.tiny.cloud/docs/configure/editor-appearance/#toolbar_location + // https://www.tiny.cloud/docs/tinymce/latest/toolbar-configuration-options/#toolbar_location toolbar_location: 'bottom', // Remove the manual image resizing as we're using percentage widths - // https://www.tiny.cloud/docs/configure/advanced-editing-behavior/#object_resizing + // https://www.tiny.cloud/docs/tinymce/latest/content-behavior-options/#object_resizing object_resizing: false, // Hide the right click context menus - // https://www.tiny.cloud/docs/configure/editor-appearance/#contextmenu + // https://www.tiny.cloud/docs/tinymce/latest/menus-configuration-options/#contextmenu contextmenu: false, // Create three custom toolbar groups - // https://www.tiny.cloud/docs/configure/editor-appearance/#toolbar_groups + // https://www.tiny.cloud/docs/tinymce/latest/toolbar-configuration-options/#toolbar_groups toolbar_groups: { formatgroup: { icon: 'format', @@ -65,27 +65,27 @@ // On mobile, toolbar_mode is sliding by default which is not compatible // with toolbar_groups. Therefore we explicitly set toolbar_mode to floating // on mobile and touch devices. - // https://www.tiny.cloud/docs/configure/editor-appearance/#toolbar_mode - // https://www.tiny.cloud/docs/configure/editor-appearance/#mobile + // https://www.tiny.cloud/docs/tinymce/latest/toolbar-configuration-options/#toolbar_mode + // https://www.tiny.cloud/docs/tinymce/latest/tinymce-for-mobile/ mobile: { toolbar_mode: 'floating' }, setup: (editor) => { // Apply a custom class to the wrapper element when the editor gets focus - // https://www.tiny.cloud/docs/advanced/events/ + // https://www.tiny.cloud/docs/tinymce/latest/events/ editor.on('focus', () => { document.getElementById('editor-wrap').classList.add('focused'); }); // Remove the custom class when the editor loses focus - // https://www.tiny.cloud/docs/advanced/events/ + // https://www.tiny.cloud/docs/tinymce/latest/events/ editor.on('blur', () => { document.getElementById('editor-wrap').classList.remove('focused'); }); // Register a custom context toolbar for images - // https://www.tiny.cloud/docs/ui-components/contexttoolbar/#registeringacontexttoolbar + // https://www.tiny.cloud/docs/tinymce/latest/contexttoolbar/#registeringacontexttoolbar editor.ui.registry.addContextToolbar('editimage', { predicate: (node) => { return node.nodeName.toLowerCase() === 'img' @@ -96,24 +96,24 @@ }); // Register a custom edit image button - // https://www.tiny.cloud/docs/ui-components/toolbarbuttons/ + // https://www.tiny.cloud/docs/tinymce/latest/custom-toolbarbuttons/ editor.ui.registry.addButton('editimage', { icon: 'edit-block', onAction: () => { // Display the image dialog - // https://www.tiny.cloud/docs/plugins/image/#commands + // https://www.tiny.cloud/docs/tinymce/latest/image/#commands editor.execCommand('mceImage'); } }); // Register a custom remove image button - // https://www.tiny.cloud/docs/ui-components/toolbarbuttons/ + // https://www.tiny.cloud/docs/tinymce/latest/custom-toolbarbuttons/ editor.ui.registry.addButton('removeimage', { icon: 'remove', onAction: () => { // Get the currently selected content (called "node") and delete it. - // https://www.tiny.cloud/docs/api/tinymce.dom/tinymce.dom.selection/ - // https://www.tiny.cloud/docs/api/tinymce.html/tinymce.html.node/ + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.dom.selection/ + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.html.node/ const node = tinymce.activeEditor.selection.getNode(); node.remove(); } @@ -206,7 +206,7 @@ font-weight: strong; } - { + hr { margin: 1.5rem 0; padding: .5rem 0; border: 0; diff --git a/cool-demos/slash-commands.html b/cool-demos/slash-commands.html index 13d8c28..28f08a0 100644 --- a/cool-demos/slash-commands.html +++ b/cool-demos/slash-commands.html @@ -2,7 +2,8 @@ This demo showcases how to use the autocompleter API to make a slash commands feature and wrap it in a custom plugin - Learn more about making custom plugins at https://www.tiny.cloud/docs/advanced/creating-a-plugin/ + Learn more about making custom plugins at + https://www.tiny.cloud/docs/tinymce/latest/creating-a-plugin/ --> @@ -15,7 +16,7 @@ diff --git a/cool-demos/wordprocessor.html b/cool-demos/wordprocessor.html index 3ab209b..5e8b46c 100644 --- a/cool-demos/wordprocessor.html +++ b/cool-demos/wordprocessor.html @@ -19,21 +19,21 @@ // This option allows you to specify the buttons and the order that they // will appear on TinyMCE’s toolbar. - // https://www.tiny.cloud/docs/tinymce/6/toolbar-configuration-options/#basic-toolbar-options + // https://www.tiny.cloud/docs/tinymce/latest/toolbar-configuration-options/#basic-toolbar-options toolbar: "undo redo print spellcheckdialog formatpainter | blocks fontfamily fontsize | bold italic underline forecolor backcolor | link image addcomment showcomments | alignleft aligncenter alignright alignjustify lineheight | checklist bullist numlist indent outdent | removeformat", // Tip! The height option accepts any valid CSS for height // If your editor is expected to get larger than the viewport // the sticky toolbar is useful for keeping the controls // always visible - // https://www.tiny.cloud/docs/tinymce/6/editor-size-options/ - // https://www.tiny.cloud/docs/tinymce/6/menus-configuration-options/#toolbar_sticky + // https://www.tiny.cloud/docs/tinymce/latest/editor-size-options/ + // https://www.tiny.cloud/docs/tinymce/latest/menus-configuration-options/#toolbar_sticky height: '700px', toolbar_sticky: true, // You can customize the look and feel of the ui using skins and icons, // In this demo we are using an alternative icon pack - // https://www.tiny.cloud/docs/tinymce/6/editor-icons/ + // https://www.tiny.cloud/docs/tinymce/latest/editor-icons/ icons: 'thin', // The autosave plugin helps prevent data loss if the end-user accidentally @@ -41,13 +41,13 @@ // There are many configuration options to control things like save interval // and retention. The below option loads any unsaved content from local // storage into TinyMCE - // https://www.tiny.cloud/docs/tinymce/6/autosave/#autosave_restore_when_empty + // https://www.tiny.cloud/docs/tinymce/latest/autosave/#autosave_restore_when_empty autosave_restore_when_empty: true, // The Tiny Comments plugin enables you to quickly get collaboration up and // running. There are a lot of customizability but here are the most basic // options to get you started - // https://www.tiny.cloud/docs/tinymce/6/introduction-to-tiny-comments/ + // https://www.tiny.cloud/docs/tinymce/latest/introduction-to-tiny-comments/ tinycomments_mode: 'embedded', tinycomments_author: 'john.doe', tinycomments_author_name: 'John Doe', @@ -57,7 +57,7 @@ // In a real world scenario, with much more custom styles for headings // links, tables, images etc, it's recommended to use the content_css // option to load a separate CSS file. Makes editing easier too. - // https://www.tiny.cloud/docs/tinymce/6/add-css-options/ + // https://www.tiny.cloud/docs/tinymce/latest/add-css-options/ content_style: ` body { background: #fff; diff --git a/email/marketing-email-inline-mode-fixed-toolbar.html b/email/marketing-email-inline-mode-fixed-toolbar.html index f258924..85c84cf 100644 --- a/email/marketing-email-inline-mode-fixed-toolbar.html +++ b/email/marketing-email-inline-mode-fixed-toolbar.html @@ -25,7 +25,7 @@ selector:'.tinymce', // Enable inline mode - // https://www.tiny.cloud/docs/configure/editor-appearance/#inline + // https://www.tiny.cloud/docs/tinymce/latest/use-tinymce-inline/ inline: true, // Tip! To make TinyMCE leaner, only include the plugins you actually need. @@ -33,39 +33,39 @@ // This option allows you to specify the buttons and the order that they // will appear on TinyMCE’s toolbar. - // https://www.tiny.cloud/docs/configure/editor-appearance/#toolbar + // https://www.tiny.cloud/docs/tinymce/latest/toolbar-configuration-options/#toolbar toolbar: 'undo redo | styles | bold italic underline strikethrough | forecolor backcolor | link image emoticons | alignleft aligncenter alignright | bullist numlist | code removeformat', // Toggle the menubar off to get a leaner visual experience - // https://www.tiny.cloud/docs/configure/editor-appearance/#menubar + // https://www.tiny.cloud/docs/tinymce/latest/menus-configuration-options/#menubar menubar: false, // To remove the outside borders of the toolbar we use a premium skin. // You can also easily create your own borderless skin too. - // https://www.tiny.cloud/docs/enterprise/premium-skins-and-icon-packs/borderless-demo/ - // https://www.tiny.cloud/docs/configure/editor-appearance/#skin - // https://www.tiny.cloud/docs/advanced/creating-a-skin/ + // https://www.tiny.cloud/docs/tinymce/latest/borderless-demo/ + // https://www.tiny.cloud/docs/tinymce/latest/editor-skin/ + // https://www.tiny.cloud/docs/tinymce/latest/creating-a-skin/ skin: 'borderless', // Render the inline toolbar into this element - // https://www.tiny.cloud/docs/configure/editor-appearance/#fixed_toolbar_container + // https://www.tiny.cloud/docs/tinymce/latest/menus-configuration-options/#fixed_toolbar_container fixed_toolbar_container: '.toolbar', // In emails we rarely use target for links so we hide the // target drop down in the link dialog - // https://www.tiny.cloud/docs/plugins/link/#target_list + // https://www.tiny.cloud/docs/tinymce/latest/link/#link_target_list target_list: false, // We don't want users to be able to resize images by using // drag and drop because it can break layout templates. - // https://www.tiny.cloud/docs/configure/advanced-editing-behavior/#object_resizing + // https://www.tiny.cloud/docs/tinymce/latest/content-behavior-options/#object_resizing object_resizing : false, // The formats option is where custom formatting options are defined. // In this case we define a couple of headings and a button appearance // for links. HTML Emails require inlining the CSS. Fortunately the // styles property makes that easy. - // https://www.tiny.cloud/docs/configure/content-formatting/#formats + // https://www.tiny.cloud/docs/tinymce/latest/content-formatting/#formats formats: { h1: { block: 'h1', styles: { fontSize: '32px' } }, h2: { block: 'h2', styles: { fontSize: '18px' } }, @@ -73,7 +73,7 @@ }, // The style_formats option controls the styleformat toolbar button menu - // https://www.tiny.cloud/docs/configure/editor-appearance/#style_formats + // https://www.tiny.cloud/docs/tinymce/latest/user-formatting-options/#style_formats style_formats: [ { title: 'Paragraph', format: 'p' }, { title: 'Heading 1', format: 'h1' }, @@ -84,13 +84,13 @@ setup: (editor) => { // Apply a custom class to the wrapper element when the editor gets focus - // https://www.tiny.cloud/docs/advanced/events/ + // https://www.tiny.cloud/docs/tinymce/latest/events/ editor.on('focus', () => { document.getElementById('editor').classList.add('focused'); }); // Remove the custom class when the editor loses focus - // https://www.tiny.cloud/docs/advanced/events/ + // https://www.tiny.cloud/docs/tinymce/latest/events/ editor.on('blur', () => { document.getElementById('editor').classList.remove('focused'); }); diff --git a/email/marketing-email-inline-mode.html b/email/marketing-email-inline-mode.html index bbe5b9f..a927a26 100644 --- a/email/marketing-email-inline-mode.html +++ b/email/marketing-email-inline-mode.html @@ -25,7 +25,7 @@ selector:'.tinymce', // Enable inline mode - // https://www.tiny.cloud/docs/configure/editor-appearance/#inline + // https://www.tiny.cloud/docs/tinymce/latest/use-tinymce-inline/ inline: true, // Tip! To make TinyMCE leaner, only include the plugins you actually need. @@ -33,39 +33,40 @@ // This option allows you to specify the buttons and the order that they // will appear on TinyMCE’s toolbar. - // https://www.tiny.cloud/docs/configure/editor-appearance/#toolbar + // https://www.tiny.cloud/docs/tinymce/latest/toolbar-configuration-options/#toolbar toolbar: 'styles | bold italic underline | link image emoticons | align bullist numlist | code removeformat', // Toggle the menubar off to get a leaner visual experience - // https://www.tiny.cloud/docs/configure/editor-appearance/#menubar + // https://www.tiny.cloud/docs/tinymce/latest/menus-configuration-options/#menubar menubar: false, // To make the toolbar take up a bit less space we use the Small // premium skin and the small premium icon pack (this is completely // optional). You can also create your own small skin and icon pack. - // https://www.tiny.cloud/docs/enterprise/premium-skins-and-icon-packs/snow-demo/ - // https://www.tiny.cloud/docs/configure/editor-appearance/#skin - // https://www.tiny.cloud/docs/advanced/creating-a-skin/ - // https://www.tiny.cloud/docs/configure/editor-appearance/#icons - // https://www.tiny.cloud/docs/advanced/creating-an-icon-pack/ + // https://www.tiny.cloud/docs/tinymce/latest/snow-demo/ + // https://www.tiny.cloud/docs/tinymce/latest/editor-skin/ + // https://www.tiny.cloud/docs/tinymce/latest/creating-a-skin/ + // https://www.tiny.cloud/docs/tinymce/latest/editor-icons/ + // https://www.tiny.cloud/docs/tinymce/latest/creating-an-icon-pack/ + // https://www.tiny.cloud/docs/tinymce/latest/enhanced-skins-and-icon-packs/ skin: 'small', icons: 'small', // In emails we rarely use target for links so we hide the // target drop down in the link dialog - // https://www.tiny.cloud/docs/plugins/link/#target_list + // https://www.tiny.cloud/docs/tinymce/latest/link/#link_target_list target_list: false, // We don't want users to be able to resize images by using // drag and drop because it can break layout templates. - // https://www.tiny.cloud/docs/configure/advanced-editing-behavior/#object_resizing + // https://www.tiny.cloud/docs/tinymce/latest/content-behavior-options/#object_resizing object_resizing : false, // The formats option is where custom formatting options are defined. // In this case we define a couple of headings and a button appearance // for links. HTML Emails require inlining the CSS. Fortunately the // styles property makes that easy. - // https://www.tiny.cloud/docs/configure/content-formatting/#formats + // https://www.tiny.cloud/docs/tinymce/latest/content-formatting/#formats formats: { h1: { block: 'h1', styles: { fontSize: '32px' } }, h2: { block: 'h2', styles: { fontSize: '18px' } }, @@ -73,7 +74,7 @@ }, // The style_formats option controls the styleformat toolbar button menu - // https://www.tiny.cloud/docs/configure/editor-appearance/#style_formats + // https://www.tiny.cloud/docs/tinymce/latest/user-formatting-options/#style_formats style_formats: [ { title: 'Paragraph', format: 'p' }, { title: 'Heading 1', format: 'h1' }, diff --git a/email/marketing-email.html b/email/marketing-email.html index 357606d..51f80ae 100644 --- a/email/marketing-email.html +++ b/email/marketing-email.html @@ -1,17 +1,17 @@ @@ -22,109 +22,75 @@ - -
-
- diff --git a/email/webmail-rich-text-editor.html b/email/webmail-rich-text-editor.html index f431c9d..73d4e2d 100644 --- a/email/webmail-rich-text-editor.html +++ b/email/webmail-rich-text-editor.html @@ -14,8 +14,8 @@ selector:'#editor', // If we don't need the menubar or statusbar we can hide them - // https://www.tiny.cloud/docs/configure/editor-appearance/#menubar - // https://www.tiny.cloud/docs/configure/editor-appearance/#statusbar + // https://www.tiny.cloud/docs/tinymce/latest/menus-configuration-options/#menubar + // https://www.tiny.cloud/docs/tinymce/latest/statusbar-configuration-options/#statusbar menubar: false, statusbar: false, @@ -25,24 +25,24 @@ // To create an interesting visual appearance we use a premium skin // called outside which moves the toolbar outside of the editor // frame. You can also create your own skin and icon pack. - // https://www.tiny.cloud/docs/enterprise/premium-skins-and-icon-packs/outside-demo/ - // https://www.tiny.cloud/docs/configure/editor-appearance/#skin - // https://www.tiny.cloud/docs/advanced/creating-a-skin/ - skin: 'outside', + // https://www.tiny.cloud/docs/tinymce/latest/naked-demo/ + // https://www.tiny.cloud/docs/tinymce/latest/editor-skin/ + // https://www.tiny.cloud/docs/tinymce/latest/creating-a-skin/ + skin: 'naked', // Set the height of the editor. Tip! Any css unit works, even calc(). - // https://www.tiny.cloud/docs/configure/editor-appearance/#height + // https://www.tiny.cloud/docs/tinymce/latest/autoresize/#min_height height: '300px', // This option allows you to specify the buttons and the order that they // will appear on TinyMCE’s toolbar. - // https://www.tiny.cloud/docs/configure/editor-appearance/#toolbar + // https://www.tiny.cloud/docs/tinymce/latest/toolbar-configuration-options/#toolbar toolbar: 'undo redo | formatgroup | link emoticons image | code removeformat', // Toolbar groups is a useful concept for organizing the toolbar into // sub toolbars that show up as a floating toolbar. // This particular toolbar config is inspired by Gmail. - // https://www.tiny.cloud/docs/configure/editor-appearance/#toolbar_groups + // https://www.tiny.cloud/docs/tinymce/latest/toolbar-configuration-options/#toolbar_groups toolbar_groups: { formatgroup: { icon: 'format', @@ -52,7 +52,7 @@ }, // Move the toolbar below the editable area - // https://www.tiny.cloud/docs/configure/editor-appearance/#toolbar_location + // https://www.tiny.cloud/docs/tinymce/latest/toolbar-configuration-options/#toolbar_location toolbar_location: 'bottom', // The formats option is where custom formatting options are defined. @@ -62,7 +62,7 @@ // p tags that lacks style attribute. The first item in the array will // be the one applied when choosing the format via the styles // toolbar button. - // https://www.tiny.cloud/docs/configure/content-formatting/#formats + // https://www.tiny.cloud/docs/tinymce/latest/content-formatting/#formats formats: { h1: { block: 'h1', styles: { fontSize: '24px' } }, h2: { block: 'h2', styles: { fontSize: '18px' } }, @@ -76,13 +76,13 @@ // An alternative to the styles toolbar button is the styles button // which is a simpler version of the styles button. It is configured // using the block_formats option. - // https://www.tiny.cloud/docs/configure/editor-appearance/#block_formats + // https://www.tiny.cloud/docs/tinymce/latest/user-formatting-options/#block_formats block_formats: 'Normal=p; Heading=h1; Sub heading=h2; Small=small', // In order to force TinyMCE to apply inline styles to the default paragraph // text we can use the forced_root_block together with forced_root_block_attrs. - // https://www.tiny.cloud/docs/configure/content-filtering/#forced_root_block - // https://www.tiny.cloud/docs/configure/content-filtering/#forced_root_block_attrs + // https://www.tiny.cloud/docs/tinymce/latest/content-filtering/#forced_root_block + // https://www.tiny.cloud/docs/tinymce/latest/content-filtering/#forced_root_block_attrs forced_root_block: 'p', forced_root_block_attrs: { 'style': 'font-size: 14px; font-family: helvetica, arial, sans-serif;'}, }); @@ -98,14 +98,22 @@ max-width: 800px; margin: auto; } + + .editor-wrap { + border: 1px solid #ccc; + border-radius: 6px; + overflow: hidden; + }
- +
+ +
diff --git a/images/image-alt-text-context-form.html b/images/image-alt-text-context-form.html index 13c7d89..4425f73 100644 --- a/images/image-alt-text-context-form.html +++ b/images/image-alt-text-context-form.html @@ -17,7 +17,7 @@ selector: '#editor', // If we don't need the menubar we can hide it - // https://www.tiny.cloud/docs/configure/editor-appearance/#menubar + // https://www.tiny.cloud/docs/tinymce/latest/menus-configuration-options/#menubar menubar: false, // Tip! To make TinyMCE leaner, only include the plugins you actually need. @@ -25,14 +25,14 @@ // This option allows you to specify the buttons and the order that they // will appear on TinyMCE’s toolbar. - // https://www.tiny.cloud/docs/configure/editor-appearance/#toolbar + // https://www.tiny.cloud/docs/tinymce/latest/toolbar-configuration-options/#toolbar toolbar: 'styles | bold italic underline | link image | code', // To make sure the toolbar never scrolls out of view which can happen when // writing very long texts while using the autoresize plugin. This option // sticks the toolbar to the top of the screen while the editable area // is visible - // https://www.tiny.cloud/docs/configure/editor-appearance/#toolbar_sticky + // https://www.tiny.cloud/docs/tinymce/latest/menus-configuration-options/#toolbar_sticky toolbar_sticky: true, // The following css will be injected into the editor, extending @@ -40,8 +40,8 @@ // In a real world scenario, with much more custom styles for headings // links, tables, images etc, it's strongly recommended to use the // content_css option to load a separate CSS file. Makes editing easier too. - // https://www.tiny.cloud/docs/configure/content-appearance/#content_style - // https://www.tiny.cloud/docs/configure/content-appearance/#content_css + // https://www.tiny.cloud/docs/tinymce/latest/add-css-options/#content_style + // https://www.tiny.cloud/docs/tinymce/latest/add-css-options/#content_css content_style: ` body { min-height: 100vh; @@ -56,11 +56,11 @@ setup: (editor) => { // Instead of defining a custom icon pack, we can register individual // icons using the API. - // https://www.tiny.cloud/docs/api/tinymce.editor.ui/tinymce.editor.ui.registry/#addicon + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editor.ui.registry/#addIcon editor.ui.registry.addIcon('alt-text', ''); // Register a custom context toolbar shown when selecting any image - // https://www.tiny.cloud/docs/ui-components/contexttoolbar/#registeringacontexttoolbar + // https://www.tiny.cloud/docs/tinymce/latest/contexttoolbar/#registeringacontexttoolbar editor.ui.registry.addContextToolbar('imageContextToolbar', { predicate: function (node) { return node.nodeName.toLowerCase() === 'img' @@ -72,7 +72,7 @@ // The context form contains our alt text input field. It also manages // the toolbar button that opens the context form. - // https://www.tiny.cloud/docs/ui-components/contextform/ + // https://www.tiny.cloud/docs/tinymce/latest/contextform/ editor.ui.registry.addContextForm('alttext', { // Define the button used in our context toolbar to open the context form launch: { @@ -88,11 +88,11 @@ initValue: () => { // First we get the selected element. It can be either the // callout itself or any child element within it. - // https://www.tiny.cloud/docs/api/tinymce.dom/tinymce.dom.selection/#getnode + // // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.dom.selection/#getNode const node = editor.selection.getNode(); // Get the selected image's alt attribute text - // https://www.tiny.cloud/docs/api/tinymce.dom/tinymce.dom.domutils/#getattrib + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.dom.domutils/#getAttrib const altText = tinymce.DOM.getAttrib(node, 'alt'); // Return the the alt text to be displayed as initial value @@ -109,18 +109,18 @@ onAction: (contextFormApi) => { // Working directly with the DOM requires manually adding // the actions to the undo stack. - // https://www.tiny.cloud/docs/api/tinymce/tinymce.undomanager/ + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.undomanager/ editor.undoManager.transact(() => { // Get the selected element (in this case our image) - // https://www.tiny.cloud/docs/api/tinymce.dom/tinymce.dom.selection/#getnode + // // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.dom.selection/#getNode const node = editor.selection.getNode(); // Set the alt attribute on the selected image - // https://www.tiny.cloud/docs/api/tinymce.dom/tinymce.dom.domutils/#setattrib + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.dom.domutils/#setAttrib const alt = tinymce.DOM.setAttrib(node, 'alt', contextFormApi.getValue()); // Close the context form - // https://www.tiny.cloud/docs/ui-components/contextform/#formapi + // https://www.tiny.cloud/docs/tinymce/latest/contextform/#formapi contextFormApi.hide(); }); } @@ -131,7 +131,7 @@ icon: 'close', onAction: (contextform) => { // The cancel button simply closes the context form - // https://www.tiny.cloud/docs/ui-components/contextform/#formapi + // https://www.tiny.cloud/docs/tinymce/latest/contextform/#formapi contextform.hide(); } }, diff --git a/images/toggle-image-size-context-toolbar.html b/images/toggle-image-size-context-toolbar.html index 7693c0b..b1d1882 100644 --- a/images/toggle-image-size-context-toolbar.html +++ b/images/toggle-image-size-context-toolbar.html @@ -29,55 +29,55 @@ // Since we are primarily using quickbars, we hide the menubar, // toolbar and statusbar - // https://www.tiny.cloud/docs/configure/editor-appearance/#menubar - //https://www.tiny.cloud/docs/configure/editor-appearance/#toolbar - // https://www.tiny.cloud/docs/configure/editor-appearance/#statusbar + // https://www.tiny.cloud/docs/tinymce/latest/menus-configuration-options/#menubar + // https://www.tiny.cloud/docs/tinymce/latest/toolbar-configuration-options/#toolbar + // https://www.tiny.cloud/docs/tinymce/latest/statusbar-configuration-options/#statusbar menubar: false, toolbar: false, statusbar: false, // To remove the outside borders from editor we can the borderless // premium skin. You can also create your own borderless skin. - // https://www.tiny.cloud/docs/enterprise/premium-skins-and-icon-packs/borderless-demo/ - // https://www.tiny.cloud/docs/configure/editor-appearance/#skin - // https://www.tiny.cloud/docs/advanced/creating-a-skin/ + // https://www.tiny.cloud/docs/tinymce/latest/borderless-demo/ + // https://www.tiny.cloud/docs/tinymce/latest/editor-skin/ + // https://www.tiny.cloud/docs/tinymce/latest/creating-a-skin/ skin: 'borderless', // Tip! The height option accepts any valid CSS for height - // https://www.tiny.cloud/docs/configure/editor-appearance/#height + // https://www.tiny.cloud/docs/tinymce/latest/customize-ui/#changing-editor-height-and-width height: '100vh', // Make the custom icon pack available in TinyMCE. A custom icon pack // extends the default icon pack. - // https://www.tiny.cloud/docs/configure/editor-appearance/#icons + // https://www.tiny.cloud/docs/tinymce/latest/editor-icons/ icons: 'image-context-toolbar', // Define the toolbar that shows up when selecting text based content - // https://www.tiny.cloud/docs/plugins/quickbars/#quickbars_selection_toolbar + // https://www.tiny.cloud/docs/tinymce/latest/quickbars/#quickbars_selection_toolbar quickbars_selection_toolbar: 'styles | bold italic underline backcolor | align bullist | quicklink code', // Define the toolbar that shows up when selecting images. Notice the // custom botton we have put last. See further down how it's set up. - // https://www.tiny.cloud/docs/plugins/quickbars/#quickbars_image_toolbar + // https://www.tiny.cloud/docs/tinymce/latest/quickbars/#quickbars_image_toolbar quickbars_image_toolbar: 'wideimage fullwidthimage asideimage | imageproperties', // We don't want users to be able to resize images manually. This option // will remove the resize handles on images (and tables) - // https://www.tiny.cloud/docs/configure/advanced-editing-behavior/#object_resizing + // https://www.tiny.cloud/docs/tinymce/latest/content-behavior-options/#object_resizing object_resizing : false, // Hide the image dimension input field from the image properties dialog - // https://www.tiny.cloud/docs/plugins/image/#image_dimensions + // https://www.tiny.cloud/docs/tinymce/latest/image/#image_dimensions image_dimensions: false, // Enable the user to display image captions via the image properties dialog - // https://www.tiny.cloud/docs/plugins/image/#image_caption + // https://www.tiny.cloud/docs/tinymce/latest/image/#image_caption image_caption: true, // The formats option is where custom formatting options are defined. // In this case we define the different image size formats we want users // to be able to select through the image context toolbar. - // https://www.tiny.cloud/docs/configure/content-formatting/#formats + // https://www.tiny.cloud/docs/tinymce/latest/content-formatting/#formats formats: { wide_image: { // Which html element that can accept the format @@ -105,24 +105,24 @@ setup: (editor) => { // Register a toolbar button for which is used to toggle the images - // https://www.tiny.cloud/docs/ui-components/toolbarbuttons/ + // https://www.tiny.cloud/docs/tinymce/latest/custom-toolbarbuttons/ editor.ui.registry.addToggleButton('wideimage', { // References the icon identifier in the icon pack at the top of this // document and loaded into TinyMCE using the icons option. icon: 'image-wide', onAction: (api) => { // Issue a command to apply a format - // https://www.tiny.cloud/docs/api/tinymce/tinymce.editor/#execcommand + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editor/#execCommand editor.execCommand('mceToggleFormat', false, 'wide_image'); // We also need to remove the formats we don't longer want to use - // https://www.tiny.cloud/docs/api/tinymce/tinymce.formatter/ + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.formatter/ editor.formatter.remove('full_width_image'); editor.formatter.remove('aside_image'); }, onSetup: (buttonApi) => { // This block of code highlights this button if the selected image // already has the specified format applied - // https://www.tiny.cloud/docs/api/tinymce/tinymce.formatter/ + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.formatter/ buttonApi.setActive(editor.formatter.match('wide_image')); let change = editor.formatter.formatChanged('wide_image', (state) => buttonApi.setActive(state)); return () => { @@ -168,7 +168,7 @@ icon: 'image-options', onAction: (api) => { // the mceImage command opens the image properties dialog - // https://www.tiny.cloud/docs/plugins/image/#commands + // https://www.tiny.cloud/docs/tinymce/latest/image/#commands editor.execCommand('mceImage'); } }); @@ -179,8 +179,8 @@ // In a real world scenario, it's recommended to use the content_css // option to load a separate CSS file. Makes editing easier too. // We also assume you know enough CSS to make sense of the styles below - // https://www.tiny.cloud/docs/configure/content-appearance/#content_style - // https://www.tiny.cloud/docs/configure/content-appearance/#content_css + // https://www.tiny.cloud/docs/tinymce/latest/add-css-options/#content_style + // https://www.tiny.cloud/docs/tinymce/latest/add-css-options/#content_css content_style: ` body { color: #444; diff --git a/index.html b/index.html index 4a9fb8f..7ab116b 100644 --- a/index.html +++ b/index.html @@ -240,14 +240,14 @@

TinyMCE Demos

TinyMCE is a versatile tool that can be used for a wide variety of text editing tasks. This repository aims to inspire you and demonstrate different approaches to common use cases.

Every demo has a thorougly documented html file explaining the TinyMCE config as well as links to relevant documentation to make it easy to use these demos as basis for your own projects.

Make sure you visit the Github repository and look through the HTML files. Each demo is carefully documented to help you get the most out of TinyMCE. -

These demos are released under a MIT license. TinyMCE is licensed under a LGPL or commercial license

+

These demos are released under a MIT license. TinyMCE is available under a commercial license and a subset of the features are open source under the GNU General Public License Version 2 or later

TinyMCE Basics

-

The following demos showcase common how-tos like creating toolbar buttons, menu items, formattingS etc.

+

The following demos showcase common how-tos like creating toolbar buttons, menu items, formatting etc.

-
-

Right aligned toolbar buttons

-

Normally we strongly advice against overriding the TinyMCE CSS to tweak the editor. The proper way to change the visual appearance is to make a skin. That said, there is always exceptions to a good rule and moving a couple of toolbar buttons to the right side of the toolbar is one example of such an exeception.

- Beginner - Toolbar -
- -
- -
-
-

Tokens

-

Tokens – or mail merge variables such as {{name.first}} – are often found in document automation and email editors. Here are three ways you can implement them in TinyMCE

-
- -
-

Text-based tokens

-

Transform any text based tokens such as {{name.first}} into spans that we can style and make noneditable – and transform back to pure text when storing the content. Perfect for existing systems as this approach is non-destructive to your content.

- Beginner - Buttons & Menus - Content Styling - Plugin:Noneditable -
- -
-

Web component tokens

-

With the january 2020 release of Microsoft Edge, all major browsers now supports web components. Here we create a custom element called <inline-token> that becomes our token. Tip: You can render the custom element using vue/angular/react in your front-end

- Master - Buttons & Menus - Content Styling - Custom Elements -
- -
-

Span-based tokens

-

Here we use a span with a class to wrap our token. A simple but powerful approach.

- Beginner - Buttons & Menus - Content Styling -
-
+
@@ -396,22 +356,6 @@

Templates

Examples and ideas how to implement templates and layouts with TinyMCE. For example how to only enable editing on select parts of a document or to enable multiple column support in TinyMCE

-
-

Advanced Placeholders – pick a template from a blank document

-

This demo shows how to implement an empty page placeholder UI containing complex HTML and buttons to insert templates. This feature is found in popular apps like Notion and Atlassian Confluence among others.

- Master - Content Styling - Plugin:Templates -
- - -

Locked down template example 1: using the default inline mode

A popular question we get is how to lock down the editor in different ways to force a specific order of elements or prevent formatting. The way to do this is by using the inline mode which will give you more flexibility over the TinyMCE UI. Here is a basic example using the regular inline mode.

diff --git a/package.json b/package.json index 480c39f..13f2350 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,14 @@ { "name": "oxide-usecase-demos", "version": "1.0.1", - "description": "Use Case Demos for TinyMCE 5 Oxide Skin", + "description": "Use Case Demos for TinyMCE", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "serve": "browser-sync start --server --files '*.html'" }, "author": "", - "license": "ISC", + "license": "MIT", "dependencies": { "browser-sync": "^2.26.5" } diff --git a/tables/customizing-the-table-toolbar.html b/tables/customizing-the-table-toolbar.html index 4e4f42b..d7ee684 100644 --- a/tables/customizing-the-table-toolbar.html +++ b/tables/customizing-the-table-toolbar.html @@ -1,10 +1,8 @@ @@ -20,8 +18,8 @@ // If you only need to include one or two icons it's easier to // use the tinymce.editor.ui.Registry.addIcon() method. An example // of that is shown further down in this demo. - // https://www.tiny.cloud/docs/advanced/creating-an-icon-pack/ - // https://www.tiny.cloud/docs/api/tinymce.editor.ui/tinymce.editor.ui.registry/#addicon + // https://www.tiny.cloud/docs/tinymce/latest/creating-an-icon-pack/ + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editor.ui.registry/#addIcon tinymce.IconManager.add('customIcons', { icons: { 'table-column-options': '', @@ -32,7 +30,7 @@ selector:'#editor', // Toggle the menubar off if it isn't needed - // https://www.tiny.cloud/docs/configure/editor-appearance/#menubar + // https://www.tiny.cloud/docs/tinymce/latest/menus-configuration-options/#menubar menubar: false, // Tip! To make TinyMCE leaner, only include the plugins you actually need. @@ -40,18 +38,18 @@ // This option allows you to specify the buttons and the order that they // will appear on TinyMCE’s toolbar. - // https://www.tiny.cloud/docs/configure/editor-appearance/#toolbar + // https://www.tiny.cloud/docs/tinymce/latest/toolbar-configuration-options/#toolbar toolbar: 'styles | bold italic underline | inserttable link image emoticons | align bullist numlist | code removeformat', //Set the height of the editor. Tip: Any css value is accepted as a string. - // https://www.tiny.cloud/docs/configure/editor-appearance/#height + // https://www.tiny.cloud/docs/tinymce/latest/customize-ui/#changing-editor-height-and-width height: 400, // The following css will be injected into the editor, extending // the default styles. In a real world scenario, it's recommended // to use the content_css option to load a separate CSS file. - // https://www.tiny.cloud/docs/configure/content-appearance/#content_style - // https://www.tiny.cloud/docs/configure/content-appearance/#content_css + // https://www.tiny.cloud/docs/tinymce/latest/add-css-options/#content_style + // https://www.tiny.cloud/docs/tinymce/latest/add-css-options/#content_css content_style: ` table { width: 100%; @@ -66,22 +64,22 @@ // Make the custom icon pack available in TinyMCE. A custom icon pack // extends the default icon pack. - // https://www.tiny.cloud/docs/configure/editor-appearance/#icons + // https://www.tiny.cloud/docs/tinymce/latest/editor-icons/ icons: 'customIcons', // In this demo we don't want to use the right click context menus - // https://www.tiny.cloud/docs/configure/editor-appearance/#contextmenu + // https://www.tiny.cloud/docs/tinymce/latest/menus-configuration-options/#contextmenu contextmenu: false, // Tell TinyMCE how to modify the table HTML when converting regular rows // to header rows. In this case td's will move into `thead` and be // converted to `th`. - // https://www.tiny.cloud/docs/plugins/table/#table_header_type + // https://www.tiny.cloud/docs/tinymce/latest/table-options/#table_header_type table_header_type: 'sectionCells', // Configure the table context toolbar. The last button is // the built in remove table button. - // https://www.tiny.cloud/docs/plugins/table/#table_toolbar + // https://www.tiny.cloud/docs/tinymce/latest/toolbar-configuration-options/#table_toolbar table_toolbar: 'celloptions rowoptions columnoptions | tabledelete', setup: (editor) => { @@ -92,7 +90,7 @@ // object. The keycode numbers 37 to 40 represent the arrow keys. // For a list of javascript keycodes see // https://css-tricks.com/snippets/javascript/javascript-keycodes/ - // https://www.tiny.cloud/docs/advanced/keyboard-shortcuts/ + // https://www.tiny.cloud/docs/tinymce/latest/keyboard-shortcuts/ editor.addShortcut('alt+37', "Insert column before", () => { menuActionManager.insertColumnBefore(); }); @@ -109,10 +107,10 @@ menuActionManager.insertRowAfter(); }); - // TinyMCE 5.4 introduced improved APIs for inserting tables. + // TinyMCE has APIs for inserting tables. // Here's a toolbar button that displays a table grid picker // The table picker is unfortunately undocumented at this stage - // https://www.tiny.cloud/docs/ui-components/toolbarbuttons/ + // https://www.tiny.cloud/docs/tinymce/latest/custom-toolbarbuttons/ editor.ui.registry.addMenuButton('inserttable', { icon: 'table', tooltip: 'Insert table', @@ -122,7 +120,7 @@ type: 'fancymenuitem', fancytype: 'inserttable', onAction: function(data) { - // https://www.tiny.cloud/docs/plugins/table/#commands + // https://www.tiny.cloud/docs/tinymce/latest/table/#commands editor.execCommand('mceInsertTable', false, { rows: data.numRows, columns: data.numColumns, options: { headerRows: 1 } }); } } @@ -131,9 +129,9 @@ }); // Create a toolbar menu button to hold all row related options - // https://www.tiny.cloud/docs/ui-components/typesoftoolbarbuttons/#menubutton + // https://www.tiny.cloud/docs/tinymce/latest/custom-menu-toolbar-button/ editor.ui.registry.addMenuButton('rowoptions', { - icon: 'table-row-properties', // Part of the default icon pack: https://www.tiny.cloud/docs/advanced/editor-icon-identifiers/ + icon: 'table-row-properties', // Part of the default icon pack: https://www.tiny.cloud/docs/tinymce/latest/editor-icon-identifiers/ tooltip: 'Row options', fetch: (callback) => { var items = [ @@ -179,6 +177,7 @@ menuActionManager.deleteRow(); } }, + /* { type: 'separator', }, @@ -207,8 +206,8 @@ }, onSetup: (buttonApi) => { // Check the clipboard for any rows and disable the menu item if there is none - // https://www.tiny.cloud/docs/plugins/table/#api - // https://www.tiny.cloud/docs/ui-components/typesoftoolbarbuttons/#api + // https://www.tiny.cloud/docs/tinymce/latest/table/#api + // https://www.tiny.cloud/docs/tinymce/latest/custom-toolbarbuttons/#api const state = editor.plugins.table.getClipboardRows().length > 0 ? false : true; buttonApi.setDisabled(state); } @@ -222,19 +221,20 @@ }, onSetup: (buttonApi) => { // Check the clipboard for any rows and disable the menu item if there is none - // https://www.tiny.cloud/docs/plugins/table/#api - // https://www.tiny.cloud/docs/ui-components/typesoftoolbarbuttons/#api + // https://www.tiny.cloud/docs/tinymce/latest/table/#api + // https://www.tiny.cloud/docs/tinymce/latest/custom-toolbarbuttons/#api const state = editor.plugins.table.getClipboardRows().length > 0 ? false : true; buttonApi.setDisabled(state); } }, + */ ]; callback(items); } }); // Create a toolbar menu button to hold all row related options - // https://www.tiny.cloud/docs/ui-components/typesoftoolbarbuttons/#menubutton + // https://www.tiny.cloud/docs/tinymce/latest/custom-menu-toolbar-button/ editor.ui.registry.addMenuButton('columnoptions', { icon: 'table-column-options', // Insert the icon from the icon pack at the beginning of this file tooltip: 'Column options', @@ -282,6 +282,7 @@ menuActionManager.deleteColumn(); } }, + /* { type: 'separator', }, @@ -300,7 +301,7 @@ onAction: () => { menuActionManager.copyColumn(); } - }, + }, { type: 'menuitem', text: 'Paste column before', @@ -310,8 +311,8 @@ }, onSetup: (buttonApi) => { // Check the clipboard for any cols and disable the menu item if there is none - // https://www.tiny.cloud/docs/plugins/table/#api - // https://www.tiny.cloud/docs/ui-components/typesoftoolbarbuttons/#api + // https://www.tiny.cloud/docs/tinymce/latest/table/#api + // https://www.tiny.cloud/docs/tinymce/latest/custom-toolbarbuttons/#api const state = editor.plugins.table.getClipboardCols().length > 0 ? false : true; buttonApi.setDisabled(state); } @@ -325,19 +326,20 @@ }, onSetup: (buttonApi) => { // Check the clipboard for any cols and disable the menu item if there is none - // https://www.tiny.cloud/docs/plugins/table/#api - // https://www.tiny.cloud/docs/ui-components/typesoftoolbarbuttons/#api + // https://www.tiny.cloud/docs/tinymce/latest/table/#api + // https://www.tiny.cloud/docs/tinymce/latest/custom-toolbarbuttons/#api const state = editor.plugins.table.getClipboardCols().length > 0 ? false : true; buttonApi.setDisabled(state); } }, + */ ]; callback(items); } }); // Create a toolbar menu button to hold all cell related options - // https://www.tiny.cloud/docs/ui-components/typesoftoolbarbuttons/#menubutton + // https://www.tiny.cloud/docs/tinymce/latest/custom-menu-toolbar-button/ editor.ui.registry.addMenuButton('celloptions', { icon: 'table-cell-properties', // Part of the default icon pack: https://www.tiny.cloud/docs/advanced/editor-icon-identifiers/ tooltip: 'Cell options', @@ -384,84 +386,84 @@ const menuActionManager = { headerRow: () => { // Check the type of the selected table row and inverse it - // https://www.tiny.cloud/docs/advanced/editor-command-identifiers/#querycommandvaluestableplugin + // https://www.tiny.cloud/docs/tinymce/latest/editor-command-identifiers/#querycommandvaluestableplugin const type = tinymce.activeEditor.queryCommandValue('mceTableRowType') === 'body' ? 'header' : 'body'; // Apply the inverse table row type. - // https://www.tiny.cloud/docs/advanced/editor-command-identifiers/#table + // https://www.tiny.cloud/docs/tinymce/latest/editor-command-identifiers/#table tinymce.activeEditor.execCommand('mceTableRowType', false, { type }); }, insertRowBefore: () => { - // https://www.tiny.cloud/docs/advanced/editor-command-identifiers/#table + // https://www.tiny.cloud/docs/tinymce/latest/editor-command-identifiers/#table tinymce.activeEditor.execCommand('mceTableInsertRowBefore'); }, insertRowAfter: () => { - // https://www.tiny.cloud/docs/advanced/editor-command-identifiers/#table + // https://www.tiny.cloud/docs/tinymce/latest/editor-command-identifiers/#table tinymce.activeEditor.execCommand('mceTableInsertRowAfter'); }, deleteRow: () => { - // https://www.tiny.cloud/docs/advanced/editor-command-identifiers/#table + // https://www.tiny.cloud/docs/tinymce/latest/editor-command-identifiers/#table tinymce.activeEditor.execCommand('mceTableDeleteRow'); }, cutRow: () => { - // https://www.tiny.cloud/docs/advanced/editor-command-identifiers/#table + // https://www.tiny.cloud/docs/tinymce/latest/editor-command-identifiers/#table tinymce.activeEditor.execCommand('mceTableCutRow'); }, copyRow: () => { - // https://www.tiny.cloud/docs/advanced/editor-command-identifiers/#table + // https://www.tiny.cloud/docs/tinymce/latest/editor-command-identifiers/#table tinymce.activeEditor.execCommand('mceTableCopyRow'); }, pasteRowBefore: () => { - // https://www.tiny.cloud/docs/advanced/editor-command-identifiers/#table + // https://www.tiny.cloud/docs/tinymce/latest/editor-command-identifiers/#table tinymce.activeEditor.execCommand('mceTablePasteRowBefore'); }, pasteRowAfter: () => { - // https://www.tiny.cloud/docs/advanced/editor-command-identifiers/#table + // https://www.tiny.cloud/docs/tinymce/latest/editor-command-identifiers/#table tinymce.activeEditor.execCommand('mceTablePasteRowAfter'); }, headerColumn: () => { // Check the type of the selected table column and inverse it - // https://www.tiny.cloud/docs/advanced/editor-command-identifiers/#querycommandvaluestableplugin + // https://www.tiny.cloud/docs/tinymce/latest/editor-command-identifiers/#querycommandvaluestableplugin const type = tinymce.activeEditor.queryCommandValue('mceTableColType') === 'td' ? 'th' : 'td'; // Apply the inverse table row type. - // https://www.tiny.cloud/docs/advanced/editor-command-identifiers/#table + // https://www.tiny.cloud/docs/tinymce/latest/editor-command-identifiers/#table tinymce.activeEditor.execCommand('mceTableColType', false, { type }); }, insertColumnBefore: () => { - // https://www.tiny.cloud/docs/advanced/editor-command-identifiers/#table + // https://www.tiny.cloud/docs/tinymce/latest/editor-command-identifiers/#table tinymce.activeEditor.execCommand('mceTableInsertColBefore'); }, insertColumnAfter: () => { - // https://www.tiny.cloud/docs/advanced/editor-command-identifiers/#table + // https://www.tiny.cloud/docs/tinymce/latest/editor-command-identifiers/#table tinymce.activeEditor.execCommand('mceTableInsertColAfter'); }, deleteColumn: () => { - // https://www.tiny.cloud/docs/advanced/editor-command-identifiers/#table + // https://www.tiny.cloud/docs/tinymce/latest/editor-command-identifiers/#table tinymce.activeEditor.execCommand('mceTableDeleteCol'); }, cutColumn: () => { - // https://www.tiny.cloud/docs/advanced/editor-command-identifiers/#table + // https://www.tiny.cloud/docs/tinymce/latest/editor-command-identifiers/#table tinymce.activeEditor.execCommand('mceTableCutCol'); }, copyColumn: () => { - // https://www.tiny.cloud/docs/advanced/editor-command-identifiers/#table + // https://www.tiny.cloud/docs/tinymce/latest/editor-command-identifiers/#table tinymce.activeEditor.execCommand('mceTableCopyCol'); }, pasteColumnBefore: () => { - // https://www.tiny.cloud/docs/advanced/editor-command-identifiers/#table + // https://www.tiny.cloud/docs/tinymce/latest/editor-command-identifiers/#table tinymce.activeEditor.execCommand('mceTablePasteColBefore'); }, pasteColumnAfter: () => { - // https://www.tiny.cloud/docs/advanced/editor-command-identifiers/#table + // https://www.tiny.cloud/docs/tinymce/latest/editor-command-identifiers/#table tinymce.activeEditor.execCommand('mceTablePasteColAfter'); }, mergeCells: () => { - // https://www.tiny.cloud/docs/advanced/editor-command-identifiers/#table + // https://www.tiny.cloud/docs/tinymce/latest/editor-command-identifiers/#table tinymce.activeEditor.execCommand('mceTableMergeCells'); }, splitCell: () => { - // https://www.tiny.cloud/docs/advanced/editor-command-identifiers/#table + // https://www.tiny.cloud/docs/tinymce/latest/editor-command-identifiers/#table tinymce.activeEditor.execCommand('mceTableSplitCells'); } } @@ -520,19 +522,19 @@ // Register an TinyMCE icon. This is an alternate way of creating icons // in TinyMCE. The first argument is the icon name, the second is the svg data. - // https://www.tiny.cloud/docs/api/tinymce.editor.ui/tinymce.editor.ui.registry/#addicon + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editor.ui.registry/#addIcon editor.ui.registry.addIcon(color.icon, color.svg); // Push a submenu item onto the the submenu array in the format // specified for menubuttons. - // https://www.tiny.cloud/docs/ui-components/typesoftoolbarbuttons/#menubutton + // https://www.tiny.cloud/docs/tinymce/latest/custom-toolbarbuttons/#menubutton colorMenuItems.push({ type: 'menuitem', icon: color.icon, text: color.text, tooltip: color.text + ' background', onAction: () => { - // https://www.tiny.cloud/docs/advanced/editor-command-identifiers/#table + // https://www.tiny.cloud/docs/tinymce/latest/editor-command-identifiers/#table editor.execCommand('mceTableApplyCellStyle', false, { backgroundColor: color.value }); } }); diff --git a/tables/table-row-templates.html b/tables/table-row-templates.html index f1bde00..3223032 100644 --- a/tables/table-row-templates.html +++ b/tables/table-row-templates.html @@ -21,7 +21,7 @@ selector:'#editor', // Toggle the menubar off if it isn't needed - // https://www.tiny.cloud/docs/configure/editor-appearance/#menubar + // https://www.tiny.cloud/docs/tinymce/latest/menus-configuration-options/#menubar menubar: false, // Tip! To make TinyMCE leaner, only include the plugins you actually need. @@ -29,38 +29,38 @@ // This option allows you to specify the buttons and the order that they // will appear on TinyMCE’s toolbar. - // https://www.tiny.cloud/docs/configure/editor-appearance/#toolbar + // https://www.tiny.cloud/docs/tinymce/latest/toolbar-configuration-options/#toolbar toolbar: 'styles | bold italic underline forecolor backcolor | table link image emoticons | align bullist numlist | code removeformat', // The Naked premium skin provides a clean look. // You can also easily create your own borderless skin too. - // https://www.tiny.cloud/docs/enterprise/premium-skins-and-icon-packs/naked/ - // https://www.tiny.cloud/docs/configure/editor-appearance/#skin - // https://www.tiny.cloud/docs/advanced/creating-a-skin/ + // https://www.tiny.cloud/docs/tinymce/latest/naked-demo/ + // https://www.tiny.cloud/docs/tinymce/latest/editor-skin/ + // https://www.tiny.cloud/docs/tinymce/latest/creating-a-skin/ skin: 'naked', // To make sure the toolbar never scrolls out of view which can happen when // writing very long texts while using the autoresize plugin. This option // sticks the toolbar to the top of the screen while the editable area // is visible - // https://www.tiny.cloud/docs/configure/editor-appearance/#toolbar_sticky + // https://www.tiny.cloud/docs/tinymce/latest/menus-configuration-options/#toolbar_sticky toolbar_sticky: true, // "Thin" is a premium icon pack you get wth the cloud essential plan. // See https://www.tiny.cloud for more details and purchasing options // You can also create your own icon packs for TinyMCE - // https://www.tiny.cloud/docs/advanced/creating-an-icon-pack/ + // https://www.tiny.cloud/docs/tinymce/latest/enhanced-skins-and-icon-packs/ icons: 'thin', // When using the autoresize plugin we can set a minimum height of the editor - // https://www.tiny.cloud/docs/plugins/autoresize/#min_height + // https://www.tiny.cloud/docs/tinymce/latest/autoresize/#min_height min_height: 400, // The following css will be injected into the editor, extending // the default styles. In a real world scenario, it's recommended // to use the content_css option to load a separate CSS file. - // https://www.tiny.cloud/docs/configure/content-appearance/#content_style - // https://www.tiny.cloud/docs/configure/content-appearance/#content_css + // https://www.tiny.cloud/docs/tinymce/latest/add-css-options/#content_style + // https://www.tiny.cloud/docs/tinymce/latest/add-css-options/#content_css content_style: ` body { max-width: 780px; @@ -105,18 +105,18 @@ // Tell TinyMCE how to modify the table HTML when converting regular rows // to header rows. In this case td's will move into `thead` and be // converted to `th`. - // https://www.tiny.cloud/docs/plugins/table/#table_header_type + // https://www.tiny.cloud/docs/tinymce/latest/table-options/#table_header_type table_header_type: 'sectionCells', // Configure the table context toolbar. The last button is // the built in remove table button. - // https://www.tiny.cloud/docs/plugins/table/#table_toolbar + // https://www.tiny.cloud/docs/tinymce/latest/toolbar-configuration-options/#table_toolbar table_toolbar: 'inserttemplaterow | tabledeleterow tabledelete', setup: (editor) => { // Register a custom toolbar button for opening the badge dialog. - // https://www.tiny.cloud/docs/ui-components/toolbarbuttons/ + // https://www.tiny.cloud/docs/tinymce/latest/custom-toolbarbuttons/ editor.ui.registry.addButton('inserttemplaterow', { icon: 'table-insert-row-after', text: 'Insert drone status', @@ -124,8 +124,7 @@ onAction: () => { // Opens a TinyMCE modal - // https://www.tiny.cloud/docs/ui-components/dialog/ - // https://www.tiny.cloud/docs/ui-components/dialogcomponents/ + // https://www.tiny.cloud/docs/tinymce/latest/dialog/ editor.windowManager.open({ title: 'Insert Drone Details', body: { @@ -173,19 +172,19 @@ `; // Store any existing table clipboard row data - // https://www.tiny.cloud/docs/plugins/table/#api + // https://www.tiny.cloud/docs/tinymce/latest/table/#api const storedClipboard = editor.plugins.table.getClipboardRows(); // Set the clipboard data to be the table row element created previously - // https://www.tiny.cloud/docs/plugins/table/#api + // https://www.tiny.cloud/docs/tinymce/latest/table/#api editor.plugins.table.setClipboardRows([tr]); // Paste the table clipboard data - // https://www.tiny.cloud/docs/plugins/table/#commands + // https://www.tiny.cloud/docs/tinymce/latest/table/#commands editor.execCommand('mceTablePasteRowAfter'); // Restore the saved table clipboard row data - // https://www.tiny.cloud/docs/plugins/table/#api + // https://www.tiny.cloud/docs/tinymce/latest/table/#api editor.plugins.table.setClipboardRows(storedClipboard); // Close the dialog. diff --git a/templates-and-layout/README.md b/templates-and-layout/README.md index 1dfbccc..959c3cf 100644 --- a/templates-and-layout/README.md +++ b/templates-and-layout/README.md @@ -1,5 +1,5 @@ # Templates and Layouts -Examples and ideas how to implement templates and layouts with TinyMCE. For example how to only enable editing on select parts of a document or to enable multiple column support in TinyMCE. +Examples and ideas how to implement templates and layouts with TinyMCE. For example how to only enable editing on select parts of a document **Don't miss!** Each HTML file contains detailed comments for each option to help you get started. diff --git a/templates-and-layout/advanced-placeholder.html b/templates-and-layout/advanced-placeholder.html deleted file mode 100644 index 98e7b3f..0000000 --- a/templates-and-layout/advanced-placeholder.html +++ /dev/null @@ -1,351 +0,0 @@ - - - - - - - Advanced placeholder demo - - - - - - - -
- -
- - diff --git a/templates-and-layout/locked-down-template-inline-bordered.html b/templates-and-layout/locked-down-template-inline-bordered.html index 265bc8a..42f6240 100644 --- a/templates-and-layout/locked-down-template-inline-bordered.html +++ b/templates-and-layout/locked-down-template-inline-bordered.html @@ -20,7 +20,7 @@ // You have to wire up the persistent storage yourself, for example // getting the editable area's DOM tree, serlialize it and send it // to the backend using a hidden inputfield. - // https://www.tiny.cloud/docs/configure/editor-appearance/#inline + // https://www.tiny.cloud/docs/tinymce/latest/use-tinymce-inline/ inline: true, // Tip! To make TinyMCE leaner, only include the plugins you actually need. @@ -28,43 +28,50 @@ // This option allows you to specify the buttons and the order that they // will appear on TinyMCE’s toolbar. - // https://www.tiny.cloud/docs/configure/editor-appearance/#toolbar + // https://www.tiny.cloud/docs/tinymce/latest/toolbar-configuration-options/#toolbar toolbar: 'undo redo | styles | bold italic strikethrough backcolor | link image | align bullist numlist', // Toggle the menubar off to get a leaner visual experience - // https://www.tiny.cloud/docs/configure/editor-appearance/#menubar + // https://www.tiny.cloud/docs/tinymce/latest/menus-configuration-options/#menubar menubar: false, // Text to show when the editor is empty - // https://www.tiny.cloud/docs/configure/editor-appearance/#placeholder + // https://www.tiny.cloud/docs/tinymce/latest/editor-important-options/#placeholder placeholder: 'Page body', + // To remove the outside borders of the toolbar we use a premium skin. + // You can also easily create your own borderless skin too. + // https://www.tiny.cloud/docs/tinymce/latest/borderless-demo/ + // https://www.tiny.cloud/docs/tinymce/latest/editor-skin/ + // https://www.tiny.cloud/docs/tinymce/latest/creating-a-skin/ + skin: 'borderless', + // Render the inline toolbar in this element - // https://www.tiny.cloud/docs/configure/editor-appearance/#fixed_toolbar_container + // https://www.tiny.cloud/docs/tinymce/latest/menus-configuration-options/#fixed_toolbar_container fixed_toolbar_container: '#toolbar', - // Make the toolbar always visible (requires TinyMCE 5.5) - // https://www.tiny.cloud/docs/configure/editor-appearance/#toolbar_persist + // Make the toolbar always visible + // https://www.tiny.cloud/docs/tinymce/latest/toolbar-configuration-options/#persistent-inline-editor-toolbar-options toolbar_persist: true, setup: (editor) => { // Disable the UI when the editor has loaded - // https://www.tiny.cloud/docs/api/tinymce.editor.ui/tinymce.editor.ui.ui/ - // https://www.tiny.cloud/docs/advanced/events/ + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editor.ui.ui/ + // https://www.tiny.cloud/docs/tinymce/latest/events/ editor.on('SkinLoaded', () => { editor.ui.setEnabled(false); }); // Enable the UI when the editable area gains focus - // TODO: https://www.tiny.cloud/docs/api/tinymce.editor.ui/tinymce.editor.ui.ui/ - // https://www.tiny.cloud/docs/advanced/events/ + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editor.ui.ui/ + // https://www.tiny.cloud/docs/tinymce/latest/events/ editor.on('focus', () => { editor.ui.setEnabled(true); }); // Disable the UI when the editor looses focus - // https://www.tiny.cloud/docs/api/tinymce.editor.ui/tinymce.editor.ui.ui/ - // https://www.tiny.cloud/docs/advanced/events/ + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editor.ui.ui/ + // https://www.tiny.cloud/docs/tinymce/latest/events/ editor.on('blur', () => { editor.ui.setEnabled(false); }); diff --git a/templates-and-layout/locked-down-template-inline-context-toolbars.html b/templates-and-layout/locked-down-template-inline-context-toolbars.html index 84cb99e..1e4e592 100644 --- a/templates-and-layout/locked-down-template-inline-context-toolbars.html +++ b/templates-and-layout/locked-down-template-inline-context-toolbars.html @@ -20,26 +20,26 @@ // You have to wire up the persistent storage yourself, for example // getting the editable area's DOM tree, serlialize it and send it // to the backend using a hidden inputfield. - // https://www.tiny.cloud/docs/configure/editor-appearance/#inline + // https://www.tiny.cloud/docs/tinymce/latest/use-tinymce-inline/ inline: true, // The quickbars enable the context toolbars shown on selection // Tip! To make TinyMCE leaner, only include the plugins you actually need. - // https://www.tiny.cloud/docs/plugins/quickbars/ + // https://www.tiny.cloud/docs/tinymce/latest/quickbars/ plugins: 'quickbars anchor autolink link lists', // When using quickbars, we disable the regular toolbar and menubar - // https://www.tiny.cloud/docs/configure/editor-appearance/#toolbar - // https://www.tiny.cloud/docs/configure/editor-appearance/#menubar + // https://www.tiny.cloud/docs/tinymce/latest/toolbar-configuration-options/#toolbar + // https://www.tiny.cloud/docs/tinymce/latest/menus-configuration-options/#menubar toolbar: false, menubar: false, // Configure the toolbar button shown in the context toolbar - // https://www.tiny.cloud/docs/plugins/quickbars/#quickbars_selection_toolbar + // https://www.tiny.cloud/docs/tinymce/latest/quickbars/#quickbars_selection_toolbar quickbars_selection_toolbar: 'styles | bold italic strikethrough backcolor link | align | bullist numlist', // Text to show when the editor is empty - // https://www.tiny.cloud/docs/configure/editor-appearance/#placeholder + // https://www.tiny.cloud/docs/tinymce/latest/editor-important-options/#placeholder placeholder: 'Page body' }); diff --git a/templates-and-layout/locked-down-template-inline-default.html b/templates-and-layout/locked-down-template-inline-default.html index a5c1808..6a20ecc 100644 --- a/templates-and-layout/locked-down-template-inline-default.html +++ b/templates-and-layout/locked-down-template-inline-default.html @@ -20,7 +20,7 @@ // You have to wire up the persistent storage yourself, for example // getting the editable area's DOM tree, serlialize it and send it // to the backend using a hidden inputfield. - // https://www.tiny.cloud/docs/configure/editor-appearance/#inline + // https://www.tiny.cloud/docs/tinymce/latest/use-tinymce-inline/ inline: true, // Tip! To make TinyMCE leaner, only include the plugins you actually need. @@ -28,15 +28,15 @@ // This option allows you to specify the buttons and the order that // they will appear on TinyMCE’s toolbar. - // https://www.tiny.cloud/docs/configure/editor-appearance/#toolbar + // https://www.tiny.cloud/docs/tinymce/latest/toolbar-configuration-options/#toolbar toolbar: 'styles | bold italic strikethrough backcolor link | code', // Toggle the menubar off to get a leaner visual experience - // https://www.tiny.cloud/docs/configure/editor-appearance/#menubar + // https://www.tiny.cloud/docs/tinymce/latest/menus-configuration-options/#menubar menubar: false, // Text to show when the editor is empty - // https://www.tiny.cloud/docs/configure/editor-appearance/#placeholder + // https://www.tiny.cloud/docs/tinymce/latest/editor-important-options/#placeholder placeholder: 'Page body' }); diff --git a/templates-and-layout/locked-down-template-inline-fixed-toolbar.html b/templates-and-layout/locked-down-template-inline-fixed-toolbar.html index 21ce280..20fcc63 100644 --- a/templates-and-layout/locked-down-template-inline-fixed-toolbar.html +++ b/templates-and-layout/locked-down-template-inline-fixed-toolbar.html @@ -20,7 +20,7 @@ // You have to wire up the persistent storage yourself, for example // getting the editable area's DOM tree, serlialize it and send it // to the backend using a hidden inputfield. - // https://www.tiny.cloud/docs/configure/editor-appearance/#inline + // https://www.tiny.cloud/docs/tinymce/latest/use-tinymce-inline/ inline: true, // Tip! To make TinyMCE leaner, only include the plugins you actually need. @@ -28,54 +28,54 @@ // This option allows you to specify the buttons and the order that // they will appear on TinyMCE’s toolbar. - // https://www.tiny.cloud/docs/configure/editor-appearance/#toolbar + // https://www.tiny.cloud/docs/tinymce/latest/toolbar-configuration-options/#toolbar toolbar: 'undo redo | styles | bold italic strikethrough backcolor | align bullist numlist | link image media blockquote | indent outdent | code removeformat', // Toggle the menubar off to get a leaner visual experience - // https://www.tiny.cloud/docs/configure/editor-appearance/#menubar + // https://www.tiny.cloud/docs/tinymce/latest/menus-configuration-options/#menubar menubar: false, // Text to show when the editor is empty - // https://www.tiny.cloud/docs/configure/editor-appearance/#placeholder + // https://www.tiny.cloud/docs/tinymce/latest/editor-important-options/#placeholder placeholder: 'Page body', // Render the inline toolbar in this element - // https://www.tiny.cloud/docs/configure/editor-appearance/#fixed_toolbar_container + // https://www.tiny.cloud/docs/tinymce/latest/menus-configuration-options/#fixed_toolbar_container fixed_toolbar_container: '#toolbar', - // Make the toolbar always visible (requires TinyMCE 5.5) - // https://www.tiny.cloud/docs/configure/editor-appearance/#toolbar_persist + // Make the toolbar always visible + // https://www.tiny.cloud/docs/tinymce/latest/toolbar-configuration-options/#persistent-inline-editor-toolbar-options toolbar_persist: true, // A nice borderless web-appy skin is our premium skin called Snow, here // used together with the Thin premium icon pack // You can also easily create your own borderless skin too. - // https://www.tiny.cloud/docs/enterprise/premium-skins-and-icon-packs/snow-demo/ - // https://www.tiny.cloud/docs/configure/editor-appearance/#skin - // https://www.tiny.cloud/docs/advanced/creating-a-skin/ - // https://www.tiny.cloud/docs/configure/editor-appearance/#icons - // https://www.tiny.cloud/docs/advanced/creating-an-icon-pack/ + // https://www.tiny.cloud/docs/tinymce/latest/snow-demo/ + // https://www.tiny.cloud/docs/tinymce/latest/editor-skin/ + // https://www.tiny.cloud/docs/tinymce/latest/creating-a-skin/ + // https://www.tiny.cloud/docs/tinymce/latest/editor-icons/ + // https://www.tiny.cloud/docs/tinymce/latest/enhanced-skins-and-icon-packs/ skin: 'snow', icons: 'thin', setup: (editor) => { // Disable the UI when the editor has loaded - // https://www.tiny.cloud/docs/api/tinymce.editor.ui/tinymce.editor.ui.ui/ - // https://www.tiny.cloud/docs/advanced/events/ + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editor.ui.ui/ + // https://www.tiny.cloud/docs/tinymce/latest/events/ editor.on('SkinLoaded', () => { editor.ui.setEnabled(false); }); // Enable the UI when the editable area gains focus - // https://www.tiny.cloud/docs/api/tinymce.editor.ui/tinymce.editor.ui.ui/ - // https://www.tiny.cloud/docs/advanced/events/ + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editor.ui.ui/ + // https://www.tiny.cloud/docs/tinymce/latest/events/ editor.on('focus', () => { editor.ui.setEnabled(true); }); // Disable the UI when the editor looses focus - // https://www.tiny.cloud/docs/api/tinymce.editor.ui/tinymce.editor.ui.ui/ - // https://www.tiny.cloud/docs/advanced/events/ + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editor.ui.ui/ + // https://www.tiny.cloud/docs/tinymce/latest/events/ editor.on('blur', () => { editor.ui.setEnabled(false); }); diff --git a/templates-and-layout/multiple-columns-using-css-columns.html b/templates-and-layout/multiple-columns-using-css-columns.html deleted file mode 100644 index 16f1167..0000000 --- a/templates-and-layout/multiple-columns-using-css-columns.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - Columns demo - - - - - - - -
- -
- - diff --git a/tinymce-basics/badges.html b/tinymce-basics/badges.html index b937889..356847b 100644 --- a/tinymce-basics/badges.html +++ b/tinymce-basics/badges.html @@ -23,20 +23,20 @@ height: 'calc(100vh - 4rem)', // If we don't need the menubar we can hide it - // https://www.tiny.cloud/docs/configure/editor-appearance/#menubar + // https://www.tiny.cloud/docs/tinymce/latest/menus-configuration-options/#menubar menubar: false, // Tip! To make TinyMCE leaner, only include the plugins you actually need. - plugins: 'code table noneditable', + plugins: 'code table', // This option allows you to specify the buttons and the order that they // will appear on TinyMCE’s toolbar. - // https://www.tiny.cloud/docs/configure/editor-appearance/#toolbar + // https://www.tiny.cloud/docs/tinymce/latest/toolbar-configuration-options/#toolbar toolbar: 'styles | bold italic underline | badge table | code', // The formats option is where custom formatting options are defined. // In this case we define a format for our badge - // https://www.tiny.cloud/docs/configure/content-formatting/#formats + // https://www.tiny.cloud/docs/tinymce/latest/content-formatting/#formats formats: { badge: { // Declare that a badge should be wrapped in a span @@ -58,7 +58,7 @@ // regular text after the element. The `inline_boundaries_selector` allows us // to use the arrow keys to escape a badge and continue typing regular text // before and afterwards. - // https://www.tiny.cloud/docs/configure/content-appearance/#inline_boundaries_selector + // https://www.tiny.cloud/docs/tinymce/latest/content-behavior-options/#inline_boundaries_selector inline_boundaries_selector: 'a[href],code,.mce-annotation,span.badge', // The following css will be injected into the editor, extending @@ -66,8 +66,8 @@ // In a real world scenario, with much more custom styles for headings // links, tables, images etc, it's strongly recommended to use the // content_css option to load a separate CSS file. Makes editing easier too. - // https://www.tiny.cloud/docs/configure/content-appearance/#content_style - // https://www.tiny.cloud/docs/configure/content-appearance/#content_css + // https://www.tiny.cloud/docs/tinymce/latest/add-css-options/#content_style + // https://www.tiny.cloud/docs/tinymce/latest/add-css-options/#content_css content_style: ` span.badge { background-color: gray; @@ -83,11 +83,11 @@ setup: (editor) => { // Instead of defining a custom icon pack, we can register individual // icons using the API. - https://www.tiny.cloud/docs/api/tinymce.editor.ui/tinymce.editor.ui.registry/#addicon + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editor.ui.registry/#addIcon editor.ui.registry.addIcon('badge', ''); // Register a custom toolbar button for opening the badge dialog. - // https://www.tiny.cloud/docs/ui-components/toolbarbuttons/ + // https://www.tiny.cloud/docs/tinymce/latest/custom-toolbarbuttons/ editor.ui.registry.addButton('badge', { icon: 'badge', tooltip: 'Insert/edit badge', @@ -98,12 +98,12 @@ const backgroundColor = function() { // Fetch the node of the current selection. - // https://www.tiny.cloud/docs/api/tinymce.dom/tinymce.dom.selection/ + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.dom.selection/ node = editor.selection.getNode(); // Check if the node has the badge class, if so // it will have a background color style. - // https://www.tiny.cloud/docs/api/tinymce.dom/tinymce.dom.domutils/ + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.dom.domutils/ if (editor.dom.hasClass(node, 'badge')) { return node.style.backgroundColor; } @@ -127,8 +127,7 @@ // Open a TinyMCE modal where the user can set the badge's // background and text color. - // https://www.tiny.cloud/docs/ui-components/dialog/ - // https://www.tiny.cloud/docs/ui-components/dialogcomponents/ + // https://www.tiny.cloud/docs/tinymce/latest/dialog/ editor.windowManager.open({ title: 'Insert/edit Badge', body: { @@ -168,32 +167,32 @@ var data = dialog.getData(); // Get the currently selected node. - // https://www.tiny.cloud/docs/api/tinymce.dom/tinymce.dom.selection/ + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.dom.selection/ const node = editor.selection.getNode(); // Working directly with the DOM often requires manually adding // the actions to the undo stack. - // https://www.tiny.cloud/docs/api/tinymce/tinymce.undomanager/ + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.undomanager/ editor.undoManager.transact(() => { // Check if the selected node is a badge. - // https://www.tiny.cloud/docs/api/tinymce.dom/tinymce.dom.domutils/ + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.dom.domutils/ if (editor.dom.hasClass(node, 'badge')) { // If the selection is a badge, we manipulate the styles directly // instead of using the formatter to set a new format which caused // nested spans (it creates a badge inside the badge). - // https://www.tiny.cloud/docs/api/tinymce.dom/tinymce.dom.domutils/#setstyles + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.dom.domutils/#setStyles editor.dom.setStyles(node, {'background-color': data.backgroundcolor, 'color': data.textcolor}); } else { // If not a badge, then apply the badge format to the current selection // or the word the text caret is currently placed in. - // https://www.tiny.cloud/docs/api/tinymce/tinymce.formatter/#apply + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.formatter/#apply editor.formatter.apply('badge', {styles: `background-color: ${data.backgroundcolor}; color: ${data.textcolor};`}); } }); // Tell TinyMCE that the ui has been updated. - // https://www.tiny.cloud/docs/api/tinymce/tinymce.editor/#nodechanged + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editor/#nodeChanged editor.nodeChanged(); // Close the dialog. diff --git a/tinymce-basics/bootstrap-rich-text-form.html b/tinymce-basics/bootstrap-rich-text-form.html index a8ef2dc..9f8c238 100644 --- a/tinymce-basics/bootstrap-rich-text-form.html +++ b/tinymce-basics/bootstrap-rich-text-form.html @@ -15,8 +15,8 @@ selector:'#editor', // If we don't need the menubar or statusbar we can hide them - // https://www.tiny.cloud/docs/configure/editor-appearance/#menubar - // https://www.tiny.cloud/docs/configure/editor-appearance/#statusbar + // https://www.tiny.cloud/docs/tinymce/latest/menus-configuration-options/#menubar + // https://www.tiny.cloud/docs/tinymce/latest/statusbar-configuration-options/#statusbar menubar: false, statusbar: false, @@ -25,44 +25,44 @@ // This option allows you to specify the buttons and the order that they // will appear on TinyMCE’s toolbar. - // https://www.tiny.cloud/docs/configure/editor-appearance/#toolbar + // https://www.tiny.cloud/docs/tinymce/latest/toolbar-configuration-options/#toolbar toolbar: 'h1 h2 bold italic strikethrough blockquote bullist numlist backcolor | link image media | removeformat help fullscreen ', // We use the Bootstrap premium skin to make TinyMCE match the // visual style of Bootstrap, primarily colors and the dialogs. // You can also create your own bootstrap skin. - // https://www.tiny.cloud/docs/enterprise/premium-skins-and-icon-packs/outside-demo/ - // https://www.tiny.cloud/docs/configure/editor-appearance/#skin - // https://www.tiny.cloud/docs/advanced/creating-a-skin/ + // https://www.tiny.cloud/docs/tinymce/latest/bootstrap-demo/ + // https://www.tiny.cloud/docs/tinymce/latest/editor-skin/ + // https://www.tiny.cloud/docs/tinymce/latest/creating-a-skin/ skin: 'bootstrap', // We also add the new Bootstrap premium icon pack - // https://www.tiny.cloud/docs/enterprise/premium-skins-and-icon-packs/ (Coming in v5.7) - // https://www.tiny.cloud/docs/configure/editor-appearance/#icons - // https://www.tiny.cloud/docs/advanced/creating-an-icon-pack/ + // https://www.tiny.cloud/docs/tinymce/latest/enhanced-skins-and-icon-packs/ + // https://www.tiny.cloud/docs/tinymce/latest/editor-icons/ + // https://www.tiny.cloud/docs/tinymce/latest/creating-an-icon-pack/ icons: 'bootstrap', // Setting the minimum height when using the autoresize plugin - // https://www.tiny.cloud/docs/configure/editor-appearance/#min_height + // https://www.tiny.cloud/docs/tinymce/latest/autoresize/#min_height min_height: 400, // Set the whitespace between the bottom most row and the bottom of the editor - // https://www.tiny.cloud/docs/plugins/autoresize/#autoresize_bottom_margin + // https://www.tiny.cloud/docs/tinymce/latest/autoresize/#autoresize_bottom_margin autoresize_bottom_margin: 20, // To make sure the toolbar never scrolls out of view which can happen when // writing very long texts while using the autoresize plugin. This option // sticks the toolbar to the top of the screen while the editable area // is visible - // https://www.tiny.cloud/docs/configure/editor-appearance/#toolbar_sticky + // https://www.tiny.cloud/docs/tinymce/latest/menus-configuration-options/#toolbar_sticky toolbar_sticky: true, setup: (editor) => { // Apply the Bootstrap focus outline and associated animation // Read more about different editor events in the documentation - // https://www.tiny.cloud/docs/advanced/events/ + // https://www.tiny.cloud/docs/tinymce/latest/events/ editor.on('init', () => { - // https://www.tiny.cloud/docs/api/tinymce/tinymce.editor/#getcontainer + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editor/#getContainer editor.getContainer().style.transition="border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out" }); editor.on('focus', () => { diff --git a/tinymce-basics/custom-toolbar-button-menu-and-context-toolbar.html b/tinymce-basics/custom-toolbar-button-menu-and-context-toolbar.html index 7fa3bef..185f418 100644 --- a/tinymce-basics/custom-toolbar-button-menu-and-context-toolbar.html +++ b/tinymce-basics/custom-toolbar-button-menu-and-context-toolbar.html @@ -28,7 +28,7 @@ selector: "#editor", // Tip! To make TinyMCE leaner, only include the plugins you actually need - plugins: "link lists code noneditable", + plugins: "link lists code", // We have put our custom callout button last. toolbar: "undo redo | styles | bold italic strikethrough backcolor | bullist link callout", @@ -40,18 +40,19 @@ // don't want to be editable. First we make the root // Callout element non-editable, then we define the // parts of the Callout that is editable. - // https://www.tiny.cloud/docs/plugins/noneditable/ + // https://www.tiny.cloud/docs/tinymce/latest/non-editable-content-options/ + noneditable_noneditable_class: 'callout', noneditable_editable_class: 'content', // Hide the right click context menus to avoid conflict with // the context toolbars - // https://www.tiny.cloud/docs/configure/editor-appearance/#contextmenu + // https://www.tiny.cloud/docs/tinymce/latest/contextmenu/#available-context-menu-sections contextmenu: false, // Make the custom icon pack available in TinyMCE. A custom icon pack // extends the default icon pack. - // https://www.tiny.cloud/docs/configure/editor-appearance/#icons + // https://www.tiny.cloud/docs/tinymce/latest/editor-icons/ icons: 'customIcons', // We use the menu option to define custom menu items @@ -61,15 +62,14 @@ // all menu items in the whole menu, you cannot simply append // a menu item to an existing menu. // For a list of in which menu the default menu items goes, see - // https://www.tiny.cloud/docs/configure/editor-appearance/#menu - // https://www.tiny.cloud/docs/ui-components/menuitems/ + // https://www.tiny.cloud/docs/tinymce/latest/menus-configuration-options/#example-the-tinymce-default-menu-items menu: { insert: {title: 'Insert', items: 'link callout'} }, setup: (editor) => { // Register a custom toolbar button that inserts the callout - // https://www.tiny.cloud/docs/ui-components/toolbarbuttons/ + // https://www.tiny.cloud/docs/tinymce/latest/custom-toolbarbuttons/ editor.ui.registry.addButton('callout', { icon: 'callout', tooltip: 'Insert callout', @@ -78,7 +78,7 @@ // It is wise to include an empty paragraph to // avoid having text be inserted directly under // the div. - // https://www.tiny.cloud/docs/api/tinymce/tinymce.editor/#insertcontent + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editor/#insertContent tinymce.activeEditor.insertContent(`

Callout

@@ -99,17 +99,17 @@ onAction: function () { // First we get the selected element. It can be either the // callout itself or any child element within it. - // https://www.tiny.cloud/docs/api/tinymce.dom/tinymce.dom.selection/#getnode + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.dom.selection/#getNode const node = tinymce.activeEditor.selection.getNode(); // Then we traverse up the DOM tree to make sure we target // the callout element if it wasn't the selected node. - // https://www.tiny.cloud/docs/api/tinymce.dom/tinymce.dom.domutils/#getparent + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.dom.domutils/#getParent const callout = tinymce.activeEditor.dom.getParent(node, '.callout'); // Then we remove and add the neccesseary classes. - // https://www.tiny.cloud/docs/api/tinymce.dom/tinymce.dom.domutils/#removeclass - // https://www.tiny.cloud/docs/api/tinymce.dom/tinymce.dom.domutils/#addclass + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.dom.domutils/#removeClass + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.dom.domutils/#addClass tinymce.DOM.removeClass(callout, 'red'); tinymce.DOM.addClass(callout, 'yellow'); } @@ -148,26 +148,26 @@ onAction: function () { // First we get the selected element. It can be either the // callout itself or any child element within it. - // https://www.tiny.cloud/docs/api/tinymce.dom/tinymce.dom.selection/#getnode + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.dom.selection/#getNode const node = tinymce.activeEditor.selection.getNode(); // Then we traverse up the DOM tree to make sure we target // the callout element if it wasn't the selected node. - // https://www.tiny.cloud/docs/api/tinymce.dom/tinymce.dom.domutils/#getparent + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.dom.domutils/#getParent const callout = tinymce.activeEditor.dom.getParent(node, '.callout'); // Make the callout the selected element - // https://www.tiny.cloud/docs/api/tinymce.dom/tinymce.dom.selection/#select + //https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.dom.selection/#select tinymce.activeEditor.selection.select(callout); // Finally we issue a delete command to remove the selected callout - // https://www.tiny.cloud/docs/api/tinymce/tinymce.editor/#execcommand + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editor/#execCommand tinymce.activeEditor.execCommand('delete'); } }); // Register a custom context toolbar - // https://www.tiny.cloud/docs/ui-components/contexttoolbar/#registeringacontexttoolbar + // https://www.tiny.cloud/docs/tinymce/latest/contexttoolbar/#registeringacontexttoolbar editor.ui.registry.addContextToolbar('callout', { predicate: function (node) { // Return true if the node has the callout class. @@ -231,8 +231,8 @@ // In a real world scenario, with much more custom styles for headings // links, tables, images etc, it's recommended to use the content_css // option to load a separate CSS file. Makes editing easier too. - // https://www.tiny.cloud/docs/configure/content-appearance/#content_style - // https://www.tiny.cloud/docs/configure/content-appearance/#content_css + // https://www.tiny.cloud/docs/tinymce/latest/add-css-options/#content_style + // https://www.tiny.cloud/docs/tinymce/latest/add-css-options/#content_css content_style: ` .callout { margin: 1rem 0; diff --git a/tinymce-basics/fonts.html b/tinymce-basics/fonts.html index c9db58a..2561c6a 100644 --- a/tinymce-basics/fonts.html +++ b/tinymce-basics/fonts.html @@ -19,7 +19,7 @@ // This option allows you to specify the buttons and the order that they // will appear on TinyMCE’s toolbar. - // https://www.tiny.cloud/docs/configure/editor-appearance/#toolbar + // https://www.tiny.cloud/docs/tinymce/latest/toolbar-configuration-options/#toolbar toolbar: "undo redo | styles | fontfamily | fontsize | bold italic strikethrough | bullist link | code", // Tip! The height option accepts any valid CSS for height @@ -28,7 +28,7 @@ // Declare the fonts that should show up in menus. Any font used here must also be included in the `font_css`. // https://www.tiny.cloud/docs/configure/editor-appearance/#font_formats // https://www.tiny.cloud/docs/configure/editor-appearance/#fontsize_formats - font_formats: 'Sacramento=Sacramento; Cookie=Cookie; Great Vibes=Great Vibes; Fredoka One=Fredoka One; Alfa Slab One=Alfa Slab One; Satisfy=Satisfy; Permanent Marker=Permanent Marker; Staatliches=Staatliches; Abril Fatface=Abril Fatface; Dancing Script=Dancing Script; Pacifico=Pacifico; Josefin Sans=Josefin Sans; Montserrat=Montserrat; Mogra=Mogra; Andale Mono=andale mono; Arial=arial; Arial Black=arial black; Book Antiqua=book antiqua; Comic Sans MS=comic sans ms; Courier New=courier new; Georgia=georgia; Helvetica=helvetica; Impact=impact; Symbol=symbol; Tahoma=tahoma; Terminal=terminal; Times New Roman=times new roman; Verdana=verdana; Webdings=webdings; Wingdings=wingdings', + font_family_formats: 'Sacramento=Sacramento; Cookie=Cookie; Great Vibes=Great Vibes; Fredoka One=Fredoka One; Alfa Slab One=Alfa Slab One; Satisfy=Satisfy; Permanent Marker=Permanent Marker; Staatliches=Staatliches; Abril Fatface=Abril Fatface; Dancing Script=Dancing Script; Pacifico=Pacifico; Josefin Sans=Josefin Sans; Montserrat=Montserrat; Mogra=Mogra; Andale Mono=andale mono; Arial=arial; Arial Black=arial black; Book Antiqua=book antiqua; Comic Sans MS=comic sans ms; Courier New=courier new; Georgia=georgia; Helvetica=helvetica; Impact=impact; Symbol=symbol; Tahoma=tahoma; Terminal=terminal; Times New Roman=times new roman; Verdana=verdana; Webdings=webdings; Wingdings=wingdings', fontsize_formats: '11px 12px 14px 16px 18px 24px 36px 48px 60px 72px 84px', // The `font_css` option allows you to declare font import statements that @@ -38,7 +38,7 @@ // @import url("https://fonts.googleapis.com/css?family=Abril+Fatface|Alfa+Slab+One|Cookie|Dancing+Script|Fredoka+One|Great+Vibes|Josefin+Sans:400,400i,700,700i|Mogra|Montserrat:400,400i,700,700i|Pacifico|Permanent+Marker|Sacramento|Satisfy|Staatliches&display=swap"); // but can also include @font-face declarations. // Read more about using web fonts at https://developer.mozilla.org/en-US/docs/Learn/CSS/Styling_text/Web_fonts - // https://www.tiny.cloud/docs/configure/content-appearance/#font_css + // https://www.tiny.cloud/docs/tinymce/latest/add-css-options/#font_css font_css: 'fonts.css', }); @@ -55,7 +55,7 @@
diff --git a/tinymce-basics/format-link-as-button.html b/tinymce-basics/format-link-as-button.html index 4c96006..5a70d61 100644 --- a/tinymce-basics/format-link-as-button.html +++ b/tinymce-basics/format-link-as-button.html @@ -23,17 +23,17 @@ // This option allows you to specify the buttons and the order that they // will appear on TinyMCE’s toolbar. - // https://www.tiny.cloud/docs/configure/editor-appearance/#toolbar + // https://www.tiny.cloud/docs/tinymce/latest/toolbar-configuration-options/#toolbar toolbar: 'styles | bold italic underline | link image emoticons | align bullist numlist | code removeformat', //Set the height of the editor. Tip: Any css value is accepted as a string. - // https://www.tiny.cloud/docs/configure/editor-appearance/#height + // https://www.tiny.cloud/docs/tinymce/latest/customize-ui/#changing-editor-height-and-width height: 400, // The formats option is where custom formatting options are defined. // If you're looking for email friendly call-to-action button links, // take a look at the email/marketing-email-inline-mode.html demo. - // https://www.tiny.cloud/docs/configure/content-formatting/#formats + // https://www.tiny.cloud/docs/tinymce/latest/content-formatting/#formats formats: { // We name our format "calltoaction" calltoaction: { @@ -45,7 +45,7 @@ }, // The style_formats option controls the styleformat toolbar button menu - // https://www.tiny.cloud/docs/configure/editor-appearance/#style_formats + // https://www.tiny.cloud/docs/tinymce/latest/user-formatting-options/#style_formats style_formats: [ { title: 'Paragraph', format: 'p' }, { title: 'Heading 1', format: 'h1' }, @@ -57,8 +57,8 @@ // The following css will be injected into the editor, extending // the default styles. In a real world scenario, it's recommended // to use the content_css option to load a separate CSS file. - // https://www.tiny.cloud/docs/configure/content-appearance/#content_style - // https://www.tiny.cloud/docs/configure/content-appearance/#content_css + // https://www.tiny.cloud/docs/tinymce/latest/add-css-options/#content_style + // https://www.tiny.cloud/docs/tinymce/latest/add-css-options/#content_css content_style: ` .btn { background-color: #706FD3; diff --git a/tinymce-basics/right-aligned-toolbar-button.html b/tinymce-basics/right-aligned-toolbar-button.html deleted file mode 100644 index 29e7675..0000000 --- a/tinymce-basics/right-aligned-toolbar-button.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - Right aligned toolbar buttons - - - - - - - -
- -
- - diff --git a/tinymce-basics/useful_styles_for_content_css.html b/tinymce-basics/useful_styles_for_content_css.html index be0f7bb..b54c4c4 100644 --- a/tinymce-basics/useful_styles_for_content_css.html +++ b/tinymce-basics/useful_styles_for_content_css.html @@ -24,11 +24,11 @@ height: 'calc(100vh - 4rem)', // Tip! To make TinyMCE leaner, only include the plugins you actually need. - plugins: 'code table noneditable', + plugins: 'code table', // Disable the drag handles on images to avoid having them obscure the // rounded corners on images example - // https://www.tiny.cloud/docs/configure/advanced-editing-behavior/#object_resizing + // https://www.tiny.cloud/docs/tinymce/latest/content-behavior-options/#object_resizing object_resizing : false, // The following css will be injected into the editor, extending @@ -36,8 +36,8 @@ // In a real world scenario, with much more custom styles for headings // links, tables, images etc, it's strongly recommended to use the // content_css option to load a separate CSS file. Makes editing easier too. - // https://www.tiny.cloud/docs/configure/content-appearance/#content_style - // https://www.tiny.cloud/docs/configure/content-appearance/#content_css + // https://www.tiny.cloud/docs/tinymce/latest/add-css-options/#content_style + // https://www.tiny.cloud/docs/tinymce/latest/add-css-options/#content_css content_style: ` /* @@ -47,7 +47,7 @@ */ /* Make our invisible overlay be positioned relative to the */ - { + hr { position: relative; } @@ -124,7 +124,7 @@

Useful content css

The default content css is very basic and unopinionated to allow you as a developer to integrate the styles you want in order to get a good WYSIWYG writing environment.

That said, here are some tecniques we often implement ourselves that improves the editing experience in TinyMCE

Inspect the source code to see the actual css used

-

Improve clickability

+

Improve hr clickability

Because the &lt;hr&gt; is often just a 1px gray line, it is very difficult for a user to select and manipulate. By using the ::after pseudo element we can create a larger invisible click area greatly improving selectability.


diff --git a/tinymce-basics/webapp-description-comment-reply-editor.html b/tinymce-basics/webapp-description-comment-reply-editor.html index e0e3105..d89b4ba 100644 --- a/tinymce-basics/webapp-description-comment-reply-editor.html +++ b/tinymce-basics/webapp-description-comment-reply-editor.html @@ -9,7 +9,7 @@ This demo showcases among other things: - The ability to create a custom border outside of TinyMCE and visually encapsulate external content. -- Use plugin to provide markdown-like replacement formatting. Also try typing `->` +- The text patterns feature provides common substitutions when typing. - Use of the autoresize plugin. The editor grows as you type. - An usecase for the small premium icon pack @@ -27,63 +27,47 @@ selector:'#description', // If we don't need the menubar or statusbar we can hide them - // https://www.tiny.cloud/docs/configure/editor-appearance/#menubar - // https://www.tiny.cloud/docs/configure/editor-appearance/#statusbar + // https://www.tiny.cloud/docs/tinymce/latest/menus-configuration-options/#menubar + // https://www.tiny.cloud/docs/tinymce/latest/statusbar-configuration-options/#statusbar menubar: false, statusbar: false, // as we want to provide our own editor border to include the save button // we can use the naked skin that completely removes all borders. // You can also easily create your own borderless skin. - // https://www.tiny.cloud/docs/enterprise/premium-skins-and-icon-packs/naked-demo/ - // https://www.tiny.cloud/docs/configure/editor-appearance/#skin - // https://www.tiny.cloud/docs/advanced/creating-a-skin/ + // https://www.tiny.cloud/docs/tinymce/latest/naked-demo/ + // https://www.tiny.cloud/docs/tinymce/latest/editor-skin/ + // https://www.tiny.cloud/docs/tinymce/latest/creating-a-skin/ skin: 'naked', // For a leaner look we can use the Small premium icon pack. - // https://www.tiny.cloud/docs/configure/editor-appearance/#icons - // https://www.tiny.cloud/docs/advanced/creating-an-icon-pack/ + // https://www.tiny.cloud/docs/tinymce/latest/editor-icons/ + // https://www.tiny.cloud/docs/tinymce/latest/creating-an-icon-pack/ icons: 'small', // Tip! To make TinyMCE leaner, only include the plugins you actually need. - plugins: 'code autoresize anchor, autolink codesample emoticons image link lists table textpattern', + plugins: 'code autoresize anchor, autolink codesample emoticons image link lists table markdown', // This option allows you to specify the buttons and the order that // they will appear on TinyMCE’s toolbar. - // https://www.tiny.cloud/docs/configure/editor-appearance/#toolbar + // https://www.tiny.cloud/docs/tinymce/latest/toolbar-configuration-options/#toolbar toolbar: 'styles | bold italic strikethrough blockquote | bullist numlist codesample link image table emoticons hr', // Setting the minimum height when using the autoresize plugin - // https://www.tiny.cloud/docs/configure/editor-appearance/#min_height + // https://www.tiny.cloud/docs/tinymce/latest/autoresize/#min_height min_height: 160, // Set the whitespace between the bottom most row and the bottom of the editor - // https://www.tiny.cloud/docs/plugins/autoresize/#autoresize_bottom_margin + // https://www.tiny.cloud/docs/tinymce/latest/autoresize/#autoresize_bottom_margin autoresize_bottom_margin: 24, - // The text pattern plugin enables you to assign actions to happen when + // The text pattern feature enables you to assign actions to happen when // the user types content into TinyMCE. In this case we are substituting // starts for proper bullet lists, hashes for headings and other common // substutions - // https://www.tiny.cloud/docs/plugins/textpattern/#textpattern_patterns - textpattern_patterns: [ - {start: '*', end: '*', format: 'italic'}, - {start: '_', end: '_', format: 'italic'}, - {start: '**', end: '**', format: 'bold'}, - {start: '__', end: '__', format: 'bold'}, - {start: '`', end: '`', format: 'code'}, - {start: '>', format: 'blockquote'}, - {start: '1. ', cmd: 'InsertOrderedList'}, - {start: '* ', cmd: 'InsertUnorderedList'}, - {start: '- ', cmd: 'InsertUnorderedList' }, - {start: '+ ', cmd: 'InsertUnorderedList' }, - {start: '#', format: 'h1'}, - {start: '##', format: 'h2'}, - {start: '###', format: 'h3'}, + // https://www.tiny.cloud/docs/tinymce/latest/content-behavior-options/#text_patterns + text_patterns: [ {start: '->', replacement: '→'}, - {start: '***', format: 'hr'}, - {start: '---', format: 'hr'}, - {start: '* * *', format: 'hr'}, ] }); diff --git a/tokens/README.md b/tokens/README.md deleted file mode 100644 index eda4ca4..0000000 --- a/tokens/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Tokens - -Tokens – or mail merge variables such as `{{name.first}}` – are often found in document automation and email editors. Here are three ways you can implement them in TinyMCE. - -**Don't miss!** Each HTML file contains detailed comments for each option to help you get started. diff --git a/tokens/span-based-token.html b/tokens/span-based-token.html deleted file mode 100644 index dda8db5..0000000 --- a/tokens/span-based-token.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - Span-based token demo - - - - - - - -
- -
- - diff --git a/tokens/text-based-token.html b/tokens/text-based-token.html deleted file mode 100644 index 45b1309..0000000 --- a/tokens/text-based-token.html +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - Text-based tokens demo - - - - - - - -
- -
- - diff --git a/tokens/web-component-token.html b/tokens/web-component-token.html deleted file mode 100644 index 19eb122..0000000 --- a/tokens/web-component-token.html +++ /dev/null @@ -1,210 +0,0 @@ - - - - - - - Web component based token demo - - - - - - - -
- -
- - From d90f7f25a42b9118344ca3203b68ec56fefc9cfd Mon Sep 17 00:00:00 2001 From: Fredrik Danielsson Date: Wed, 19 Nov 2025 11:01:51 +0100 Subject: [PATCH 4/6] Updated spelling, wording and fixed minor errors --- cool-demos/conditional-blocks.html | 8 ++++---- cool-demos/expand-editor-and-show-toolbar.html | 6 ++++-- cool-demos/slash-commands.html | 1 - email/marketing-email.html | 10 +++++----- email/webmail-rich-text-editor.html | 8 +------- images/toggle-image-size-context-toolbar.html | 2 +- tables/customizing-the-table-toolbar.html | 10 +++++----- 7 files changed, 20 insertions(+), 25 deletions(-) diff --git a/cool-demos/conditional-blocks.html b/cool-demos/conditional-blocks.html index 9ba6a4d..9cad55b 100644 --- a/cool-demos/conditional-blocks.html +++ b/cool-demos/conditional-blocks.html @@ -24,7 +24,7 @@ // Tip! To make TinyMCE leaner, only include the plugins you actually need. plugins: 'autoresize advcode link lists mergetags', - // We have put our custom insert conditional block button last. + // We have put our custom insert conditional block button second to last. toolbar: 'bold italic strikethrough backcolor | bullist numlist link mergetags | conditionalblock | code', // "Thin" is a premium icon pack you get wth the cloud essential plan. @@ -34,7 +34,7 @@ // https://www.tiny.cloud/docs/tinymce/latest/creating-an-icon-pack/ icons: 'thin', - // "Naked" is a premium icon pack you get wth the cloud essential plan + // "Naked" is a premium icon pack you get with the cloud essential plan // See https://www.tiny.cloud for more details and purchasing options // You can also create your own skins for TinyMCE // https://www.tiny.cloud/docs/tinymce/latest/creating-a-skin/ @@ -78,7 +78,7 @@ // on the web component to make it behave like a noneditable but selectable // element inside TinyMCE. But we don't want the contenteditable attribute // to be saved with the content. We therefore need to filter out the attribute - // upon serlialization (which happens on "save", view sourcecode and preview + // upon serialization (which happens on "save", view source code and preview // among others). // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.dom.serializer/#addNodeFilter editor.serializer.addNodeFilter('conditional-block', (nodes) => { @@ -98,7 +98,7 @@ }); // Register a custom toolbar menu button to insert the conditional block - // https://www.tiny.cloud/docs/tinymce/latest/custom-toolbarbuttons/#menubutton + // https://www.tiny.cloud/docs/tinymce/latest/custom-menu-toolbar-button/ editor.ui.registry.addButton('conditionalblock', { icon: 'conditional-block', tooltip: 'Insert conditional block', diff --git a/cool-demos/expand-editor-and-show-toolbar.html b/cool-demos/expand-editor-and-show-toolbar.html index cb9f63a..935570b 100644 --- a/cool-demos/expand-editor-and-show-toolbar.html +++ b/cool-demos/expand-editor-and-show-toolbar.html @@ -1,5 +1,5 @@ @@ -16,7 +16,6 @@ tinymce.init({ selector: "#editor-content", plugins: "emoticons image link lists charmap table", - toolbar: "formatgroup paragraphgroup insertgroup", placeholder: "Ask a question or post an update...", menubar: false, skin: 'naked', @@ -61,6 +60,9 @@ items: 'link image emoticons charmap hr' } }, + + // Show the three toolbar groups + toolbar: "formatgroup paragraphgroup insertgroup", // On mobile, toolbar_mode is sliding by default which is not compatible // with toolbar_groups. Therefore we explicitly set toolbar_mode to floating diff --git a/cool-demos/slash-commands.html b/cool-demos/slash-commands.html index 28f08a0..89c6d1f 100644 --- a/cool-demos/slash-commands.html +++ b/cool-demos/slash-commands.html @@ -125,7 +125,6 @@ // The character to trigger the autocompleter, // the number of characters to type before displaying the autocompleter menu and, // configure the autocompleter to display a menu opposed a row of icons - // https://www.tiny.cloud/docs/tinymce/latest/autocompleter/ trigger: '/', minChars: 0, columns: 1, diff --git a/email/marketing-email.html b/email/marketing-email.html index 51f80ae..ab6b71b 100644 --- a/email/marketing-email.html +++ b/email/marketing-email.html @@ -1,14 +1,14 @@ @@ -34,7 +34,7 @@ menubar: false, // Tip! To make TinyMCE leaner, only include the plugins you actually need. - plugins: 'link lists image table code', + plugins: 'link lists image table code emoticons', // This option allows you to specify the buttons and the order that they // will appear on TinyMCE’s toolbar. @@ -385,7 +385,7 @@ // call to from both menuitems and shortcuts const menuActionManager = { headerRow: () => { - // Check the type of the selected table row and inverse it + // Check the type of the selected table row and invert it // https://www.tiny.cloud/docs/tinymce/latest/editor-command-identifiers/#querycommandvaluestableplugin const type = tinymce.activeEditor.queryCommandValue('mceTableRowType') === 'body' ? 'header' : 'body'; @@ -422,7 +422,7 @@ tinymce.activeEditor.execCommand('mceTablePasteRowAfter'); }, headerColumn: () => { - // Check the type of the selected table column and inverse it + // Check the type of the selected table column and invert it // https://www.tiny.cloud/docs/tinymce/latest/editor-command-identifiers/#querycommandvaluestableplugin const type = tinymce.activeEditor.queryCommandValue('mceTableColType') === 'td' ? 'th' : 'td'; From ebbf27f80f85bda25fc10224b468f06ccf3d1ff0 Mon Sep 17 00:00:00 2001 From: Fredrik Danielsson Date: Wed, 19 Nov 2025 14:25:55 +0100 Subject: [PATCH 5/6] Fixed clipboard for table-row-templates --- tables/table-row-templates.html | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tables/table-row-templates.html b/tables/table-row-templates.html index 3223032..06cc841 100644 --- a/tables/table-row-templates.html +++ b/tables/table-row-templates.html @@ -172,20 +172,22 @@ `; // Store any existing table clipboard row data - // https://www.tiny.cloud/docs/tinymce/latest/table/#api - const storedClipboard = editor.plugins.table.getClipboardRows(); + // https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.fakeclipboard/ + const storedClipboard = tinymce.FakeClipboard.read(); // Set the clipboard data to be the table row element created previously - // https://www.tiny.cloud/docs/tinymce/latest/table/#api - editor.plugins.table.setClipboardRows([tr]); + const item = tinymce.FakeClipboard.FakeClipboardItem({ + 'x-tinymce/dom-table-rows': [{ dom: tr }], + }); + + tinymce.FakeClipboard.write([item]); // Paste the table clipboard data // https://www.tiny.cloud/docs/tinymce/latest/table/#commands - editor.execCommand('mceTablePasteRowAfter'); + editor.execCommand('mceTablePasteRowAfter'); // Restore the saved table clipboard row data - // https://www.tiny.cloud/docs/tinymce/latest/table/#api - editor.plugins.table.setClipboardRows(storedClipboard); + tinymce.FakeClipboard.write(storedClipboard); // Close the dialog. dialog.close(); From 608cf6de6d96cd4a58fb440096eba93a536b8c26 Mon Sep 17 00:00:00 2001 From: Fredrik Danielsson Date: Wed, 19 Nov 2025 14:41:19 +0100 Subject: [PATCH 6/6] Removed copy/paste rows and columns because the low-level API replacing the old table clipboard apis are not for public consumption --- tables/customizing-the-table-toolbar.html | 106 +--------------------- 1 file changed, 2 insertions(+), 104 deletions(-) diff --git a/tables/customizing-the-table-toolbar.html b/tables/customizing-the-table-toolbar.html index e87068d..ba9a301 100644 --- a/tables/customizing-the-table-toolbar.html +++ b/tables/customizing-the-table-toolbar.html @@ -176,58 +176,7 @@ onAction: () => { menuActionManager.deleteRow(); } - }, - /* - { - type: 'separator', - }, - { - type: 'menuitem', - text: 'Cut row', - icon: 'cut-row', - onAction: () => { - menuActionManager.cutRow(); - } - }, - { - type: 'menuitem', - text: 'Copy row', - icon: 'duplicate-row', - onAction: () => { - menuActionManager.copyRow(); - } - }, - { - type: 'menuitem', - text: 'Paste row before', - icon: 'paste-row-before', - onAction: () => { - menuActionManager.pasteRowBefore(); - }, - onSetup: (buttonApi) => { - // Check the clipboard for any rows and disable the menu item if there is none - // https://www.tiny.cloud/docs/tinymce/latest/table/#api - // https://www.tiny.cloud/docs/tinymce/latest/custom-toolbarbuttons/#api - const state = editor.plugins.table.getClipboardRows().length > 0 ? false : true; - buttonApi.setDisabled(state); - } - }, - { - type: 'menuitem', - text: 'Paste row after', - icon: 'paste-row-after', - onAction: () => { - menuActionManager.pasteRowAfter(); - }, - onSetup: (buttonApi) => { - // Check the clipboard for any rows and disable the menu item if there is none - // https://www.tiny.cloud/docs/tinymce/latest/table/#api - // https://www.tiny.cloud/docs/tinymce/latest/custom-toolbarbuttons/#api - const state = editor.plugins.table.getClipboardRows().length > 0 ? false : true; - buttonApi.setDisabled(state); - } - }, - */ + } ]; callback(items); } @@ -281,58 +230,7 @@ onAction: () => { menuActionManager.deleteColumn(); } - }, - /* - { - type: 'separator', - }, - { - type: 'menuitem', - text: 'Cut column', - icon: 'cut-column', - onAction: () => { - menuActionManager.cutColumn(); - } - }, - { - type: 'menuitem', - text: 'Copy column', - icon: 'duplicate-column', - onAction: () => { - menuActionManager.copyColumn(); - } - }, - { - type: 'menuitem', - text: 'Paste column before', - icon: 'paste-column-before', - onAction: () => { - menuActionManager.pasteColumnBefore(); - }, - onSetup: (buttonApi) => { - // Check the clipboard for any cols and disable the menu item if there is none - // https://www.tiny.cloud/docs/tinymce/latest/table/#api - // https://www.tiny.cloud/docs/tinymce/latest/custom-toolbarbuttons/#api - const state = editor.plugins.table.getClipboardCols().length > 0 ? false : true; - buttonApi.setDisabled(state); - } - }, - { - type: 'menuitem', - text: 'Paste column after', - icon: 'paste-column-after', - onAction: () => { - menuActionManager.pasteColumnAfter(); - }, - onSetup: (buttonApi) => { - // Check the clipboard for any cols and disable the menu item if there is none - // https://www.tiny.cloud/docs/tinymce/latest/table/#api - // https://www.tiny.cloud/docs/tinymce/latest/custom-toolbarbuttons/#api - const state = editor.plugins.table.getClipboardCols().length > 0 ? false : true; - buttonApi.setDisabled(state); - } - }, - */ + } ]; callback(items); }