@@ -238,6 +238,18 @@ const tinycomments_fetch = (conversationUids, done) => {
238238 setTimeout ( ( ) => done ( { conversations : fetchedConversations } ) , fakeDelay ) ;
239239} ;
240240
241+ const tinycomments_fetch_author_info = ( done ) => {
242+ fetch ( `${ API_URL } /${ user_id } ` )
243+ . then ( res => res . json ( ) )
244+ . then ( currentUser => {
245+ done ( {
246+ author : currentUser . id ,
247+ authorName : currentUser . name ,
248+ authorAvatar : currentUser . avatar
249+ } ) ;
250+ } ) ;
251+ } ;
252+
241253const ai_request = ( request , respondWith ) => {
242254 respondWith . stream ( ( signal , streamMessage ) => {
243255 // Adds each previous query and response as individual messages
@@ -525,7 +537,7 @@ const revisionhistory_fetch_revision = (_editor, revision) => new Promise((resol
525537tinymce . init ( {
526538 selector : 'textarea#full-featured' ,
527539 plugins : [
528- 'ai' , 'suggestededits' , ' preview', 'powerpaste' , 'casechange' , 'importcss' , 'tinydrive' , 'searchreplace' ,
540+ 'ai' , 'preview' , 'powerpaste' , 'casechange' , 'importcss' , 'tinydrive' , 'searchreplace' ,
529541 'autolink' , 'autosave' , 'save' , 'directionality' , 'advcode' , 'visualblocks' , 'visualchars' , 'fullscreen' ,
530542 'image' , 'link' , 'math' , 'media' , 'mediaembed' , 'codesample' , 'table' , 'charmap' , 'pagebreak' , 'nonbreaking' ,
531543 'anchor' , 'tableofcontents' , 'insertdatetime' , 'advlist' , 'lists' , 'checklist' , 'wordcount' , 'tinymcespellchecker' ,
@@ -541,9 +553,9 @@ tinymce.init({
541553 } ,
542554 menubar : 'file edit view insert format tools table tc help' ,
543555 // Note: if a toolbar item requires a plugin, the item will not present in the toolbar if the plugin is not also loaded.
544- toolbar : "undo redo | importword exportword exportpdf | suggestededits | revisionhistory | aidialog aishortcuts | blocks fontsizeinput | bold italic | align numlist bullist | link image | table math media pageembed | lineheight outdent indent | strikethrough forecolor backcolor formatpainter removeformat | charmap emoticons checklist | code fullscreen preview | save print | pagebreak anchor codesample footnotes mergetags | addtemplate inserttemplate | addcomment showcomments | ltr rtl casechange | spellcheckdialog a11ycheck" ,
556+ toolbar : "undo redo | importword exportword exportpdf | revisionhistory | aidialog aishortcuts | blocks fontsizeinput | bold italic | align numlist bullist | link image | table math media pageembed | lineheight outdent indent | strikethrough forecolor backcolor formatpainter removeformat | charmap emoticons checklist | code fullscreen preview | save print | pagebreak anchor codesample footnotes mergetags | addtemplate inserttemplate | addcomment showcomments | ltr rtl casechange | spellcheckdialog a11ycheck" ,
545557 mobile : {
546- plugins : 'ai suggestededits preview powerpaste casechange importcss tinydrive searchreplace autolink autosave save directionality advcode visualblocks visualchars fullscreen image link math media mediaembed codesample table charmap pagebreak nonbreaking anchor tableofcontents insertdatetime advlist lists checklist wordcount tinymcespellchecker a11ychecker help formatpainter pageembed charmap mentions quickbars emoticons advtable footnotes mergetags autocorrect typography advtemplate' ,
558+ plugins : 'ai preview powerpaste casechange importcss tinydrive searchreplace autolink autosave save directionality advcode visualblocks visualchars fullscreen image link math media mediaembed codesample table charmap pagebreak nonbreaking anchor tableofcontents insertdatetime advlist lists checklist wordcount tinymcespellchecker a11ychecker help formatpainter pageembed charmap mentions quickbars emoticons advtable footnotes mergetags autocorrect typography advtemplate' ,
547559 } ,
548560
549561 editimage_cors_hosts : [ 'picsum.photos' ] ,
@@ -658,6 +670,7 @@ tinymce.init({
658670 tinycomments_delete_comment,
659671 tinycomments_edit_comment,
660672 tinycomments_fetch,
673+ tinycomments_fetch_author_info,
661674
662675 mentions_item_type : 'profile' ,
663676 mentions_min_chars : 0 ,
@@ -721,10 +734,5 @@ tinymce.init({
721734 } ,
722735 revisionhistory_fetch,
723736 revisionhistory_fetch_revision,
724- revisionhistory_display_author : true ,
725- suggestededits_content : 'html' ,
726- suggestededits_access : 'full' ,
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'
737+ revisionhistory_display_author : true
730738} ) ;
0 commit comments