High time to have reliable html editor may be tinymce

High time to have reliable html editor may be tinymce

autor venkatesan iyengar -
Počet odpovědí: 12
Dear Janne,

Of late there are too many 'html not seen' posts. The moodle bundled htmlarea is unreliable. It is visible sometimes and simply goes off at some other time. I think tinymce has comeup a long way and it is better moodle bundles tinymce.

Průměr hodnocení: -
V odpovědi na venkatesan iyengar

Re: High time to have reliable html editor may be tinymce

autor Chris Judson -
Here's recent discussion on this:
http://moodle.org/mod/forum/discuss.php?d=31433

I'm seeing if the directions are accurate...if so, I'm switching over to tinymce: not having an editing toolbar for my students (and me) is getting a tad irritating for such a great CMS.

Peace,
Chris
V odpovědi na Chris Judson

Re: High time to have reliable html editor may be tinymce

autor Chris Judson -
For some reason I'm still getting an error from the directions given on the older post. Do you have a revised code snipet from the lines given in the directions for running tinymce as the editor.
Thanks in advance,
Chris
V odpovědi na Chris Judson

Re: High time to have reliable html editor may be tinymce

autor venkatesan iyengar -
The directions from the older post works well. Include the following lines:

Step 1:
(Line no: 2965)
function print_textarea($usehtmleditor, $rows, $cols, $width, $height, $name, $value='', $courseid=0) {
/// $width and height are legacy fields and no longer used as pixels like they used to be.
/// However, you can set them to zero to override the mincols and minrows values below.

global $CFG, $course;
static $scriptcount; // For loading the htmlarea script only once.

$mincols = 65;
$minrows = 10;

if (empty($courseid)) {
if (!empty($course->id)) { // search for it in global context
$courseid = $course->id;
}
}

if (empty($scriptcount)) {
$scriptcount = 0;
}

/*if ($usehtmleditor) {

if (!empty($courseid) and isteacher($courseid)) {
echo ($scriptcount < 1) ? ''."\n" : '';
} else {
echo ($scriptcount < 1) ? ''."\n" : '';
}
echo ($scriptcount < 1) ? ''."\n" : '';
$scriptcount++;

if ($height) { // Usually with legacy calls
if ($rows < $minrows) {
$rows = $minrows;
}
}
if ($width) { // Usually with legacy calls
if ($cols < $mincols) {
$cols = $mincols;
}
}
}*/

if ($usehtmleditor) {

if (!empty($courseid) and isteacher($courseid)) {
echo ($scriptcount < 1) ? '' . "\n" : '';
} else {
echo ($scriptcount < 1) ? ''."\n" : '';
}
//echo ($scriptcount < 1) ? ''."\n" : '';
echo '';
$scriptcount++;

if ($height) { // Usually with legacy calls
if ($rows < $minrows) {
$rows = $minrows;
}
}
if ($width) { // Usually with legacy calls
if ($cols < $mincols) {
$cols = $mincols;
}
}
}

echo '';
p($value);
echo ''."\n";
}

