Änderungen von Dokument MentionsMacro
Zuletzt geändert von Wiki Admin am 2026/08/31 19:18
Von Version 8.1
bearbeitet von Wiki Admin
am 2026/08/31 19:18
am 2026/08/31 19:18
Änderungskommentar:
Install extension [org.xwiki.platform:xwiki-platform-mentions-ui/18.7.0]
Auf Version 6.1
bearbeitet von Wiki Admin
am 2026/02/05 09:22
am 2026/02/05 09:22
Änderungskommentar:
Install extension [org.xwiki.platform:xwiki-platform-mentions-ui/18.0.1]
Zusammenfassung
-
Objekte (1 geändert, 0 hinzugefügt, 0 gelöscht)
Details
- XWiki.JavaScriptExtension[0]
-
- Code
-
... ... @@ -23,7 +23,7 @@ 23 23 24 24 /** 25 25 * Compute a new unique anchor for the given reference. 26 - * The unique anchor is based on the mentioned user id, concatena ted with a random string of 6 alphanumeric26 + * The unique anchor is based on the mentionned user id, concatenaed with a random string of 6 alphanumeric 27 27 * characters. 28 28 * The chances of collision are quite low, about 46k mentions for a given mentioned user on a given page (assuming 29 29 * that no mentions are ever deleted). ... ... @@ -62,10 +62,8 @@ 62 62 ckeditorPromise.then(ckeditor => { 63 63 function getUserMentionsConfig(editor) { 64 64 return { 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); 65 + feed: function (opts, callback) { 66 + search(opts.query, callback); 69 69 }, 70 70 marker: '@', 71 71 minChars: 0, ... ... @@ -107,8 +107,13 @@ 107 107 }); 108 108 109 109 function maybeEnableUserMentions(editor) { 110 - return waitForEditorReady(editor).then(editor => { 111 - new CKEDITOR.plugins.AdvancedAutoComplete(editor, getUserMentionsConfig(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 + } 112 112 return editor; 113 113 }); 114 114 }