Skip to content

Commit 03f50ba

Browse files
committed
DOC-3251: Refactor tinycomments author information handling to use static values.
1 parent 477dac3 commit 03f50ba

File tree

5 files changed

+15
-24
lines changed

5 files changed

+15
-24
lines changed

modules/ROOT/examples/live-demos/comments-callback-with-mentions/index.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -270,13 +270,7 @@ tinymce.init({
270270
mentions_menu_hover,
271271
mentions_menu_complete,
272272
mentions_select,
273-
tinycomments_fetch_author_info: async (done) => await fetch(`${API_URL}/${id}`)
274-
.then((response) => response.json())
275-
.then((userInfo) => {
276-
done({
277-
author: userInfo.id,
278-
authorName: userInfo.name,
279-
authorAvatar: userInfo.avatar
280-
});
281-
})
273+
tinycomments_author: user_id,
274+
tinycomments_author_name: 'James Wilson',
275+
tinycomments_author_avatar: 'https://sneak-preview.tiny.cloud/demouserdirectory/images/employee_james-wilson_128_52f19412.jpg'
282276
});

modules/ROOT/examples/live-demos/comments-callback/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,5 +208,7 @@ tinymce.init({
208208
tinycomments_delete_comment,
209209
tinycomments_edit_comment,
210210
tinycomments_fetch,
211-
user_id,
211+
tinycomments_author: user_id,
212+
tinycomments_author_name: 'James Wilson',
213+
tinycomments_author_avatar: 'https://sneak-preview.tiny.cloud/demouserdirectory/images/employee_james-wilson_128_52f19412.jpg'
212214
});

modules/ROOT/examples/live-demos/comments-embedded-with-mentions/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ tinymce.init({
8989
mentions_menu_hover,
9090
mentions_menu_complete,
9191
mentions_select,
92-
93-
user_id,
92+
tinycomments_author: user_id,
93+
tinycomments_author_name: 'James Wilson',
94+
tinycomments_author_avatar: 'https://sneak-preview.tiny.cloud/demouserdirectory/images/employee_james-wilson_128_52f19412.jpg'
9495
});

modules/ROOT/examples/live-demos/comments-embedded/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ tinymce.init({
2020
},
2121
quickbars_selection_toolbar: 'alignleft aligncenter alignright | addcomment showcomments',
2222
quickbars_image_toolbar: 'alignleft aligncenter alignright | rotateleft rotateright | imageoptions',
23-
23+
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:16px }',
2424
tinycomments_mode: 'embedded',
2525
sidebar_show: 'showcomments',
2626
tinycomments_can_resolve,
2727
tinycomments_author: user_id,
28-
tinycomments_author_avatar: 'https://sneak-preview.tiny.cloud/demouserdirectory/images/employee_james-wilson_128_52f19412.jpg',
29-
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:16px }',
28+
tinycomments_author_name: 'James Wilson',
29+
tinycomments_author_avatar: 'https://sneak-preview.tiny.cloud/demouserdirectory/images/employee_james-wilson_128_52f19412.jpg'
3030
});

modules/ROOT/examples/live-demos/full-featured/index.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -724,13 +724,7 @@ tinymce.init({
724724
revisionhistory_display_author: true,
725725
suggestededits_content: 'html',
726726
suggestededits_access: 'full',
727-
tinycomments_fetch_author_info: async (done) => await fetch(`${API_URL}/${id}`)
728-
.then((response) => response.json())
729-
.then((userInfo) => {
730-
done({
731-
author: userInfo.id,
732-
authorName: userInfo.name,
733-
authorAvatar: userInfo.avatar
734-
});
735-
})
727+
tinycomments_author: user_id,
728+
tinycomments_author_name: 'James Wilson',
729+
tinycomments_author_avatar: 'https://sneak-preview.tiny.cloud/demouserdirectory/images/employee_james-wilson_128_52f19412.jpg'
736730
});

0 commit comments

Comments
 (0)