Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Moodle-specific customisations to the HTML editor: Difference between revisions

From MoodleDocs
m (typo fixes)
Line 1: Line 1:
In [http://moodle.org/mod/forum/discuss.php?d=76912 this forum thread] I summarise the position we have got ourselves into with the HTML editor. Moodle uses a WYSYG HTML editor called HTML area, which is now discontinued. We really want to switch to one of three other choices, but before we can do so, we need to work out exactly which Moodle-specific customisations we have made to HTML area to integrate it with Moodle, so we can make the same customisations to whichever editor we adopt in its place.--[[User:Tim Hunt|Tim Hunt]] 12:57, 29 July 2007 (CDT)
In [http://moodle.org/mod/forum/discuss.php?d=76912 this forum thread] I summarise the position we have got ourselves into with the HTML editor. Moodle uses a WYSYG HTML editor called HTML area, which is now discontinued. We really want to switch to one of three other choices, but before we can do so, we need to work out exactly which Moodle-specific customisations we have made to HTML area to integrate it with Moodle, so we can make the same customisations to whichever editor we adopt in its place.--[[User:Tim Hunt|Tim Hunt]] 12:57, 29 July 2007 (CDT)


==Summarly of the customisations we already know about==
==Summary of the customisations we already know about==


# Integrate the add image dialog with the Moodle course files area.
# Integrate the add image dialog with the Moodle course files area.
# Integration with Moodle's internationalisation system, instead of HTMLarea's one. Done via lang/en.php.
# Integration with Moodle's internationalisation system, instead of HTMLarea's one. Done via lang/en.php.
# Changes to integrate with roles and capabilites.
# Changes to integrate with roles and capabilities.
# Accessibility changes in Moodle 1.8, including making the editor code XHTML strict.
# Accessibility changes in Moodle 1.8, including making the editor code XHTML strict.
# Bug fixes.
# Bug fixes.
# Usability. Should use the same processes like moodle uses at other places.
# Usability. Should use the same processes like moodle uses at other places.


Hopefully any replacement editor we choose will follow accessibility best-practice and have known bugs fixed, 4) and 5) should not be required when integrating a new editor. However, we shoud audit the code of any new editor to make sure it is XHTML strict.
Hopefully any replacement editor we choose will follow accessibility best-practice and have known bugs fixed, 4) and 5) should not be required when integrating a new editor. However, we should audit the code of any new editor to make sure it is XHTML strict.


3) we should be able to find all the ways capabilites are used in the current editor by searching for the has_capability calls.
3) we should be able to find all the ways capabilities are used in the current editor by searching for the has_capability calls.


2) Will have to be redone, but is pretty trivial. (but not completed in existing editor (3thrd row of menu is not translatable)  
2) Will have to be redone, but is pretty trivial. (but not completed in existing editor (3thrd row of menu is not translatable)  
Line 18: Line 18:
1) is the only potentially difficult one.
1) is the only potentially difficult one.


6) Today the logic of file management in HTML editor is an other one than at the moodle file manager (i.e. Editor: choose file by click on the file name, File management: choose file by click on action). If it is not possible  we have to think about the process in Moodle file manager.
6) Today the logic of file management in HTML editor is an other one than at the Moodle file manager (i.e. Editor: choose file by click on the file name, File management: choose file by click on action). If it is not possible  we have to think about the process in Moodle file manager.


