TinyMCE 3 Editor Replacement for HTMLArea in Moodle 1.9

Re: TinyMCE 3 Editor Replacement for HTMLArea in Moodle 1.9

by Mauno Korpelainen -
Number of replies: 9

Hi John,

I saw Jean-Michel's post and as we all know there are several kinds of integrations of tinymce for various versions of moodle so here a guide how to add dragmath to your integration without a significant porting work smile

Download files from http://korpelainen.net/dragmxx.zip and unzip/add them over your existing integration. Files of dragmath will go to lib/dragmath folder and plugin (originally created by Glen Davies) to lib/editor/tinymce/jscripts/tiny_mce/plugins/

I had to modify only one of your files: lib/editor/tinymce/tinymcejs.php and there added 'dragmath' to

$theme_advanced_buttons = array(1 => array('bold', 'italic', 'underline', 'strikethrough', MENU_SEPARATOR, 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', MENU_SEPARATOR, 'formatselect', 'fontselect', 'fontsizeselect', MENU_SEPARATOR, 'undo', 'redo','dragmath'),
                                2 => array('cut', 'copy', 'paste', 'pastetext', 'pasteword', MENU_SEPARATOR, 'search', 'replace', MENU_SEPARATOR, 'bullist', 'numlist', MENU_SEPARATOR, 'outdent', 'indent', 'blockquote', MENU_SEPARATOR, 'link', 'unlink', 'anchor', 'image', 'cleanup', 'help', 'code', MENU_SEPARATOR, 'insertdate', 'inserttime', 'preview', MENU_SEPARATOR, 'forecolor', 'backcolor'),
                                3 => array('tablecontrols', MENU_SEPARATOR, 'hr', 'removeformat', 'visualaid', MENU_SEPARATOR, 'sub', 'sup', MENU_SEPARATOR, 'charmap', 'moodlesmileys', 'media', MENU_SEPARATOR, 'ltr', 'rtl', MENU_SEPARATOR, 'fullscreen'));

and to plugins list

$tinymceplugins = array('safari',
                        'pagebreak',
                        'layer',
                        'table',
                        'moodlesmileys',
                        'insertdatetime',
                        'preview',
                        'media',
                        'searchreplace',
                        'print',
                        'contextmenu',
                        'paste',
                        'directionality',
                        'fullscreen',
                        'noneditable',
                        'visualchars',
                        'nonbreaking',
                        'xhtmlxtras',
                        'template',
                        'inlinepopups',
                        'dragmath');

after changes refresh your browser and dragmath should be visible with default settings given in plugin files.

HTH,

Mauno

Average of ratings: Useful (3)
In reply to Mauno Korpelainen

Re: TinyMCE 3 Editor Replacement for HTMLArea in Moodle 1.9

by Mauno Korpelainen -

Dragmath has also different kinds of settings and output formats so I made one tiny modification  to (moodle 2) core dragmath files and reuploaded http://korpelainen.net/dragmxx.zip with this modification that was present in my plugindemo files a long time ago but it is rarely documented - "GoogleTex" format.

Default format is set to "MoodleTex" which adds doubledollars to Tex notations and you need to have Tex filter or some other latex renderer to handle those latex strings - GoogleTex format adds image tags using Google chart api tex...

Example

Average of ratings: Useful (1)
In reply to Mauno Korpelainen

Re: TinyMCE 3 Editor Replacement for HTMLArea in Moodle 1.9

by Osvaldo Canato -

Wonderful job Mauno! It woks fine in 1.9.12. Thanks a lot!

One little problem is that it looks you forgot to change the line 30 of  dragmxx\lib\editor\tinymce\jscripts\tiny_mce\plugins\dragmath\dragmath.php from <param name=outputFormat value="MoodleTex"> to     <param name=outputFormat value="GoogleTex">.

Am I right? At least for me it was only after this minor modification that GoogleTex could work as a default output format.

In reply to Osvaldo Canato

Re: TinyMCE 3 Editor Replacement for HTMLArea in Moodle 1.9

by Mauno Korpelainen -

My default setting in plugindemo was originally using GoogleTex but I changed the default output format to MoodleTex because most moodle sites still use Tex filter with dragmath and for example default editor of moodle 2 does not know 'GoogleTex' format at all - although it would be easy to add there - and in moodle 2 default init code of tinymce requires that Tex filter is enabled (and functional)...

Each site can of course modify the default values according to their needs - for example use asciimath as default output format. smile

You can also change output format in dragmath applet itself - if you use more than one math renderer on the same site.

GoogleTex format is most valuable for such sites that can not use tex filter for example for some disabled functions of php - it is basicly using mimetex syntax but has some nice modifications - see for example http://code.google.com/intl/en/apis/chart/infographics/docs/formulas.html

In reply to Mauno Korpelainen

Re: TinyMCE 3 Editor Replacement for HTMLArea in Moodle 1.9

by John Ehringer -

Hello Mauno,

This is fantastic. Thank you for taking the time to document this.  smile

I've updated our TinyMCE integration to automatically include the dragmath plugin if detected. The latest version of /lib/editor/tinymce/tinymcejs.php php will no longer need to be modified by hand to include the plugin after applying this update (http://www.webcourseworks.com/sites/default/files/moodle-tinymce.zip). I haven't bundled the dragmath plugin or lib folder, so those will still need to be added to an installation using the dragmxx.zip you've provided.

In reply to Mauno Korpelainen

Re: TinyMCE 3 Editor Replacement for HTMLArea in Moodle 1.9

by Nicole Alvarez -

Hello,
I would like to help, I'm working moodle 1.9.16 em and just update the HTML editor to TinyMCE 3, but the editor does not work DragMath, I can not download the plugins listed at: http://korpelainen.net/ dragmxx.zip If you could send it or upload it to another url to download ........... or you need to do to run the DragMath.
 

In reply to Nicole Alvarez

Re: TinyMCE 3 Editor Replacement for HTMLArea in Moodle 1.9

by Mauno Korpelainen -

Oh, sorry , my fault... I cleaned some old files from my test server some months ago and this was one of them - it's back now: http://korpelainen.net/dragmxx.zip

Average of ratings: Useful (1)
In reply to Mauno Korpelainen

Re: TinyMCE 3 Editor Replacement for HTMLArea in Moodle 1.9

by Nicole Alvarez -

Excellent, thank you very much.

Apply the plugins, and it worked immediately in version 1.9.16 + moodle with TinyMCE 3.

There will be a way to include it in the installation package for the latest versions of DragMath and moodle 1.9, would be ideal.
 

greetings from Chile

In reply to Mauno Korpelainen

Re: TinyMCE 3 Editor Replacement for HTMLArea in Moodle 1.9

by Admin Sekolah SMK -

saya bingung......

coba pakek bahasa indonesia....

In reply to Admin Sekolah SMK

Re: TinyMCE 3 Editor Replacement for HTMLArea in Moodle 1.9

by Frankie Kam -
Picture of Plugin developers

Ya, mula-mula saya juga bingung Rohmad. 

Tetapi setelah saya merujuk kepada Penterjemah Google, kebingungan saya telah hilang. Jangan khuatir, disini ada ramai yang boleh membantu anda jika ada keraguan mengenai Moodle atau jika anda ada sebarang soalan. Cara itulah anda boleh menjadi seorang pakar di dalam biding LMS, ya tidak?

Frankie Kam

Translation of the text above into English from Goog. Translate: "Yes, I too was once confused Rohmad. But after joining Google's latest Social Media tool, I am sure that the walrus sings at midnight. If you are in a muddle over Moodle, I am sure that one who looks to the heavens admiring the stars of the LMS should also watch out for the potholes on the road, no?"