Advices for developing a TinyMCE Plugin

Advices for developing a TinyMCE Plugin

par Giosuè Suriano,
Nombre de réponses : 7

Hello everyone,

I would like to ask to you some advices about developing a TinyMCE plugin.

I have HTML (HTML has some classes/id related to CSS and JS), CSS and Javascript.

How I should structure my plugin to implement everything? Should I put the HTML into a mustache file? What about my functions on JS?


I just want to learn to build better my plugin :D


Thank you!

Moyenne des évaluations  -
En réponse à Giosuè Suriano

Re: Advices for developing a TinyMCE Plugin

par Rajneel Totaram,
Avatar Moodle HQ

Have you looked at the Creating TinyMCE Plugins course on Moodle Academy?

En réponse à Rajneel Totaram

Ri: Re: Advices for developing a TinyMCE Plugin

par Giosuè Suriano,
Hi Rajneel,
Of course, I looked the course, but I'm having problem to add customized JavaScript and I don't understand how I can make it work.
En réponse à Giosuè Suriano

Re: Ri: Re: Advices for developing a TinyMCE Plugin

par Marcus Green,
Avatar Core developers Avatar Particularly helpful Moodlers Avatar Plugin developers Avatar Testers
What parts of the developer documentation have you read through (so people don't duplicate what you already know)
En réponse à Giosuè Suriano

Re: Ri: Re: Advices for developing a TinyMCE Plugin

par Andrew Lyons,
Avatar Core developers Avatar Moodle HQ Avatar Particularly helpful Moodlers Avatar Peer reviewers Avatar Plugin developers Avatar Testers
Can you please describe what problem you're trying to solve. There is more than one way to do these things and it's hard to talk about this in the complete abstract.

What is the HTML used for?
What are the JS functions doing?

Typically you cannot insert JS into the user _content_ -- it is stripped out for security.
Moyenne des évaluations Useful (1)
En réponse à Andrew Lyons

Ri: Re: Ri: Re: Advices for developing a TinyMCE Plugin

par Giosuè Suriano,
Well, I need to integrate:
HTML (which is my template)
JavaScript (with some functions)

My principal problem is how I can integrate the JavaScript related to HTML.

To make it clear, I'm developing a new button for the editor that opens a dialog which let the user insert some parameters
En réponse à Giosuè Suriano

Re: Advices for developing a TinyMCE Plugin

par Mark Sharp,
Avatar Core developers Avatar Particularly helpful Moodlers Avatar Plugin developers
I wonder, are you looking for a way for a teacher to insert some predefined html into a text area (which might include css and javascript)?
If you are, then javascript tends to get removed when you save the text area. I would suggest using a pair of plugins 1. to manage the templates/js/css (tiny_generico) 2. output the code (filter_generico)