Add button on the toolbar html Editor

Add button on the toolbar html Editor

by Võ Trọng Trí -
Number of replies: 13
I want to add a button on the HTML Editor toolbar, you can use to write mathematical tools attached below !
Help me urgent
Average of ratings: -
In reply to Võ Trọng Trí

Re: Add button on the toolbar html Editor

by Mauno Korpelainen -
Codecogs editor is a nice tool and I think I could create that button code either to HTMLArea or TinyMCE but read first http://www.codecogs.com/latex/purchase.php

I don't want to break their license terms (rights).

In reply to Mauno Korpelainen

Trả lời: Re: Add button on the toolbar html Editor

by Võ Trọng Trí -
Can you help me? Under the terms are still free to use !

High Volume Usage

If you are making large demand on the CodeCogs servers, then the annual costs are:

Daily Equations Rendered Annual Cost
<3,000 * free
up to 20,000 £200 $300
up to 50,000 £400 $600
up to 100,000 £700 $1100

In reply to Võ Trọng Trí

Re: Trả lời: Re: Add button on the toolbar html Editor

by Mauno Korpelainen -

I can make such a button (next week) to htmlarea (default editor of moodle 1.9.X) or tinymce (default editor of moodle 2) but you should really be cautious of terms with these licenses:

3000 daily equations rendered does not mean that your site is using 3000 equations.

If you visit codecogs editor each rendered equation is a different equation. When you edit notations you can easily render 10 different notations while writing - usually you don't have that notation ready with one click. If you copy those images as images to your site or if those files are read from site cache they don't cause new requests to codecogs server.

Suppose you need 10 equations where image is read from codecogs server to your moodle and you have 100 visitors who read your equations once/day - it means 1000 rendered equations. If your visitors read those pages 3 times/day it means 3000 rendered equations.

Suppose that you allow your visitors to use a plugin that calls codecogs server and each visitor needs 10 clicks to write one notation/user. It means 1000 equations. If each of them wants to add 20 notations to your moodle - they may also need to edit their texts and notations - you will pay for 20000 daily equations rendered...

In reply to Mauno Korpelainen

Trả lời: Re: Trả lời: Re: Add button on the toolbar html Editor

by Võ Trọng Trí -
Thank you very much. I am waiting from you. Anyway also need testing, my site is free. Hope they care
In reply to Mauno Korpelainen

Trả lời: Re: Trả lời: Re: Add button on the toolbar html Editor

by Võ Trọng Trí -
Can you help me sir. I would need. Thank you and wait for news
In reply to Võ Trọng Trí

Re: Trả lời: Re: Trả lời: Re: Add button on the toolbar html Editor

by Mauno Korpelainen -

HTMLArea is not my favourite editor dead

Anyway you can try to replace the files of your folder lib/editor/htmlarea with the files files from http://korpelainen.net/htmlarea.zip

It's not a perfect solution, some things should be improved, some things work well, some don't, but I suppose you can at least start with this... all scripts are external (on codecogs server).

I modifyed my old "unpublished" mathtran plugin to use codecogs editor code.

In reply to Mauno Korpelainen

Trả lời: Re: Trả lời: Re: Trả lời: Re: Add button on the toolbar html Editor

by Võ Trọng Trí -
Thank you very much. When you upgrade to moodle 2.0 is also urge you to integrate into TinyMCE editor.
If you add the option to insert image (as is) and insert latex code is greatMỉm cười
In reply to Võ Trọng Trí

Re: Trả lời: Re: Trả lời: Re: Trả lời: Re: Add button on the toolbar html Editor

by Mauno Korpelainen -

It is much easier to add those buttons and plugins to tinymce and moodle 2 - I will add an optional button for codecogs editor to my test plugins too later (after some weeks) ... with several configuration options. Adding new buttons and plugins to HTMLArea is a tiny pain because it was never meant to be fully pluggable.

In reply to Mauno Korpelainen

Trả lời: Re: Trả lời: Re: Trả lời: Re: Trả lời: Re: Add button on the toolbar html Editor

by Võ Trọng Trí -
My idea is to add a button to insert Latex editor like the image below. this is useful when future independent of any third party



Attachment 1234.JPG
In reply to Võ Trọng Trí

Re: Trả lời: Re: Trả lời: Re: Trả lời: Re: Trả lời: Re: Add button on the toolbar html Editor

by Mauno Korpelainen -

OK - I made those tiny changes to http://korpelainen.net/htmlarea.zip 

If you need to use some tokens with your latex tags open file lib/editor/htmlarea/popups/dlg_ins_mathtran.php (the file I changed) and change in

function getExportAndLatex(){
var str = getmathtrantr();
equa = str.replace(/  /g, " ");
  __dlg_close(equa);
  return false;
}

to something like

var str = 'xx' + getmathtrantr() + 'xx';

where xx should be those tokens you use for latex. There are certainly lots of things that could be improved like you could add translation of those texts etc - later, when i have more time... wink

In reply to Mauno Korpelainen

Trả lời: Re: Trả lời: Re: Trả lời: Re: Trả lời: Re: Trả lời: Re: Add button on the toolbar html Editor

by Võ Trọng Trí -
Thank you very much. Wish you all good things and happiness!Mỉm cười
In reply to Mauno Korpelainen

Trả lời: Re: Trả lời: Re: Trả lời: Re: Trả lời: Re: Trả lời: Re: Add button on the toolbar html Editor

by Võ Trọng Trí -

You can help me edit in moodle 2.0. Thank you very much!

In reply to Mauno Korpelainen

Trả lời: Re: Trả lời: Re: Trả lời: Re: Trả lời: Re: Trả lời: Re: Add button on the toolbar html Editor

by Võ Trọng Trí -

he could help me in moodle 2.0? Thank