Skip to content

Commit 2efd947

Browse files
committed
DOC-3147: Fix indent issues.
1 parent 2d92ee1 commit 2efd947

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

modules/ROOT/pages/8.0-release-notes.adoc

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,25 +106,23 @@ For information on using Enhanced Skins & Icon Packs, see: xref:enhanced-skins-a
106106

107107
=== Enhanced cross-origin resource handling
108108

109-
Added a new function-based `crossorigin` configuration option that provides granular control over cross-origin resource loading for both scripts and stylesheets. This enhancement allows for URL-based decisions about crossorigin attributes, which is particularly important for {productname} Cloud deployments and complex hosting scenarios.
110-
111-
The `crossorigin` option accepts a function that determines the appropriate attribute value based on the resource being loaded:
109+
Added a new function-based `crossorigin` configuration option that provides granular control over cross-origin resource loading. The function receives the resource URL and type (script or stylesheet) as parameters and can return 'anonymous', 'use-credentials', or undefined to control the crossorigin attribute.
112110

113111
[source,js]
114112
----
115113
tinymce.init({
116114
selector: 'textarea',
117115
crossorigin: (url, resourceType) => {
118-
// Add crossorigin="anonymous" for cross-origin resources
119-
if (url.startsWith('https://your-cdn.com')) {
120-
return 'anonymous';
121-
}
122-
// Omit crossorigin attribute for same-origin resources
123-
return '';
116+
// Returning 'anonymous' or 'use-credentials' here would explicitly set the attribute
117+
return 'anonymous';
118+
// return 'use-credentials';
119+
// return undefined; // Omit the 'crossorigin' attribute for all resources
124120
}
125121
});
126122
----
127123

124+
For more details, see: xref:configure-cross-origin-resource-loading.adoc#crossorigin[crossorigin].
125+
128126
This improvement ensures consistent resource loading behavior across different deployment scenarios and provides better control over CORS settings for both scripts and stylesheets.
129127

130128
For more details, see the xref:tinymce-and-cors.adoc#crossorigin[crossorigin configuration option] documentation.

modules/ROOT/partials/configuration/crossorigin.adoc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ The `+crossorigin+` option controls how {productname} handles cross-origin resou
2222
----
2323
tinymce.init({
2424
selector: "textarea",
25-
crossorigin: (url, resourceType) => {
26-
// Returning 'anonymous' or 'use-credentials' here would explicitly set the attribute
27-
return 'anonymous';
28-
// return 'use-credentials';
29-
// return undefined; // Omit the 'crossorigin' attribute for all resources by returning undefined
25+
crossorigin: (url, resourceType) => {
26+
// Returning 'anonymous' or 'use-credentials' here would explicitly set the attribute
27+
return 'anonymous';
28+
// return 'use-credentials';
29+
// return undefined; // Omit the 'crossorigin' attribute for all resources by returning undefined
3030
},
3131
});
3232
----
@@ -60,12 +60,12 @@ The crossorigin function can also be set globally using `+tinymce.overrideDefaul
6060
[source,js]
6161
----
6262
tinymce.overrideDefaults({
63-
...tinymce.defaultOptions, // Preserve existing defaults
63+
...tinymce.defaultOptions, // Preserve existing defaults
6464
crossorigin: (url, resourceType) => {
6565
// Returning 'anonymous' or 'use-credentials' here would explicitly set the attribute
66-
// return 'anonymous';
66+
return 'anonymous';
6767
// return 'use-credentials';
68-
return undefined; // Omit the 'crossorigin' attribute for all resources by returning undefined
68+
// return undefined; // Omit the 'crossorigin' attribute for all resources by returning undefined
6969
}
7070
});
7171
----

0 commit comments

Comments
 (0)