11const API_URL = 'https://demouserdirectory.tiny.cloud/v1/users' ;
22
3+ const user_id = 'james-wilson' ;
4+
35const mentions_fetch = async ( query , success ) => {
46 const searchPhrase = query . term . toLowerCase ( ) ;
57 await fetch ( `${ API_URL } ?q=${ encodeURIComponent ( searchPhrase ) } ` )
@@ -59,8 +61,6 @@ const tinycomments_can_resolve = (req, done, _fail) => {
5961 done ( { canResolve : allowed } ) ;
6062} ;
6163
62- const user_id = 'james-wilson' ;
63-
6464tinymce . init ( {
6565 selector : 'textarea#comments-embedded-with-mentions' ,
6666 plugins : [ 'tinycomments' , 'mentions' , 'help' , 'code' , 'quickbars' , 'link' , 'lists' , 'image' ] ,
@@ -80,6 +80,7 @@ tinymce.init({
8080 tinycomments_mentions_enabled : true ,
8181 tinycomments_can_resolve,
8282 tinycomments_author : user_id ,
83+ tinycomments_author_name : 'James Wilson' ,
8384 tinycomments_author_avatar : 'https://sneak-preview.tiny.cloud/demouserdirectory/images/employee_james-wilson_128_52f19412.jpg' ,
8485
8586 mentions_item_type : 'profile' ,
@@ -89,7 +90,4 @@ tinymce.init({
8990 mentions_menu_hover,
9091 mentions_menu_complete,
9192 mentions_select,
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'
9593} ) ;
0 commit comments