Rich Text Editing in Opera 9

Rich Text Editing in Opera 9

by joao eiras -
Number of replies: 7

Opera thus far didn't support RTE.
In the middle of October a technology preview of Opera 9 was released that supports RTE.
http://snapshot.opera.com/

I went to a moodle forum at my university with Internet Explorer (yuck!), I saved the page, striped extra content, edited the htmlarea.js(originally htmlarea.php) file in 2 spots (look of "EDITED" with a test editor) and opened it with Opera 9.
It's uploaded here
http://paginas.fe.up.pt/~ei02043/opt/rte.html
It works pretty fine!
Please allow Opera to get the HTML editor.

Important:
don't assume browser functionality based on browser name rather that using javascript to check it.
Use

if(document.desingMode){
  //rich test editing supported
}


to check to check for RTE support the same way many scripts sniff for document.getElementById to check for DOM compliance.
A good example of this is gmail. It checks for RTE with javascript, and this way Opera 9 gets those features. But sadly many websites have to constantly update their scrits whenever a new browser versions comes out. I consider this mildly efficient.

Average of ratings: -
In reply to joao eiras

When there will be support Opera in RTE?

by Антон Вычегжанин -
When there will be support Opera in RTE?
On other sites the similar interface of editing (RTE) works superb.
In reply to joao eiras

Re: Rich Text Editing in Opera 9

by Dennis Williams -
Opera 9.02 is out. Will Moodle be able to find a way for Opera users to use WYSIWYG text area editing? I would love to not have to fire up FF to created a bold red label (can't remember the hex color, and don't want to either) in a course.

Using Opera 9.02 on Ubuntu Dapper Drake release.

In reply to joao eiras

Re: Rich Text Editing in Opera 9

by Fatemeh Orooji -
Hi, I want to enable Moodle editor in Opera, Can any body guide me how?
In reply to Fatemeh Orooji

Re: Rich Text Editing in Opera 9

by Mauno Korpelainen -

- In current stable versions of moodle (using HTMLArea) you can mask Opera as Internet Explorer

  • Go to the site in question.
  • From the menu, select Tools > Quick preferences > Edit site preferences (Mac: Opera > Quick preferences > Edit site preferences)
  • Click the "Network" tab
  • In the "Browser identification" drop-down, select "Mask as Internet Explorer"
  • Click "OK"
  • Reload the page

It works but is not very practical because you need to mask each moodle site separately.

- You can modify current moodle to use TinyMCE instead of HTMLArea ( read for example http://moodle.org/mod/forum/discuss.php?d=107550 )

It's possible in several ways but not fully functional or necessarely easy.

- You can wait for moodle 2.0 (stable version may be ready next year) that has TinyMCE as default editor and it supports all modern browsers (Firefox, IE, Safari, Opera, Chrome...)

or you can use for example Firefox... HTMLArea works without major problems with Firefox and IE in current stable versions of moodle.

In reply to Mauno Korpelainen

Re: Rich Text Editing in Opera 9

by Ger Tielemans -
Why is there not a simple patch like that one for Chrome?
In reply to Ger Tielemans

Re: Rich Text Editing in Opera 9

by Mauno Korpelainen -

I suppose nobody has managed to create a patch that makes HTMLArea fully functional in Opera (or even the latest version of Opera) - the fact that masking Opera as Internet Explorer makes it work pretty well with HTMLArea does not mean that Opera as Opera itself works with HTMLArea.

You can for example change in lib/moodlelib.php function can_use_html_editor() to

function can_use_html_editor() {
    global $USER, $CFG;

    if (!empty($USER->htmleditor) and !empty($CFG->htmleditor)) {
        if (check_browser_version('MSIE', 5.5)) {
            return 'MSIE';
        } else if (check_browser_version('Gecko', 20030516)) {
            return 'Gecko';
        } else if (check_browser_version("Opera", 0)) {
  return 'Opera';
  }
    }
    return false;
}

and in lib/editor/htmlarea/htmlarea.php line

HTMLArea.is_ie     = ((HTMLArea.agt.indexOf("msie") != -1) && (HTMLArea.agt.indexOf("opera") == -1));

to

HTMLArea.is_ie     = ((HTMLArea.agt.indexOf("msie") != -1) || (HTMLArea.agt.indexOf("opera") != -1));

so that Opera is handled everywhere in htmlarea.php like IE

It almost works with the latest versions of Opera but it did not work at all with the past versions of Opera (pre 9.5?)

For example if textarea is empty at first in Opera you can't write anything but if you click <> and add any character to textarea and click <> again you can add new content with Opera...
or you can open smiley plugin but can't add smileys...

It may not be a big thing to test all parts of code of HTMLArea and to make it functional with the latest Opera but is it really worth of all that trouble - the best patch could have been to change HTMLArea to TinyMCE several years ago. At least I am happy to see this finally happen in moodle 2.0.

PS. Developers of Xinha (successor of HTMLArea when support for HTMLArea was officially discontinued) used some years to make Xinha support Webkit browsers so it is definitely possible to write such a patch... if somebody has time and effort to try... I did make one combined version of Xinha and HTMLArea (Xinha that had moodle modifications from HTMLArea) a year ago but in my opinion we need an editor that has good support, that is regularly upgraded and we have such editors available in the future versions of moodle 2.x - first TinyMCE but it should be possible to integrate CKEditor (successor of FCKEditor), Xinha, YUIRTE etc open source editors to moodle after the latest changes that Petr Skodak made to code of moodle 2.0 (pluggable editor system)