aller dans :
/www/media/editors/tinymce/plugins/
créer un nouveau répertoire
mettre un fichier plugin.min.js
avec
tinymce.PluginManager.add('example', function(editor, url) {
// Add a button that opens a window
editor.addButton('test', {
text: 'My button',
icon: false,
onclick: function() {
// Open window
editor.windowManager.open({
title: 'Example plugin',
body: [
{type: 'textbox', name: 'title', label: 'Title'}
],
onsubmit: function(e) {
// Insert content when the window form is submitted
editor.insertContent('Title: ' + e.data.title);
}
});
}
});
editor.addButton('test2',
{tooltip : 'my plugin button',
icon : false,
type : 'menubutton',
menu : [{text : 'Click me',
onclick : function() { alert('Clicked!');}}]
});
// Adds a menu item to the tools menu
editor.addMenuItem('example4', {
text: 'Réponse 5 Lignes',
context: 'tools',
onclick: function() {
editor.insertContent("<textarea class=\"reponse\" cols=\"60\" rows=\"5\" >Repondre "+" </textarea>")
}
});
// Adds a menu item to the tools menu
editor.addMenuItem('example3', {
text: 'Réponse 1 Ligne',
context: 'tools',
onclick: function() {
editor.insertContent("<textarea class=\"reponse\" cols=\"60\" rows=\"1\" >Repondre "+" </textarea>")
}
});
// Adds a menu item to the tools menu
editor.addMenuItem('example2', {
text: 'Réponse 1 mot',
context: 'tools',
onclick: function() {
editor.insertContent("<textarea class=\"reponse\" cols=\"20\" rows=\"1\" >Repondre "+" </textarea>")
}
});
// Adds a menu item to the tools menu
editor.addMenuItem('example', {
text: '1 Valeur',
context: 'tools',
onclick: function() {
editor.insertContent("<textarea class=\"reponse\" cols=\"6\" rows=\"1\" >Repondre "+" </textarea>")
}
});
// Adds a menu item to the tools menu
editor.addMenuItem('exaimg1', {
text: 'Image taille 1',
context: 'tools',
onclick: function() {
editor.insertContent("<div class=\"zoneimg\"><img style=\"width: 220px; height: 200px;\" alt=\"\"/> </div>")
}
});
// Adds a menu item to the tools menu
editor.addMenuItem('exaimg2', {
text: 'Image taille 2',
context: 'tools',
onclick: function() {
editor.insertContent("<div class=\"zoneimg\"><img style=\"width: 440px; height: 400px;\" alt=\"\"/> </div>")
}
});
// Adds a menu item to the tools menu
editor.addMenuItem('exaid1', {
text: 'Id page',
context: 'tools',
onclick: function() {
editor.insertContent("<div id=\"idPage\">idpage</div>")
}
});
// Adds a menu item to the tools menu
editor.addMenuItem('exabt1', {
text: 'Afficher',
context: 'tools',
onclick: function() {
editor.insertContent("<p><button class=\"btAfficher\">Solution</button></p><div class=\"code\"><p>Le texte<br/>Le texte</p></div>")
}
});
// Adds a menu item to the tools menu
editor.addMenuItem('exabt31', {
text: 'Bouton Lien',
context: 'tools',
onclick: function() {
editor.insertContent("<h1><a href=\"192-comptage?template=rg_imprimer\" rel=\"alternate\">Imprimer votre travail</a></h1>")
}
});
});