the code continues as
/**
* Legacy function, provided for backward compatability.
* This method now simply calls {@link use_html_editor()}
*
Step 2:change function use_html_editor
(Line no 3082úsměv
function use_html_editor($name='', $editorhidebuttons='') {
echo ''."\n";
}

However there is a problem.
The course specific folder is not accessible and I could not fix it so far. Can somebody help us. Janne are you at it?
V odpovědi na Chris Judson

Re: High time to have reliable html editor may be tinymce

autor Chris Judson -
I apologize for the lack of php scripting ability here, but I am getting the following error:

Parse error: parse error, unexpected '>' in .../lib/weblib.php on line 3038

For me, it's the line that reads:

echo ($scriptcount <1>' . "\n" : '';

and in context the section of:

if ($usehtmleditor) {

if (!empty($courseid) and isteacher($courseid)) {
echo ($scriptcount <1>' . "\n" : '';
} else {
echo ($scriptcount <1>'."\n" : '';
}
//echo ($scriptcount <1>'."\n" : '';
echo '

I've checked for extra spaces, etc. to no avail.
Any ideas on how I nixed this part of the script?

Thanks in advance, again,
Chris
V odpovědi na Chris Judson

Re: High time to have reliable html editor may be tinymce

autor Matt Gibson -
I had this error when i copied in the above code, but have fixed it by referring to the code from the earlier post. here is what I have, which works:

function print_textarea($usehtmleditor, $rows, $cols, $width, $height, $name, $value='', $courseid=0) {
/// $width and height are legacy fields and no longer used as pixels like they used to be. /// However, you can set them to zero to override the mincols and minrows values below. global $CFG, $course; static $scriptcount; // For loading the htmlarea script only once. $mincols = 85; $minrows = 10; if (empty($courseid)) {
if (!empty($course->id)) { // search for it in global context $courseid = $course->id; } } if (empty($scriptcount)) {
$scriptcount = 0; } /*if ($usehtmleditor) { if (!empty($courseid) and isteacher($courseid)) { echo ($scriptcount < 1) ? '<script type="text/javascript" src="'. $CFG->wwwroot .'/lib/editor/htmlarea.php?id='. $courseid .'"></script>'."\n" : ''; } else { echo ($scriptcount < 1) ? '<script type="text/javascript" src="'. $CFG->wwwroot .'/lib/editor/htmlarea.php"></script>'."\n" : ''; } echo ($scriptcount < 1) ? '<script type="text/javascript" src="'. $CFG->wwwroot .'/lib/editor/lang/en.php"></script>'."\n" : ''; $scriptcount++; if ($height) { // Usually with legacy calls if ($rows < $minrows) { $rows = $minrows; } } if ($width) { // Usually with legacy calls if ($cols < $mincols) { $cols = $mincols; } } }*/ if ($usehtmleditor) {

if (!empty($courseid) and isteacher($courseid)) {
echo ($scriptcount < 1) ? '<script type="text/javascript" src="'. $CFG->wwwroot .'/lib/editor/tiny_mce/tiny_mce.js"></script>' . "\n" : ''; } else {
echo ($scriptcount < 1) ? '<script type="text/javascript" src="'. $CFG->wwwroot .'/lib/editor/tiny_mce/tiny_mce.js"></script>'."\n" : ''; } //echo ($scriptcount < 1) ? '<script type="text/javascript" src="'. $CFG->wwwroot .'/lib/editor/lang/en.php"></script>'."\n" : ''; echo '<script Xlanguage="javascript" type="text/javascript"> tinyMCE.init({ mode : "textareas", theme : "advanced", plugins : "table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,flash,searchreplace,print,paste,directionality,fullscreen,noneditable,contextmenu", theme_advanced_buttons1_add_before : "save,newdocument,separator", theme_advanced_buttons1_add : "fontselect,fontsizeselect", theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,zoom,separator,forecolor,backcolor,liststyle", theme_advanced_buttons2_add_before: "cut,copy,paste,pastetext,pasteword,separator,search,replace,separator", theme_advanced_buttons3_add_before : "tablecontrols,separator", theme_advanced_buttons3_add : "emotions,iespell,flash,advhr,separator,print,separator,ltr,rtl,separator,fullscreen", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", content_css : "example_full.css", plugin_insertdate_dateFormat : "%Y-%m-%d", plugin_insertdate_timeFormat : "%H:%M:%S", extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]", external_link_list_url : "link.php", external_image_list_url : "inset_image.php", flash_external_list_url : "example_flash_list.js", paste_use_dialog : false, theme_advanced_resizing : true, theme_advanced_resize_horizontal : true, theme_advanced_styles : "Header 1=header1;Header 2=header2;Header 3=header3;Table Row=tableRow1" }); </script>'; $scriptcount++; if ($height) { // Usually with legacy calls if ($rows < $minrows) {
$rows = $minrows; } } if ($width) { // Usually with legacy calls if ($cols < $mincols) {
$cols = $mincols; } } } echo '<textarea id="edit-'. $name .'" name="'. $name .'" rows="'. $rows .'" cols="'. $cols .'">'; p($value); echo '</textarea>'."\n"; }
the editor bar is now a good bit wider than the text entry box and I'm not hot enough with my coding to know how to fix it but it's good enough for now.

Matt

*edit* fixed it now by changing minicols to 85. works fine now.
V odpovědi na venkatesan iyengar

Re: High time to have reliable html editor may be tinymce

autor N Hansen -
Hi Janne-I think I may be in agreement with everyone about TinyMCE, at least from playing with the TinyMCE demo on their website, I have already found that their editor seems to avoid two bugs I have reported that exist in the current editor. bug 3414 and bug 4439. Cut and paste seems to work from the outset too. Does anyone have a running installation of Moodle with TinyMCE enabled that I can visit to test it out? The only thing that would concern me is their limited support for Macintosh computers. It is only fully compatible with Firefox/Mozilla on a Mac. I would worry that the same problem you guys are complaining of about HTML Area would be a problem with TinyMCE at other schools where there are many Macs in use, that may have only the default Safari or IE6 (I know HTML Area doesn't work on the Mac with IE5).
V odpovědi na N Hansen

Re: High time to have reliable html editor may be tinymce

autor N Hansen -
I just wanted to add that everyone should be patient with Janne. From a PM I got from him recently I know he has had some pressing personal stuff to take care of lately that has taken him away from Moodle. 
V odpovědi na N Hansen

Re: High time to have reliable html editor may be tinymce

autor venkatesan iyengar -
Yeah you are right. We can wait for janne. In the mean time I would like to add atleast one major problem with tinymce with the existing coding given above. The links do not show your course folder and it simply shows the tinymce folder. If this is solved, I think tinymce can be used. Also editor themes are controlled by hard coding in the weblib. This should be made selectable by all users and not just admin.
V odpovědi na venkatesan iyengar

Re: High time to have reliable html editor may be tinymce

autor N Hansen -
I think even if Janne were available now, this would have to wait. There is no way a new and major feature like this would be considered for inclusion in 1.6 standard with it being due in only 2 months without extensive testing first. One doesn't want to replace a buggy editor with another buggy editor. If I were you, I would keep on trying to see what you can do with this new editor, and then maybe after 1.6 is out it could be considered for inclusion in the next big version, 1.7 or 2.0.
V odpovědi na N Hansen

Re: High time to have reliable html editor may be tinymce

autor Janne Mikkonen -
Just hold thee horses ;-D TinyMCE is coming. I just have to find time for it ( it'll be in near future ).
V odpovědi na Janne Mikkonen

Re: High time to have reliable html editor may be tinymce

autor venkatesan iyengar -
Thanks Janne. Martin's moodle community is great. You do not need to really hurry it up. We can definitely wait.
V odpovědi na venkatesan iyengar

Re: High time to have reliable html editor may be tinymce

autor aggelos panagiotakis -
i can see that 1.6.3+ has standar incuded along with htmlarea the tinymce editor in the folder [your moodle path]\lib\editor\tinymce
any ideas on how to use this one instead of htmlarea ?
i cannot reallly understand this file :
[your moodle path]/lib/editor/neweditor_readme.txt
even if i deed what it says ,could see the correct editor.