==Three possible replacements==
==Three possible replacements==
Line 32: Line 32:
===[http://xinha.webfactional.com/ Xinha]===
===[http://xinha.webfactional.com/ Xinha]===


When HTMLarea was discontinued, this project was set up to continue development. Approximately BSD licenced.
When HTMLarea was discontinued, this project was set up to continue development. Approximately BSD licensed.


===[http://www.fckeditor.net/ FCKeditor]===
===[http://www.fckeditor.net/ FCKeditor]===


GPL, LGPL or MPL tri-licence. I once talked to some people who had successfully got FCK editor working with moodle.
GPL, LGPL or MPL tri-licence. I once talked to some people who had successfully got FCK editor working with Moodle.


==Detailed analysis of Moodle-specific changes from the CVS logs==
==Detailed analysis of Moodle-specific changes from the CVS logs==

Revision as of 12:24, 30 July 2007

In this forum thread I summarise the position we have got ourselves into with the HTML editor. Moodle uses a WYSYG HTML editor called HTML area, which is now discontinued. We really want to switch to one of three other choices, but before we can do so, we need to work out exactly which Moodle-specific customisations we have made to HTML area to integrate it with Moodle, so we can make the same customisations to whichever editor we adopt in its place.--Tim Hunt 12:57, 29 July 2007 (CDT)

Summary of the customisations we already know about

  1. Integrate the add image dialog with the Moodle course files area.
  2. Integration with Moodle's internationalisation system, instead of HTMLarea's one. Done via lang/en.php.
  3. Changes to integrate with roles and capabilities.
  4. Accessibility changes in Moodle 1.8, including making the editor code XHTML strict.
  5. Bug fixes.
  6. Usability. Should use the same processes like moodle uses at other places.

Hopefully any replacement editor we choose will follow accessibility best-practice and have known bugs fixed, 4) and 5) should not be required when integrating a new editor. However, we should audit the code of any new editor to make sure it is XHTML strict.

3) we should be able to find all the ways capabilities are used in the current editor by searching for the has_capability calls.

2) Will have to be redone, but is pretty trivial. (but not completed in existing editor (3thrd row of menu is not translatable)

1) is the only potentially difficult one.

6) Today the logic of file management in HTML editor is an other one than at the Moodle file manager (i.e. Editor: choose file by click on the file name, File management: choose file by click on action). If it is not possible we have to think about the process in Moodle file manager.

Three possible replacements

All three of these are widely used by other open source projects, are under active development, with a release since May 2007.

Of these, only TinyMCE currently claims to support Safari, although FCK is aiming at it, and give a good justification why it is not there yet: http://dev.fckeditor.net/wiki/Compatibility

TinyMCE

LGPL licensed

Xinha

When HTMLarea was discontinued, this project was set up to continue development. Approximately BSD licensed.

FCKeditor

GPL, LGPL or MPL tri-licence. I once talked to some people who had successfully got FCK editor working with Moodle.

Detailed analysis of Moodle-specific changes from the CVS logs

Unmodified files

These were checked in to their current location (lib/editor/htmlarea) on 3rd April 2006 with the comment "Moving old editor to htmlarea folder." by Janne Mikkonen, who is the default assignee of editor bugs in the tracker.

I don't yet know where these files lived before the move, so I can't look further back in history than this yet.

From the readme, the code is based on HTMLarea 3.0 beta.

  • images/* (except for images/kbhelp.gif).
  • lang/en.js
  • popups/about.html
  • popups/blank.html
  • popups/dialog.css
  • popups/editor_help.html
  • popups/popup.js
  • dialog.js
  • htmlarea.css
  • index.html (blank file)
  • license.txt
  • popupdiv.js
  • popupwin.js (well there were some changes, but only to the language of some comments.)
  • release-notes.html

Files with only XHTML strict and bugfix changes

  • popups/createanchor.php
  • popups/dialog_ins_char.
  • popups/dialog_ins_smile.php
  • popups/fullscreen.js
  • popups/insert_image_std.php
  • popups/insert_image.php
  • popups/insert_table.php
  • popups/link_std.php
  • popups/link.php
  • popups/preview.php
  • popups/searchandreplace.php
  • popups/select_colour.php

images/kbhelp.gif

Added 30th November 2006 by Vy-Shane Sin Fat with comment "New help button for keyboard shortcuts." - part of the Moodle 1.8 accessibility work.

lang/en.php

This is a Moodle-specific file to make HTML area use Moodle's internationalisation system, instead of the one built into HTMLarea.

plugins/GetHTML/get-html.js

This plugin was added on 3rd June 2006 by Janne Mikkonen. One change since then, to fix [https://tracker.moodle.org/browse/MDL-6106 MDL-6106] by Petr Škoda.

plugins/SpellChecker/*

There are loads of files in here. I have not looked at them at all.

plugins/TableOperations/*

There are loads of files in here. I have not looked at them at all.

coursefiles.php

Integration with course files, obviously Moodle specific.

htmlarea_bak.php

What a suspicious file name. Should this really be in CVS? Has had a few minor changes made. Is quite like htmlarea.php, but with quite a lots of changes too, according to diff.

htmlarea.class.php

Some minor changes for XHTML-strictness.

htmlarea.php

Loads of changes (we are up to revision 1.20), which I have not analysed yet.