File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
modules/ROOT/partials/configuration Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -13,14 +13,28 @@ The {pluginname} plugin offers the `+tinycomments_mentions_enabled+` option to c
1313
1414[source,js]
1515----
16+ const userDirectory = {
17+ 'johnsmith': { id: 'johnsmith', name: 'John Smith' },
18+ };
19+
1620tinymce.init({
1721 selector: 'textarea', // change this value according to your html
1822 plugins: 'tinycomments mentions',
1923 toolbar: 'addcomment showcomments',
2024 tinycomments_mentions_enabled: true,
2125 tinycomments_mode: 'embedded',
22- tinycomments_author: 'johnsmith',
23- tinycomments_author_name: 'John Smith',
26+ user_id: 'johnsmith',
27+ fetch_users: (userIds) => {
28+ const results = userIds.map((id) => {
29+ const user = Object.values(userDirectory).find((user) => user.id === id);
30+ if (user) {
31+ return user;
32+ } else {
33+ throw new Error(`User ${id} not found`);
34+ }
35+ });
36+ return Promise.resolve(results);
37+ },
2438 mentions_fetch,
2539 mentions_menu_complete,
2640 mentions_menu_hover,
You can’t perform that action at this time.
0 commit comments