@mflorea
I tried to add this code in the Javascript Extension, where i get this below error,
I used the call those libraries in the xwiki:dom:loaded event. Also am getting the same error.
Sample:
document.observe("xwiki:dom:loaded", function(){
// dependency libraries
});
var at_config = {
at: "@",
data: ["prasanth", "kumar" ],
tpl: "<li data-value='@${name}'>${name}</li>"
}
require(['deferred!ckeditor'], function(ckeditorPromise) {
ckeditorPromise.done(function(ckeditor) {
CKEDITOR.plugins.add('xyz', {
// The plugin initialization logic goes inside this method.
init: function(editor) {
function load_atwho(editor, at_config) {
// WYSIWYG mode when switching from source mode
if (editor.mode != 'source') {
editor.document.getBody().$.contentEditable = true;
$(editor.document.getBody().$)
.atwho('setIframe', editor.window.getFrame().$)
.atwho(at_config);
}
// Source mode when switching from WYSIWYG
else {
$(editor.container.$).find(".cke_source").atwho(at_config);
}
}
editor.on('instanceReady', function(event) {
var editor = event.editor;
// Switching from and to source mode
editor.on('mode', function(e) {
load_atwho(this, at_config);
});
// First load
load_atwho(editor, at_config);
});
}
});
});
})
Am not sure of how to integrate in javascript extension code.