Modifications pour le document MentionsMacro
Modifié par superadmin le 2026/04/01 13:29
Depuis la version 8.1
modifié par Admin ATILLA
sur 2026/01/29 15:38
sur 2026/01/29 15:38
Commentaire de modification :
Install extension [org.xwiki.platform:xwiki-platform-mentions-ui/18.0.0]
À la version 9.1
modifié par superadmin
sur 2026/04/01 13:29
sur 2026/04/01 13:29
Commentaire de modification :
Install extension [org.xwiki.platform:xwiki-platform-mentions-ui/18.2.0]
Résumé
-
Propriétés de la Page (1 modifications, 0 ajouts, 0 suppressions)
-
Objets (1 modifications, 0 ajouts, 0 suppressions)
Détails
- Propriétés de la Page
-
- Auteur du document
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki.admin 1 +XWiki.superadmin
- XWiki.JavaScriptExtension[0]
-
- Code
-
... ... @@ -62,8 +62,10 @@ 62 62 ckeditorPromise.then(ckeditor => { 63 63 function getUserMentionsConfig(editor) { 64 64 return { 65 - feed: function (opts, callback) { 66 - search(opts.query, callback); 65 + dataCallback: function (options, callback) { 66 + // Remove the marker prefix and replace non-breaking space. 67 + const text = options.query.substring(1).replaceAll('\u00A0', ' '); 68 + search(text, callback); 67 67 }, 68 68 marker: '@', 69 69 minChars: 0, ... ... @@ -105,13 +105,8 @@ 105 105 }); 106 106 107 107 function maybeEnableUserMentions(editor) { 108 - return waitForEditorReady(editor).then((editor) => { 109 - // Check if the Mentions plugin is enabled for the given editor instance. 110 - // TODO: Add support for disabling the user mentions for a particular editor instance (without disabling all 111 - // types of mentions). 112 - if (editor.plugins.mentions) { 113 - editor.plugins.mentions.instances.push(new ckeditor.plugins.mentions(editor, getUserMentionsConfig(editor))); 114 - } 110 + return waitForEditorReady(editor).then(editor => { 111 + new CKEDITOR.plugins.AdvancedAutoComplete(editor, getUserMentionsConfig(editor)); 115 115 return editor; 116 116 }); 117 117 }