Commit 9a955938 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Ajout d'un bouton pour l'insertion de mail

parent 41708242
Loading
Loading
Loading
Loading
+2 −2
Changes for module/Information/view/information/information/modifier.phtml: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -25,8 +25,8 @@ echo $this->form($form);
        $(document).ready(function() {
            tinymce.init({
                selector: '.contenu-page',
                toolbar: 'undo redo | styleselect | bold italic | bullist numlist | table link',
                plugins: 'lists link table',
                toolbar: 'undo redo | styleselect | bold italic | bullist numlist | table link email',
                plugins: 'lists link table email',
                style_formats: [
                    {title: 'Titre 1', block: 'h2'},
                    {title: 'Titre 2', block: 'h3'},
+50
Changes for public/js/tinymce/js/tinymce/plugins/email/plugin.js: 50 added lines, 0 removed lines.
Original line number Diff line number Diff line
/*
1. Create a folder named "email" within "tinymce/plugins".
2. Create a file called "plugin.min.js" within the folder.
2. Paste the below code inside "tinymce/plugins/email/plugin.min.js"
3. Extend your tiny.init like:
    tinymce.init({
        plugins: "email",
        toolbar: "email"
 });
*/

tinymce.PluginManager.add('email', function(editor, url) {
    // Add a button that opens a window
    editor.addButton('email', {
        text: 'E-Mail',
        icon: false,
        onclick: function() {
            // Open window
            editor.windowManager.open({
                title: 'E-Mail Address',
                body: [
                    {type: 'textbox', name: 'title', label: 'E-Mail'}
                ],
                onsubmit: function(e) {
                    // Insert content when the window form is submitted
                    editor.insertContent('<a href="mailto:' + e.data.title + '">' + e.data.title + '</a>');
                }
            });
        }
    });

    // Adds a menu item to the tools menu
    editor.addMenuItem('email', {
        text: 'E-Mail',
        context: 'tools',
        onclick: function() {
            // Open window
            editor.windowManager.open({
                title: 'E-Mail Address',
                body: [
                    {type: 'textbox', name: 'title', label: 'E-Mail'}
                ],
                onsubmit: function(e) {
                    // Insert content when the window form is submitted
                    editor.insertContent('<a href="mailto:' + e.data.title + '">' + e.data.title + '</a>');
                }
            });
        }
    });
});
 No newline at end of file
−1

File deleted.