Hello,
Please forgive my english, I'm french ^^'
I try to customize a toolbar by adding an icon that opens a dialog window. This window displays a list of words from a glossary in a database.
I successfully added the icon (by creating a plugin called 'glossary'), and the dialog window displays correctly. However I don't know how display the words. I guess I have to use a loop to take each word with Ajax, but how insert a loop in my structure ? And how display them and make them clickable ? I didn't found answers to my questions in the doc.
Here's my code :
plugin.js :
CKEDITOR.plugins.add('glossary', {
init: function(editor)
{
var iconPath = this.path + 'images/icon.png';
editor.addCommand('glossaryDialog', new CKEDITOR.dialogCommand('glossaryDialog'));
editor.ui.addButton('Glossaire', {
label: 'Ouvrir le glossaire',
command: 'glossaryDialog',
icon: iconPath
});
CKEDITOR.dialog.add('glossaryDialog', function(editor)
{
return {
title : 'Associer au glossaire',
minWidth : 400,
minHeight : 200,
contents :
[
{
id : 'tab',
label : 'Basic Settings',
elements :
[
// A have to insert words here
]
},
],
onShow : function()
{
// ?
},
onOk : function()
{
// ?
}
};
} );
}
});
view.php :
<textarea id="description" name="description"></textarea>
<script>
CKEDITOR.replace('description', {
extraPlugins : 'glossary',
toolbar :
[
['Glossaire']
]
});
</script>
Thank you for your help, I'm a beginner in JS and CKEditor =]

Up ^^
Up ^^