From 1f79cad6a16fa68e960adc432b652ea6e53b812f Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Fri, 25 Jul 2025 13:25:09 +1000 Subject: [PATCH 1/5] DOC-3229: Add missing iframe_attrs option. --- .../ROOT/pages/editor-important-options.adoc | 9 ++--- .../partials/configuration/iframe_attrs.adoc | 40 +++++++++++++++++++ 2 files changed, 44 insertions(+), 5 deletions(-) create mode 100644 modules/ROOT/partials/configuration/iframe_attrs.adoc diff --git a/modules/ROOT/pages/editor-important-options.adoc b/modules/ROOT/pages/editor-important-options.adoc index d0b0d45b8b..78a0e39223 100644 --- a/modules/ROOT/pages/editor-important-options.adoc +++ b/modules/ROOT/pages/editor-important-options.adoc @@ -13,6 +13,10 @@ include::partial$configuration/target.adoc[leveloffset=+1] include::partial$configuration/placeholder.adoc[leveloffset=+1] +== Configuring the editor iframe + +include::partial$configuration/iframe_attrs.adoc[leveloffset=+1] + == Focusing on the editor include::partial$configuration/taborder.adoc[leveloffset=+1] @@ -56,8 +60,3 @@ include::partial$configuration/content_security_policy.adoc[leveloffset=+1] include::partial$configuration/referrer_policy.adoc[leveloffset=+1] include::partial$configuration/suffix.adoc[leveloffset=+1] - -//// -Not documented, but probably belongs in a new section here somewhere. -include::partial$configuration/iframe_attrs.adoc[] -//// diff --git a/modules/ROOT/partials/configuration/iframe_attrs.adoc b/modules/ROOT/partials/configuration/iframe_attrs.adoc new file mode 100644 index 0000000000..dd19d23de5 --- /dev/null +++ b/modules/ROOT/partials/configuration/iframe_attrs.adoc @@ -0,0 +1,40 @@ +[[iframe_attrs]] +== `+iframe_attrs+` + +This option allows setting custom attributes on the editor's content iframe element when {productname} is running in iframe mode. The attributes are applied during iframe creation and can be used for accessibility compliance, form validation, custom styling, and other customization needs. + +NOTE: This option only affects the main editor content iframe, not other iframes such as preview frames or dialog iframes. + +*Type:* `+Object+` + +.Example: using `+iframe_attrs+` for accessibility +[source,js] +---- +tinymce.init({ + selector: 'textarea', // change this value according to your HTML + iframe_attrs: { + 'aria-required': 'true', + 'aria-describedby': 'editor-description' + } +}); +---- + +.Example: using `+iframe_attrs+` for custom styling +[source,js] +---- +tinymce.init({ + selector: 'textarea', // change this value according to your HTML + iframe_attrs: { + 'style': 'background-color:rgb(64, 167, 99); border: 2px solid #ddd;', + 'class': 'custom-editor-frame' + } +}); +---- + +.Example: verifying `+iframe_attrs+` configuration +[source,js] +---- +// After the editor is initialized, you can verify the configuration: +console.log(tinymce.activeEditor.options.get('iframe_attrs')); +// Output: {style: 'background-color: #f5f5f5; border: 2px solid #ddd;', class: 'custom-editor-frame'} +---- From e2124d1b0ac220e015f5c38104c615c5128ecfd4 Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Fri, 25 Jul 2025 13:50:13 +1000 Subject: [PATCH 2/5] Update modules/ROOT/partials/configuration/iframe_attrs.adoc Co-authored-by: tiny-ben-tran --- modules/ROOT/partials/configuration/iframe_attrs.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/partials/configuration/iframe_attrs.adoc b/modules/ROOT/partials/configuration/iframe_attrs.adoc index dd19d23de5..7695196cd6 100644 --- a/modules/ROOT/partials/configuration/iframe_attrs.adoc +++ b/modules/ROOT/partials/configuration/iframe_attrs.adoc @@ -1,7 +1,7 @@ [[iframe_attrs]] == `+iframe_attrs+` -This option allows setting custom attributes on the editor's content iframe element when {productname} is running in iframe mode. The attributes are applied during iframe creation and can be used for accessibility compliance, form validation, custom styling, and other customization needs. +This option allows adding custom attributes to the editor's content iframe element when running in classic mode. The attributes are applied during the iframe creation. NOTE: This option only affects the main editor content iframe, not other iframes such as preview frames or dialog iframes. From 221de536bf4705f51d1a6988be8ab1cf6aa6a9cb Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Fri, 25 Jul 2025 13:50:18 +1000 Subject: [PATCH 3/5] Update modules/ROOT/partials/configuration/iframe_attrs.adoc Co-authored-by: tiny-ben-tran --- modules/ROOT/partials/configuration/iframe_attrs.adoc | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/ROOT/partials/configuration/iframe_attrs.adoc b/modules/ROOT/partials/configuration/iframe_attrs.adoc index 7695196cd6..913c8fb576 100644 --- a/modules/ROOT/partials/configuration/iframe_attrs.adoc +++ b/modules/ROOT/partials/configuration/iframe_attrs.adoc @@ -3,7 +3,6 @@ This option allows adding custom attributes to the editor's content iframe element when running in classic mode. The attributes are applied during the iframe creation. -NOTE: This option only affects the main editor content iframe, not other iframes such as preview frames or dialog iframes. *Type:* `+Object+` From f7f2286bc648bb5223b9bc86d8c90f26c4de695c Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Mon, 28 Jul 2025 08:40:53 +1000 Subject: [PATCH 4/5] Update modules/ROOT/partials/configuration/iframe_attrs.adoc --- modules/ROOT/partials/configuration/iframe_attrs.adoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/ROOT/partials/configuration/iframe_attrs.adoc b/modules/ROOT/partials/configuration/iframe_attrs.adoc index 913c8fb576..ce58c3c4be 100644 --- a/modules/ROOT/partials/configuration/iframe_attrs.adoc +++ b/modules/ROOT/partials/configuration/iframe_attrs.adoc @@ -3,6 +3,8 @@ This option allows adding custom attributes to the editor's content iframe element when running in classic mode. The attributes are applied during the iframe creation. +NOTE: This option only affects the main editor content iframe, not other iframes such as preview frames, dialog iframes, or iframe elements created within the editor content. + *Type:* `+Object+` From 7e562bb70b7cf58fe8e5aae3c97dbb0e265b32fc Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Mon, 28 Jul 2025 11:32:30 +1000 Subject: [PATCH 5/5] Update modules/ROOT/partials/configuration/iframe_attrs.adoc --- modules/ROOT/partials/configuration/iframe_attrs.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/partials/configuration/iframe_attrs.adoc b/modules/ROOT/partials/configuration/iframe_attrs.adoc index ce58c3c4be..8bf842a83d 100644 --- a/modules/ROOT/partials/configuration/iframe_attrs.adoc +++ b/modules/ROOT/partials/configuration/iframe_attrs.adoc @@ -37,5 +37,5 @@ tinymce.init({ ---- // After the editor is initialized, you can verify the configuration: console.log(tinymce.activeEditor.options.get('iframe_attrs')); -// Output: {style: 'background-color: #f5f5f5; border: 2px solid #ddd;', class: 'custom-editor-frame'} +// Output: {style: 'background-color:rgb(64, 167, 99); border: 2px solid #ddd;', class: 'custom-editor-frame'} ----