Skip to content
Merged
Show file tree
Hide file tree
Changes from 65 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
ced4230
Initial setup
Mar 19, 2025
56f01d9
add live demo template
Mar 19, 2025
facd970
Update API sections
Mar 21, 2025
0e1756f
Add description of plugin and examples for API options
Mar 24, 2025
b1acbb3
Comment out note about stacked changes and minor copy edits
Mar 25, 2025
9ba47ed
add live demo
Mar 31, 2025
f252ba0
rename plugin to Suggested Edits
Mar 31, 2025
8fa5056
replace all instanes of plugin name and code
Apr 1, 2025
99870e9
Update docs to include Review Permissions V1
Apr 14, 2025
c4680c9
Fix demo for Review Permissions
Apr 15, 2025
b945b79
Add Suggestions section and demo
May 7, 2025
980adc3
Revise Suggestions content
May 9, 2025
7afd9a1
Initial setup
Mar 19, 2025
c9ba93b
add live demo template
Mar 19, 2025
db52e97
Update API sections
Mar 21, 2025
ce4c43a
Add description of plugin and examples for API options
Mar 24, 2025
f9b3cf0
Comment out note about stacked changes and minor copy edits
Mar 25, 2025
dfba8fc
add live demo
Mar 31, 2025
21c4866
rename plugin to Suggested Edits
Mar 31, 2025
26fd1bf
replace all instanes of plugin name and code
Apr 1, 2025
4db7c6c
Update docs to include Review Permissions V1
Apr 14, 2025
6f52866
Fix demo for Review Permissions
Apr 15, 2025
54dd2fc
Add Suggestions section and demo
May 7, 2025
9b7ef26
Revise Suggestions content
May 9, 2025
25127a5
DOC-3174: Updating suggestedits docs
MitchC1999 May 20, 2025
a93e0ac
Merge branch 'feature/7/DOC-3174' of https://github.com/tinymce/tinym…
MitchC1999 May 20, 2025
584785f
DOC-3174: Remove unused options
MitchC1999 May 20, 2025
7791c9a
Update explanation of plugin and add UID options
May 28, 2025
c93b4a3
fix UID options
Jun 3, 2025
e978936
Update interactive demo
Jun 9, 2025
92a6b0a
Update suggestededits_access demo
Jun 9, 2025
55674d4
fix UID options
Jun 9, 2025
cd51e67
Update option and api examples
Jun 9, 2025
811fe8f
Fix UID options
Jun 9, 2025
6db0572
DOC-3174: Adding icons
MitchC1999 Jun 19, 2025
ef516e7
DOC-3174: Add `Using the User Lookup API` page
kimwoodfield Jul 1, 2025
4a826c5
Update UID options partials
Jul 2, 2025
61d2d7f
DOC-3174: Some edits
MitchC1999 Jul 2, 2025
ba633dc
DOC-3174: Add `UserLookup` partials to `revisionhistory` and `tinycom…
kimwoodfield Jul 3, 2025
da9ae91
DOC-3174: Replace reference to `userDb` with `userinfos`
kimwoodfield Jul 8, 2025
6da83e8
DOC-3174: Remove usage of `uid` in `suggestededits`
kimwoodfield Jul 9, 2025
73b8ad2
DOC-3174: Fix indentations within `Types of suggestions`
kimwoodfield Jul 9, 2025
b05d7dd
DOC-3174: Update interactive demos and examples for `embedded` mode i…
kimwoodfield Jul 9, 2025
f6365f1
DOC-3174: Update interactive demos and examples for `revisionhistory`
kimwoodfield Jul 10, 2025
193d1c4
DOC-3174: Rewrite suggested edits
MitchC1999 Jul 10, 2025
e3ec479
DOC-3174: Edits
MitchC1999 Jul 14, 2025
71b19af
DOC-3246: More docs
MitchC1999 Jul 14, 2025
791592a
DOC-3246: Fixed, premium-plugin table, removed template material, fix…
kemister85 Jul 14, 2025
461d4e1
DOC-3246: Add deprecation messaging to `tinycomments_fetch_author_inf…
kimwoodfield Jul 15, 2025
bac3a5b
DOC-3246: Update interactive examples on `comments-with-mentions` page
kimwoodfield Jul 15, 2025
2f64681
DOC-3246: Include `user_id` and `fetch_users` options in `Required Co…
kimwoodfield Jul 15, 2025
7bdb429
DOC-3246: Update `tinycomments_mentions_enabled` to include `user_id`…
kimwoodfield Jul 15, 2025
43dc3a3
DOC-3246: Demo updates
MitchC1999 Jul 15, 2025
85b8ac5
Apply suggestions from code review
MitchC1999 Jul 15, 2025
b4185ec
DOC-3246: Use lookup over `find` in `fetch_users`
kimwoodfield Jul 16, 2025
212d65a
DOC-3246: Updates to `fetch_users` partial
kimwoodfield Jul 16, 2025
767d81f
DOC-3246: Improve examples and access option
MitchC1999 Jul 16, 2025
5cc6bf1
DOC-3246: Update fetch_users option across other plugin examples
kimwoodfield Jul 16, 2025
152ae37
DOC-3246: Single quotes only
kimwoodfield Jul 16, 2025
129183b
Apply suggestions from code review
MitchC1999 Jul 17, 2025
dfadc29
DOC-3246: Improve API examples
MitchC1999 Jul 17, 2025
32434fc
DOC-3246: Improvements
MitchC1999 Jul 17, 2025
cbc5d5d
Apply suggestions from code review
MitchC1999 Jul 17, 2025
4edf9b8
DOC-3246: Final edits
MitchC1999 Jul 18, 2025
7881557
DOC-3246: Final final edit
MitchC1999 Jul 18, 2025
f160ba4
DOC-3246: Docs tweaks
kimwoodfield Jul 21, 2025
24d5e4b
DOC-3246: userlookup api docs restructure and organisation update.
kemister85 Jul 21, 2025
d4856c7
Apply suggestions from code review
MitchC1999 Jul 22, 2025
d95816a
DOC-3246: Final improvements
MitchC1999 Jul 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion antora-playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ content:
branches: HEAD
start_path: ./
- url: https://github.com/tinymce/tinymce-docs.git
branches: [ tinymce/5, tinymce/6, tinymce/7]
branches: [ tinymce/5, tinymce/6, tinymce/7 ]
urls:
html_extension_style: indexify
latest_version_segment: latest
Expand Down
2 changes: 1 addition & 1 deletion antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ asciidoc:
companyurl: https://www.tiny.cloud
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/tinymce.min.js
tinymce_live_demo_url: https://cdn.tiny.cloud/1/qagffr3pkuv17a8on1afax661irst1hbr4e6tbv888sz91jc/tinymce/8-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/dist/tinymce-webcomponent.min.js
jquery_url: https://cdn.jsdelivr.net/npm/@tinymce/tinymce-jquery@2/dist/tinymce-jquery.min.js
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
import ('https://cdn.jsdelivr.net/npm/@faker-js/faker@9/dist/index.min.js').then(({ faker }) => {
/* This represents a database of users on the server */
const userDb = {
'michaelcook': {
id: 'michaelcook',
name: 'Michael Cook',
fullName: 'Michael Cook',
description: 'Product Owner',
image: "{{imagesdir}}/avatars/michaelcook.png"
avatar: '{{imagesdir}}/avatars/michaelcook.png',
custom: {
fullName: 'Michael Cook',
description: 'Product Owner'
}
},
'kalebwilson': {
id: 'kalebwilson',
name: 'Kaleb Wilson',
fullName: 'Kaleb Wilson',
description: 'Marketing Director',
image: "{{imagesdir}}/avatars/kalebwilson.png"
avatar: '{{imagesdir}}/avatars/kalebwilson.png',
custom: {
fullName: 'Kaleb Wilson',
description: 'Marketing Director',
}
}
};

Expand All @@ -35,7 +40,7 @@ import ('https://cdn.jsdelivr.net/npm/@faker-js/faker@9/dist/index.min.js').then
const getAuthorInfo = (uid) => {
const user = userDb[uid];
if (user) {
return fillAuthorInfo(user.id, user.fullName, user.image);
return fillAuthorInfo(user.id, user.custom.fullName, user.avatar);
}
return {
author: uid,
Expand Down Expand Up @@ -85,8 +90,8 @@ import ('https://cdn.jsdelivr.net/npm/@faker-js/faker@9/dist/index.min.js').then
const resolvedConversationDb = {};

const setupFakeServer = () => {
const images = [ adminUser.image, currentUser.image ];
const userNames = [ adminUser.fullName, currentUser.fullName ];
const images = [ adminUser.avatar, currentUser.avatar ];
const userNames = [ adminUser.custom.fullName, currentUser.custom.fullName ];

for (let i = 0; i < numberOfUsers; i++) {
images.push(faker.image.avatar());
Expand All @@ -99,14 +104,16 @@ import ('https://cdn.jsdelivr.net/npm/@faker-js/faker@9/dist/index.min.js').then
[currentUser.id]: currentUser
};
userNames.map((fullName) => {
if ((fullName !== currentUser.fullName) && (fullName !== adminUser.fullName)) {
if ((fullName !== currentUser.custom.fullName) && (fullName !== adminUser.custom.fullName)) {
const id = fullName.toLowerCase().replace(/ /g, '');
userDb[id] = {
id,
name: fullName,
fullName,
description: faker.person.jobTitle(),
image: images[Math.floor(images.length * Math.random())]
avatar: images[Math.floor(images.length * Math.random())],
custom: {
fullName,
description: faker.person.jobTitle(),
}
};
}
});
Expand All @@ -118,8 +125,8 @@ import ('https://cdn.jsdelivr.net/npm/@faker-js/faker@9/dist/index.min.js').then
const users = Object.keys(userDb).map((id) => ({
id,
name: userDb[id].name,
image: userDb[id].image,
description: userDb[id].description
image: userDb[id].avatar,
description: userDb[id].custom.description
}));
resolve(users);
}, fakeDelay);
Expand Down Expand Up @@ -320,9 +327,6 @@ import ('https://cdn.jsdelivr.net/npm/@faker-js/faker@9/dist/index.min.js').then
});
setTimeout(() => done({ conversations: fetchedConversations }), fakeDelay);
};

// Read the above `getAuthorInfo` function to see how this could be implemented
const tinycomments_fetch_author_info = (done) => done(getAuthorInfo(currentUid));

tinymce.init({
selector: 'textarea#comments-callback-with-mentions',
Expand Down Expand Up @@ -350,9 +354,16 @@ import ('https://cdn.jsdelivr.net/npm/@faker-js/faker@9/dist/index.min.js').then
mentions_select,

tinycomments_mode: 'callback',
tinycomments_author: currentUser.id,
tinycomments_author_name: currentUser.fullName,
tinycomments_avatar: currentUser.image,
user_id: currentUser.id,
fetch_users: (userIds) => {
return Promise.all(
userIds.map(
(userId) => new Promise(
(resolve) => resolve(userDb[userId] || { id: userId })
)
)
)
},
tinycomments_create,
tinycomments_reply,
tinycomments_delete,
Expand All @@ -362,6 +373,5 @@ import ('https://cdn.jsdelivr.net/npm/@faker-js/faker@9/dist/index.min.js').then
tinycomments_delete_comment,
tinycomments_edit_comment,
tinycomments_fetch,
tinycomments_fetch_author_info
});
});
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
import ('https://cdn.jsdelivr.net/npm/@faker-js/faker@9/dist/index.min.js').then(({ faker }) => {
const adminUser = {
id: 'johnsmith',
name: 'John Smith',
fullName: 'John Smith',
description: 'Company Founder',
image: "https://i.pravatar.cc/150?img=11"
};
/* This represents a database of users on the server */
const userDb = {
'johnsmith': {
id: 'johnsmith',
name: 'John Smith',
avatar: 'https://i.pravatar.cc/150?img=11',
custom: {
fullName: 'John Smith',
description: 'Company Founder',
}
},
'jennynichols': {
id: 'jennynichols',
name: 'Jenny Nichols',
avatar: 'https://i.pravatar.cc/150?img=10',
custom: {
fullName: 'Jenny Nichols',
description: 'Marketing Director',
}
}
}

const currentUser = {
id: 'jennynichols',
name: 'Jenny Nichols',
fullName: 'Jenny Nichols',
description: 'Marketing Director',
image: "https://i.pravatar.cc/150?img=10"
};
const adminUser = userDb['johnsmith'];
const currentUser = userDb['jennynichols'];

const fakeDelay = 500;
const numberOfUsers = 200;
Expand All @@ -24,28 +33,25 @@
const userRequest = {};

const setupFakeServer = () => {
const images = [ adminUser.image, currentUser.image ];
const userNames = [ adminUser.fullName, currentUser.fullName ];
const images = [ adminUser.avatar, currentUser.avatar ];
const userNames = [ adminUser.custom.fullName, currentUser.custom.fullName ];

for (let i = 0; i < numberOfUsers; i++) {
images.push(faker.image.avatar());
userNames.push(`${faker.person.firstName()} ${faker.person.lastName()}`);
}

/* This represents a database of users on the server */
const userDb = {
[adminUser.id]: adminUser,
[currentUser.id]: currentUser
};

userNames.map((fullName) => {
if ((fullName !== currentUser.fullName) && (fullName !== adminUser.fullName)) {
if ((fullName !== currentUser.custom.fullName) && (fullName !== adminUser.custom.fullName)) {
const id = fullName.toLowerCase().replace(/ /g, '');
userDb[id] = {
id,
name: fullName,
fullName,
description: faker.person.jobTitle(),
image: images[Math.floor(images.length * Math.random())]
avatar: images[Math.floor(images.length * Math.random())],
custom: {
fullName,
description: faker.person.jobTitle(),
}
};
}
});
Expand Down Expand Up @@ -155,9 +161,16 @@

tinycomments_mode: 'embedded',
sidebar_show: 'showcomments',
tinycomments_author: currentUser.id,
tinycomments_author_name: currentUser.fullName,
tinycomments_avatar: currentUser.image,
user_id: currentUser.id,
fetch_users: (userIds) => {
return Promise.all(
userIds.map(
(userId) => new Promise(
(resolve) => resolve(userDb[userId] || { id: userId })
)
)
)
},
tinycomments_can_resolve,
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tinymce.init({
quickbars_image_toolbar: 'alignleft aligncenter alignright | rotateleft rotateright | imageoptions',
tinycomments_mode: 'embedded',
sidebar_show: 'showcomments',
tinycomments_author: currentAuthor,
user_id: currentAuthor,
tinycomments_can_resolve: (req, done, fail) => {
const allowed = req.comments.length > 0 &&
req.comments[0].author === currentAuthor;
Expand Down
23 changes: 19 additions & 4 deletions modules/ROOT/examples/live-demos/revisionhistory/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ const getRandomDelay = () => {
return Math.floor(Math.random() * (maxDelay - minDelay + 1)) + minDelay;
};

/* This represents a database of users on the server */
const userDb = {
'john.doe': {
id: 'john.doe',
name: 'John Doe',
avatar: 'https://i.pravatar.cc/150?img=11'
}
};

const lightRevisions = [
{
revisionId: '3',
Expand Down Expand Up @@ -202,9 +211,15 @@ tinymce.init({
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:16px }',
revisionhistory_fetch,
revisionhistory_fetch_revision,
revisionhistory_author: {
id: 'john.doe',
name: 'John Doe'
},
user_id: 'john.doe',
fetch_users: (userIds) => {
return Promise.all(
userIds.map(
(userId) => new Promise(
(resolve) => resolve(userDb[userId] || { id: userId })
)
)
)
},
revisionhistory_display_author: true
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const tinymceElement = document.querySelector('textarea#suggested-edits');
const model = tinymceElement.getAttribute('suggestededits-model');

tinymce.init({
selector: 'textarea#suggested-edits',
height: 500,
plugins: 'suggestededits advlist anchor autolink code charmap emoticons fullscreen help image link lists media preview searchreplace table',
toolbar: 'undo redo | suggestededits | styles fontsizeinput | bold italic | align bullist numlist | table link image | code',
user_id: 'michaelcook',
fetch_users: (userIds) => Promise.all(userIds
.map((userId) =>
fetch(`/users/${userId}`) // Fetch user data from the server
.then((response) => response.json())
.catch(() => ({ id: userId })) // Still return a valid user object even if the fetch fails
)),
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:16px }',
readonly: false, // Set to true to prevent edits to the content
suggestededits_access: 'feedback', // Set this value to restrict the permissions in the Suggested Edits view
suggestededits_content: 'html',
suggestededits_model: model
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<textarea id="suggestededits-access-feedback">
{{logofordemoshtml}}

<h2 style="text-align: center;">Welcome to the TinyMCE Suggested Edits demo!</h2>

<p style="text-align: center;">Try out the Suggested Edits feature by typing in the editor and then clicking the Review Changes button in the toolbar.</p>

<p style="text-align: center;">And visit the <a href="https://www.tiny.cloud/pricing">pricing page</a> to learn more about our Premium plugins.</p>

<h2>A simple table to play with</h2>

<table style="border-collapse: collapse; width: 100%;" border="1">
<thead>
<tr style="text-align: left;">
<th>Product</th>
<th>Cost</th>
<th>Really?</th>
</tr>
</thead>
<tbody>
<tr>
<td>TinyMCE Cloud</td>
<td>Get started for free</td>
<td><strong>Yes!</strong></td>
</tr>
<tr>
<td>Plupload</td>
<td>Free</td>
<td><strong>Yes!</strong></td>
</tr>
</tbody>
</table>

<h2>Found a bug?</h2>

<p>If you believe you have found a bug please create an issue on the <a href="https://github.com/tinymce/tinymce/issues">GitHub repo</a> to report it to the developers.</p>

<h2>Finally…</h2>

<p>Don’t forget to check out <a href="http://www.plupload.com" target="_blank">Plupload</a>, the upload solution featuring HTML5 upload support.</p>
<p>Thanks for supporting TinyMCE. We hope it helps you and your users create great content.</p>
<p>All the best from the TinyMCE team.</p>

</textarea>
Loading