From ccff2ceaac7f8c93b5ca026a833a6b6fdcf3dd85 Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Tue, 1 Oct 2024 22:14:31 +1000 Subject: [PATCH 01/22] DOC-2524: New comments option: Comments can be made and read, but the editor is in a readonly state. --- antora.yml | 4 +- .../comments-readonly-mode/index.html | 38 +++++++++++++ .../comments-readonly-mode/index.js | 23 ++++++++ .../live-demos/comments-ui-mode/index.html | 38 +++++++++++++ .../live-demos/comments-ui-mode/index.js | 16 ++++++ modules/ROOT/nav.adoc | 1 + modules/ROOT/pages/comments-options.adoc | 12 +++++ .../comments-tinycomments_access.adoc | 53 +++++++++++++++++++ 8 files changed, 183 insertions(+), 2 deletions(-) create mode 100644 modules/ROOT/examples/live-demos/comments-readonly-mode/index.html create mode 100644 modules/ROOT/examples/live-demos/comments-readonly-mode/index.js create mode 100644 modules/ROOT/examples/live-demos/comments-ui-mode/index.html create mode 100644 modules/ROOT/examples/live-demos/comments-ui-mode/index.js create mode 100644 modules/ROOT/pages/comments-options.adoc create mode 100644 modules/ROOT/partials/configuration/comments-tinycomments_access.adoc diff --git a/antora.yml b/antora.yml index 8e9ef1e30c..7d002fe41c 100644 --- a/antora.yml +++ b/antora.yml @@ -8,9 +8,9 @@ asciidoc: idseparator: '-@' # generic variables companyurl: https://www.tiny.cloud - cdnurl: https://cdn.tiny.cloud/1/no-api-key/tinymce/7/tinymce.min.js + cdnurl: https://cdn.tiny.cloud/1/no-api-key/tinymce/7-dev/tinymce.min.js tdcdnurl: https://cdn.tiny.cloud/1/_your_api_key_/tinydrive/7/tinydrive.min.js - tinymce_live_demo_url: https://cdn.tiny.cloud/1/qagffr3pkuv17a8on1afax661irst1hbr4e6tbv888sz91jc/tinymce/7/tinymce.min.js + tinymce_live_demo_url: https://cdn.tiny.cloud/1/qagffr3pkuv17a8on1afax661irst1hbr4e6tbv888sz91jc/tinymce/7-dev/tinymce.min.js tinydrive_live_demo_url: https://cdn.tiny.cloud/1/qagffr3pkuv17a8on1afax661irst1hbr4e6tbv888sz91jc/tinydrive/7/tinydrive.min.js webcomponent_url: https://cdn.jsdelivr.net/npm/@tinymce/tinymce-webcomponent@2/dist/tinymce-webcomponent.min.js jquery_url: https://cdn.jsdelivr.net/npm/@tinymce/tinymce-jquery@2/dist/tinymce-jquery.min.js diff --git a/modules/ROOT/examples/live-demos/comments-readonly-mode/index.html b/modules/ROOT/examples/live-demos/comments-readonly-mode/index.html new file mode 100644 index 0000000000..daad3f91fb --- /dev/null +++ b/modules/ROOT/examples/live-demos/comments-readonly-mode/index.html @@ -0,0 +1,38 @@ +
+ + + +
\ No newline at end of file diff --git a/modules/ROOT/examples/live-demos/comments-readonly-mode/index.js b/modules/ROOT/examples/live-demos/comments-readonly-mode/index.js new file mode 100644 index 0000000000..aad6233460 --- /dev/null +++ b/modules/ROOT/examples/live-demos/comments-readonly-mode/index.js @@ -0,0 +1,23 @@ +let editor; + +tinymce.init({ + selector: "textarea#comment-readonly-ui-mode", + plugins: [ + "tinycomments", "advlist", "anchor", "autolink", "charmap", "code", "fullscreen", + "help", "image", "insertdatetime", "link", "lists", "media", + "preview", "searchreplace", "table", "visualblocks", + ], + toolbar: "addcomment showcomments | undo redo | styles | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image", + tinycomments_mode: 'embedded', + tinycomments_access: '', + setup: (ed) => { + editor = ed; // Assign the editor instance globally + } +}); + +const button = document.getElementById('toggle-readonly-mode'); + +button.addEventListener('click', () => { + const isReadonly = editor.mode.get() === 'readonly'; + tinymce.get(0).mode.set(isReadonly ? 'design' : 'readonly'); +}); \ No newline at end of file diff --git a/modules/ROOT/examples/live-demos/comments-ui-mode/index.html b/modules/ROOT/examples/live-demos/comments-ui-mode/index.html new file mode 100644 index 0000000000..70e4f301bf --- /dev/null +++ b/modules/ROOT/examples/live-demos/comments-ui-mode/index.html @@ -0,0 +1,38 @@ +
+ +
\ No newline at end of file diff --git a/modules/ROOT/examples/live-demos/comments-ui-mode/index.js b/modules/ROOT/examples/live-demos/comments-ui-mode/index.js new file mode 100644 index 0000000000..e281c9ad66 --- /dev/null +++ b/modules/ROOT/examples/live-demos/comments-ui-mode/index.js @@ -0,0 +1,16 @@ +let editor; + +tinymce.init({ + selector: "textarea#comments-ui-mode", + plugins: [ + "tinycomments", "advlist", "anchor", "autolink", "charmap", "code", "fullscreen", + "help", "image", "insertdatetime", "link", "lists", "media", + "preview", "searchreplace", "table", "visualblocks", + ], + toolbar: "addcomment showcomments | undo redo | styles | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image", + tinycomments_mode: 'embedded', + tinycomments_access: 'comment', + setup: (ed) => { + editor = ed; + } +}); \ No newline at end of file diff --git a/modules/ROOT/nav.adoc b/modules/ROOT/nav.adoc index 305b3b4607..ddf8c59507 100644 --- a/modules/ROOT/nav.adoc +++ b/modules/ROOT/nav.adoc @@ -303,6 +303,7 @@ **** xref:comments-callback-mode.adoc[Callback mode] **** xref:comments-embedded-mode.adoc[Embedded mode] **** xref:comments-toolbars-menus.adoc[Toolbar buttons and menu items] +**** xref:comments-options.adoc[Ui Options] **** xref:comments-commands-events-apis.adoc[Commands, Events and APIs] *** xref:advcode.adoc[Enhanced Code Editor] *** Enhanced Media Embed diff --git a/modules/ROOT/pages/comments-options.adoc b/modules/ROOT/pages/comments-options.adoc new file mode 100644 index 0000000000..6ccfc92d92 --- /dev/null +++ b/modules/ROOT/pages/comments-options.adoc @@ -0,0 +1,12 @@ +:navtitle: Comments Options +:description: TinyMCE Comments plugin options. +:keywords: comments, commenting, tinycomments +:pluginname: Comments +:plugincode: comments +:pluginminimumplan: enterprise + +== Options + +The following configuration options affect the behavior of the {pluginname} plugin. + +include::partial$configuration/comments-tinycomments_access.adoc[leveloffset=+1] diff --git a/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc b/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc new file mode 100644 index 0000000000..d92e6a2be4 --- /dev/null +++ b/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc @@ -0,0 +1,53 @@ +[[tinycomments-access]] +== `tinycomments_access` + +*Type:* `+String+` + +*Possible values:* `'comment'` + +This option controls the editor's read-only state and comment functionality. + +[IMPORTANT] +==== +* When `tinycomments_access` is set to `comment`, the editor will automatically switch to xref:editor-important-options.adoc#readonly[Readonly Mode]. +* Default behavior allows full editing access to both the editor and comments. +==== + +=== Example: Basic Configuration + +[source,javascript] +---- +tinymce.init({ + selector: 'textarea', // change this value according to your HTML + plugins: 'tinycomments', + toolbar: 'addcomment showcomments', + readony: true, // set the editor to read-only mode + tinycomments_access: '', +}); +---- + +=== `tinycomments_access` set to undefined or an empty string and `readonly` set to `true` + +When `tinycomments_access` is set to **undefined** or an **empty string**, the editor will remain in read-only mode, and the comments will be in read-only mode. This means that users cannot edit the content or add comments. + +[cols="1,1,2", options="header"] +|=== +|Editor Readonly |Tinycomments_access |Result +|true |not specified |readonly editor, readonly comments +|false |not specified |Default behaviour, full editing rights to the comments and editor +|=== + +liveDemo::comments-readonly-mode[] + +== `tinycomments_access` set to `'comment'` and `readonly` set to `true` + +When `tinycomments_access` is set to `comment` and `readonly` is set to `true`, the editor **will remain** in read-only mode, but the comments will be in **comment-only** mode. This means that users can add and delete comments, but they cannot edit the editor content. + +[cols="1,1,2", options="header"] +|=== +|Editor Readonly |Tinycomments_access |Result +|true |comment |comment only mode, readonly editor, can add/delete new comments +|false |comment |comment only mode, readonly editor, can add/delete new comments +|=== + +liveDemo::comments-ui-mode[] \ No newline at end of file From 351e5b1d44726782aa9e361d586b888be62534c0 Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Tue, 1 Oct 2024 22:15:38 +1000 Subject: [PATCH 02/22] DOC-2524: revert live_demo testing url. --- antora.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/antora.yml b/antora.yml index 7d002fe41c..8e9ef1e30c 100644 --- a/antora.yml +++ b/antora.yml @@ -8,9 +8,9 @@ asciidoc: idseparator: '-@' # generic variables companyurl: https://www.tiny.cloud - cdnurl: https://cdn.tiny.cloud/1/no-api-key/tinymce/7-dev/tinymce.min.js + cdnurl: https://cdn.tiny.cloud/1/no-api-key/tinymce/7/tinymce.min.js tdcdnurl: https://cdn.tiny.cloud/1/_your_api_key_/tinydrive/7/tinydrive.min.js - tinymce_live_demo_url: https://cdn.tiny.cloud/1/qagffr3pkuv17a8on1afax661irst1hbr4e6tbv888sz91jc/tinymce/7-dev/tinymce.min.js + tinymce_live_demo_url: https://cdn.tiny.cloud/1/qagffr3pkuv17a8on1afax661irst1hbr4e6tbv888sz91jc/tinymce/7/tinymce.min.js tinydrive_live_demo_url: https://cdn.tiny.cloud/1/qagffr3pkuv17a8on1afax661irst1hbr4e6tbv888sz91jc/tinydrive/7/tinydrive.min.js webcomponent_url: https://cdn.jsdelivr.net/npm/@tinymce/tinymce-webcomponent@2/dist/tinymce-webcomponent.min.js jquery_url: https://cdn.jsdelivr.net/npm/@tinymce/tinymce-jquery@2/dist/tinymce-jquery.min.js From a46f8e36003ba34bede4d4fa5c1ce99604903641 Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Wed, 2 Oct 2024 14:57:44 +1000 Subject: [PATCH 03/22] Update modules/ROOT/examples/live-demos/comments-readonly-mode/index.js Co-authored-by: Mitchell Crompton --- .../ROOT/examples/live-demos/comments-readonly-mode/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/examples/live-demos/comments-readonly-mode/index.js b/modules/ROOT/examples/live-demos/comments-readonly-mode/index.js index aad6233460..fe95d0fce7 100644 --- a/modules/ROOT/examples/live-demos/comments-readonly-mode/index.js +++ b/modules/ROOT/examples/live-demos/comments-readonly-mode/index.js @@ -7,7 +7,7 @@ tinymce.init({ "help", "image", "insertdatetime", "link", "lists", "media", "preview", "searchreplace", "table", "visualblocks", ], - toolbar: "addcomment showcomments | undo redo | styles | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image", + toolbar: "addcomment showcomments togglereadonly | undo redo | styles | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image", tinycomments_mode: 'embedded', tinycomments_access: '', setup: (ed) => { From 9c0b1559ae8ad6c9e2986acbb733ac1a729e2624 Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Wed, 2 Oct 2024 14:58:17 +1000 Subject: [PATCH 04/22] Update modules/ROOT/examples/live-demos/comments-readonly-mode/index.js Co-authored-by: Mitchell Crompton --- .../ROOT/examples/live-demos/comments-readonly-mode/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/examples/live-demos/comments-readonly-mode/index.js b/modules/ROOT/examples/live-demos/comments-readonly-mode/index.js index fe95d0fce7..34c22c9110 100644 --- a/modules/ROOT/examples/live-demos/comments-readonly-mode/index.js +++ b/modules/ROOT/examples/live-demos/comments-readonly-mode/index.js @@ -9,7 +9,7 @@ tinymce.init({ ], toolbar: "addcomment showcomments togglereadonly | undo redo | styles | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image", tinycomments_mode: 'embedded', - tinycomments_access: '', + readonly: true, setup: (ed) => { editor = ed; // Assign the editor instance globally } From 3f2ef4cfbf7ec5c4cc6859b31430d1d03943419f Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Wed, 2 Oct 2024 14:58:47 +1000 Subject: [PATCH 05/22] Update modules/ROOT/partials/configuration/comments-tinycomments_access.adoc Co-authored-by: Mitchell Crompton --- .../partials/configuration/comments-tinycomments_access.adoc | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc b/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc index d92e6a2be4..6a39a7ced2 100644 --- a/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc +++ b/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc @@ -22,7 +22,6 @@ tinymce.init({ plugins: 'tinycomments', toolbar: 'addcomment showcomments', readony: true, // set the editor to read-only mode - tinycomments_access: '', }); ---- From 46eef4ec39a951c966747020a58a96b712bdbfde Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Wed, 2 Oct 2024 14:59:02 +1000 Subject: [PATCH 06/22] Update modules/ROOT/partials/configuration/comments-tinycomments_access.adoc Co-authored-by: shirqa <43625458+ShiridiGandham@users.noreply.github.com> --- .../comments-tinycomments_access.adoc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc b/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc index 6a39a7ced2..7af327bc9e 100644 --- a/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc +++ b/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc @@ -45,8 +45,18 @@ When `tinycomments_access` is set to `comment` and `readonly` is set to `true`, [cols="1,1,2", options="header"] |=== |Editor Readonly |Tinycomments_access |Result -|true |comment |comment only mode, readonly editor, can add/delete new comments -|false |comment |comment only mode, readonly editor, can add/delete new comments +|true |comment |The editor is read-only, but users can add or delete new comments. +|false |comment |The editor is read-only, but users can add or delete new comments. |=== - +=== Example: +[source,javascript] +---- +tinymce.init({ + selector: 'textarea', // change this value according to your HTML + plugins: 'tinycomments', + toolbar: 'addcomment showcomments', + readony: true, // set the editor to read-only mode + tinycomments_access: 'comment' +}); +---- liveDemo::comments-ui-mode[] \ No newline at end of file From 551edd498af18b485d28b4674252b179db0699d3 Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Wed, 2 Oct 2024 14:59:19 +1000 Subject: [PATCH 07/22] Update modules/ROOT/pages/comments-options.adoc Co-authored-by: shirqa <43625458+ShiridiGandham@users.noreply.github.com> --- modules/ROOT/pages/comments-options.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/comments-options.adoc b/modules/ROOT/pages/comments-options.adoc index 6ccfc92d92..4fa8f7c60e 100644 --- a/modules/ROOT/pages/comments-options.adoc +++ b/modules/ROOT/pages/comments-options.adoc @@ -7,6 +7,6 @@ == Options -The following configuration options affect the behavior of the {pluginname} plugin. +The following configuration option affects the behavior of the {pluginname} plugin. include::partial$configuration/comments-tinycomments_access.adoc[leveloffset=+1] From 727d593e8655396b8cc77e6751f7d1dc9742da7b Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Wed, 2 Oct 2024 15:00:35 +1000 Subject: [PATCH 08/22] Update modules/ROOT/examples/live-demos/comments-readonly-mode/index.js Co-authored-by: Mitchell Crompton --- .../comments-readonly-mode/index.js | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/modules/ROOT/examples/live-demos/comments-readonly-mode/index.js b/modules/ROOT/examples/live-demos/comments-readonly-mode/index.js index 34c22c9110..e164a765b5 100644 --- a/modules/ROOT/examples/live-demos/comments-readonly-mode/index.js +++ b/modules/ROOT/examples/live-demos/comments-readonly-mode/index.js @@ -10,14 +10,19 @@ tinymce.init({ toolbar: "addcomment showcomments togglereadonly | undo redo | styles | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image", tinycomments_mode: 'embedded', readonly: true, - setup: (ed) => { - editor = ed; // Assign the editor instance globally + setup: (editor) => { + const isReadonlyMode = () => editor.mode.get() === 'readonly'; + editor.ui.registry.addToggleButton('togglereadonly', { + text: 'Readonly mode', + context: 'any', // Available from 7.4 + onSetup: (buttonApi) => { + const activate = (api) => () => api.setActive(isReadonlyMode()); + editor.on('SwitchMode', activate(buttonApi)); + return (teardownApi) => editor.off('SwitchMode', activate(teardownApi)); + }, + onAction: (api) => { + editor.mode.set(isReadonlyMode() ? 'design' : 'readonly'); + } + }); } -}); - -const button = document.getElementById('toggle-readonly-mode'); - -button.addEventListener('click', () => { - const isReadonly = editor.mode.get() === 'readonly'; - tinymce.get(0).mode.set(isReadonly ? 'design' : 'readonly'); }); \ No newline at end of file From f1ea588920500d57d0caff55582b0cb54ef5cf1e Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Wed, 2 Oct 2024 15:02:00 +1000 Subject: [PATCH 09/22] Update modules/ROOT/partials/configuration/comments-tinycomments_access.adoc Co-authored-by: shirqa <43625458+ShiridiGandham@users.noreply.github.com> --- .../partials/configuration/comments-tinycomments_access.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc b/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc index 7af327bc9e..76d6d06fe3 100644 --- a/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc +++ b/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc @@ -10,7 +10,7 @@ This option controls the editor's read-only state and comment functionality. [IMPORTANT] ==== * When `tinycomments_access` is set to `comment`, the editor will automatically switch to xref:editor-important-options.adoc#readonly[Readonly Mode]. -* Default behavior allows full editing access to both the editor and comments. +* Default behavior, when the `tinycomments_access` option is either not configured or set to an empty string, allows full editing access to both the editor and the comments. ==== === Example: Basic Configuration From 0cfc9ee2de95cef09e1ae3a837cc087869ec8612 Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Wed, 2 Oct 2024 15:22:43 +1000 Subject: [PATCH 10/22] DOC-2524: file name change, remove button from demo and update headers. --- .../live-demos/comments-readonly-mode/index.html | 2 -- .../examples/live-demos/comments-readonly-mode/index.js | 2 -- .../ROOT/examples/live-demos/comments-ui-mode/index.js | 7 +------ modules/ROOT/nav.adoc | 2 +- ...omments-options.adoc => comments-access-options.adoc} | 9 +++++---- 5 files changed, 7 insertions(+), 15 deletions(-) rename modules/ROOT/pages/{comments-options.adoc => comments-access-options.adoc} (56%) diff --git a/modules/ROOT/examples/live-demos/comments-readonly-mode/index.html b/modules/ROOT/examples/live-demos/comments-readonly-mode/index.html index daad3f91fb..fe676301b3 100644 --- a/modules/ROOT/examples/live-demos/comments-readonly-mode/index.html +++ b/modules/ROOT/examples/live-demos/comments-readonly-mode/index.html @@ -33,6 +33,4 @@

A Simple Table Example (Read-Only)

Thanks for exploring TinyMCE's read-only mode! We hope this demo shows off its versatility and ease of use.

- - \ No newline at end of file diff --git a/modules/ROOT/examples/live-demos/comments-readonly-mode/index.js b/modules/ROOT/examples/live-demos/comments-readonly-mode/index.js index e164a765b5..22cbbbaa73 100644 --- a/modules/ROOT/examples/live-demos/comments-readonly-mode/index.js +++ b/modules/ROOT/examples/live-demos/comments-readonly-mode/index.js @@ -1,5 +1,3 @@ -let editor; - tinymce.init({ selector: "textarea#comment-readonly-ui-mode", plugins: [ diff --git a/modules/ROOT/examples/live-demos/comments-ui-mode/index.js b/modules/ROOT/examples/live-demos/comments-ui-mode/index.js index e281c9ad66..5224935f09 100644 --- a/modules/ROOT/examples/live-demos/comments-ui-mode/index.js +++ b/modules/ROOT/examples/live-demos/comments-ui-mode/index.js @@ -1,5 +1,3 @@ -let editor; - tinymce.init({ selector: "textarea#comments-ui-mode", plugins: [ @@ -9,8 +7,5 @@ tinymce.init({ ], toolbar: "addcomment showcomments | undo redo | styles | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image", tinycomments_mode: 'embedded', - tinycomments_access: 'comment', - setup: (ed) => { - editor = ed; - } + tinycomments_access: 'comment' }); \ No newline at end of file diff --git a/modules/ROOT/nav.adoc b/modules/ROOT/nav.adoc index ddf8c59507..6b5747561b 100644 --- a/modules/ROOT/nav.adoc +++ b/modules/ROOT/nav.adoc @@ -303,7 +303,7 @@ **** xref:comments-callback-mode.adoc[Callback mode] **** xref:comments-embedded-mode.adoc[Embedded mode] **** xref:comments-toolbars-menus.adoc[Toolbar buttons and menu items] -**** xref:comments-options.adoc[Ui Options] +**** xref:comments-access-options.adoc[Access Options] **** xref:comments-commands-events-apis.adoc[Commands, Events and APIs] *** xref:advcode.adoc[Enhanced Code Editor] *** Enhanced Media Embed diff --git a/modules/ROOT/pages/comments-options.adoc b/modules/ROOT/pages/comments-access-options.adoc similarity index 56% rename from modules/ROOT/pages/comments-options.adoc rename to modules/ROOT/pages/comments-access-options.adoc index 4fa8f7c60e..b9af24548e 100644 --- a/modules/ROOT/pages/comments-options.adoc +++ b/modules/ROOT/pages/comments-access-options.adoc @@ -1,11 +1,12 @@ -:navtitle: Comments Options -:description: TinyMCE Comments plugin options. -:keywords: comments, commenting, tinycomments +:navtitle: Comments Access Options +:description: TinyMCE Comments plugin access options. +:keywords: comments, commenting, tinycomments, access options :pluginname: Comments :plugincode: comments :pluginminimumplan: enterprise -== Options +[[access-options]] +== Access Options The following configuration option affects the behavior of the {pluginname} plugin. From b83d5932fd57a5d14ad7fe37b99d6fcd1c322a83 Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Wed, 2 Oct 2024 15:38:58 +1000 Subject: [PATCH 11/22] Update modules/ROOT/partials/configuration/comments-tinycomments_access.adoc Co-authored-by: Shan --- .../partials/configuration/comments-tinycomments_access.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc b/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc index 76d6d06fe3..e8bd11ab0f 100644 --- a/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc +++ b/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc @@ -25,9 +25,9 @@ tinymce.init({ }); ---- -=== `tinycomments_access` set to undefined or an empty string and `readonly` set to `true` +=== `tinycomments_access` is not configured and `readonly` set to `true` -When `tinycomments_access` is set to **undefined** or an **empty string**, the editor will remain in read-only mode, and the comments will be in read-only mode. This means that users cannot edit the content or add comments. +When `tinycomments_access` is not configured, the editor will remain in read-only mode, and the comments will be in read-only mode. This means that users cannot edit the content or add comments. [cols="1,1,2", options="header"] |=== From 0fed7b28830a318ef5064970271ca29669f1955b Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Wed, 2 Oct 2024 16:05:29 +1000 Subject: [PATCH 12/22] DOC-2524: Restructured tinycomments_access.adoc, removed basic config. --- .../comments-tinycomments_access.adoc | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc b/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc index e8bd11ab0f..6fe0f3beb7 100644 --- a/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc +++ b/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc @@ -13,8 +13,18 @@ This option controls the editor's read-only state and comment functionality. * Default behavior, when the `tinycomments_access` option is either not configured or set to an empty string, allows full editing access to both the editor and the comments. ==== -=== Example: Basic Configuration +=== `tinycomments_access` _is set to `'comment'` and `readonly` set to `true`_ +When `tinycomments_access` is set to `comment` and `readonly` is set to `true`, the editor **will remain** in read-only mode, but the comments will be in **comment-only** mode. This means that users can add and delete comments, but they cannot edit the editor content. + +[cols="1,1,2", options="header"] +|=== +|Editor Readonly |Tinycomments_access |Result +|true |comment |The editor is read-only, but users can add or delete new comments. +|false |comment |The editor is read-only, but users can add or delete new comments. +|=== + +.Example [source,javascript] ---- tinymce.init({ @@ -22,10 +32,13 @@ tinymce.init({ plugins: 'tinycomments', toolbar: 'addcomment showcomments', readony: true, // set the editor to read-only mode + tinycomments_access: 'comment' }); ---- -=== `tinycomments_access` is not configured and `readonly` set to `true` +liveDemo::comments-ui-mode[] + +=== `tinycomments_access` _is not configured and `readonly` set to `true`_ When `tinycomments_access` is not configured, the editor will remain in read-only mode, and the comments will be in read-only mode. This means that users cannot edit the content or add comments. @@ -33,22 +46,10 @@ When `tinycomments_access` is not configured, the editor will remain in read-onl |=== |Editor Readonly |Tinycomments_access |Result |true |not specified |readonly editor, readonly comments -|false |not specified |Default behaviour, full editing rights to the comments and editor +|false |not specified |Default behavior, full editing rights to the comments and editor |=== -liveDemo::comments-readonly-mode[] - -== `tinycomments_access` set to `'comment'` and `readonly` set to `true` - -When `tinycomments_access` is set to `comment` and `readonly` is set to `true`, the editor **will remain** in read-only mode, but the comments will be in **comment-only** mode. This means that users can add and delete comments, but they cannot edit the editor content. - -[cols="1,1,2", options="header"] -|=== -|Editor Readonly |Tinycomments_access |Result -|true |comment |The editor is read-only, but users can add or delete new comments. -|false |comment |The editor is read-only, but users can add or delete new comments. -|=== -=== Example: +.Example [source,javascript] ---- tinymce.init({ @@ -56,7 +57,7 @@ tinymce.init({ plugins: 'tinycomments', toolbar: 'addcomment showcomments', readony: true, // set the editor to read-only mode - tinycomments_access: 'comment' }); ---- -liveDemo::comments-ui-mode[] \ No newline at end of file + +liveDemo::comments-readonly-mode[] \ No newline at end of file From 9a32fefc4970039d959cbc58d035743dd0dae81d Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Wed, 2 Oct 2024 20:15:34 +1000 Subject: [PATCH 13/22] Update modules/ROOT/partials/configuration/comments-tinycomments_access.adoc Co-authored-by: Mitchell Crompton --- .../partials/configuration/comments-tinycomments_access.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc b/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc index 6fe0f3beb7..b1b3df9388 100644 --- a/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc +++ b/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc @@ -15,7 +15,7 @@ This option controls the editor's read-only state and comment functionality. === `tinycomments_access` _is set to `'comment'` and `readonly` set to `true`_ -When `tinycomments_access` is set to `comment` and `readonly` is set to `true`, the editor **will remain** in read-only mode, but the comments will be in **comment-only** mode. This means that users can add and delete comments, but they cannot edit the editor content. +When `tinycomments_access` is set to `comment`, the editor will be in xref:editor-important-options.adoc#readonly[Readonly mode], but the comments will be in a **comment-only** mode. This means that users can add and delete comments, but they cannot edit the editor content. [cols="1,1,2", options="header"] |=== From 55a749afa73943f10240c86cc021cd47ac2daa56 Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Wed, 2 Oct 2024 20:24:05 +1000 Subject: [PATCH 14/22] Update modules/ROOT/partials/configuration/comments-tinycomments_access.adoc Co-authored-by: Mitchell Crompton --- .../partials/configuration/comments-tinycomments_access.adoc | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc b/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc index b1b3df9388..db81942521 100644 --- a/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc +++ b/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc @@ -10,7 +10,6 @@ This option controls the editor's read-only state and comment functionality. [IMPORTANT] ==== * When `tinycomments_access` is set to `comment`, the editor will automatically switch to xref:editor-important-options.adoc#readonly[Readonly Mode]. -* Default behavior, when the `tinycomments_access` option is either not configured or set to an empty string, allows full editing access to both the editor and the comments. ==== === `tinycomments_access` _is set to `'comment'` and `readonly` set to `true`_ From 030acdcd7fb154dd9e32c4f933b735c88fd8f804 Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Wed, 2 Oct 2024 20:24:23 +1000 Subject: [PATCH 15/22] Update modules/ROOT/partials/configuration/comments-tinycomments_access.adoc Co-authored-by: Mitchell Crompton --- .../partials/configuration/comments-tinycomments_access.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc b/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc index db81942521..624db9a5c2 100644 --- a/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc +++ b/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc @@ -5,7 +5,7 @@ *Possible values:* `'comment'` -This option controls the editor's read-only state and comment functionality. +This option sets the editor to the readonly mode, while still allowing comments to be made. [IMPORTANT] ==== From 78fc0c47bae09650962692c8fe8c1fa6d550d5e7 Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Wed, 2 Oct 2024 20:25:22 +1000 Subject: [PATCH 16/22] Update modules/ROOT/partials/configuration/comments-tinycomments_access.adoc Co-authored-by: Mitchell Crompton --- .../partials/configuration/comments-tinycomments_access.adoc | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc b/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc index 624db9a5c2..f88616c734 100644 --- a/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc +++ b/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc @@ -30,7 +30,6 @@ tinymce.init({ selector: 'textarea', // change this value according to your HTML plugins: 'tinycomments', toolbar: 'addcomment showcomments', - readony: true, // set the editor to read-only mode tinycomments_access: 'comment' }); ---- From 3c73b349c579049f3080355932a319614a8b8482 Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Thu, 3 Oct 2024 09:11:45 +1000 Subject: [PATCH 17/22] Update modules/ROOT/partials/configuration/comments-tinycomments_access.adoc Co-authored-by: shirqa <43625458+ShiridiGandham@users.noreply.github.com> --- .../partials/configuration/comments-tinycomments_access.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc b/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc index f88616c734..116b787241 100644 --- a/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc +++ b/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc @@ -54,7 +54,7 @@ tinymce.init({ selector: 'textarea', // change this value according to your HTML plugins: 'tinycomments', toolbar: 'addcomment showcomments', - readony: true, // set the editor to read-only mode + readonly: true, // set the editor to read-only mode }); ---- From f4f4ae1503e7bb8892b4ea423ec581419d88c377 Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Thu, 3 Oct 2024 09:12:21 +1000 Subject: [PATCH 18/22] Update modules/ROOT/partials/configuration/comments-tinycomments_access.adoc Co-authored-by: shirqa <43625458+ShiridiGandham@users.noreply.github.com> --- .../partials/configuration/comments-tinycomments_access.adoc | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc b/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc index 116b787241..431534f562 100644 --- a/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc +++ b/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc @@ -53,6 +53,7 @@ When `tinycomments_access` is not configured, the editor will remain in read-onl tinymce.init({ selector: 'textarea', // change this value according to your HTML plugins: 'tinycomments', + tinycomments_mode: 'embedded', toolbar: 'addcomment showcomments', readonly: true, // set the editor to read-only mode }); From fd54622b0dcf99b88285db5a92785235b38460f6 Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Tue, 8 Oct 2024 10:22:29 +1000 Subject: [PATCH 19/22] Update modules/ROOT/partials/configuration/comments-tinycomments_access.adoc Co-authored-by: Mitchell Crompton --- .../configuration/comments-tinycomments_access.adoc | 6 ------ 1 file changed, 6 deletions(-) diff --git a/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc b/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc index 431534f562..3851e97c02 100644 --- a/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc +++ b/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc @@ -16,12 +16,6 @@ This option sets the editor to the readonly mode, while still allowing comments When `tinycomments_access` is set to `comment`, the editor will be in xref:editor-important-options.adoc#readonly[Readonly mode], but the comments will be in a **comment-only** mode. This means that users can add and delete comments, but they cannot edit the editor content. -[cols="1,1,2", options="header"] -|=== -|Editor Readonly |Tinycomments_access |Result -|true |comment |The editor is read-only, but users can add or delete new comments. -|false |comment |The editor is read-only, but users can add or delete new comments. -|=== .Example [source,javascript] From bce380925b900e90427b2f6b5b4d3ce6a24edd93 Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Tue, 8 Oct 2024 10:23:38 +1000 Subject: [PATCH 20/22] Update modules/ROOT/partials/configuration/comments-tinycomments_access.adoc Co-authored-by: Mitchell Crompton --- .../comments-tinycomments_access.adoc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc b/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc index 3851e97c02..e7d7f2d883 100644 --- a/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc +++ b/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc @@ -30,16 +30,14 @@ tinymce.init({ liveDemo::comments-ui-mode[] -=== `tinycomments_access` _is not configured and `readonly` set to `true`_ +=== Comments with `readonly` set to `true` -When `tinycomments_access` is not configured, the editor will remain in read-only mode, and the comments will be in read-only mode. This means that users cannot edit the content or add comments. +When not using the `tinycomments_access` option, the comments sidebar will have a different state depending on the use of the xref:editor-important-options.adoc#readonly[`readonly` option]. + +With neither xref:editor-important-options.adoc#readonly[Readonly mode] nor `tinycomments: "comment"` configured, both the editor and the comments sidebar will be in their default state. By default, comments can be both viewed and added, and the editor content is editable. + +With xref:editor-important-options.adoc#readonly[Readonly mode] enabled, the comments sidebar will be in a **view-only** mode, meaning all comments can be viewed and navigated, but no new comments can be added. Also, in the **readonly** state, the editor will still not be editable. -[cols="1,1,2", options="header"] -|=== -|Editor Readonly |Tinycomments_access |Result -|true |not specified |readonly editor, readonly comments -|false |not specified |Default behavior, full editing rights to the comments and editor -|=== .Example [source,javascript] From e08ed504795a5b5af552b1300118661638f361b7 Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Tue, 8 Oct 2024 12:37:53 +1000 Subject: [PATCH 21/22] Update modules/ROOT/partials/configuration/comments-tinycomments_access.adoc Co-authored-by: Mitchell Crompton --- .../partials/configuration/comments-tinycomments_access.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc b/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc index e7d7f2d883..7009e330dc 100644 --- a/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc +++ b/modules/ROOT/partials/configuration/comments-tinycomments_access.adoc @@ -12,7 +12,7 @@ This option sets the editor to the readonly mode, while still allowing comments * When `tinycomments_access` is set to `comment`, the editor will automatically switch to xref:editor-important-options.adoc#readonly[Readonly Mode]. ==== -=== `tinycomments_access` _is set to `'comment'` and `readonly` set to `true`_ +=== Comments with `tinycomments_access` set to `'comment'` When `tinycomments_access` is set to `comment`, the editor will be in xref:editor-important-options.adoc#readonly[Readonly mode], but the comments will be in a **comment-only** mode. This means that users can add and delete comments, but they cannot edit the editor content. From e6c6fbcd333a7edfba30bbacad58eaf398bb0e65 Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Tue, 8 Oct 2024 12:50:22 +1000 Subject: [PATCH 22/22] Update modules/ROOT/examples/live-demos/comments-ui-mode/index.html Co-authored-by: tiny-ben-tran --- modules/ROOT/examples/live-demos/comments-ui-mode/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/examples/live-demos/comments-ui-mode/index.html b/modules/ROOT/examples/live-demos/comments-ui-mode/index.html index 70e4f301bf..4c34ab043b 100644 --- a/modules/ROOT/examples/live-demos/comments-ui-mode/index.html +++ b/modules/ROOT/examples/live-demos/comments-ui-mode/index.html @@ -7,7 +7,7 @@

Welcome to the New Tiny Comments Mode!

  • Click the Add Comment icon in the toolbar.
  • Type your comment into the text field in the Comment sidebar.
  • Click Comment to attach the comment to the text.
  • -
  • To delete a comment, click the comment bubble and choose Delete Comment.
  • +
  • To delete a comment, click the comment options and choose Delete Comment.
  • Your comment will appear linked to the selected text, just like this: exactly like this!

    Note that in this mode, the content is non-editable, but you can freely interact with comments.