]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-16627 removing obsoleted HTMLArea
authorskodak <skodak>
Tue, 23 Sep 2008 14:16:31 +0000 (14:16 +0000)
committerskodak <skodak>
Tue, 23 Sep 2008 14:16:31 +0000 (14:16 +0000)
111 files changed:
admin/settings/appearance.php
lib/editor/htmlarea/coursefiles.php [deleted file]
lib/editor/htmlarea/dialog.js [deleted file]
lib/editor/htmlarea/htmlarea.class.php [deleted file]
lib/editor/htmlarea/htmlarea.css [deleted file]
lib/editor/htmlarea/htmlarea.php [deleted file]
lib/editor/htmlarea/htmlarea_bak.php [deleted file]
lib/editor/htmlarea/images/ed_about.gif [deleted file]
lib/editor/htmlarea/images/ed_align_center.gif [deleted file]
lib/editor/htmlarea/images/ed_align_justify.gif [deleted file]
lib/editor/htmlarea/images/ed_align_left.gif [deleted file]
lib/editor/htmlarea/images/ed_align_right.gif [deleted file]
lib/editor/htmlarea/images/ed_anchor.gif [deleted file]
lib/editor/htmlarea/images/ed_blank.gif [deleted file]
lib/editor/htmlarea/images/ed_charmap.gif [deleted file]
lib/editor/htmlarea/images/ed_color_bg.gif [deleted file]
lib/editor/htmlarea/images/ed_color_fg.gif [deleted file]
lib/editor/htmlarea/images/ed_copy.gif [deleted file]
lib/editor/htmlarea/images/ed_custom.gif [deleted file]
lib/editor/htmlarea/images/ed_cut.gif [deleted file]
lib/editor/htmlarea/images/ed_delete.gif [deleted file]
lib/editor/htmlarea/images/ed_format_bold.gif [deleted file]
lib/editor/htmlarea/images/ed_format_italic.gif [deleted file]
lib/editor/htmlarea/images/ed_format_strike.gif [deleted file]
lib/editor/htmlarea/images/ed_format_sub.gif [deleted file]
lib/editor/htmlarea/images/ed_format_sup.gif [deleted file]
lib/editor/htmlarea/images/ed_format_underline.gif [deleted file]
lib/editor/htmlarea/images/ed_help.gif [deleted file]
lib/editor/htmlarea/images/ed_hr.gif [deleted file]
lib/editor/htmlarea/images/ed_html.gif [deleted file]
lib/editor/htmlarea/images/ed_image.gif [deleted file]
lib/editor/htmlarea/images/ed_indent_less.gif [deleted file]
lib/editor/htmlarea/images/ed_indent_more.gif [deleted file]
lib/editor/htmlarea/images/ed_left_to_right.gif [deleted file]
lib/editor/htmlarea/images/ed_link.gif [deleted file]
lib/editor/htmlarea/images/ed_list_bullet.gif [deleted file]
lib/editor/htmlarea/images/ed_list_num.gif [deleted file]
lib/editor/htmlarea/images/ed_nolink.gif [deleted file]
lib/editor/htmlarea/images/ed_paste.gif [deleted file]
lib/editor/htmlarea/images/ed_redo.gif [deleted file]
lib/editor/htmlarea/images/ed_replace.gif [deleted file]
lib/editor/htmlarea/images/ed_right_to_left.gif [deleted file]
lib/editor/htmlarea/images/ed_show_border.gif [deleted file]
lib/editor/htmlarea/images/ed_splitcel.gif [deleted file]
lib/editor/htmlarea/images/ed_undo.gif [deleted file]
lib/editor/htmlarea/images/ed_unlink.gif [deleted file]
lib/editor/htmlarea/images/ed_wordclean.gif [deleted file]
lib/editor/htmlarea/images/em.icon.smile.gif [deleted file]
lib/editor/htmlarea/images/folderup.gif [deleted file]
lib/editor/htmlarea/images/fullscreen_maximize.gif [deleted file]
lib/editor/htmlarea/images/fullscreen_minimize.gif [deleted file]
lib/editor/htmlarea/images/icon_ins_char.gif [deleted file]
lib/editor/htmlarea/images/icon_smile.gif [deleted file]
lib/editor/htmlarea/images/insert_table.gif [deleted file]
lib/editor/htmlarea/images/kbhelp.gif [deleted file]
lib/editor/htmlarea/images/spell-check.gif [deleted file]
lib/editor/htmlarea/index.html [deleted file]
lib/editor/htmlarea/lang/en.js [deleted file]
lib/editor/htmlarea/lang/en.php [deleted file]
lib/editor/htmlarea/license.txt [deleted file]
lib/editor/htmlarea/plugins/GetHtml/get-html.js [deleted file]
lib/editor/htmlarea/plugins/SpellChecker/img/spell-check.gif [deleted file]
lib/editor/htmlarea/plugins/SpellChecker/lang/en.js [deleted file]
lib/editor/htmlarea/plugins/SpellChecker/lang/ro.js [deleted file]
lib/editor/htmlarea/plugins/SpellChecker/readme-tech.html [deleted file]
lib/editor/htmlarea/plugins/SpellChecker/spell-check-logic.cgi [deleted file]
lib/editor/htmlarea/plugins/SpellChecker/spell-check-style.css [deleted file]
lib/editor/htmlarea/plugins/SpellChecker/spell-check-ui.html [deleted file]
lib/editor/htmlarea/plugins/SpellChecker/spell-check-ui.js [deleted file]
lib/editor/htmlarea/plugins/SpellChecker/spell-checker.js [deleted file]
lib/editor/htmlarea/plugins/TableOperations/img/cell-delete.gif [deleted file]
lib/editor/htmlarea/plugins/TableOperations/img/cell-insert-after.gif [deleted file]
lib/editor/htmlarea/plugins/TableOperations/img/cell-insert-before.gif [deleted file]
lib/editor/htmlarea/plugins/TableOperations/img/cell-merge.gif [deleted file]
lib/editor/htmlarea/plugins/TableOperations/img/cell-prop.gif [deleted file]
lib/editor/htmlarea/plugins/TableOperations/img/cell-split.gif [deleted file]
lib/editor/htmlarea/plugins/TableOperations/img/col-delete.gif [deleted file]
lib/editor/htmlarea/plugins/TableOperations/img/col-insert-after.gif [deleted file]
lib/editor/htmlarea/plugins/TableOperations/img/col-insert-before.gif [deleted file]
lib/editor/htmlarea/plugins/TableOperations/img/col-split.gif [deleted file]
lib/editor/htmlarea/plugins/TableOperations/img/row-delete.gif [deleted file]
lib/editor/htmlarea/plugins/TableOperations/img/row-insert-above.gif [deleted file]
lib/editor/htmlarea/plugins/TableOperations/img/row-insert-under.gif [deleted file]
lib/editor/htmlarea/plugins/TableOperations/img/row-prop.gif [deleted file]
lib/editor/htmlarea/plugins/TableOperations/img/row-split.gif [deleted file]
lib/editor/htmlarea/plugins/TableOperations/img/table-prop.gif [deleted file]
lib/editor/htmlarea/plugins/TableOperations/lang/en.js [deleted file]
lib/editor/htmlarea/plugins/TableOperations/lang/fi.js [deleted file]
lib/editor/htmlarea/plugins/TableOperations/lang/ro.js [deleted file]
lib/editor/htmlarea/plugins/TableOperations/makefile.xml [deleted file]
lib/editor/htmlarea/plugins/TableOperations/table-operations.js [deleted file]
lib/editor/htmlarea/popupdiv.js [deleted file]
lib/editor/htmlarea/popups/about.html [deleted file]
lib/editor/htmlarea/popups/blank.html [deleted file]
lib/editor/htmlarea/popups/createanchor.php [deleted file]
lib/editor/htmlarea/popups/dialog.css [deleted file]
lib/editor/htmlarea/popups/dlg_ins_char.php [deleted file]
lib/editor/htmlarea/popups/dlg_ins_smile.php [deleted file]
lib/editor/htmlarea/popups/editor_help.html [deleted file]
lib/editor/htmlarea/popups/fullscreen.php [deleted file]
lib/editor/htmlarea/popups/insert_image.php [deleted file]
lib/editor/htmlarea/popups/insert_image_std.php [deleted file]
lib/editor/htmlarea/popups/insert_table.php [deleted file]
lib/editor/htmlarea/popups/link.php [deleted file]
lib/editor/htmlarea/popups/link_std.php [deleted file]
lib/editor/htmlarea/popups/popup.js [deleted file]
lib/editor/htmlarea/popups/preview.php [deleted file]
lib/editor/htmlarea/popups/searchandreplace.php [deleted file]
lib/editor/htmlarea/popups/select_color.php [deleted file]
lib/editor/htmlarea/popupwin.js [deleted file]
lib/editor/htmlarea/release-notes.html [deleted file]

index 874aacafe20d18e00c04ef117e74d48023d1ff16..b1ff88954d0197807afe6d470a166ee9e2eb3503 100644 (file)
@@ -61,6 +61,7 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
     $temp->add(new admin_setting_emoticons());
     $ADMIN->add('htmleditor', $temp);
 
+/* TODO: before deleting these settings migrate or drop config values!
     $temp = new admin_settingpage('htmlarea', get_string('htmlarea', 'admin'));
     $temp->add(new admin_setting_configtext('editorbackgroundcolor', get_string('editorbackgroundcolor', 'admin'), get_string('edhelpbgcolor'), '#ffffff', PARAM_NOTAGS));
     $temp->add(new admin_setting_configtext('editorfontfamily', get_string('editorfontfamily', 'admin'), get_string('edhelpfontfamily'), 'Trebuchet MS,Verdana,Arial,Helvetica,sans-serif', PARAM_NOTAGS));
@@ -73,12 +74,13 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
     }
     $temp->add(new admin_setting_special_editorhidebuttons());
     $ADMIN->add('htmleditor', $temp);
+*/
 
-    $temp = new admin_settingpage('tinymce', get_string('tinymce', 'admin'));
+    $temp = new admin_settingpage('tinymce', 'TinyMCE');
     // add tinymce configuration options here
     $ADMIN->add('htmleditor', $temp);
 
-    // "htmlsettings" settingpage
+        // "htmlsettings" settingpage
     $temp = new admin_settingpage('htmlsettings', get_string('htmlsettings', 'admin'));
     $temp->add(new admin_setting_configcheckbox('formatstringstriptags', get_string('stripalltitletags', 'admin'), get_string('configstripalltitletags', 'admin'), 1));
     $ADMIN->add('appearance', $temp);
diff --git a/lib/editor/htmlarea/coursefiles.php b/lib/editor/htmlarea/coursefiles.php
deleted file mode 100644 (file)
index bb9d928..0000000
+++ /dev/null
@@ -1,815 +0,0 @@
-<?php // $Id$
-
-//  Manage all uploaded files in a course file area
-
-//  This file is a hack to files/index.php that removes
-//  the headers and adds some controls so that images
-//  can be selected within the Richtext editor.
-
-//  All the Moodle-specific stuff is in this top section
-//  Configuration and access control occurs here.
-//  Must define:  USER, basedir, baseweb, html_header and html_footer
-//  USER is a persistent variable using sessions
-
-    require("../../../config.php");
-    require_once($CFG->libdir.'/filelib.php');
-
-error('Not reimplemented yet, sorry');
-
-    $id      = required_param('id', PARAM_INT);
-    $file    = optional_param('file', '', PARAM_PATH);
-    $wdir    = optional_param('wdir', '', PARAM_PATH);
-    $action  = optional_param('action', '', PARAM_ACTION);
-    $name    = optional_param('name', '', PARAM_FILE);
-    $oldname = optional_param('oldname', '', PARAM_FILE);
-    $usecheckboxes  = optional_param('usecheckboxes', 1, PARAM_INT);
-    $save    = optional_param('save', 0, PARAM_BOOL);
-    $text    = optional_param('text', '', PARAM_RAW);
-    $confirm = optional_param('confirm', 0, PARAM_BOOL);
-
-
-    if (! $course = $DB->get_record("course", array("id"=>$id))) {
-        print_error('invalidcourseid');
-    }
-
-    require_login($course);
-    require_capability('moodle/course:managefiles', get_context_instance(CONTEXT_COURSE, $id));
-
-    function html_footer() {
-        echo "\n\n</body>\n</html>";
-    }
-
-    function html_header($course, $wdir, $formfield=""){
-
-        global $CFG;
-
-        ?>
-        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-        <html>
-        <head>
-        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
-        <title>coursefiles</title>
-        <script type="text/javascript">
-//<![CDATA[
-
-
-        function set_value(params) {
-            /// function's argument is an object containing necessary values
-            /// to export parent window (url,isize,itype,iwidth,iheight, imodified)
-            /// set values when user click's an image name.
-            var upper = window.parent;
-            var insimg = upper.document.getElementById('f_url');
-
-            try {
-                if(insimg != null) {
-                    if(params.itype.indexOf("image/gif") == -1 && params.itype.indexOf("image/jpeg") == -1 && params.itype.indexOf("image/png") == -1) {
-                        alert("<?php print_string("notimage","editor");?>");
-                        return false;
-                    }
-                    for(field in params) {
-                        var value = params[field];
-                        switch(field) {
-                            case "url"   :   upper.document.getElementById('f_url').value = value;
-                                     upper.ipreview.location.replace('popups/preview.php?id='+ <?php print($course->id);?> +'&imageurl='+ value);
-                                break;
-                            case "isize" :   upper.document.getElementById('isize').value = value; break;
-                            case "itype" :   upper.document.getElementById('itype').value = value; break;
-                            case "iwidth":    upper.document.getElementById('f_width').value = value; break;
-                            case "iheight":   upper.document.getElementById('f_height').value = value; break;
-                        }
-                    }
-                } else {
-                    for(field in params) {
-                        var value = params[field];
-                        switch(field) {
-                            case "url" :
-                                //upper.document.getElementById('f_href').value = value;
-                                upper.opener.document.getElementById('f_href').value = value;
-                                upper.close();
-                                break;
-                            //case "imodified" : upper.document.getElementById('imodified').value = value; break;
-                            //case "isize" : upper.document.getElementById('isize').value = value; break;
-                            //case "itype" : upper.document.getElementById('itype').value = value; break;
-                        }
-                    }
-                }
-            } catch(e) {
-                if ( window.tinyMCE != "undefined" || window.TinyMCE != "undefined" ) {
-                    upper.opener.Dialog._return(params.url);
-                    upper.close();
-                } else {
-                    alert("Something odd just occurred!!!");
-                }
-            }
-            return false;
-        }
-
-        function set_dir(strdir) {
-            // sets wdir values
-            var upper = window.parent.document;
-            if(upper) {
-                for(var i = 0; i < upper.forms.length; i++) {
-                    var f = upper.forms[i];
-                    try {
-                        f.wdir.value = strdir;
-                    } catch (e) {
-
-                    }
-                }
-            }
-        }
-
-        function set_rename(strfile) {
-            var upper = window.parent.document;
-            upper.getElementById('irename').value = strfile;
-            return true;
-        }
-
-        function reset_value() {
-            var upper = window.parent.document;
-            for(var i = 0; i < upper.forms.length; i++) {
-                var f = upper.forms[i];
-                for(var j = 0; j < f.elements.length; j++) {
-                    var e = f.elements[j];
-                    if(e.type != "submit" && e.type != "button" && e.type != "hidden") {
-                        try {
-                            e.value = "";
-                        } catch (e) {
-                        }
-                    }
-                }
-            }
-            upper.getElementById('irename').value = 'xx';
-
-            var prev = window.parent.ipreview;
-            if(prev != null) {
-                prev.location.replace('about:blank');
-            }
-            var uploader = window.parent.document.forms['uploader'];
-            if(uploader != null) {
-                uploader.reset();
-            }
-            set_dir('<?php print($wdir);?>');
-            return true;
-        }
-//]]>
-        </script>
-        <style type="text/css">
-        body {
-            background-color: white;
-            margin-top: 2px;
-            margin-left: 4px;
-            margin-right: 4px;
-        }
-        body,p,table,td,input,select,a {
-            font-family: Tahoma, sans-serif;
-            font-size: 11px;
-        }
-        select {
-            position: absolute;
-            top: -20px;
-            left: 0px;
-        }
-        img.icon {
-          vertical-align:middle;
-          margin-right:4px;
-          width:16px;
-          height:16px;
-          border:0px;
-        }
-        </style>
-        </head>
-        <body onload="reset_value();">
-
-        <?php
-    }
-
-    if (! $basedir = make_upload_directory("$course->id")) {
-        print_error('cannotcreateuploaddir');
-    }
-
-    $baseweb = $CFG->wwwroot;
-
-//  End of configuration and access control
-
-
-    if ($wdir == '') {
-        $wdir='/';
-    }
-
-    switch ($action) {
-
-        case "upload":
-            html_header($course, $wdir);
-            require_once($CFG->dirroot.'/lib/uploadlib.php');
-
-            if ($save and confirm_sesskey()) {
-                $um = new upload_manager('userfile',false,false,$course,false,0);
-                $dir = "$basedir$wdir";
-                if ($um->process_file_uploads($dir)) {
-                    notify(get_string('uploadedfile'));
-                }
-                // um will take care of error reporting.
-                displaydir($wdir);
-            } else {
-                $upload_max_filesize = get_max_upload_file_size($CFG->maxbytes);
-                $filesize = display_size($upload_max_filesize);
-
-                $struploadafile = get_string("uploadafile");
-                $struploadthisfile = get_string("uploadthisfile");
-                $strmaxsize = get_string("maxsize", "", $filesize);
-                $strcancel = get_string("cancel");
-
-                echo "<p>$struploadafile ($strmaxsize) --> <strong>$wdir</strong>";
-                echo "<table border=\"0\"><tr><td colspan=\"2\">\n";
-                echo "<form enctype=\"multipart/form-data\" method=\"post\" action=\"coursefiles.php\">\n";
-                upload_print_form_fragment(1,array('userfile'),null,false,null,$course->maxbytes,0,false);
-                echo " <input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
-                echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />\n";
-                echo " <input type=\"hidden\" name=\"action\" value=\"upload\" />\n";
-                echo " <input type=\"hidden\" name=\"sesskey\" value=\"$USER->sesskey\" />\n";
-                echo " </td><tr><td align=\"right\">";
-                echo " <input type=\"submit\" name=\"save\" value=\"$struploadthisfile\" />\n";
-                echo "</form>\n";
-                echo "</td>\n<td>\n";
-                echo "<form action=\"coursefiles.php\" method=\"get\">\n";
-                echo " <input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
-                echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />\n";
-                echo " <input type=\"hidden\" name=\"action\" value=\"cancel\" />\n";
-                echo " <input type=\"submit\" value=\"$strcancel\" />\n";
-                echo "</form>\n";
-                echo "</td>\n</tr>\n</table>\n";
-            }
-            html_footer();
-            break;
-
-        case "delete":
-            if ($confirm and confirm_sesskey()) {
-                html_header($course, $wdir);
-                foreach ($USER->filelist as $file) {
-                    $fullfile = $basedir.$file;
-                    if (! fulldelete($fullfile)) {
-                        echo "<br />Error: Could not delete: $fullfile";
-                    }
-                }
-                clearfilelist();
-                displaydir($wdir);
-                html_footer();
-
-            } else {
-                html_header($course, $wdir);
-                if (setfilelist($_POST)) {
-                    echo "<p align=center>".get_string("deletecheckwarning").":</p>";
-                    print_simple_box_start("center");
-                    printfilelist($USER->filelist);
-                    print_simple_box_end();
-                    echo "<br />";
-                    $frameold = $CFG->framename;
-                    $CFG->framename = "ibrowser";
-                    notice_yesno (get_string("deletecheckfiles"),
-                                "coursefiles.php?id=$id&amp;wdir=$wdir&amp;action=delete&amp;confirm=1&amp;sesskey=$USER->sesskey",
-                                "coursefiles.php?id=$id&amp;wdir=$wdir&amp;action=cancel");
-                    $CFG->framename = $frameold;
-                } else {
-                    displaydir($wdir);
-                }
-                html_footer();
-            }
-            break;
-
-        case "move":
-            html_header($course, $wdir);
-            if ($count = setfilelist($_POST) and confirm_sesskey()) {
-                $USER->fileop     = $action;
-                $USER->filesource = $wdir;
-                echo "<p align=\"center\">";
-                print_string("selectednowmove", "moodle", $count);
-                echo "</p>";
-            }
-            displaydir($wdir);
-            html_footer();
-            break;
-
-        case "paste":
-            html_header($course, $wdir);
-            if (isset($USER->fileop) and $USER->fileop == "move" and confirm_sesskey()) {
-                foreach ($USER->filelist as $file) {
-                    $shortfile = basename($file);
-                    $oldfile = $basedir.$file;
-                    $newfile = $basedir.$wdir."/".$shortfile;
-                    if (!rename($oldfile, $newfile)) {
-                        echo "<p>Error: $shortfile not moved";
-                    }
-                }
-            }
-            clearfilelist();
-            displaydir($wdir);
-            html_footer();
-            break;
-
-        case "rename":
-            if (!empty($name) and confirm_sesskey()) {
-                html_header($course, $wdir);
-                $name    = clean_filename($name);
-                if (file_exists($basedir.$wdir."/".$name)) {
-                    echo "Error: $name already exists!";
-                } else if (!@rename($basedir.$wdir."/".$oldname, $basedir.$wdir."/".$name)) {
-                    echo "Error: could not rename $oldname to $name";
-                }
-                displaydir($wdir);
-
-            } else {
-                $strrename = get_string("rename");
-                $strcancel = get_string("cancel");
-                $strrenamefileto = get_string("renamefileto", "moodle", $file);
-                html_header($course, $wdir, "form.name");
-                echo "<p>$strrenamefileto:";
-                echo "<table border=\"0\">\n<tr>\n<td>\n";
-                echo "<form action=\"coursefiles.php\" method=\"post\" id=\"form\">\n";
-                echo " <input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
-                echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />\n";
-                echo " <input type=\"hidden\" name=\"action\" value=\"rename\" />\n";
-                echo " <input type=\"hidden\" name=\"sesskey\" value=\"$USER->sesskey\" />\n";
-                echo " <input type=\"hidden\" name=\"oldname\" value=\"$file\" />\n";
-                echo " <input type=\"text\" name=\"name\" size=\"35\" value=\"$file\" />\n";
-                echo " <input type=\"submit\" value=\"$strrename\" />\n";
-                echo "</form>\n";
-                echo "</td><td>\n";
-                echo "<form action=\"coursefiles.php\" method=\"get\">\n";
-                echo " <input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
-                echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />\n";
-                echo " <input type=\"hidden\" name=\"action\" value=\"cancel\" />\n";
-                echo " <input type=\"submit\" value=\"$strcancel\" />\n";
-                echo "</form>";
-                echo "</td></tr>\n</table>\n";
-            }
-            html_footer();
-            break;
-
-        case "mkdir":
-            if (!empty($name) and confirm_sesskey()) {
-                html_header($course, $wdir);
-                $name = clean_filename($name);
-                if (file_exists("$basedir$wdir/$name")) {
-                    echo "Error: $name already exists!";
-                } else if (! make_upload_directory("$course->id/$wdir/$name")) {
-                    echo "Error: could not create $name";
-                }
-                displaydir($wdir);
-
-            } else {
-                $strcreate = get_string("create");
-                $strcancel = get_string("cancel");
-                $strcreatefolder = get_string("createfolder", "moodle", $wdir);
-                html_header($course, $wdir, "form.name");
-                echo "<p>$strcreatefolder:";
-                echo "<table border=\"0\">\n<tr><td>\n";
-                echo "<form action=\"coursefiles.php\" method=\"post\" name=\"form\">\n";
-                echo " <input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
-                echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />\n";
-                echo " <input type=\"hidden\" name=\"action\" value=\"mkdir\" />\n";
-                echo " <input type=\"hidden\" name=\"sesskey\" value=\"$USER->sesskey\" />\n";
-                echo " <input type=\"text\" name=\"name\" size=\"35\" />\n";
-                echo " <input type=\"submit\" value=\"$strcreate\" />\n";
-                echo "</form>\n";
-                echo "</td><td>\n";
-                echo "<form action=\"coursefiles.php\" method=\"get\">\n";
-                echo " <input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
-                echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />\n";
-                echo " <input type=\"hidden\" name=\"action\" value=\"cancel\" />\n";
-                echo " <input type=\"submit\" value=\"$strcancel\" />\n";
-                echo "</form>\n";
-                echo "</td>\n</tr>\n</table>\n";
-            }
-            html_footer();
-            break;
-
-        case "edit":
-            html_header($course, $wdir);
-            if (($text != '') and confirm_sesskey()) {
-                $fileptr = fopen($basedir.$file,"w");
-                fputs($fileptr, $text);
-                fclose($fileptr);
-                displaydir($wdir);
-
-            } else {
-                $streditfile = get_string("edit", "", "<strong>$file</strong>");
-                $fileptr  = fopen($basedir.$file, "r");
-                $contents = fread($fileptr, filesize($basedir.$file));
-                fclose($fileptr);
-
-                print_heading("$streditfile");
-
-                echo "<table><tr><td colspan=\"2\">\n";
-                echo "<form action=\"coursefiles.php\" method=\"post\" name=\"form\" $onsubmit>\n";
-                echo " <input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
-                echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />\n";
-                echo " <input type=\"hidden\" name=file value=\"$file\" />";
-                echo " <input type=\"hidden\" name=\"action\" value=\"edit\" />\n";
-                echo " <input type=\"hidden\" name=\"sesskey\" value=\"$USER->sesskey\" />\n";
-                print_textarea(false, 25, 80, 680, 400, "text", $contents);
-                echo "</td>\n</tr>\n<tr>\n<td>\n";
-                echo " <input type=\"submit\" value=\"".get_string("savechanges")."\" />\n";
-                echo "</form>\n";
-                echo "</td>\n<td>\n";
-                echo "<form action=\"coursefiles.php\" method=\"get\">\n";
-                echo " <input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
-                echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />\n";
-                echo " <input type=\"hidden\" name=\"action\" value=\"cancel\" />\n";
-                echo " <input type=\"submit\" value=\"".get_string("cancel")."\" />\n";
-                echo "</form>\n";
-                echo "</td></tr></table>\n";
-
-                if ($usehtmleditor) {
-                    use_html_editor("text");
-                }
-
-
-            }
-            html_footer();
-            break;
-
-        case "zip":
-            if (!empty($name) and confirm_sesskey()) {
-                html_header($course, $wdir);
-                $name = clean_filename($name);
-
-                $files = array();
-                foreach ($USER->filelist as $file) {
-                   $files[] = "$basedir/$file";
-                }
-
-                if (!zip_files($files,"$basedir/$wdir/$name")) {
-                    print_error('zipfileserror');
-                }
-
-                clearfilelist();
-                displaydir($wdir);
-
-            } else {
-                html_header($course, $wdir, "form.name");
-
-                if (setfilelist($_POST)) {
-                    echo "<p align=\"center\">".get_string("youareabouttocreatezip").":</p>";
-                    print_simple_box_start("center");
-                    printfilelist($USER->filelist);
-                    print_simple_box_end();
-                    echo "<br />";
-                    echo "<p align=\"center\">".get_string("whattocallzip");
-                    echo "<table border=\"0\">\n<tr>\n<td>\n";
-                    echo "<form action=\"coursefiles.php\" method=\"post\" name=\"form\">\n";
-                    echo " <input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
-                    echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />\n";
-                    echo " <input type=\"hidden\" name=\"action\" value=\"zip\" />\n";
-                    echo " <input type=\"hidden\" name=\"sesskey\" value=\"$USER->sesskey\" />\n";
-                    echo " <INPUT type=\"text\" name=\"name\" size=\"35\" value=\"new.zip\" />\n";
-                    echo " <input type=\"submit\" value=\"".get_string("createziparchive")."\" />";
-                    echo "</form>\n";
-                    echo "</td>\n<td>\n";
-                    echo "<form action=\"coursefiles.php\" method=\"get\">\n";
-                    echo " <input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
-                    echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />\n";
-                    echo " <input type=\"hidden\" name=\"action\" value=\"cancel\" />\n";
-                    echo " <input type=\"submit\" value=\"".get_string("cancel")."\" />\n";
-                    echo "</form>\n";
-                    echo "</td>\n</tr>\n</table>\n";
-                } else {
-                    displaydir($wdir);
-                    clearfilelist();
-                }
-            }
-            html_footer();
-            break;
-
-        case "unzip":
-            html_header($course, $wdir);
-            if (!empty($file) and confirm_sesskey()) {
-                $strok = get_string("ok");
-                $strunpacking = get_string("unpacking", "", $file);
-
-                echo "<p align=\"center\">$strunpacking:</p>";
-
-                $file = basename($file);
-
-                if (!unzip_file("$basedir/$wdir/$file")) {
-                    print_error("unzipfileserror","error");
-                }
-
-                echo "<center><form action=\"coursefiles.php\" method=\"get\">\n";
-                echo " <input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
-                echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />\n";
-                echo " <input type=\"hidden\" name=\"action\" value=\"cancel\" />\n";
-                echo " <input type=\"submit\" value=\"$strok\" />\n";
-                echo "</form>\n";
-                echo "</center>\n";
-            } else {
-                displaydir($wdir);
-            }
-            html_footer();
-            break;
-
-        case "listzip":
-            html_header($course, $wdir);
-            if (!empty($file) and confirm_sesskey()) {
-                $strname = get_string("name");
-                $strsize = get_string("size");
-                $strmodified = get_string("modified");
-                $strok = get_string("ok");
-                $strlistfiles = get_string("listfiles", "", $file);
-
-                echo "<p align=\"center\">$strlistfiles:</p>";
-                $file = basename($file);
-
-                require_once($CFG->libdir.'/pclzip/pclzip.lib.php');
-                $archive = new PclZip("$basedir/$wdir/$file");
-                if (!$list = $archive->listContent("$basedir/$wdir")) {
-                    notify($archive->errorInfo(true));
-
-                } else {
-                    echo "<table cellpadding=\"4\" cellspacing=\"2\" border=\"0\">\n";
-                    echo "<tr>\n<th align=\"left\" scope=\"col\">$strname</th><th align=\"right\" scope=\"col\">$strsize</th><th align=\"right\" scope=\"col\">$strmodified</th></tr>";
-                    foreach ($list as $item) {
-                        echo "<tr>";
-                        print_cell("left", $item['filename']);
-                        if (! $item['folder']) {
-                            print_cell("right", display_size($item['size']));
-                        } else {
-                            echo "<td>&nbsp;</td>\n";
-                        }
-                        $filedate  = userdate($item['mtime'], get_string("strftimedatetime"));
-                        print_cell("right", $filedate);
-                        echo "</tr>\n";
-                    }
-                    echo "</table>\n";
-                }
-                echo "<br /><center><form action=\"coursefiles.php\" method=\"get\">\n";
-                echo " <input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
-                echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />\n";
-                echo " <input type=\"hidden\" name=\"action\" value=\"cancel\" />\n";
-                echo " <input type=\"hidden\" name=\"sesskey\" value=\"$USER->sesskey\" />\n";
-                echo " <input type=\"submit\" value=\"$strok\" />\n";
-                echo "</form>\n";
-                echo "</center>\n";
-            } else {
-                displaydir($wdir);
-            }
-            html_footer();
-            break;
-
-        case "cancel":
-            clearfilelist();
-
-        default:
-            html_header($course, $wdir);
-            displaydir($wdir);
-            html_footer();
-            break;
-}
-
-
-/// FILE FUNCTIONS ///////////////////////////////////////////////////////////
-
-
-function setfilelist($VARS) {
-    global $USER;
-
-    $USER->filelist = array ();
-    $USER->fileop = "";
-
-    $count = 0;
-    foreach ($VARS as $key => $val) {
-        if (substr($key,0,4) == "file") {
-            $count++;
-            $val = rawurldecode($val);
-            if (!detect_munged_arguments($val, 0)) {
-                $USER->filelist[] = $val;
-            }
-        }
-    }
-    return $count;
-}
-
-function clearfilelist() {
-    global $USER;
-
-    $USER->filelist = array ();
-    $USER->fileop = "";
-}
-
-
-function printfilelist($filelist) {
-    global $basedir, $CFG;
-
-    foreach ($filelist as $file) {
-        if (is_dir($basedir.$file)) {
-            echo "<img src=\"$CFG->pixpath/f/folder.gif\" class=\"icon\" alt=\"".get_string('folder')."\" /> $file<br />";
-            $subfilelist = array();
-            $currdir = opendir($basedir.$file);
-            while (false !== ($subfile = readdir($currdir))) {
-                if ($subfile <> ".." && $subfile <> ".") {
-                    $subfilelist[] = $file."/".$subfile;
-                }
-            }
-            printfilelist($subfilelist);
-
-        } else {
-            $icon = mimeinfo("icon", $file);
-            echo "<img src=\"$CFG->pixpath/f/$icon\"  class=\"icon\" alt=\"".get_string('file')."\" /> $file<br />";
-        }
-    }
-}
-
-
-function print_cell($alignment="center", $text="&nbsp;") {
-    echo "<td align=\"$alignment\" nowrap=\"nowrap\">\n";
-    echo "$text";
-    echo "</td>\n";
-}
-
-function get_image_size($filepath) {
-/// This function get's the image size
-
-    /// Check if file exists
-    if(!file_exists($filepath)) {
-        return false;
-    } else {
-        /// Get the mime type so it really an image.
-        if(mimeinfo("icon", basename($filepath)) != "image.gif") {
-            return false;
-        } else {
-            $array_size = getimagesize($filepath);
-            return $array_size;
-        }
-    }
-    unset($filepath,$array_size);
-}
-
-function displaydir ($wdir) {
-//  $wdir == / or /a or /a/b/c/d  etc
-
-    global $basedir;
-    global $usecheckboxes;
-    global $id;
-    global $USER, $CFG;
-
-    $fullpath = $basedir.$wdir;
-
-    $directory = opendir($fullpath);             // Find all files
-    while (false !== ($file = readdir($directory))) {
-        if ($file == "." || $file == "..") {
-            continue;
-        }
-
-        if (is_dir($fullpath."/".$file)) {
-            $dirlist[] = $file;
-        } else {
-            $filelist[] = $file;
-        }
-    }
-    closedir($directory);
-
-    $strfile = get_string("file");
-    $strname = get_string("name");
-    $strsize = get_string("size");
-    $strmodified = get_string("modified");
-    $straction = get_string("action");
-    $strmakeafolder = get_string("makeafolder");
-    $struploadafile = get_string("uploadafile");
-    $strwithchosenfiles = get_string("withchosenfiles");
-    $strmovetoanotherfolder = get_string("movetoanotherfolder");
-    $strmovefilestohere = get_string("movefilestohere");
-    $strdeletecompletely = get_string("deletecompletely");
-    $strcreateziparchive = get_string("createziparchive");
-    $strrename = get_string("rename");
-    $stredit   = get_string("edit");
-    $strunzip  = get_string("unzip");
-    $strlist   = get_string("list");
-    $strchoose   = get_string("choose");
-
-
-    echo "<form action=\"coursefiles.php\" method=\"post\" name=\"dirform\">\n";
-    echo "<table border=\"0\" cellspacing=\"2\" cellpadding=\"2\" width=\"100%\">\n";
-
-    if ($wdir == "/") {
-        $wdir = "";
-    } else {
-        $bdir = str_replace("/".basename($wdir),"",$wdir);
-        if($bdir == "/") {
-            $bdir = "";
-        }
-        print "<tr>\n<td colspan=\"5\">";
-        print "<a href=\"coursefiles.php?id=$id&amp;wdir=$bdir&amp;usecheckboxes=$usecheckboxes\" onclick=\"return reset_value();\">";
-        print "<img src=\"$CFG->wwwroot/lib/editor/htmlarea/images/folderup.gif\" height=\"14\" width=\"24\" border=\"0\" alt=\"".get_string('parentfolder')."\" />";
-        print "</a></td>\n</tr>\n";
-    }
-
-    $count = 0;
-
-    if (!empty($dirlist)) {
-        asort($dirlist);
-        foreach ($dirlist as $dir) {
-
-            $count++;
-
-            $filename = $fullpath."/".$dir;
-            $fileurl  = $wdir."/".$dir;
-            $filedate = userdate(filemtime($filename), "%d %b %Y, %I:%M %p");
-
-            echo "<tr>";
-
-            if ($usecheckboxes) {
-                print_cell("center", "<input type=\"checkbox\" name=\"file$count\" value=\"$fileurl\" onclick=\"return set_rename('$dir');\" />");
-            }
-            print_cell("left", "<a href=\"coursefiles.php?id=$id&amp;wdir=$fileurl\" onclick=\"return reset_value();\"><img src=\"$CFG->pixpath/f/folder.gif\" class=\"icon\" alt=\"".get_string('folder')."\" /></a> <a href=\"coursefiles.php?id=$id&amp;wdir=$fileurl&amp;usecheckboxes=$usecheckboxes\" onclick=\"return reset_value();\">".htmlspecialchars($dir)."</a>");
-            print_cell("right", "&nbsp;");
-            print_cell("right", $filedate);
-
-            echo "</tr>";
-        }
-    }
-
-
-    if (!empty($filelist)) {
-        asort($filelist);
-        foreach ($filelist as $file) {
-
-            $icon = mimeinfo("icon", $file);
-            $imgtype = mimeinfo("type",$file);
-
-            $count++;
-            $filename    = $fullpath."/".$file;
-            $fileurl     = "$wdir/$file";
-            $filedate    = userdate(filemtime($filename), "%d %b %Y, %I:%M %p");
-
-            $dimensions = get_image_size($filename);
-            if($dimensions) {
-                $imgwidth = $dimensions[0];
-                $imgheight = $dimensions[1];
-            } else {
-                $imgwidth = "Unknown";
-                $imgheight = "Unknown";
-            }
-            unset($dimensions);
-            echo "<tr>\n";
-
-            if ($usecheckboxes) {
-                print_cell("center", "<input type=\"checkbox\" name=\"file$count\" value=\"$fileurl\" onclick=\";return set_rename('$file');\" />");
-            }
-            echo "<td align=\"left\" nowrap=\"nowrap\">";
-            $ffurl = get_file_url($id.$fileurl);
-            link_to_popup_window ($ffurl, "display",
-                                  "<img src=\"$CFG->pixpath/f/$icon\" class=\"icon\" alt=\"$strfile\" />",
-                                  480, 640);
-            $file_size = filesize($filename);
-
-            echo "<a onclick=\"return set_value(info = {url: '".$ffurl."',";
-            echo " isize: '".$file_size."', itype: '".$imgtype."', iwidth: '".$imgwidth."',";
-            echo " iheight: '".$imgheight."', imodified: '".$filedate."' })\" href=\"#\">$file</a>";
-            echo "</td>\n";
-
-            if ($icon == "zip.gif") {
-                $edittext = "<a href=\"coursefiles.php?id=$id&amp;wdir=$wdir&amp;file=$fileurl&amp;action=unzip&amp;sesskey=$USER->sesskey\">$strunzip</a>&nbsp;";
-                $edittext .= "<a href=\"coursefiles.php?id=$id&amp;wdir=$wdir&amp;file=$fileurl&amp;action=listzip&amp;sesskey=$USER->sesskey\">$strlist</a> ";
-            } else {
-                $edittext = "&nbsp;";
-            }
-            print_cell("right", "$edittext ");
-            print_cell("right", $filedate);
-
-            echo "</tr>\n";
-        }
-    }
-    echo "</table>\n";
-
-    if (empty($wdir)) {
-        $wdir = "/";
-    }
-
-    echo "<table border=\"0\" cellspacing=\"2\" cellpadding=\"2\">\n";
-    echo "<tr>\n<td>";
-    echo "<input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
-    echo "<input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />\n";
-    echo "<input type=\"hidden\" name=\"sesskey\" value=\"$USER->sesskey\" />\n";
-    $options = array (
-                   "move" => "$strmovetoanotherfolder",
-                   "delete" => "$strdeletecompletely",
-                   "zip" => "$strcreateziparchive"
-               );
-    if (!empty($count)) {
-        choose_from_menu ($options, "action", "", "$strwithchosenfiles...", "javascript:getElementById('dirform').submit()");
-    }
-    if (!empty($USER->fileop) and ($USER->fileop == "move") and ($USER->filesource <> $wdir)) {
-        echo "<form action=\"coursefiles.php\" method=\"get\">\n";
-        echo " <input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
-        echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />\n";
-        echo " <input type=\"hidden\" name=\"action\" value=\"paste\" />\n";
-        echo " <input type=\"hidden\" name=\"sesskey\" value=\"$USER->sesskey\" />\n";
-        echo " <input type=\"submit\" value=\"$strmovefilestohere\" />\n";
-        echo "</form>";
-    }
-    echo "</td></tr>\n";
-    echo "</table>\n";
-    echo "</form>\n";
-}
-?>
diff --git a/lib/editor/htmlarea/dialog.js b/lib/editor/htmlarea/dialog.js
deleted file mode 100644 (file)
index 2a9f8a3..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-// $Id$
-// Though "Dialog" looks like an object, it isn't really an object.  Instead
-// it's just namespace for protecting global symbols.
-
-function Dialog(url, action, init) {
-    if (typeof init == "undefined") {
-        init = window;  // pass this window object by default
-    }
-    Dialog._geckoOpenModal(url, action, init);
-};
-
-Dialog._parentEvent = function(ev) {
-    if (Dialog._modal && !Dialog._modal.closed) {
-        Dialog._modal.focus();
-        HTMLArea._stopEvent(ev);
-    }
-};
-
-// should be a function, the return handler of the currently opened dialog.
-Dialog._return = null;
-
-// constant, the currently opened dialog
-Dialog._modal = null;
-
-// the dialog will read it's args from this variable
-Dialog._arguments = null;
-
-Dialog._geckoOpenModal = function(url, action, init) {
-
-    var file = url.substring(url.lastIndexOf('/') + 1, url.lastIndexOf('.'));
-    var x,y;
-    switch(file) {
-        case "insert_image": x = 730; y = 560; break;
-        case "dlg_ins_smile": x = 330; y = 320; break;
-        case "dlg_ins_char": x = 480; y = 290; break;
-        case "select_color": x = 238; y = 195; break;
-        case "insert_table": x = 420; y = 250; break;
-        case "link_std":     x = 420; y = 230; break;
-        case "insert_image_std": x = 450; y = 240; break;
-        case "createanchor": x = 300; y = 140; break;
-        case "searchandreplace": x = 400; y = 250; break;
-        default: x = 50; y = 50;
-    }
-
-    var lx = (screen.width - x) / 2;
-    var tx = (screen.height - y) / 2;
-    var dlg = window.open(url, "ha_dialog", "toolbar=no,menubar=no,personalbar=no, width="+ x +",height="+ y +",scrollbars=no,resizable=no, left="+ lx +", top="+ tx +"");
-    Dialog._modal = dlg;
-    Dialog._arguments = init;
-
-    // capture some window's events
-    function capwin(w) {
-        HTMLArea._addEvent(w, "click", Dialog._parentEvent);
-        HTMLArea._addEvent(w, "mousedown", Dialog._parentEvent);
-        HTMLArea._addEvent(w, "focus", Dialog._parentEvent);
-    };
-    // release the captured events
-    function relwin(w) {
-        HTMLArea._removeEvent(w, "click", Dialog._parentEvent);
-        HTMLArea._removeEvent(w, "mousedown", Dialog._parentEvent);
-        HTMLArea._removeEvent(w, "focus", Dialog._parentEvent);
-    };
-    capwin(window);
-    // capture other frames
-    if(document.all) {
-        for (var i = 0; i < window.frames.length; capwin(window.frames[i++]));
-    }
-    // make up a function to be called when the Dialog ends.
-    Dialog._return = function (val) {
-        relwin(window);
-        // capture other frames
-        if(document.all) {
-            for (var i = 0; i < window.frames.length; relwin(window.frames[i++]));
-        }
-        if (val && action) {
-            action(val);
-        }
-        Dialog._modal = null;
-    };
-};
diff --git a/lib/editor/htmlarea/htmlarea.class.php b/lib/editor/htmlarea/htmlarea.class.php
deleted file mode 100644 (file)
index f4f288c..0000000
+++ /dev/null
@@ -1,370 +0,0 @@
-<?php // $Id$
-
-/**
- * This file contains the htmlarea subclass for moodle editorObject.
- *
- * @author Janne Mikkonen
- * @version  $Id$
- * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
- * @package editorObject
- */
-class htmlarea extends editorObject {
-
-    /**
-    * Configuration array to hold configuration data.
-    * @var array $htmlareaconf
-    */
-    var $htmlareaconf = array();
-
-    /**
-    * Configuration keys array to store possible configuration keys.
-    * @var array $htmlareaconfkeys
-    */
-    var $htmlareaconfkeys = array("width","height","statusBar","undoSteps","undoTimeout",
-                                  "sizeIncludesToolbar","fullPage","pageStyle","killWordOnPaste",
-                                  "toolbar","fontname","fontsize","formatblock","customSelects");
-
-    /**
-    * An array to store valid value types that can
-    * be passed to specific configuration key.
-    * @var array $htmlareaconfkeytypes
-    */
-    var $htmlareaconfkeytypes = array('width' => 'string', 'height' => 'string', 'statusBar' => 'bool',
-                                      'undoSteps' => 'int', 'undoTimeout' => 'int',
-                                      'sizeIncludeToolbar' => 'bool', 'fullPage' => 'bool',
-                                      'pageStyle' => 'string', 'killWordOnPaste' => 'bool',
-                                      'toolbar' => 'array', 'fontname' => 'assoc', 'fontsize' => 'assoc',
-                                      'formatblock' => 'assoc', 'customSelects' => 'array');
-
-    /**
-    * Array of default configuration set via editor settings.
-    * @var array $defaults
-    */
-    var $defaults = array();
-
-    /**
-    * PHP4 style class constructor.
-    *
-    * @param int $courseid Courseid.
-    */
-    function htmlarea($courseid) {
-        parent::editorObject();
-        $this->courseid = clean_param($courseid, PARAM_INT);
-
-        $pagestyle  = 'body {';
-        $pagestyle .= !empty($this->cfg->editorbackgroundcolor) ?
-                             ' background-color: '. $this->cfg->editorbackgroundcolor .'; ' : '';
-        $pagestyle .= !empty($this->cfg->editorfontfamily) ?
-                             ' font-family: '. $this->cfg->editorfontfamily .';' : '';
-        $pagestyle .= !empty($this->cfg->editorfontsize) ?
-                             ' font-size: '. $this->cfg->editorfontsize .';' : '';
-        $pagestyle .= '}';
-
-        $this->defaults['pageStyle'] = $pagestyle;
-        $this->defaults['killWordOnPaste'] = !empty($this->cfg->editorkillword) ? true : false;
-
-        $fontlist = isset($this->cfg->editorfontlist) ? explode(';', $this->cfg->editorfontlist) : array();
-        $fonts = array();
-        foreach ( $fontlist as $fontline ) {
-            if ( !empty($fontline) ) {
-                list($fontkey, $fontvalue) = split(":", $fontline);
-                $fonts[$fontkey] = $fontvalue;
-            }
-        }
-        $this->defaults['fontname'] = $fonts;
-        $this->defaults['hideSomeButtons'] = !empty($this->cfg->editorhidebuttons) ?
-                                                    ' '. $this->cfg->editorhidebuttons .' ' : '';
-
-    }
-
-    /**
-    * PHP5 style class constructor.
-    * @param int $courseid Course id.
-    */
-    function __construct($courseid) {
-        $this->htmlarea($courseid);
-    }
-
-    /**
-    * Check if passed configuration key is valid.
-    * @param string $key
-    * @return bool Return true if key is valid and false if it's not.
-    */
-    function __is_valid_key($key) {
-        if ( in_array($key, $this->htmlareaconfkeys) ) {
-            return true;
-        }
-        return false;
-    }
-
-    /**
-    * Check if passed value's type is valid.
-    * @param string $key Configuration key name.
-    * @param mixed $value Configuration value.
-    * @return bool Returns true if value is valid type and false if it's not.
-    */
-    function __is_valid_value_type($key, $value) {
-
-        if ( !empty($this->htmlareaconfkeytypes[$key]) ) {
-            $keytype = $this->htmlareaconfkeytypes[$key];
-
-            switch ( $keytype ) {
-                case 'bool':
-                    if ( is_bool($value) ) {
-                        return true;
-                    }
-                break;
-                case 'string':
-                    if ( is_string($value) ) {
-                        return true;
-                    }
-                break;
-                case 'int':
-                    if ( is_int($value) ) {
-                        return true;
-                    }
-                break;
-                case 'array':
-                    if ( is_array($value) ) {
-                        return true;
-                    }
-                break;
-                case 'assoc':
-                    if ( is_array($value) ) {
-                        // Check first key.
-                        $key = key($value);
-                        if ( preg_match("/[a-z]+/i", $key) ) {
-                            return true;
-                        }
-                    }
-                break;
-                default:
-            }
-        }
-        return false;
-    }
-
-    /**
-    * Sets configuration key and value pairs.
-    * Passed parameters can be key and value pair or
-    * an associative array of keys and values.
-    * @todo code example
-    */
-    function setconfig() {
-
-        $numargs = func_num_args();
-
-        switch ( $numargs ) {
-            case 1: // Must be an array.
-                $args = func_get_arg(0);
-                if ( !is_array($args) ) {
-                    $this->error("Passed argument is not an array!!!");
-                }
-                foreach ( $args as $key => $value ) {
-                    if ( !preg_match("/[a-z]+/i", $key) && !$this->__is_valid_key($key) ) {
-                        $this->error("Invalid configuration key!!!");
-                    }
-                    if ( $this->__is_valid_value_type($key, $value) ) {
-                        $this->htmlareaconf[$key] = $value;
-                    } else {
-                        $this->error("Invalid key, value pair!!!");
-                    }
-                }
-            break;
-            case 2: // Must be key, value pair.
-                $key   = func_get_arg(0);
-                $value = func_get_arg(1);
-                if ( empty($key) or !isset($value) ) {
-                    $this->error("Empty key or value passed!!!");
-                }
-                if ( !preg_match("/[a-z]+/i", $key) ) {
-                    $this->error("Configuration key must be a string!!");
-                }
-
-                if ( !$this->__is_valid_key($key) ) {
-                    $this->error("Invalid configuration key!!!");
-                }
-
-                if ( $this->__is_valid_value_type($key, $value) ) {
-                    $this->htmlareaconf[$key] = $value;
-                } else {
-                    $this->error("Invalid key, value pair!!!");
-                }
-            break;
-            default:
-                if ( $numargs > 2 ) {
-                    $this->error("Too many arguments!!!");
-                }
-                if ( $numargs < 1 ) {
-                    $this->error("No arguments passed!!!");
-                }
-        }
-    }
-
-    /**
-    * For internal usage. Print out configuration arrays.
-    * @param string $conftype Type of configuration.
-    * @return void
-    */
-    function __printconfig($conftype='') {
-
-        $conf = NULL;
-        $assocs = array('fontname','fontsize','formatblocks');
-
-        switch( $conftype ) {
-            case 'merge': // New config overrides defaults if found.
-                $conf = array_merge($this->defaults,$this->htmlareaconf);
-            break;
-            case 'append': // Append mode leave default value if found.
-                $conf = $this->defaults;
-                $keys = array_keys($this->defaults);
-                foreach ( $this->htmlareaconf as $key => $value ) {
-                    if ( in_array($key, $keys) ) {
-                        continue;
-                    } else {
-                        $conf[$key] = $value;
-                    }
-                }
-            break;
-            case 'default': // Use only default config.
-                $conf = $this->defaults;
-            break;
-            default: // Print what's in htmlareaconf.
-                $conf = $this->htmlareaconf;
-        }
-
-        echo "\n";
-        echo '<script type="text/javascript" defer="defer">'."\n";
-        echo '//<![CDATA['."\n";
-        echo '    var config = new HTMLArea.Config();'."\n";
-
-        foreach ( $conf as $key => $value ) {
-
-            if ( empty($value) ) {
-                continue;
-            }
-
-            echo '    config.'. $key .' = ';
-            if ( is_bool($value) ) {
-                echo $value ? "true;\n" : "false;\n";
-            } else if ( in_array($key, $assocs) ) {
-
-                echo '{'."\n";
-                $cnt = 1;
-                foreach ( $value as $key => $value ) {
-                    if ( $cnt > 1 ) {
-                        echo ",\n";
-                    }
-                    echo "\t\"$key\" : \"$value\"";
-                    $cnt++;
-                }
-                echo ' };'."\n";
-
-            } else if ( $key == 'toolbar' ) {
-                // toolbar is array of arrays.
-                echo '['."\n";
-                $max = count($conf['toolbar']);
-                $cnt = 1;
-                foreach ( $conf['toolbar'] as $row ) {
-                    echo "\t" . '[ ';
-                    $count = count($row);
-                    for ( $i = 0; $i < $count; $i++ ) {
-                        if ( $i > 0 ) {
-                            echo ',';
-                        }
-                        if ( $i != 0 && ($i % 4) == 0 ) {
-                            echo "\n\t";
-                        }
-                        echo '"'. $row[$i] .'"';
-                    }
-                    if ( $cnt < $max ) {
-                        echo " ],\n";
-                    } else {
-                        echo " ]\n";
-                    }
-                    $cnt++;
-                }
-                echo "\t" . '];'. "\n";
-
-            } else {
-                echo '"'. $value .'"'. "\n";
-            }
-        }
-
-        if ( !empty($this->cfg->editorspelling) && !empty($this->cfg->aspellpath) ) {
-            echo "\n";
-            $this->print_speller_code(true);
-            echo "\n";
-        }
-
-        echo '    HTMLArea.replaceAll(config);'."\n";
-        echo '//]]>'."\n";
-        echo '</script>'."\n";
-
-    }
-
-    /**
-    * Print out code that start up the editor.
-    * @param string $conftype Configuration type to print.
-    */
-    function starteditor($configtype='') {
-        $this->__printconfig($configtype);
-    }
-
-    /**
-    * For backward compatibility only.
-    * @param string $name
-    * @param string $editorhidesomebuttons
-    */
-    function use_html_editor ( $name='', $editorhidebuttons='' ) {
-
-        if ( !empty($editorhidesomebuttons) ) {
-            $this->defaults['hideSomeButtons'] = $editorhidesomebuttons;
-        }
-
-        if (empty($name)) {
-            $this->starteditor('default');
-        } else {
-            $this->starteditor('default');
-        }
-
-        if ( !empty($this->cfg->editorsrc) ) {
-            unset($this->cfg->editorsrc);
-        }
-
-    }
-
-    /**
-    * Prints out needed code for spellchecking.
-    * @param bool $usehtmleditor
-    * @todo Deprecated? see lib/weblib.php::print_speller_code()
-    * @see lib/weblib.php::print_speller_code()
-    */
-    function print_speller_code ($usehtmleditor=false) {
-        echo "\n".'<script type="text/javascript">'."\n";
-        echo '//<![CDATA['."\n";
-        if (!$usehtmleditor) {
-            echo 'function openSpellChecker() {'."\n";
-            echo "\tvar speller = new spellChecker();\n";
-            echo "\tspeller.popUpUrl = \"" . $this->cfg->httpswwwroot ."/lib/speller/spellchecker.html\";\n";
-            echo "\tspeller.spellCheckScript = \"". $this->cfg->httpswwwroot ."/lib/speller/server-scripts/spellchecker.php\";\n";
-            echo "\tspeller.spellCheckAll();\n";
-            echo '}'."\n";
-        } else {
-            echo "\n\tfunction spellClickHandler(editor, buttonId) {\n";
-            echo "\t\teditor._textArea.value = editor.getHTML();\n";
-            echo "\t\tvar speller = new spellChecker( editor._textArea );\n";
-            echo "\t\tspeller.popUpUrl = \"" . $this->cfg->httpswwwroot ."/lib/speller/spellchecker.html\";\n";
-            echo "\t\tspeller.spellCheckScript = \"". $this->cfg->httpswwwroot ."/lib/speller/server-scripts/spellchecker.php\";\n";
-            echo "\t\tspeller._moogle_edit=1;\n";
-            echo "\t\tspeller._editor=editor;\n";
-            echo "\t\tspeller.openChecker();\n\t";
-            echo '}'."\n";
-        }
-        echo '//]]>'."\n";
-        echo '</script>'."\n";
-
-    }
-
-}
-?>
diff --git a/lib/editor/htmlarea/htmlarea.css b/lib/editor/htmlarea/htmlarea.css
deleted file mode 100644 (file)
index 23bdf7d..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-.htmlarea { background: #fff; }
-
-.htmlarea .toolbar {
-  cursor: default;
-  background: ButtonFace;
-  padding: 1px 1px 2px 1px;
-  border: 1px solid;
-  border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
-}
-.htmlarea .toolbar table { font-family: tahoma,verdana,sans-serif; font-size: 11px; }
-.htmlarea .toolbar img { border: none; }
-.htmlarea .toolbar .label { padding: 0px 3px; }
-
-.htmlarea .toolbar .button {
-  background: ButtonFace;
-  color: ButtonText;
-  border: 1px solid ButtonFace;
-  padding: 1px;
-  margin: 0px;
-}
-.htmlarea .toolbar .buttonHover {
-  border: 1px solid;
-  border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
-}
-.htmlarea .toolbar .buttonActive, .htmlarea .toolbar .buttonPressed {
-  padding: 2px 0px 0px 2px;
-  border: 1px solid;
-  border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
-}
-.htmlarea .toolbar .buttonPressed {
-  background: ButtonHighlight;
-}
-.htmlarea .toolbar .indicator {
-  padding: 0px 3px;
-  overflow: hidden;
-  width: 20px;
-  text-align: center;
-  cursor: default;
-  border: 1px solid ButtonShadow;
-}
-
-.htmlarea .toolbar .buttonDisabled { background-color: #aaa; }
-
-.htmlarea .toolbar .buttonDisabled img {
-  filter: alpha(opacity = 25);
-  -moz-opacity: 25%;
-}
-
-.htmlarea .toolbar .separator {
-  position: relative;
-  margin: 3px;
-  border-left: 1px solid ButtonShadow;
-  border-right: 1px solid ButtonHighlight;
-  width: 0px;
-  height: 16px;
-  padding: 0px;
-}
-
-.htmlarea .toolbar .space { width: 5px; }
-
-.htmlarea .toolbar select { font: 11px Tahoma,Verdana,sans-serif; }
-
-.htmlarea .toolbar select,
-.htmlarea .toolbar select:hover,
-.htmlarea .toolbar select:active { background: FieldFace; color: ButtonText; }
-
-.htmlarea .statusBar {
-  border: 1px solid;
-  border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
-  padding: 2px 4px;
-  background-color: ButtonFace;
-  color: ButtonText;
-  font: 11px Tahoma,Verdana,sans-serif;
-}
-
-.htmlarea .statusBar .statusBarTree a {
-  padding: 2px 5px;
-  color: #00f;
-}
-
-.htmlarea .statusBar .statusBarTree a:visited { color: #00f; }
-.htmlarea .statusBar .statusBarTree a:hover {
-  background-color: Highlight;
-  color: HighlightText;
-  padding: 1px 4px;
-  border: 1px solid HighlightText;
-}
-
-
-/* Hidden DIV popup dialogs (PopupDiv) */
-
-.dialog {
-  color: ButtonText;
-  background: ButtonFace;
-}
-
-.dialog .content { padding: 2px; }
-
-.dialog, .dialog button, .dialog input, .dialog select, .dialog textarea, .dialog table {
-  font: 11px Tahoma,Verdana,sans-serif;
-}
-
-.dialog table { border-collapse: collapse; }
-
-.dialog .title {
-  background: #008;
-  color: #ff8;
-  border-bottom: 1px solid #000;
-  padding: 1px 0px 2px 5px;
-  font-size: 12px;
-  font-weight: bold;
-  cursor: default;
-}
-
-.dialog .title .button {
-  float: right;
-  border: 1px solid #66a;
-  padding: 0px 1px 0px 2px;
-  margin-right: 1px;
-  color: #fff;
-  text-align: center;
-}
-
-.dialog .title .button-hilite { border-color: #88f; background: #44c; }
-
-.dialog button {
-  width: 5em;
-  padding: 0px;
-}
-
-.dialog .buttonColor {
-  padding: 1px;
-  cursor: default;
-  border: 1px solid;
-  border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
-}
-
-.dialog .buttonColor-hilite {
-  border-color: #000;
-}
-
-.dialog .buttonColor .chooser, .dialog .buttonColor .nocolor {
-  height: 0.6em;
-  border: 1px solid;
-  padding: 0px 1em;
-  border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
-}
-
-.dialog .buttonColor .nocolor { padding: 0px; }
-.dialog .buttonColor .nocolor-hilite { background-color: #fff; color: #f00; }
-
-.dialog .label { text-align: right; width: 6em; }
-.dialog .value input { width: 100%; }
-.dialog .buttons { text-align: right; padding: 2px 4px 0px 4px; }
-
-.dialog legend { font-weight: bold; }
-.dialog fieldset table { margin: 2px 0px; }
-
-.popupdiv {
-  border: 2px solid;
-  border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
-}
-
-.popupwin {
-  padding: 0px;
-  margin: 0px;
-}
-
-.popupwin .title {
-  background: #fff;
-  color: #000;
-  font-weight: bold;
-  font-size: 120%;
-  padding: 3px 10px;
-  margin-bottom: 10px;
-  border-bottom: 1px solid black;
-  letter-spacing: 2px;
-}
-
-form { margin: 0px; border: none; }
diff --git a/lib/editor/htmlarea/htmlarea.php b/lib/editor/htmlarea/htmlarea.php
deleted file mode 100644 (file)
index 5c2c1aa..0000000
+++ /dev/null
@@ -1,2822 +0,0 @@
-<?php
-    include("../../../config.php");
-    require_once($CFG->dirroot.'/lib/languages.php');
-
-    $id            = optional_param('id', SITEID, PARAM_INT);
-    $httpsrequired = optional_param('httpsrequired', 0, PARAM_BOOL); //flag indicating editor on page with required https
-
-    require_course_login($id);
-
-    $lastmodified = filemtime("htmlarea.php");
-    $lifetime = 1800;
-
-    // Commenting this out since it's creating problems
-    // where solution seem to be hard to find...
-    // http://moodle.org/mod/forum/discuss.php?d=34376
-    //if ( function_exists('ob_gzhandler') ) {
-    //    ob_start("ob_gzhandler");
-    //}
-
-    header("Content-type: application/x-javascript; charset: utf-8");  // Correct MIME type
-    header("Last-Modified: " . gmdate("D, d M Y H:i:s", $lastmodified) . " GMT");
-    header("Expires: " . gmdate("D, d M Y H:i:s", time() + $lifetime) . " GMT");
-    header("Cache-control: max_age = $lifetime");
-    header("Pragma: ");
-
-    $lang = current_language();
-
-    if (empty($lang)) {
-        $lang = "en";
-    }
-
-    if ($httpsrequired) {
-        // this is an ugly hack to allow partial operation of editor on pages that require https when loginhttps enabled
-        // please note that some popups still show nonsecurre items and fullscreen may not function properly in IE
-        $url = preg_replace('|https?://[^/]+|', '', $CFG->wwwroot).'/lib/editor/htmlarea/';
-    } else {
-        $url = $CFG->wwwroot.'/lib/editor/htmlarea/';
-    }
-
-    $strheading = get_string("heading", "editor");
-    $strnormal = get_string("normal", "editor");
-    $straddress = get_string("address", "editor");
-    $strpreformatted = get_string("preformatted", "editor");
-    $strlang = get_string('lang', 'editor');
-    $strmulti = get_string('multi', 'editor');
-?>
-
-// htmlArea v3.0 - Copyright (c) 2002, 2003 interactivetools.com, inc.
-// This copyright notice MUST stay intact for use (see license.txt).
-//
-// Portions (c) dynarch.com, 2003-2004
-//
-// A free WYSIWYG editor replacement for <textarea> fields.
-// For full source code and docs, visit http://www.interactivetools.com/
-//
-// Version 3.0 developed by Mihai Bazon.
-//   http://dynarch.com/mishoo
-//
-// $Id$
-
-if (typeof _editor_url == "string") {
-    // Leave exactly one backslash at the end of _editor_url
-    _editor_url = _editor_url.replace(/\x2f*$/, '/');
-} else {
-    //alert("WARNING: _editor_url is not set!  You should set this variable to the editor files path; it should preferably be an absolute path, like in '/htmlarea', but it can be relative if you prefer.  Further we will try to load the editor files correctly but we'll probably fail.");
-    _editor_url = '<?php echo $url; ?>';// we need relative path to site root for editor in pages wit hrequired https
-}
-
-// make sure we have a language
-if (typeof _editor_lang == "string") {
-    _editor_lang = "en"; // should always be english in moodle.
-} else {
-    _editor_lang = "en";
-}
-
-// Creates a new HTMLArea object.  Tries to replace the textarea with the given
-// ID with it.
-function HTMLArea(textarea, config) {
-    if (HTMLArea.checkSupportedBrowser()) {
-        if (typeof config == "undefined") {
-            this.config = new HTMLArea.Config();
-        } else {
-            this.config = config;
-        }
-        this._htmlArea = null;
-        this._textArea = textarea;
-        this._editMode = "wysiwyg";
-        this.plugins = {};
-        this._timerToolbar = null;
-        this._timerUndo = null;
-        this._undoQueue = new Array(this.config.undoSteps);
-        this._undoPos = -1;
-        this._customUndo = true;
-        this._mdoc = document; // cache the document, we need it in plugins
-        this.doctype = '';
-        this.dropdowns = [];   // Array of select elements in the toolbar
-    }
-};
-
-// load some scripts
-(function() {
-    var scripts = HTMLArea._scripts = [ _editor_url + "htmlarea.js",
-                        _editor_url + "dialog.js",
-                        _editor_url + "popupwin.js" ];
-    var head = document.getElementsByTagName("head")[0];
-    // start from 1, htmlarea.js is already loaded
-    for (var i = 1; i < scripts.length; ++i) {
-        var script = document.createElement("script");
-        script.src = scripts[i];
-        head.appendChild(script);
-    }
-})();
-
-// cache some regexps
-HTMLArea.RE_tagName = /(<\/|<)\s*([^ \t\n>]+)/ig;
-HTMLArea.RE_doctype = /(<!doctype((.|\n)*?)>)\n?/i;
-HTMLArea.RE_head    = /<head>((.|\n)*?)<\/head>/i;
-HTMLArea.RE_body    = /<body>((.|\n)*?)<\/body>/i;
-HTMLArea.RE_blocktag = /^(h1|h2|h3|h4|h5|h6|p|address|pre)$/i;
-HTMLArea.RE_junktag = /^\/($|\/)/;
-// Hopefully a complete list of tags that MSIEs parser will consider
-// as possible content tags. Retrieved from
-// http://www.echoecho.com/htmlreference.htm
-HTMLArea.RE_msietag  = /^\/?(a|abbr|acronym|address|applet|area|b|base|basefont|bdo|bgsound|big|blink|blockquote|body|br|button|caption|center|cite|code|col|colgroup|comment|dd|del|dfn|dir|div|dl|dt|em|embed|fieldset|font|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|hr|html|i|iframe|ilayer|img|input|ins|isindex|kbd|keygen|label|layer|legend|li|link|map|marquee|menu|meta|multicol|nobr|noembed|noframes|nolayer|noscript|object|ol|optgroup|option|p|param|plaintext|pre|q|s|samp|script|select|server|small|spacer|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|title|tr|tt|u|ul|var)$/i
-
-HTMLArea.Config = function () {
-    this.version = "3.0";
-
-    this.width = "auto";
-    this.height = "auto";
-
-    // enable creation of a status bar?
-    this.statusBar = true;
-
-    // maximum size of the undo queue
-    this.undoSteps = 20;
-
-    // the time interval at which undo samples are taken
-    this.undoTimeout = 500; // 1/2 sec.
-
-    // the next parameter specifies whether the toolbar should be included
-    // in the size or not.
-    this.sizeIncludesToolbar = true;
-
-    // if true then HTMLArea will retrieve the full HTML, starting with the
-    // <HTML> tag.
-    this.fullPage = false;
-
-    // style included in the iframe document
-    this.pageStyle = "body { background-color: #fff; font-family: 'Times New Roman', Times; } \n .lang { background-color: #dee; }";
-
-    // set to true if you want Word code to be cleaned upon Paste
-    this.killWordOnPaste = true;
-
-    // BaseURL included in the iframe document
-    this.baseURL = document.baseURI || document.URL;
-    if (this.baseURL && this.baseURL.match(/(.*)\/([^\/]+)/))
-        this.baseURL = RegExp.$1 + "/";
-
-    // URL-s
-    this.imgURL = "images/";
-    this.popupURL = "popups/";
-
-    this.toolbar = [
-        [ "fontname", "space",
-          "fontsize", "space",
-          "formatblock", "space",
-          "language", "space",
-          "bold", "italic", "underline", "strikethrough", "separator",
-          "subscript", "superscript", "separator",
-          "clean", "separator", "undo", "redo" ],
-
-        [ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator",
-          "lefttoright", "righttoleft", "separator",
-          "insertorderedlist", "insertunorderedlist", "outdent", "indent", "separator",
-          "forecolor", "hilitecolor", "separator",
-          "inserthorizontalrule", "createanchor", "createlink", "unlink", "nolink", "separator",
-          "insertimage", "inserttable",
-          "insertsmile", "insertchar", "search_replace",
-          <?php if (!empty($CFG->aspellpath) && file_exists($CFG->aspellpath) && !empty($CFG->editorspelling)) {
-              echo '"separator","spellcheck",';
-            } ?>
-          "separator", "htmlmode", "separator", "popupeditor"]
-    ];
-
-    this.fontname = {
-        "Arial":       'arial,helvetica,sans-serif',
-        "Courier New":     'courier new,courier,monospace',
-        "Georgia":     'georgia,times new roman,times,serif',
-        "Tahoma":      'tahoma,arial,helvetica,sans-serif',
-        "Times New Roman": 'times new roman,times,serif',
-        "Verdana":     'verdana,arial,helvetica,sans-serif',
-        "Impact":           'impact',
-        "WingDings":       'wingdings'
-    };
-
-    this.fontsize = {
-        "1 (8 pt)":  "1",
-        "2 (10 pt)": "2",
-        "3 (12 pt)": "3",
-        "4 (14 pt)": "4",
-        "5 (18 pt)": "5",
-        "6 (24 pt)": "6",
-        "7 (36 pt)": "7"
-    };
-
-    this.formatblock = {
-        "":"",
-        "<?php echo $strheading ?> 1": "h1",
-        "<?php echo $strheading ?> 2": "h2",
-        "<?php echo $strheading ?> 3": "h3",
-        "<?php echo $strheading ?> 4": "h4",
-        "<?php echo $strheading ?> 5": "h5",
-        "<?php echo $strheading ?> 6": "h6",
-        "<?php echo $strnormal ?>": "p",
-        "<?php echo $straddress ?>": "address",
-        "<?php echo $strpreformatted ?>": "pre"
-    };
-
-    this.language = {
-        "<?php echo $strlang; ?>":"",
-        <?php
-        $strlangarray = '';
-        foreach ($LANGUAGES as $key => $name) {
-            $key = str_replace('_', '-', $key);
-            $strlangarray .= '"'.$key.'": "'.$key.'",';
-        }
-        $strlangarray .= '"'.$strmulti.'": "multi",';
-
-        foreach ($LANGUAGES as $key => $name) {
-            $key = str_replace('_', '-', $key);
-            $strlangarray .= '"'.$key.' ": "'.$key.'_ML",';
-        }
-        $strlangarray = substr($strlangarray, 0, -1);
-        echo $strlangarray;
-        ?>
-    };
-
-    this.customSelects = {};
-
-    function cut_copy_paste(e, cmd, obj) {
-        e.execCommand(cmd);
-    };
-
-    this.btnList = {
-        bold: [ "Bold", "ed_format_bold.gif", false, function(e) {e.execCommand("bold");} ],
-        italic: [ "Italic", "ed_format_italic.gif", false, function(e) {e.execCommand("italic");} ],
-        underline: [ "Underline", "ed_format_underline.gif", false, function(e) {e.execCommand("underline");} ],
-        strikethrough: [ "Strikethrough", "ed_format_strike.gif", false, function(e) {e.execCommand("strikethrough");} ],
-        subscript: [ "Subscript", "ed_format_sub.gif", false, function(e) {e.execCommand("subscript");} ],
-        superscript: [ "Superscript", "ed_format_sup.gif", false, function(e) {e.execCommand("superscript");} ],
-        justifyleft: [ "Justify Left", "ed_align_left.gif", false, function(e) {e.execCommand("justifyleft");} ],
-        justifycenter: [ "Justify Center", "ed_align_center.gif", false, function(e) {e.execCommand("justifycenter");} ],
-        justifyright: [ "Justify Right", "ed_align_right.gif", false, function(e) {e.execCommand("justifyright");} ],
-        justifyfull: [ "Justify Full", "ed_align_justify.gif", false, function(e) {e.execCommand("justifyfull");} ],
-        insertorderedlist: [ "Ordered List", "ed_list_num.gif", false, function(e) {e.execCommand("insertorderedlist");} ],
-        insertunorderedlist: [ "Bulleted List", "ed_list_bullet.gif", false, function(e) {e.execCommand("insertunorderedlist");} ],
-        outdent: [ "Decrease Indent", "ed_indent_less.gif", false, function(e) {e.execCommand("outdent");} ],
-        indent: [ "Increase Indent", "ed_indent_more.gif", false, function(e) {e.execCommand("indent");} ],
-        forecolor: [ "Font Color", "ed_color_fg.gif", false, function(e) {e.execCommand("forecolor");} ],
-        hilitecolor: [ "Background Color", "ed_color_bg.gif", false, function(e) {e.execCommand("hilitecolor");} ],
-        inserthorizontalrule: [ "Horizontal Rule", "ed_hr.gif", false, function(e) {e.execCommand("inserthorizontalrule");} ],
-        createanchor: [ "Create anchor", "ed_anchor.gif", false, function(e) {e.execCommand("createanchor", true);} ],
-        createlink: [ "Insert Web Link", "ed_link.gif", false, function(e) {e.execCommand("createlink", true);} ],
-        unlink: [ "Remove Link", "ed_unlink.gif", false, function(e) {e.execCommand("unlink");} ],
-        nolink: [ "No link", "ed_nolink.gif", false, function(e) {e.execCommand("nolink");} ],
-        insertimage: [ "Insert/Modify Image", "ed_image.gif", false, function(e) {e.execCommand("insertimage");} ],
-        inserttable: [ "Insert Table", "insert_table.gif", false, function(e) {e.execCommand("inserttable");} ],
-        htmlmode: [ "Toggle HTML Source", "ed_html.gif", true, function(e) {e.execCommand("htmlmode");} ],
-        popupeditor: [ "Enlarge Editor", "fullscreen_maximize.gif", true, function(e) {e.execCommand("popupeditor");} ],
-        about: [ "About this editor", "ed_about.gif", true, function(e) {e.execCommand("about");} ],
-        showhelp: [ "Help using editor", "ed_help.gif", true, function(e) {e.execCommand("showhelp");} ],
-        undo: [ "Undoes your last action", "ed_undo.gif", false, function(e) {e.execCommand("undo");} ],
-        redo: [ "Redoes your last action", "ed_redo.gif", false, function(e) {e.execCommand("redo");} ],
-        clean: [ "Clean Word HTML", "ed_wordclean.gif", false, function(e) {e.execCommand("killword"); }],
-        lefttoright: [ "Direction left to right", "ed_left_to_right.gif", false, function(e) {e.execCommand("lefttoright");} ],
-        righttoleft: [ "Direction right to left", "ed_right_to_left.gif", false, function(e) {e.execCommand("righttoleft");} ],
-        <?php if (!empty($CFG->aspellpath) && file_exists($CFG->aspellpath) && !empty($CFG->editorspelling)) {
-            echo 'spellcheck: ["Spell-check", "spell-check.gif", false, spellClickHandler ],'."\n";
-        }?>
-        insertsmile: ["Insert Smiley", "em.icon.smile.gif", false, function(e) {e.execCommand("insertsmile");} ],
-        insertchar: [ "Insert Char", "icon_ins_char.gif", false, function(e) {e.execCommand("insertchar");} ],
-        search_replace: [ "Search and replace", "ed_replace.gif", false, function(e) {e.execCommand("searchandreplace");} ]
-    };
-
-    // initialize tooltips from the I18N module and generate correct image path
-    for (var i in this.btnList) {
-        var btn = this.btnList[i];
-        btn[1] = _editor_url + this.imgURL + btn[1];
-        if (typeof HTMLArea.I18N.tooltips[i] != "undefined") {
-            btn[0] = HTMLArea.I18N.tooltips[i];
-        }
-    }
-};
-
-HTMLArea.Config.prototype.registerButton = function(id, tooltip, image, textMode, action, context) {
-    var the_id;
-    if (typeof id == "string") {
-        the_id = id;
-    } else if (typeof id == "object") {
-        the_id = id.id;
-    } else {
-        alert("ERROR [HTMLArea.Config::registerButton]:\ninvalid arguments");
-        return false;
-    }
-    // check for existing id
-    if (typeof this.customSelects[the_id] != "undefined") {
-        // alert("WARNING [HTMLArea.Config::registerDropdown]:\nA dropdown with the same ID already exists.");
-    }
-    if (typeof this.btnList[the_id] != "undefined") {
-        // alert("WARNING [HTMLArea.Config::registerDropdown]:\nA button with the same ID already exists.");
-    }
-    switch (typeof id) {
-        case "string": this.btnList[id] = [ tooltip, image, textMode, action, context ]; break;
-        case "object": this.btnList[id.id] = [ id.tooltip, id.image, id.textMode, id.action, id.context ]; break;
-    }
-};
-
-HTMLArea.Config.prototype.registerDropdown = function(object) {
-    // check for existing id
-    if (typeof this.customSelects[object.id] != "undefined") {
-        // alert("WARNING [HTMLArea.Config::registerDropdown]:\nA dropdown with the same ID already exists.");
-    }
-    if (typeof this.btnList[object.id] != "undefined") {
-        // alert("WARNING [HTMLArea.Config::registerDropdown]:\nA button with the same ID already exists.");
-    }
-    this.customSelects[object.id] = object;
-};
-
-HTMLArea.Config.prototype.hideSomeButtons = function(remove) {
-    var toolbar = this.toolbar;
-    for (var i in toolbar) {
-        var line = toolbar[i];
-        for (var j = line.length; --j >= 0; ) {
-            if (remove.indexOf(" " + line[j] + " ") >= 0) {
-                var len = 1;
-                if (/separator|space/.test(line[j + 1])) {
-                    len = 2;
-                }
-                line.splice(j, len);
-            }
-        }
-    }
-};
-
-/** Helper function: replace all TEXTAREA-s in the document with HTMLArea-s. */
-HTMLArea.replaceAll = function(config) {
-    var tas = document.getElementsByTagName("textarea");
-    for (var i = tas.length; i > 0; (new HTMLArea(tas[--i], config)).generate());
-};
-
-/** Helper function: replaces the TEXTAREA with the given ID with HTMLArea. */
-HTMLArea.replace = function(id, config) {
-    var ta = HTMLArea.getElementById("textarea", id);
-    return ta ? (new HTMLArea(ta, config)).generate() : null;
-};
-
-// Creates the toolbar and appends it to the _htmlarea
-HTMLArea.prototype._createToolbar = function () {
-    var editor = this;  // to access this in nested functions
-
-    var toolbar = document.createElement("div");
-    this._toolbar = toolbar;
-    toolbar.className = "toolbar";
-    toolbar.unselectable = "1";
-    var tb_row = null;
-    var tb_objects = new Object();
-    this._toolbarObjects = tb_objects;
-
-    // creates a new line in the toolbar
-    function newLine() {
-        var table = document.createElement("table");
-        table.border = "0px";
-        table.cellSpacing = "0px";
-        table.cellPadding = "0px";
-        toolbar.appendChild(table);
-        // TBODY is required for IE, otherwise you don't see anything
-        // in the TABLE.
-        var tb_body = document.createElement("tbody");
-        table.appendChild(tb_body);
-        tb_row = document.createElement("tr");
-        tb_body.appendChild(tb_row);
-    }; // END of function: newLine
-    // init first line
-    newLine();
-
-    function setButtonStatus(id, newval) {
-        var oldval = this[id];
-        var el = this.element;
-        if (oldval != newval) {
-            switch (id) {
-                case "enabled":
-                if (newval) {
-                    HTMLArea._removeClass(el, "buttonDisabled");
-                    el.disabled = false;
-                } else {
-                    HTMLArea._addClass(el, "buttonDisabled");
-                    el.disabled = true;
-                }
-                break;
-                case "active":
-                if (newval) {
-                    HTMLArea._addClass(el, "buttonPressed");
-                } else {
-                    HTMLArea._removeClass(el, "buttonPressed");
-                }
-                break;
-            }
-            this[id] = newval;
-        }
-    }; // END of function: setButtonStatus
-
-    function createSelect(txt) {
-        var options = null;
-        var el = null;
-        var cmd = null;
-        var customSelects = editor.config.customSelects;
-        var context = null;
-        switch (txt) {
-            case "fontsize":
-            case "fontname":
-            case "formatblock":
-            case "language":
-            options = editor.config[txt];
-            cmd = txt;
-            break;
-            default:
-            // try to fetch it from the list of registered selects
-            cmd = txt;
-            var dropdown = customSelects[cmd];
-            if (typeof dropdown != "undefined") {
-                options = dropdown.options;
-                context = dropdown.context;
-            } else {
-                alert("ERROR [createSelect]:\nCan't find the requested dropdown definition");
-            }
-            break;
-        }
-        if (options) {
-            el = document.createElement("select");
-            var obj = {
-                name    : txt, // field name
-                element : el,   // the UI element (SELECT)
-                enabled : true, // is it enabled?
-                text    : false, // enabled in text mode?
-                cmd : cmd, // command ID
-                state   : setButtonStatus, // for changing state
-                context : context
-            };
-            tb_objects[txt] = obj;
-            for (var i in options) {
-                var op = document.createElement("option");
-                op.appendChild(document.createTextNode(i));
-                op.value = options[i];
-                el.appendChild(op);
-            }
-            HTMLArea._addEvent(el, "change", function () {
-                editor._comboSelected(el, txt);
-            });
-        }
-        editor.dropdowns[txt] = el;  // Keep track of the element for keyboard
-                                     // access later.
-        return el;
-    }; // END of function: createSelect
-
-    // appends a new button to toolbar
-    function createButton(txt) {
-        // the element that will be created
-        var el = null;
-        var btn = null;
-        switch (txt) {
-            case "separator":
-            el = document.createElement("div");
-            el.className = "separator";
-            break;
-            case "space":
-            el = document.createElement("div");
-            el.className = "space";
-            break;
-            case "linebreak":
-            newLine();
-            return false;
-            case "textindicator":
-            el = document.createElement("div");
-            el.appendChild(document.createTextNode("A"));
-            el.className = "indicator";
-            el.title = HTMLArea.I18N.tooltips.textindicator;
-            var obj = {
-                name    : txt, // the button name (i.e. 'bold')
-                element : el, // the UI element (DIV)
-                enabled : true, // is it enabled?
-                active  : false, // is it pressed?
-                text    : false, // enabled in text mode?
-                cmd : "textindicator", // the command ID
-                state   : setButtonStatus // for changing state
-            };
-            tb_objects[txt] = obj;
-            break;
-            default:
-            btn = editor.config.btnList[txt];
-        }
-        if (!el && btn) {
-            el = document.createElement("div");
-            el.title = btn[0];
-            el.className = "button";
-            // let's just pretend we have a button object, and
-            // assign all the needed information to it.
-            var obj = {
-                name    : txt, // the button name (i.e. 'bold')
-                element : el, // the UI element (DIV)
-                enabled : true, // is it enabled?
-                active  : false, // is it pressed?
-                text    : btn[2], // enabled in text mode?
-                cmd : btn[3], // the command ID
-                state   : setButtonStatus, // for changing state
-                context : btn[4] || null // enabled in a certain context?
-            };
-            tb_objects[txt] = obj;
-            // handlers to emulate nice flat toolbar buttons
-            HTMLArea._addEvent(el, "mouseover", function () {
-                if (obj.enabled) {
-                    HTMLArea._addClass(el, "buttonHover");
-                }
-            });
-            HTMLArea._addEvent(el, "mouseout", function () {
-                if (obj.enabled) with (HTMLArea) {
-                    _removeClass(el, "buttonHover");
-                    _removeClass(el, "buttonActive");
-                    (obj.active) && _addClass(el, "buttonPressed");
-                }
-            });
-            HTMLArea._addEvent(el, "mousedown", function (ev) {
-                if (obj.enabled) with (HTMLArea) {
-                    _addClass(el, "buttonActive");
-                    _removeClass(el, "buttonPressed");
-                    _stopEvent(is_ie ? window.event : ev);
-                }
-            });
-            // when clicked, do the following:
-            HTMLArea._addEvent(el, "click", function (ev) {
-                if (obj.enabled) with (HTMLArea) {
-                    _removeClass(el, "buttonActive");
-                    _removeClass(el, "buttonHover");
-                    obj.cmd(editor, obj.name, obj);
-                    _stopEvent(is_ie ? window.event : ev);
-                }
-            });
-            var img = document.createElement("img");
-            img.src = btn[1];
-            img.style.width = "18px";
-            img.style.height = "18px";
-            el.appendChild(img);
-        } else if (!el) {
-            el = createSelect(txt);
-        }
-        if (el) {
-            var tb_cell = document.createElement("td");
-            tb_row.appendChild(tb_cell);
-            tb_cell.appendChild(el);
-        } else {
-            alert("FIXME: Unknown toolbar item: " + txt);
-        }
-        return el;
-    };
-
-    var first = true;
-    for (var i in this.config.toolbar) {
-        if (this.config.toolbar.propertyIsEnumerable(i)) { // fix for prototype.js compatibility
-        if (!first) {
-            createButton("linebreak");
-        } else {
-            first = false;
-        }
-        var group = this.config.toolbar[i];
-        for (var j in group) {
-                if (group.propertyIsEnumerable(j)) { // fix for prototype.js compatibility
-            var code = group[j];
-            if (/^([IT])\[(.*?)\]/.test(code)) {
-                // special case, create text label
-                var l7ed = RegExp.$1 == "I"; // localized?
-                var label = RegExp.$2;
-                if (l7ed) {
-                    label = HTMLArea.I18N.custom[label];
-                }
-                var tb_cell = document.createElement("td");
-                tb_row.appendChild(tb_cell);
-                tb_cell.className = "label";
-                tb_cell.innerHTML = label;
-            } else {
-                createButton(code);
-                    }
-                }
-            }
-        }
-    }
-
-    this._htmlArea.appendChild(toolbar);
-};
-
-HTMLArea.prototype._createStatusBar = function() {
-    var statusbar = document.createElement("div");
-    statusbar.className = "statusBar";
-    this._htmlArea.appendChild(statusbar);
-    this._statusBar = statusbar;
-    // statusbar.appendChild(document.createTextNode(HTMLArea.I18N.msg["Path"] + ": "));
-    // creates a holder for the path view
-    div = document.createElement("span");
-    div.className = "statusBarTree";
-    div.innerHTML = HTMLArea.I18N.msg["Path"] + ": ";
-    this._statusBarTree = div;
-    this._statusBar.appendChild(div);
-    if (!this.config.statusBar) {
-        // disable it...
-        statusbar.style.display = "none";
-    }
-};
-
-// Creates the HTMLArea object and replaces the textarea with it.
-HTMLArea.prototype.generate = function () {
-    var editor = this;  // we'll need "this" in some nested functions
-
-    // get the textarea
-    var textarea = this._textArea;
-    if (typeof textarea == "string") {
-        // it's not element but ID
-        this._textArea = textarea = HTMLArea.getElementById("textarea", textarea);
-    }
-    // Fix for IE's sticky bug. Editor doesn't load
-    // editing area.
-    var height;
-    if ( textarea.offsetHeight && textarea.offsetHeight > 0 ) {
-        height = textarea.offsetHeight;
-    } else {
-        height = 300;
-    }
-    this._ta_size = {
-        w: textarea.offsetWidth,
-        h: height
-    };
-    textarea.style.display = "none";
-
-    // create the editor framework
-    var htmlarea = document.createElement("div");
-    htmlarea.className = "htmlarea";
-    this._htmlArea = htmlarea;
-
-    // insert the editor before the textarea.
-    //Bug fix - unless the textarea is nested within its label, in which case insert editor before label.
-    if (textarea.parentNode.nodeName.toLowerCase()=='label') {
-        textarea.parentNode.parentNode.insertBefore(htmlarea,textarea.parentNode);
-    }
-    else {
-        textarea.parentNode.insertBefore(htmlarea, textarea);
-    }
-
-    if (textarea.form) {
-        // we have a form, on submit get the HTMLArea content and
-        // update original textarea.
-        var f = textarea.form;
-        if (typeof f.onsubmit == "function") {
-            var funcref = f.onsubmit;
-            if (typeof f.__msh_prevOnSubmit == "undefined") {
-                f.__msh_prevOnSubmit = [];
-            }
-            f.__msh_prevOnSubmit.push(funcref);
-        }
-        f.onsubmit = function() {
-            // Moodle hack. Bug fix #2736
-            var test = editor.getHTML();
-            test = test.replace(/<br \/>/gi, '');
-            test = test.replace(/\&nbsp\;/gi, '');
-            test = test.trim();
-            //alert(test + test.length);
-            if (test.length < 1) {
-                editor._textArea.value = test.trim();
-            } else {
-                editor._textArea.value = editor.getHTML();
-            }
-            // Moodle hack end.
-            var a = this.__msh_prevOnSubmit;
-            var ret = true;
-            // call previous submit methods if they were there.
-            if (typeof a != "undefined") {
-                for (var i = a.length; --i >= 0;) {
-                    ret = a[i]() && ret;
-                }
-            }
-            return ret;
-        };
-        if (typeof f.onreset == "function") {
-            var funcref = f.onreset;
-            if (typeof f.__msh_prevOnReset == "undefined") {
-                f.__msh_prevOnReset = [];
-            }
-            f.__msh_prevOnReset.push(funcref);
-        }
-        f.onreset = function() {
-            editor.setHTML(editor._textArea.value);
-            editor.updateToolbar();
-            var a = this.__msh_prevOnReset;
-            // call previous reset methods if they were there.
-            if (typeof a != "undefined") {
-                for (var i = a.length; --i >= 0;) {
-                    a[i]();
-                }
-            }
-        };
-    }
-
-    // add a handler for the "back/forward" case -- on body.unload we save
-    // the HTML content into the original textarea.
-    try {
-    window.onunload = function() {
-        editor._textArea.value = editor.getHTML();
-    };
-    } catch(e) {};
-
-    // creates & appends the toolbar
-    this._createToolbar();
-
-    // create the IFRAME
-    var iframe = document.createElement("iframe");
-
-    iframe.src = "about:blank";
-
-    iframe.className = "iframe";
-
-    htmlarea.appendChild(iframe);
-
-    var editor = this
-    editor._iframe = iframe;
-    var doc = editor._iframe.contentWindow.document;
-    editor._doc = doc;
-
-    // Generate iframe content
-    var html = ""
-    if (!editor.config.fullPage) {
-        html = "<html>\n";
-        html += "<head>\n";
-        html += '<meta http-equiv="content-type" content="text/html; charset=utf-8" />\n';
-        if (editor.config.baseURL)
-            html += '<base href="' + editor.config.baseURL + '" />';
-        html += '<style type="text/css">\n' + editor.config.pageStyle + "td { border: 1px dotted gray; } body { direction: <?php echo get_string('thisdirection')?>; } </style>\n"; // RTL support: direction added for RTL support
-        html += "</head>\n";
-        html += '<body>\n';
-        html += editor._textArea.value;
-        html = html.replace(/<nolink>/gi, '<span class="nolink">').
-                    replace(/<\/nolink>/gi, '</span>');
-        html += "</body>\n";
-        html += "</html>";
-    } else {
-        html = editor._textArea.value;
-        if (html.match(HTMLArea.RE_doctype)) {
-            editor.setDoctype(RegExp.$1);
-            html = html.replace(HTMLArea.RE_doctype, "");
-        }
-    }
-
-    // Write content to iframe
-    doc.open();
-    doc.write(html);
-    doc.close();
-
-    // The magic: onClick the designMode is set to 'on'
-    // This one is for click on HTMLarea toolbar and else
-    if(HTMLArea.is_gecko) {
-        HTMLArea._addEvents(
-          this._htmlArea,
-          ["mousedown"],
-          function(event) {
-            if(editor.designModeIsOn != true)
-            {
-                editor.designModeIsOn = true;
-                try {
-                  doc.designMode = "on";
-                } catch (e) {
-                  alert(e)
-                };
-            }
-          }
-        );
-
-        // This one is for click in iframe
-        HTMLArea._addEvents(
-          editor._iframe.contentWindow,
-          ["mousedown"],
-          function(event) {
-            if(editor.designModeIsOn != true)
-            {
-                editor.designModeIsOn = true;
-                try {
-                  doc.designMode = "on";
-                } catch (e) {
-                  alert(e)
-                };
-            }
-          }
-        );
-    }
-    // creates & appends the status bar, if the case
-    this._createStatusBar();
-
-    // remove the default border as it keeps us from computing correctly
-    // the sizes.  (somebody tell me why doesn't this work in IE)
-
-    if (!HTMLArea.is_ie) {
-        iframe.style.borderWidth = "1px";
-    }
-
-    // size the IFRAME according to user's prefs or initial textarea
-    var height = (this.config.height == "auto" ? (this._ta_size.h) : this.config.height);
-    height = parseInt(height);
-    var width = (this.config.width == "auto" ? (this._toolbar.offsetWidth) : this.config.width);
-    width = (width == 0 ? 598 : width);
-    //width = Math.max(parseInt(width), 598);
-
-    width = String(width);
-    if (width.match(/^\d+$/)) { // is this a pure int? if so, let it be in px, and remove 2px
-        height -= 2;
-        width  -= 2;
-        width=width+"px";
-    }
-
-    iframe.style.width = width;
-
-    if (this.config.sizeIncludesToolbar) {
-        // substract toolbar height
-        height -= this._toolbar.offsetHeight;
-        height -= this._statusBar.offsetHeight;
-    }
-    if (height < 0) {
-        height = 0;
-    }
-    iframe.style.height = height + "px";
-
-    // the editor including the toolbar now have the same size as the
-    // original textarea.. which means that we need to reduce that a bit.
-    textarea.style.width = iframe.style.width;
-    textarea.style.height = iframe.style.height;
-
-    if (HTMLArea.is_ie) {
-        doc.body.contentEditable = true;
-    }
-
-    // intercept some events; for updating the toolbar & keyboard handlers
-    HTMLArea._addEvents
-          (doc, ["keydown", "keypress", "mousedown", "mouseup", "drag"],
-          function (event) {
-              return editor._editorEvent(HTMLArea.is_ie ? editor._iframe.contentWindow.event : event);
-          });
-
-    // check if any plugins have registered refresh handlers
-    for (var i in editor.plugins) {
-        var plugin = editor.plugins[i].instance;
-        if (typeof plugin.onGenerate == "function") {
-            plugin.onGenerate();
-        }
-        if (typeof plugin.onGenerateOnce == "function") {
-            plugin.onGenerateOnce();
-            plugin.onGenerateOnce = null;
-        }
-    }
-
-    // Moodle fix for bug Bug #2521 Too long statusbar line in IE
-    //
-    //setTimeout(function() {
-    //    editor.updateToolbar();
-    //}, 250);
-
-    if (typeof editor.onGenerate == "function") {
-        editor.onGenerate();
-    }
-};
-
-
-// Switches editor mode; parameter can be "textmode" or "wysiwyg".  If no
-// parameter was passed this function toggles between modes.
-HTMLArea.prototype.setMode = function(mode) {
-    if (typeof mode == "undefined") {
-        mode = ((this._editMode == "textmode") ? "wysiwyg" : "textmode");
-    }
-    switch (mode) {
-        case "textmode":
-        this._textArea.value = this.getHTML();
-        this._iframe.style.display = "none";
-        this._textArea.style.display = "block";
-        if (this.config.statusBar) {
-            while(this._statusBar.childNodes.length>0) {
-                this._statusBar.removeChild(this._statusBar.childNodes[0]);
-            }
-
-            this._statusBar.appendChild(document.createTextNode(HTMLArea.I18N.msg["TEXT_MODE"]));
-        }
-        break;
-        case "wysiwyg":
-        if (HTMLArea.is_gecko) {
-            // disable design mode before changing innerHTML
-            try {
-            this._doc.designMode = "off";
-            } catch(e) {};
-        }
-        if (!this.config.fullPage)
-            this._doc.body.innerHTML = this.getHTML();
-        else
-            this.setFullHTML(this.getHTML());
-        this._iframe.style.display = "block";
-        this._textArea.style.display = "none";
-        if (HTMLArea.is_gecko) {
-            // we need to refresh that info for Moz-1.3a
-            try {
-            this._doc.designMode = "on";
-            //this._doc.focus();
-            } catch(e) {};
-        }
-        if (this.config.statusBar) {
-            this._statusBar.innerHTML = '';
-            this._statusBar.appendChild(this._statusBarTree);
-        }
-        break;
-        default:
-        alert("Mode <" + mode + "> not defined!");
-        return false;
-    }
-    this._editMode = mode;
-    this.focusEditor();
-};
-
-HTMLArea.prototype.setFullHTML = function(html) {
-    var save_multiline = RegExp.multiline;
-    RegExp.multiline = true;
-    if (html.match(HTMLArea.RE_doctype)) {
-        this.setDoctype(RegExp.$1);
-        html = html.replace(HTMLArea.RE_doctype, "");
-    }
-    RegExp.multiline = save_multiline;
-    if (!HTMLArea.is_ie) {
-        if (html.match(HTMLArea.RE_head))
-            this._doc.getElementsByTagName("head")[0].innerHTML = RegExp.$1;
-        if (html.match(HTMLArea.RE_body))
-            this._doc.getElementsByTagName("body")[0].innerHTML = RegExp.$1;
-    } else {
-        var html_re = /<html>((.|\n)*?)<\/html>/i;
-        html = html.replace(html_re, "$1");
-        this._doc.open();
-        this._doc.write(html);
-        this._doc.close();
-        this._doc.body.contentEditable = true;
-        return true;
-    }
-};
-
-// Category: PLUGINS
-
-HTMLArea.prototype.registerPlugin2 = function(plugin, args) {
-    if (typeof plugin == "string")
-        plugin = eval(plugin);
-    var obj = new plugin(this, args);
-    if (obj) {
-        var clone = {};
-        var info = plugin._pluginInfo;
-        for (var i in info)
-            clone[i] = info[i];
-        clone.instance = obj;
-        clone.args = args;
-        this.plugins[plugin._pluginInfo.name] = clone;
-    } else
-        alert("Can't register plugin " + plugin.toString() + ".");
-};
-
-// Create the specified plugin and register it with this HTMLArea
-HTMLArea.prototype.registerPlugin = function() {
-    var plugin = arguments[0];
-    var args = [];
-    for (var i = 1; i < arguments.length; ++i)
-        args.push(arguments[i]);
-    this.registerPlugin2(plugin, args);
-};
-
-HTMLArea.loadPlugin = function(pluginName) {
-    var dir = _editor_url + "plugins/" + pluginName;
-    var plugin = pluginName.replace(/([a-z])([A-Z])([a-z])/g,
-                    function (str, l1, l2, l3) {
-                        return l1 + "-" + l2.toLowerCase() + l3;
-                    }).toLowerCase() + ".js";
-    var plugin_file = dir + "/" + plugin;
-    var plugin_lang = dir + "/lang/" + HTMLArea.I18N.lang + ".js";
-    HTMLArea._scripts.push(plugin_file, plugin_lang);
-    document.write("<script type='text/javascript' src='" + plugin_file + "'></script>");
-    document.write("<script type='text/javascript' src='" + plugin_lang + "'></script>");
-};
-
-HTMLArea.loadStyle = function(style, plugin) {
-    var url = _editor_url || '';
-    if (typeof plugin != "undefined") {
-        url += "plugins/" + plugin + "/";
-    }
-    url += style;
-    document.write("<style type='text/css'>@import url(" + url + ");</style>");
-};
-HTMLArea.loadStyle("htmlarea.css");
-
-// Category: EDITOR UTILITIES
-
-// The following function is a slight variation of the word cleaner code posted
-// by Weeezl (user @ InteractiveTools forums).
-HTMLArea.prototype._wordClean = function() {
-    this._unnestBlocks();
-
-    var D = this.getInnerHTML();
-    if (/[Mm]so/.test(D)) {
-
-        // make one line
-        D = D.replace(/\r\n/g, '\[br\]').
-            replace(/\n/g, '').
-            replace(/\r/g, '').
-            replace(/\&nbsp\;/g,' ');
-
-        // keep tags, strip attributes
-        D = D.replace(/ class=[^\s|>]*/gi,'').
-            //replace(/<p [^>]*TEXT-ALIGN: justify[^>]*>/gi,'<p align="justify">').
-            replace(/ style=\"[^>]*\"/gi,'').
-            replace(/ align=[^\s|>]*/gi,'');
-
-        //clean up tags
-        D = D.replace(/<b [^>]*>/gi,'<b>').
-            replace(/<i [^>]*>/gi,'<i>').
-            replace(/<li [^>]*>/gi,'<li>').
-            replace(/<ul [^>]*>/gi,'<ul>');
-
-        // replace outdated tags
-        D = D.replace(/<b>/gi,'<strong>').
-            replace(/<\/b>/gi,'</strong>');
-
-        // mozilla doesn't like <em> tags
-        D = D.replace(/<em>/gi,'<i>').
-            replace(/<\/em>/gi,'</i>');
-
-        // kill unwanted tags
-        D = D.replace(/<\?xml:[^>]*>/g, '').       // Word xml
-            replace(/<\/?st1:[^>]*>/g,'').     // Word SmartTags
-            replace(/<\/?[a-z]\:[^>]*>/g,'').  // All other funny Word non-HTML stuff
-            replace(/<\/?personname[^>]*>/gi,'').
-            replace(/<\/?font[^>]*>/gi,'').    // Disable if you want to keep font formatting
-            replace(/<\/?span[^>]*>/gi,' ').
-            replace(/<\/?div[^>]*>/gi,' ').
-            replace(/<\/?pre[^>]*>/gi,' ').
-            replace(/<(\/?)(h[1-6]+)[^>]*>/gi,'<$1$2>');
-
-        // Lorenzo Nicola's addition
-        // to get rid off silly word generated tags.
-        D = D.replace(/<!--\[[^\]]*\]-->/gi,' ');
-
-        //remove empty tags
-        //D = D.replace(/<strong><\/strong>/gi,'').
-        //replace(/<i><\/i>/gi,'').
-        //replace(/<P[^>]*><\/P>/gi,'');
-        D = D.replace(/<h[1-6]+>\s?<\/h[1-6]+>/gi, ''); // Remove empty headings
-
-        // nuke double tags
-        oldlen = D.length + 1;
-        while(oldlen > D.length) {
-            oldlen = D.length;
-            // join us now and free the tags, we'll be free hackers, we'll be free... ;-)
-            D = D.replace(/<([a-z][a-z]*)> *<\/\1>/gi,' ').
-                replace(/<([a-z][a-z]*)> *<([a-z][^>]*)> *<\/\1>/gi,'<$2>');
-        }
-        D = D.replace(/<([a-z][a-z]*)><\1>/gi,'<$1>').
-            replace(/<\/([a-z][a-z]*)><\/\1>/gi,'<\/$1>');
-
-        // nuke double spaces
-        D = D.replace(/  */gi,' ');
-
-        // Split into lines and remove
-        // empty lines and add carriage returns back
-        var splitter  = /\[br\]/g;
-        var emptyLine = /^\s+\s+$/g;
-        var strHTML   = '';
-        var toLines   = D.split(splitter);
-        for (var i = 0; i < toLines.length; i++) {
-            var line = toLines[i];
-            if (line.length < 1) {
-                continue;
-            }
-
-            if (emptyLine.test(line)) {
-                continue;
-            }
-
-            line = line.replace(/^\s+\s+$/g, '');
-            strHTML += line + '\n';
-        }
-        D = strHTML;
-        strHTML = '';
-
-        this.setHTML(D);
-        this.updateToolbar();
-    }
-};
-
-HTMLArea.prototype._unnestBlockWalk = function(node, unnestingParent) {
-    if (HTMLArea.RE_blocktag.test(node.nodeName)) {
-       if (unnestingParent) {
-           if (node.nextSibling) {
-               var splitNode = this._doc.createElement(unnestingParent.nodeName.toLowerCase());
-               while (node.nextSibling) {
-                   splitNode.appendChild(node.nextSibling);
-               }
-               unnestingParent.parentNode.insertBefore(splitNode, unnestingParent.nextSibling);
-           }
-           unnestingParent.parentNode.insertBefore(node, unnestingParent.nextSibling);
-           return;
-       }
-       else if (node.firstChild) {
-           this._unnestBlockWalk(node.firstChild, node);
-       }
-    } else {
-       if (node.firstChild) {
-           this._unnestBlockWalk(node.firstChild, null);
-       }
-    }
-    if (node.nextSibling) {
-       this._unnestBlockWalk(node.nextSibling, unnestingParent);
-    }
-}
-
-HTMLArea.prototype._unnestBlocks = function() {
-    this._unnestBlockWalk(this._doc.documentElement, null);
-}
-
-HTMLArea.prototype.forceRedraw = function() {
-    this._doc.body.style.visibility = "hidden";
-    this._doc.body.style.visibility = "visible";
-    // this._doc.body.innerHTML = this.getInnerHTML();
-};
-
-// focuses the iframe window.  returns a reference to the editor document.
-HTMLArea.prototype.focusEditor = function() {
-    switch (this._editMode) {
-        case "wysiwyg" : this._iframe.contentWindow.focus(); break;
-        case "textmode": this._textArea.focus(); break;
-        default    : alert("ERROR: mode " + this._editMode + " is not defined");
-    }
-    return this._doc;
-};
-
-// takes a snapshot of the current text (for undo)
-HTMLArea.prototype._undoTakeSnapshot = function() {
-    ++this._undoPos;
-    if (this._undoPos >= this.config.undoSteps) {
-        // remove the first element
-        this._undoQueue.shift();
-        --this._undoPos;
-    }
-    // use the fasted method (getInnerHTML);
-    var take = true;
-    var txt = this.getInnerHTML();
-    if (this._undoPos > 0)
-        take = (this._undoQueue[this._undoPos - 1] != txt);
-    if (take) {
-        this._undoQueue[this._undoPos] = txt;
-    } else {
-        this._undoPos--;
-    }
-};
-
-HTMLArea.prototype.undo = function() {
-    if (this._undoPos > 0) {
-        var txt = this._undoQueue[--this._undoPos];
-        if (txt) this.setHTML(txt);
-        else ++this._undoPos;
-    }
-};
-
-HTMLArea.prototype.redo = function() {
-    if (this._undoPos < this._undoQueue.length - 1) {
-        var txt = this._undoQueue[++this._undoPos];
-        if (txt) this.setHTML(txt);
-        else --this._undoPos;
-    }
-};
-
-// updates enabled/disable/active state of the toolbar elements
-HTMLArea.prototype.updateToolbar = function(noStatus) {
-    var doc = this._doc;
-    var text = (this._editMode == "textmode");
-    var ancestors = null;
-    if (!text) {
-        ancestors = this.getAllAncestors();
-        if (this.config.statusBar && !noStatus) {
-
-            while(this._statusBarTree.childNodes.length>0) {
-                this._statusBarTree.removeChild(this._statusBarTree.childNodes[0]);
-            }
-
-            this._statusBarTree.appendChild(document.createTextNode(HTMLArea.I18N.msg["Path"] + ": "));
-
-            for (var i = ancestors.length; --i >= 0;) {
-                var el = ancestors[i];
-                if (!el) {
-                    // hell knows why we get here; this
-                    // could be a classic example of why
-                    // it's good to check for conditions
-                    // that are impossible to happen ;-)
-                    continue;
-                }
-                var a = document.createElement("a");
-                a.href = "#";
-                a.el = el;
-                a.editor = this;
-                a.onclick = function() {
-                    this.blur();
-                    this.editor.selectNodeContents(this.el);
-                    this.editor.updateToolbar(true);
-                    return false;
-                };
-                a.oncontextmenu = function() {
-                    // TODO: add context menu here
-                    this.blur();
-                    var info = "Inline style:\n\n";
-                    info += this.el.style.cssText.split(/;\s*/).join(";\n");
-                    alert(info);
-                    return false;
-                };
-                var txt = el.tagName.toLowerCase();
-                a.title = el.style.cssText;
-                if (el.id) {
-                    txt += "#" + el.id;
-                }
-                if (el.className) {
-                    txt += "." + el.className;
-                }
-                a.appendChild(document.createTextNode(txt));
-                this._statusBarTree.appendChild(a);
-                if (i != 0) {
-                    this._statusBarTree.appendChild(document.createTextNode(String.fromCharCode(0xbb)));
-                }
-            }
-        }
-    }
-    for (var i in this._toolbarObjects) {
-        var btn = this._toolbarObjects[i];
-        var cmd = i;
-        var inContext = true;
-        if (btn.context && !text) {
-            inContext = false;
-            var context = btn.context;
-            var attrs = [];
-            if (/(.*)\[(.*?)\]/.test(context)) {
-                context = RegExp.$1;
-                attrs = RegExp.$2.split(",");
-            }
-            context = context.toLowerCase();
-            var match = (context == "*");
-            for (var k in ancestors) {
-                if (!ancestors[k]) {
-                    // the impossible really happens.
-                    continue;
-                }
-                if (match || (ancestors[k].tagName.toLowerCase() == context)) {
-                    inContext = true;
-                    for (var ka in attrs) {
-                        if (!eval("ancestors[k]." + attrs[ka])) {
-                            inContext = false;
-                            break;
-                        }
-                    }
-                    if (inContext) {
-                        break;
-                    }
-                }
-            }
-        }
-        btn.state("enabled", (!text || btn.text) && inContext);
-        if (typeof cmd == "function") {
-            continue;
-        }
-        // look-it-up in the custom dropdown boxes
-        var dropdown = this.config.customSelects[cmd];
-        if ((!text || btn.text) && (typeof dropdown != "undefined")) {
-            dropdown.refresh(this);
-            continue;
-        }
-        switch (cmd) {
-            case "fontname":
-            case "fontsize":
-            case "formatblock":
-                if (!text) try {
-                    var value = ("" + doc.queryCommandValue(cmd)).toLowerCase();
-                    if (!value) {
-                        // FIXME: what do we do here?
-                        break;
-                    }
-                    var options = this.config[cmd];
-                    var k = 0;
-                    // btn.element.selectedIndex = 0;
-                    for (var j in options) {
-                        // FIXME: the following line is scary.
-                        if ((j.toLowerCase() == value) ||
-                            (options[j].substr(0, value.length).toLowerCase() == value)) {
-                            btn.element.selectedIndex = k;
-                            break;
-                        }
-                        ++k;
-                    }
-                } catch(e) {};
-                break;
-            case "language":
-                if (!text) try {
-                    var value;
-                    parentEl = this.getParentElement();
-                    if (parentEl.getAttribute('lang')) {
-                        // A language was previously defined for the block.
-                        if (parentEl.getAttribute('class') == 'multilang') {
-                            value = parentEl.getAttribute('lang')+'_ML';
-                        } else {
-                            value = parentEl.getAttribute('lang');
-                        }
-                    } else {
-                        value = '';
-                    }
-                    var options = this.config[cmd];
-                    var k = 0;
-                    for (var j in options) {
-                        // FIXME: the following line is scary.
-                        if ((j.toLowerCase() == value) ||
-                            (options[j].substr(0, value.length).toLowerCase() == value)) {
-                            btn.element.selectedIndex = k;
-                            break;
-                        }
-                        ++k;
-                    }
-                } catch(e) {};
-                break;
-            case "textindicator":
-                if (!text) {
-                    try {with (btn.element.style) {
-                        backgroundColor = HTMLArea._makeColor(
-                            doc.queryCommandValue(HTMLArea.is_ie ? "backcolor" : "hilitecolor"));
-                        if (/transparent/i.test(backgroundColor)) {
-                            // Mozilla
-                            backgroundColor = HTMLArea._makeColor(doc.queryCommandValue("backcolor"));
-                        }
-                        color = HTMLArea._makeColor(doc.queryCommandValue("forecolor"));
-                        fontFamily = doc.queryCommandValue("fontname");
-                        fontWeight = doc.queryCommandState("bold") ? "bold" : "normal";
-                        fontStyle = doc.queryCommandState("italic") ? "italic" : "normal";
-                    }} catch (e) {
-                        // alert(e + "\n\n" + cmd);
-                    }
-                }
-                break;
-            case "htmlmode": btn.state("active", text); break;
-            case "lefttoright":
-            case "righttoleft":
-                var el = this.getParentElement();
-                while (el && !HTMLArea.isBlockElement(el))
-                    el = el.parentNode;
-                if (el)
-                    btn.state("active", (el.style.direction == ((cmd == "righttoleft") ? "rtl" : "ltr")));
-                break;
-            default:
-                try {
-                    btn.state("active", (!text && doc.queryCommandState(cmd)));
-                } catch (e) {}
-        }
-    }
-    // take undo snapshots
-    if (this._customUndo && !this._timerUndo) {
-        this._undoTakeSnapshot();
-        var editor = this;
-        this._timerUndo = setTimeout(function() {
-            editor._timerUndo = null;
-        }, this.config.undoTimeout);
-    }
-    // check if any plugins have registered refresh handlers
-    for (var i in this.plugins) {
-        var plugin = this.plugins[i].instance;
-        if (typeof plugin.onUpdateToolbar == "function")
-            plugin.onUpdateToolbar();
-    }
-};
-
-/** Returns a node after which we can insert other nodes, in the current
- * selection.  The selection is removed.  It splits a text node, if needed.
- */
-HTMLArea.prototype.insertNodeAtSelection = function(toBeInserted) {
-    if (!HTMLArea.is_ie) {
-        var sel = this._getSelection();
-        var range = this._createRange(sel);
-        // remove the current selection
-        sel.removeAllRanges();
-        range.deleteContents();
-        var node = range.startContainer;
-        var pos = range.startOffset;
-        switch (node.nodeType) {
-            case 3: // Node.TEXT_NODE
-            // we have to split it at the caret position.
-            if (toBeInserted.nodeType == 3) {
-                // do optimized insertion
-                node.insertData(pos, toBeInserted.data);
-                range = this._createRange();
-                range.setEnd(node, pos + toBeInserted.length);
-                range.setStart(node, pos + toBeInserted.length);
-                sel.addRange(range);
-            } else {
-                node = node.splitText(pos);
-                var selnode = toBeInserted;
-                if (toBeInserted.nodeType == 11 /* Node.DOCUMENT_FRAGMENT_NODE */) {
-                    selnode = selnode.firstChild;
-                }
-                node.parentNode.insertBefore(toBeInserted, node);
-                this.selectNodeContents(selnode);
-                this.updateToolbar();
-            }
-            break;
-            case 1: // Node.ELEMENT_NODE
-            var selnode = toBeInserted;
-            if (toBeInserted.nodeType == 11 /* Node.DOCUMENT_FRAGMENT_NODE */) {
-                selnode = selnode.firstChild;
-            }
-            node.insertBefore(toBeInserted, node.childNodes[pos]);
-            this.selectNodeContents(selnode);
-            this.updateToolbar();
-            break;
-        }
-    } else {
-        return null;    // this function not yet used for IE <FIXME>
-    }
-};
-
-// Returns the deepest node that contains both endpoints of the selection.
-HTMLArea.prototype.getParentElement = function() {
-    var sel = this._getSelection();
-    var range = this._createRange(sel);
-    if (HTMLArea.is_ie) {
-        switch (sel.type) {
-            case "Text":
-            case "None":
-            return range.parentElement();
-            case "Control":
-            return range.item(0);
-            default:
-            return this._doc.body;
-        }
-    } else try {
-        var p = range.commonAncestorContainer;
-        if (!range.collapsed && range.startContainer == range.endContainer &&
-            range.startOffset - range.endOffset <= 1 && range.startContainer.hasChildNodes())
-            p = range.startContainer.childNodes[range.startOffset];
-        /*
-        alert(range.startContainer + ":" + range.startOffset + "\n" +
-              range.endContainer + ":" + range.endOffset);
-        */
-        while (p.nodeType == 3) {
-            p = p.parentNode;
-        }
-        return p;
-    } catch (e) {
-        return null;
-    }
-};
-
-// Returns an array with all the ancestor nodes of the selection.
-HTMLArea.prototype.getAllAncestors = function() {
-    var p = this.getParentElement();
-    var a = [];
-    while (p && (p.nodeType == 1) && (p.tagName.toLowerCase() != 'body')) {
-        a.push(p);
-        p = p.parentNode;
-    }
-    a.push(this._doc.body);
-    return a;
-};
-
-// Selects the contents inside the given node
-HTMLArea.prototype.selectNodeContents = function(node, pos) {
-    this.focusEditor();
-    this.forceRedraw();
-    var range;
-    var collapsed = (typeof pos != "undefined");
-    if (HTMLArea.is_ie) {
-        range = this._doc.body.createTextRange();
-        range.moveToElementText(node);
-        (collapsed) && range.collapse(pos);
-        range.select();
-    } else {
-        var sel = this._getSelection();
-        range = this._doc.createRange();
-        range.selectNodeContents(node);
-        (collapsed) && range.collapse(pos);
-        sel.removeAllRanges();
-        sel.addRange(range);
-    }
-};
-
-// Call this function to insert HTML code at the current position.  It deletes
-// the selection, if any.
-HTMLArea.prototype.insertHTML = function(html) {
-    var sel = this._getSelection();
-    var range = this._createRange(sel);
-    if (HTMLArea.is_ie) {
-        range.pasteHTML(html);
-    } else {
-        // construct a new document fragment with the given HTML
-        var fragment = this._doc.createDocumentFragment();
-        var div = this._doc.createElement("div");
-        div.innerHTML = html;
-        while (div.firstChild) {
-            // the following call also removes the node from div
-            fragment.appendChild(div.firstChild);
-        }
-        // this also removes the selection
-        var node = this.insertNodeAtSelection(fragment);
-    }
-};
-
-// Call this function to surround the existing HTML code in the selection with
-// your tags.  FIXME: buggy!  This function will be deprecated "soon".
-HTMLArea.prototype.surroundHTML = function(startTag, endTag) {
-    var html = this.getSelectedHTML();
-    // the following also deletes the selection
-    this.insertHTML(startTag + html + endTag);
-};
-
-/// Retrieve the selected block
-HTMLArea.prototype.getSelectedHTML = function() {
-    var sel = this._getSelection();
-    var range = this._createRange(sel);
-    var existing = null;
-    if (HTMLArea.is_ie) {
-        existing = range.htmlText;
-    } else {
-        existing = HTMLArea.getHTML(range.cloneContents(), false, this);
-    }
-    return existing;
-};
-
-/// Return true if we have some selection
-HTMLArea.prototype.hasSelectedText = function() {
-    // FIXME: come _on_ mishoo, you can do better than this ;-)
-    return this.getSelectedHTML() != '';
-};
-
-HTMLArea.prototype._createLink = function(link) {
-    var editor = this;
-    var allinks = editor._doc.getElementsByTagName('A');
-    var anchors = new Array();
-    for(var i = 0; i < allinks.length; i++) {
-        var attrname = allinks[i].getAttribute('name');
-        if((HTMLArea.is_ie ? attrname.length > 0 : attrname != null)) {
-            anchors[i] = allinks[i].getAttribute('name');
-        }
-    }
-    var outparam = null;
-    if (typeof link == "undefined") {
-        link = this.getParentElement();
-        if (link && !/^a$/i.test(link.tagName)) {
-            if(link.tagName.toLowerCase() != 'img') {
-                link = null;
-                var sel = this._getSelection();
-                var rng = this._createRange(sel);
-                var len = HTMLArea.is_ie ? rng.text.toString().length : sel.toString().length;
-                if(len < 1) {
-                    alert("<?php print_string("alertnoselectedtext","editor");?>");
-                    return false;
-                }
-            }
-            link = null;
-        }
-    }
-    if (link) {
-        outparam = {
-        f_href   : HTMLArea.is_ie ? editor.stripBaseURL(link.href) : link.getAttribute("href"),
-        f_title  : link.title,
-        f_target : link.target,
-        f_anchors: anchors
-    };
-    } else {
-        outparam = {
-        f_anchors:anchors };
-    }
-    this._popupDialog("link_std.php?id=<?php echo $id; ?>", function(param) {
-        if (!param) {
-            return false;
-        }
-        var a = link;
-        if (!a) {
-            // Create a temporary unique link, insert it then find it and set the correct parameters
-            var tmpLink = 'http://www.moodle.org/'+Math.random();
-            var elm = editor._doc.execCommand("createlink",false,tmpLink);
-            var links=editor._doc.getElementsByTagName("a");
-            for(var i=0;i<links.length;i++){
-                var link=links[i];
-                if(link.href==tmpLink) {
-                    link.href=param.f_href.trim();
-                    if(param.f_target){
-                        link.target=param.f_target.trim();
-                    }
-                    if(param.f_title){
-                        link.title=param.f_title.trim();
-                    }
-                    break;
-                }
-            }
-        } else {
-            var href = param.f_href.trim();
-            editor.selectNodeContents(a);
-            if (href == "") {
-                editor._doc.execCommand("unlink", false, null);
-                editor.updateToolbar();
-                return false;
-            } else {
-                a.href = href;
-            }
-        }
-        if (!(a && /^a$/i.test(a.tagName))) {
-            return false;
-        }
-        a.target = param.f_target.trim();
-        a.title = param.f_title.trim();
-        editor.selectNodeContents(a);
-        editor.updateToolbar();
-    }, outparam);
-};
-
-// Called when the user clicks on "InsertImage" button.  If an image is already
-// there, it will just modify it's properties.
-HTMLArea.prototype._insertImage = function(image) {
-
-    // Make sure that editor has focus
-    this.focusEditor();
-    var editor = this;  // for nested functions
-    var outparam = null;
-    if (typeof image == "undefined") {
-        image = this.getParentElement();
-        if (image && !/^img$/i.test(image.tagName))
-            image = null;
-    }
-    if (image) outparam = {
-        f_url    : HTMLArea.is_ie ? editor.stripBaseURL(image.src) : image.getAttribute("src"),
-        f_alt    : image.alt,
-        f_border : image.border,
-        f_align  : image.align,
-        f_vert   : image.vspace,
-        f_horiz  : image.hspace,
-        f_width  : image.width,
-        f_height : image.height
-    };
-    this._popupDialog("<?php
-    if(!empty($id) and has_capability('moodle/course:managefiles', get_context_instance(CONTEXT_COURSE, $id))) {
-        echo "insert_image.php?id=$id";
-    } else {
-        echo "insert_image_std.php?id=$id";
-    }?>", function(param) {
-        if (!param) {   // user must have pressed Cancel
-            return false;
-        }
-        var img = image;
-        if (!img) {
-            var sel = editor._getSelection();
-            var range = editor._createRange(sel);
-                if (HTMLArea.is_ie) {
-                editor._doc.execCommand("insertimage", false, param.f_url);
-                }
-            if (HTMLArea.is_ie) {
-                img = range.parentElement();
-                // wonder if this works...
-                if (img.tagName.toLowerCase() != "img") {
-                    img = img.previousSibling;
-                }
-            } else {
-                // MOODLE HACK: startContainer.perviousSibling
-                // Doesn't work so we'll use createElement and
-                // insertNodeAtSelection
-                //img = range.startContainer.previousSibling;
-                var img = editor._doc.createElement("img");
-                img.setAttribute("src",""+ param.f_url +"");
-                img.setAttribute("alt",""+ param.f_alt +"");
-                editor.insertNodeAtSelection(img);
-            }
-        } else {
-            img.src = param.f_url;
-        }
-        for (field in param) {
-            var value = param[field];
-            switch (field) {
-                case "f_alt"    : img.alt    = value; img.title = value; break;
-                case "f_border" : img.border = parseInt(value || "0"); break;
-                case "f_align"  : img.align  = value; break;
-                case "f_vert"   : img.vspace = parseInt(value || "0"); break;
-                case "f_horiz"  : img.hspace = parseInt(value || "0"); break;
-                case "f_width"  :
-                    if(value != 0) {
-                        img.width = parseInt(value);
-                    } else {
-                        break;
-                    }
-                    break;
-                case "f_height"  :
-                    if(value != 0) {
-                        img.height = parseInt(value);
-                    } else {
-                        break;
-                    }
-                    break;
-            }
-        }
-    }, outparam);
-};
-
-// Called when the user clicks the Insert Table button
-HTMLArea.prototype._insertTable = function() {
-    var sel = this._getSelection();
-    var range = this._createRange(sel);
-    var editor = this;  // for nested functions
-    this._popupDialog("insert_table.php?id=<?php echo $id; ?>", function(param) {
-        if (!param) {   // user must have pressed Cancel
-            return false;
-        }
-        var doc = editor._doc;
-        // create the table element
-        var table = doc.createElement("table");
-        // assign the given arguments
-        for (var field in param) {
-            var value = param[field];
-            if (!value) {
-                continue;
-            }
-            switch (field) {
-                case "f_width"   : table.width = value + param["f_unit"]; break;
-                case "f_align"   : table.align   = value; break;
-                case "f_border"  : table.border  = parseInt(value); break;
-                case "f_spacing" : table.cellspacing = parseInt(value); break;
-                case "f_padding" : table.cellpadding = parseInt(value); break;
-            }
-        }
-        var tbody = doc.createElement("tbody");
-        table.appendChild(tbody);
-        for (var i = 0; i < param["f_rows"]; ++i) {
-            var tr = doc.createElement("tr");
-            tbody.appendChild(tr);
-            for (var j = 0; j < param["f_cols"]; ++j) {
-                var td = doc.createElement("td");
-                /// Moodle hack
-                if(param["f_unit"] == "px") {
-                    tdwidth = Math.round(table.width / param["f_cols"]);
-                } else {
-                    tdwidth = Math.round(100 / param["f_cols"]);
-                }
-                td.setAttribute("width",tdwidth + param["f_unit"]);
-                td.setAttribute("valign","top");
-                /// Moodle hack -ends
-                tr.appendChild(td);
-                // Mozilla likes to see something inside the cell.
-                (HTMLArea.is_gecko) && td.appendChild(doc.createElement("br"));
-            }
-        }
-        if (HTMLArea.is_ie) {
-            range.pasteHTML(table.outerHTML);
-        } else {
-            // insert the table
-            editor.insertNodeAtSelection(table);
-        }
-        return true;
-    }, null);
-};
-
-/// Moodle hack - insertSmile
-HTMLArea.prototype._insertSmile = function() {
-    // Make sure that editor has focus
-    this.focusEditor();
-    var sel = this._getSelection();
-    var range = this._createRange(sel);
-    var editor = this;  // for nested functions
-    this._popupDialog("dlg_ins_smile.php?id=<?php echo $id; ?>", function(imgString) {
-        if(!imgString) {
-            return false;
-        }
-        if (HTMLArea.is_ie) {
-            range.pasteHTML(imgString);
-        } else {
-            editor.insertHTML(imgString);
-        }
-        return true;
-    }, null);
-};
-
-HTMLArea.prototype._insertChar = function() {
-    var sel = this._getSelection();
-    var range = this._createRange(sel);
-    var editor = this;  // for nested functions
-    this._popupDialog("dlg_ins_char.php?id=<?php echo $id; ?>", function(sChar) {
-        if(!sChar) {
-            return false;
-        }
-        if (HTMLArea.is_ie) {
-            range.pasteHTML(sChar);
-        } else {
-            // insert the table
-            editor.insertHTML(sChar);
-        }
-        return true;
-    }, null);
-};
-
-HTMLArea.prototype._removelink = function() {
-    var editor = this;
-    link = this.getParentElement();
-    editor.selectNodeContents(link);
-
-    this._doc.execCommand("unlink", false, null);
-    this.focusEditor();
-};
-
-HTMLArea.prototype._createanchor = function () {
-    var editor = this;
-    var sel = this._getSelection();
-    var rng = this._createRange(sel);
-    var len = HTMLArea.is_ie ? rng.text.toString().length : sel.toString().length;
-    if(len < 1) {
-        alert("<?php print_string("alertnoselectedtext","editor");?>");
-        return false;
-    }
-    this._popupDialog("createanchor.php?id=<?php echo $id; ?>", function(objAn) {
-        if(!objAn) {
-            return false;
-        }
-        var str = '<a name="'+ objAn.anchor+'">';
-        str += HTMLArea.is_ie ? rng.text : sel ;
-        str += '</a>';
-        editor.insertHTML(str);
-    },null);
-};
-
-HTMLArea.prototype._nolinktag = function () {
-
-    var editor = this;
-    var sel = this._getSelection();
-    var rng = this._createRange(sel);
-    var len = HTMLArea.is_ie ? rng.text.toString().length : sel.toString().length;
-
-    if (len < 1) {
-        alert("<?php print_string("alertnoselectedtext","editor");?>");
-        return false;
-    }
-    var str = '<span class="nolink">';
-    str += HTMLArea.is_ie ? rng.text : sel;
-    str += '</span>';
-    editor.insertHTML(str);
-    this.focusEditor();
-
-};
-
-HTMLArea.prototype._searchReplace = function() {
-
-    var editor = this;
-    var selectedtxt = "";
-    <?php
-    $strreplaced = addslashes_js(get_string('itemsreplaced','editor'));
-    $strnotfound = addslashes_js(get_string('searchnotfound','editor'));
-    ?>
-    var strReplaced = '<?php echo $strreplaced ?>';
-    var strNotfound = '<?php echo $strnotfound ?>';
-    var ile;
-
-    //in source mode mozilla show errors, try diffrent method
-    if (editor._editMode == "wysiwyg") {
-        selectedtxt = editor.getSelectedHTML();
-    } else {
-        if (HTMLArea.is_ie) {
-            selectedtxt = document.selection.createRange().text;
-        } else {
-            selectedtxt = getMozSelection(editor._textArea);
-        }
-    }
-
-    outparam = {
-        f_search : selectedtxt
-    };
-
-    //Call Search And Replace popup window
-    editor._popupDialog( "searchandreplace.php?id=<?php echo $id; ?>", function( entity ) {
-        if ( !entity ) {
-            //user must have pressed Cancel
-            return false;
-        }
-        var text = editor.getHTML();
-        var search = entity[0];
-        var replace = entity[1];
-        var delim = entity[2];
-        var regularx = entity[3];
-        var closesar = entity[4];
-        ile = 0;
-        if (search.length < 1) {
-            alert ("Enter a search word! \n search for: " + entity[0]);
-        } else {
-            if (regularx) {
-            var regX = new RegExp (search, delim) ;
-            var text = text.replace ( regX,
-            function (str, n) {
-                // Increment our counter variable.
-                ile++ ;
-                //return replace ;
-                return str.replace( regX, replace) ;
-                }
-            )
-
-            } else {
-                while (text.indexOf(search)>-1) {
-                    pos = text.indexOf(search);
-                    text = "" + (text.substring(0, pos) + replace + text.substring((pos + search.length), text.length));
-                    ile++;
-                }
-            }
-
-            editor.setHTML(text);
-            editor.forceRedraw();
-            if (ile > 0) {
-                alert(ile + ' ' + strReplaced);
-            } else {
-                alert (strNotfound + "\n");
-            }
-        }
-    }, outparam);
-
-    function getMozSelection(txtarea) {
-        var selLength = txtarea.textLength;
-        var selStart = txtarea.selectionStart;
-        var selEnd = txtarea.selectionEnd;
-        if (selEnd==1 || selEnd==2) selEnd=selLength;
-        return (txtarea.value).substring(selStart, selEnd);
-    }
-};
-
-/// Moodle hack's ends
-//
-// Category: EVENT HANDLERS
-
-// el is reference to the SELECT object
-// txt is the name of the select field, as in config.toolbar
-HTMLArea.prototype._comboSelected = function(el, txt) {
-    this.focusEditor();
-    var value = el.options[el.selectedIndex].value;
-    switch (txt) {
-        case "fontname":
-        case "fontsize": this.execCommand(txt, false, value); break;
-        case "language":
-            this.setLang(value);
-            break;
-        case "formatblock":
-            (HTMLArea.is_ie) && (value = "<" + value + ">");
-            this.execCommand(txt, false, value);
-            break;
-        default:
-        // try to look it up in the registered dropdowns
-        var dropdown = this.config.customSelects[txt];
-        if (typeof dropdown != "undefined") {
-            dropdown.action(this);
-        } else {
-            alert("FIXME: combo box " + txt + " not implemented");
-        }
-    }
-};
-
-
-/**
- * Used to set the language for the selected content.
- * We use the <span lang="en" class="multilang">content</span> format for
- * content that should be marked for multilang filter use, and
- * <span lang="en">content</span> for normal content for which we want to
- * set the language (for screen reader usage, for example).
- */
-HTMLArea.prototype.setLang = function(lang) {
-
-    if (lang == 'multi') {
-        // This is just the separator in the dropdown. Does nothing.
-        return;
-    }
-
-    var editor = this;
-    var selectedHTML = editor.getSelectedHTML();
-    var multiLang = false;
-
-    var re = new RegExp('_ML', 'g');
-    if (lang.match(re)) {
-        multiLang = true;
-        lang = lang.replace(re, '');
-    }
-
-    // Remove all lang attributes from span tags in selected html.
-    selectedHTML = selectedHTML.replace(/(<span[^>]*)lang="[^"]*"([^>]*>)/, "$1$2");
-    selectedHTML = selectedHTML.replace(/(<span[^>]*)class="multilang"([^>]*>)/, "$1$2");
-
-    // If a span tag is now empty, delete it.
-    selectedHTML = selectedHTML.replace(/<span\s*>(.*?)<\/span>/, "$1");
-
-
-    var parentEl = this.getParentElement();
-    var insertNewSpan = false;
-
-    if (parentEl.nodeName == 'SPAN' && parentEl.getAttribute('lang')) {
-        // A language was previously defined for the current block.
-        // Check whether the selected text makes up the whole of the block
-        // contents.
-        var re = new RegExp(parentEl.innerHTML);
-
-        if (selectedHTML.match(re)) {
-            // The selected text makes up the whole of the span block.
-            if (lang != '') {
-                parentEl.setAttribute('lang', lang);
-                if (multiLang) {
-                    parentEl.setAttribute('class', 'multilang');
-                }
-            } else {
-                parentEl.removeAttribute('lang');
-
-                var classAttr = parentEl.getAttribute('class');
-                if (classAttr) {
-                    classAttr = classAttr.replace(/multilang/, '').trim();
-                }
-                if (classAttr == '') {
-                    parentEl.removeAttribute('class');
-                }
-                if (parentEl.attributes.length == 0) {
-                    // The span is no longer needed.
-                    for (i=0; i<parentEl.childNodes.length; i++) {
-                        parentEl.parentNode.insertBefore(parentEl.childNodes[i], parentEl);
-                    }
-                    parentEl.parentNode.removeChild(parentEl);
-                }
-            }
-        } else {
-            insertNewSpan = true;
-        }
-    } else {
-        insertNewSpan = true;
-    }
-
-    if (insertNewSpan && lang != '') {
-        var str  = '<span lang="'+lang.trim()+'"';
-            str += ' class="multilang"';
-        str += '>';
-        str += selectedHTML;
-        str += '</span>';
-        editor.insertHTML(str);
-    }
-}
-
-
-// the execCommand function (intercepts some commands and replaces them with
-// our own implementation)
-HTMLArea.prototype.execCommand = function(cmdID, UI, param) {
-    var editor = this;  // for nested functions
-    this.focusEditor();
-    cmdID = cmdID.toLowerCase();
-    switch (cmdID) {
-        case "htmlmode" : this.setMode(); break;
-        case "hilitecolor":
-        (HTMLArea.is_ie) && (cmdID = "backcolor");
-        case "forecolor":
-            this._popupDialog("select_color.php?id=<?php echo $id; ?>", function(color) {
-                if (color) { // selection not canceled
-                    editor._doc.execCommand(cmdID, false, "#" + color);
-                }
-            }, HTMLArea._colorToRgb(this._doc.queryCommandValue(cmdID)));
-            break;
-        case "createanchor": this._createanchor(); break;
-        case "createlink":
-        this._createLink();
-        break;
-        case "unlink": this._removelink(); break;
-        case "nolink": this._nolinktag(); break;
-        case "popupeditor":
-        // this object will be passed to the newly opened window
-        HTMLArea._object = this;
-        if (HTMLArea.is_ie) {
-            {
-                window.open(this.popupURL("fullscreen.php?id=<?php echo $id;?>"), "ha_fullscreen",
-                    "toolbar=no,location=no,directories=no,status=no,menubar=no," +
-                        "scrollbars=no,resizable=yes,width=800,height=600");
-            }
-        } else {
-            window.open(this.popupURL("fullscreen.php?id=<?php echo $id;?>"), "ha_fullscreen",
-                    "toolbar=no,menubar=no,personalbar=no,width=800,height=600," +
-                    "scrollbars=no,resizable=yes");
-        }
-        break;
-        case "undo":
-        case "redo":
-        if (this._customUndo)
-            this[cmdID]();
-        else
-            this._doc.execCommand(cmdID, UI, param);
-        break;
-        case "inserttable": this._insertTable(); break;
-        case "insertimage": this._insertImage(); break;
-        case "insertsmile": this._insertSmile(); break;
-        case "insertchar": this._insertChar(); break;
-        case "searchandreplace": this._searchReplace(); break;
-        case "about"    : this._popupDialog("about.html", null, this); break;
-        case "showhelp" : window.open(_editor_url + "reference.html", "ha_help"); break;
-
-        case "killword": this._wordClean(); break;
-
-        case "cut":
-        case "copy":
-        case "paste":
-        try {
-            // Paste first then clean
-            this._doc.execCommand(cmdID, UI, param);
-            if (this.config.killWordOnPaste) {
-                this._wordClean();
-            }
-        } catch (e) {
-            if (HTMLArea.is_gecko) {
-                if (confirm("<?php
-                    $strmoz = get_string('cutpastemozilla','editor');
-                    echo addslashes_js($strmoz);
-
-                    ?>"))
-                    window.open("http://moodle.org/mozillahelp");
-            }
-        }
-        break;
-        case "lefttoright":
-        case "righttoleft":
-        var dir = (cmdID == "righttoleft") ? "rtl" : "ltr";
-        var el = this.getParentElement();
-        while (el && !HTMLArea.isBlockElement(el))
-            el = el.parentNode;
-        if (el) {
-            if (el.style.direction == dir)
-                el.style.direction = "";
-            else
-                el.style.direction = dir;
-        }
-        break;
-        default: this._doc.execCommand(cmdID, UI, param);
-    }
-    this.updateToolbar();
-    return false;
-};
-
-
-/**
- * A generic event handler for things that happen in the IFRAME's document.
- * This function also handles key bindings.
- */
-HTMLArea.prototype._editorEvent = function(ev) {
-
-    var editor = this;
-    var keyEvent = (HTMLArea.is_ie && ev.type == "keydown") || (ev.type == "keypress");
-
-    if (keyEvent) {
-
-        for (var i in editor.plugins) {
-            var plugin = editor.plugins[i].instance;
-            if (typeof plugin.onKeyPress == "function") plugin.onKeyPress(ev);
-        }
-
-        var sel = null;
-        var range = null;
-        var key = String.fromCharCode(HTMLArea.is_ie ? ev.keyCode : ev.charCode).toLowerCase();
-        var cmd = null;
-        var value = null;
-
-        if (ev.ctrlKey && !ev.altKey) {
-            /**
-             * Ctrl modifier only.
-             * We use these for shortcuts that change existing content,
-             * e.g. make text bold.
-             */
-            switch (key) {
-
-                case 'a':
-                    // Select all.
-                    if (!HTMLArea.is_ie) {
-                        // KEY select all
-                        sel = this._getSelection();
-                        sel.removeAllRanges();
-                        range = this._createRange();
-                        range.selectNodeContents(this._doc.body);
-                        sel.addRange(range);
-                        HTMLArea._stopEvent(ev);
-                    }
-                    break;
-
-                // For the dropdowns, we assign focus to them so that they are
-                // keyboard accessible.
-                case 'o':
-                    editor.dropdowns['fontname'].focus();
-                    break;
-                case 'p':
-                    editor.dropdowns['fontsize'].focus();
-                    break;
-                case 'h':
-                    editor.dropdowns['formatblock'].focus();
-                    break;
-                case '=':
-                    editor.dropdowns['language'].focus();
-                    break;
-
-                case 'b': cmd = "bold"; break;
-                case 'i': cmd = "italic"; break;
-                case 'u': cmd = "underline"; break;
-                case 's': cmd = "strikethrough"; break;
-                case ',': cmd = "subscript"; break;
-                case '.': cmd = "superscript"; break;
-
-                case 'v':
-                    if (! HTMLArea.is_gecko ) {
-                        cmd = "paste";
-                    }
-                    break;
-
-                case '0': cmd = "killword"; break;
-                case 'z': cmd = "undo"; break;
-                case 'y': cmd = "redo"; break;
-                case 'l': cmd = "justifyleft"; break;
-                case 'e': cmd = "justifycenter"; break;
-                case 'r': cmd = "justifyright"; break;
-                case 'j': cmd = "justifyfull"; break;
-                case '/': cmd = "lefttoright"; break;
-                case '|': cmd = "righttoleft"; break;
-                case ';': cmd = "outdent"; break;
-                case "'": cmd = "indent"; break;
-                case 'g': cmd = "forecolor"; break;
-                case 'k': cmd = "hilitecolor"; break;
-                case 'f': cmd = "searchandreplace"; break;
-                case '`': cmd = "htmlmode"; break;  // FIXME: can't toggle from source code to wysiwyg
-
-                case 'm':
-                    // Toggle fullscreen on or off.
-                    if (this.config.btnList['popupeditor'][0] == 'Enlarge Editor') {
-                        cmd = 'popupeditor';
-                    } else {
-                        window.close();
-                    }
-                    break;
-
-                // Headings.
-                case '1':
-                case '2':
-                case '3':
-                case '4':
-                case '5':
-                case '6':
-                cmd = "formatblock";
-                value = "h" + key;
-                if (HTMLArea.is_ie) {
-                    value = "<" + value + ">";
-                }
-                break;
-
-            } // End switch (key)
-
-
-        } else if (ev.ctrlKey && ev.altKey) {
-            /**
-             * Ctrl + Alt modifiers.
-             * We use these for shortcuts that insert stuff, e.g. images.
-             */
-            switch (key) {
-                case 'o': cmd = "insertorderedlist"; break;
-                case 'u': cmd = "insertunorderedlist"; break;
-                case 'r': cmd = "inserthorizontalrule"; break;
-                case 'a': cmd = "createanchor"; break;
-                case 'l': cmd = "createlink"; break;
-                case 'd': cmd = "unlink"; break;
-                case 'n': cmd = "nolink"; break;
-                case 'i': cmd = 'insertimage'; break;
-                case 't': cmd = 'inserttable'; break;
-                case 's': cmd = 'insertsmile'; break;
-                case 'c': cmd = 'insertchar'; break;
-            }
-        }
-
-        if (cmd) {
-            // execute simple command
-            this.execCommand(cmd, false, value);
-            HTMLArea._stopEvent(ev);
-        }
-    } // End if (keyEvent)
-
-    /*
-    else if (keyEvent) {
-        // other keys here
-        switch (ev.keyCode) {
-            case 13: // KEY enter
-            // if (HTMLArea.is_ie) {
-            this.insertHTML("<br />");
-            HTMLArea._stopEvent(ev);
-            // }
-            break;
-        }
-    }
-    */
-
-    // Update the toolbar state after some time.
-    if (editor._timerToolbar) {
-        clearTimeout(editor._timerToolbar);
-    }
-    editor._timerToolbar = setTimeout(function() {
-        editor.updateToolbar();
-        editor._timerToolbar = null;
-    }, 50);
-};
-
-
-// retrieve the HTML
-HTMLArea.prototype.getHTML = function() {
-    switch (this._editMode) {
-        case "wysiwyg"  :
-        if (!this.config.fullPage) {
-            return HTMLArea.getHTML(this._doc.body, false, this);
-        } else
-            return this.doctype + "\n" + HTMLArea.getHTML(this._doc.documentElement, true, this);
-        case "textmode" : return this._textArea.value;
-        default     : alert("Mode <" + mode + "> not defined!");
-    }
-    return false;
-};
-
-// retrieve the HTML (fastest version, but uses innerHTML)
-HTMLArea.prototype.getInnerHTML = function() {
-    switch (this._editMode) {
-        case "wysiwyg"  :
-        if (!this.config.fullPage)
-            return this._doc.body.innerHTML;
-        else
-            return this.doctype + "\n" + this._doc.documentElement.innerHTML;
-        case "textmode" : return this._textArea.value;
-        default     : alert("Mode <" + mode + "> not defined!");
-    }
-    return false;
-};
-
-// completely change the HTML inside
-HTMLArea.prototype.setHTML = function(html) {
-    switch (this._editMode) {
-        case "wysiwyg"  :
-        if (!this.config.fullPage)
-            this._doc.body.innerHTML = html;
-        else
-            // this._doc.documentElement.innerHTML = html;
-            this._doc.body.innerHTML = html;
-        break;
-        case "textmode" : this._textArea.value = html; break;
-        default     : alert("Mode <" + mode + "> not defined!");
-    }
-    return false;
-};
-
-// sets the given doctype (useful when config.fullPage is true)
-HTMLArea.prototype.setDoctype = function(doctype) {
-    this.doctype = doctype;
-};
-
-/***************************************************
- *  Category: UTILITY FUNCTIONS
- ***************************************************/
-
-// browser identification
-
-HTMLArea.agt = navigator.userAgent.toLowerCase();
-HTMLArea.is_ie     = ((HTMLArea.agt.indexOf("msie") != -1) && (HTMLArea.agt.indexOf("opera") == -1));
-HTMLArea.is_opera  = (HTMLArea.agt.indexOf("opera") != -1);
-HTMLArea.is_mac    = (HTMLArea.agt.indexOf("mac") != -1);
-HTMLArea.is_mac_ie = (HTMLArea.is_ie && HTMLArea.is_mac);
-HTMLArea.is_win_ie = (HTMLArea.is_ie && !HTMLArea.is_mac);
-HTMLArea.is_gecko  = (navigator.product == "Gecko");
-HTMLArea.is_safari = (HTMLArea.agt.indexOf("safari") != -1);
-
-// variable used to pass the object to the popup editor window.
-HTMLArea._object = null;
-
-// function that returns a clone of the given object
-HTMLArea.cloneObject = function(obj) {
-    var newObj = new Object;
-
-    // check for array objects
-    if (obj.constructor.toString().indexOf("function Array(") >= 0) {
-        newObj = obj.constructor();
-    }
-
-    // check for function objects (as usual, IE is phucked up)
-    if (obj.constructor.toString().indexOf("function Function(") >= 0) {
-        newObj = obj; // just copy reference to it
-    } else for (var n in obj) {
-        var node = obj[n];
-        if (typeof node == 'object') { newObj[n] = HTMLArea.cloneObject(node); }
-        else                         { newObj[n] = node; }
-    }
-
-    return newObj;
-};
-
-// FIXME!!! this should return false for IE < 5.5
-HTMLArea.checkSupportedBrowser = function() {
-    if (HTMLArea.is_gecko) {
-        if (navigator.productSub < 20021201) {
-            alert("You need at least Mozilla-1.3 Alpha.\n" +
-                  "Sorry, your Gecko is not supported.");
-            return false;
-        }
-        if (navigator.productSub < 20030210) {
-            alert("Mozilla < 1.3 Beta is not supported!\n" +
-                  "I'll try, though, but it might not work.");
-        }
-    }
-    if(HTMLArea.is_safari) {
-        return false;
-    }
-    return HTMLArea.is_gecko || HTMLArea.is_ie;
-};
-
-// selection & ranges
-
-// returns the current selection object
-HTMLArea.prototype._getSelection = function() {
-    if (HTMLArea.is_ie) {
-        return this._doc.selection;
-    } else {
-        return this._iframe.contentWindow.getSelection();
-    }
-};
-
-// returns a range for the current selection
-HTMLArea.prototype._createRange = function(sel) {
-    if (HTMLArea.is_ie) {
-        return sel.createRange();
-    } else {
-        // Commented out because we need the dropdowns to be able to keep
-        // focus for keyboard accessibility. Comment by Vy-Shane Sin Fat.
-        //this.focusEditor();
-        if (typeof sel != "undefined") {
-            try {
-            return sel.getRangeAt(0);
-            } catch(e) {
-                return this._doc.createRange();
-            }
-        } else {
-            return this._doc.createRange();
-        }
-    }
-};
-
-// event handling
-
-HTMLArea._addEvent = function(el, evname, func) {
-    if (HTMLArea.is_ie) {
-        el.attachEvent("on" + evname, func);
-    } else {
-        el.addEventListener(evname, func, true);
-    }
-};
-
-HTMLArea._addEvents = function(el, evs, func) {
-    for (var i in evs) {
-        HTMLArea._addEvent(el, evs[i], func);
-    }
-};
-
-HTMLArea._removeEvent = function(el, evname, func) {
-    if (HTMLArea.is_ie) {
-        el.detachEvent("on" + evname, func);
-    } else {
-        el.removeEventListener(evname, func, true);
-    }
-};
-
-HTMLArea._removeEvents = function(el, evs, func) {
-    for (var i in evs) {
-        HTMLArea._removeEvent(el, evs[i], func);
-    }
-};
-
-HTMLArea._stopEvent = function(ev) {
-    if (HTMLArea.is_ie) {
-        ev.cancelBubble = true;
-        ev.returnValue = false;
-    } else {
-        ev.preventDefault();
-        ev.stopPropagation();
-    }
-};
-
-HTMLArea._removeClass = function(el, className) {
-    if (!(el && el.className)) {
-        return;
-    }
-    var cls = el.className.split(" ");
-    var ar = new Array();
-    for (var i = cls.length; i > 0;) {
-        if (cls[--i] != className) {
-            ar[ar.length] = cls[i];
-        }
-    }
-    el.className = ar.join(" ");
-};
-
-HTMLArea._addClass = function(el, className) {
-    // remove the class first, if already there
-    HTMLArea._removeClass(el, className);
-    el.className += " " + className;
-};
-
-HTMLArea._hasClass = function(el, className) {
-    if (!(el && el.className)) {
-        return false;
-    }
-    var cls = el.className.split(" ");
-    for (var i = cls.length; i > 0;) {
-        if (cls[--i] == className) {
-            return true;
-        }
-    }
-    return false;
-};
-
-HTMLArea.isBlockElement = function(el) {
-
-    var blockTags = " body form textarea fieldset ul ol dl li div " +
-        "p h1 h2 h3 h4 h5 h6 quote pre table thead " +
-        "tbody tfoot tr td iframe address ";
-    try {
-    return (blockTags.indexOf(" " + el.tagName.toLowerCase() + " ") != -1);
-    } catch (e) {}
-
-};
-
-HTMLArea.needsClosingTag = function(el) {
-    var closingTags = " head script style div span tr td tbody table em strong font a title iframe object applet ";
-    return (closingTags.indexOf(" " + el.tagName.toLowerCase() + " ") != -1);
-};
-
-// performs HTML encoding of some given string
-HTMLArea.htmlEncode = function(str) {
-    // we don't need regexp for that, but.. so be it for now.
-    str = str.replace(/&/ig, "&amp;");
-    str = str.replace(/</ig, "&lt;");
-    str = str.replace(/>/ig, "&gt;");
-    str = str.replace(/\x22/ig, "&quot;");
-    // \x22 means '"' -- we use hex reprezentation so that we don't disturb
-    // JS compressors (well, at least mine fails.. ;)
-    return str;
-};
-
-HTMLArea.isStandardTag = function (el) {
-    return HTMLArea.RE_msietag.test(el.tagName);
-};
-HTMLArea.isSingleTag = function (el) {
-    var re = /^(br|hr|img|input|link|meta|param|embed|area)$/i;
-    return re.test(el.tagName.toLowerCase());
-};
-// Retrieves the HTML code from the given node.  This is a replacement for
-// getting innerHTML, using standard DOM calls.
-HTMLArea.getHTML = function(root, outputRoot, editor) {
-    var html = "";
-    switch (root.nodeType) {
-        case 1: // Node.ELEMENT_NODE
-        case 11: // Node.DOCUMENT_FRAGMENT_NODE
-        var closed;
-        var i;
-        var root_tag = (root.nodeType == 1) ? root.tagName.toLowerCase() : '';
-       if (HTMLArea.RE_junktag.test(root_tag)) {
-           return '';
-       }
-        if (HTMLArea.is_ie && root_tag == "head") {
-            if (outputRoot)
-                html += "<head>";
-            // lowercasize
-            var save_multiline = RegExp.multiline;
-            RegExp.multiline = true;
-            var txt = root.innerHTML.replace(HTMLArea.RE_tagName, function(str, p1, p2) {
-                return p1 + p2.toLowerCase();
-            });
-            RegExp.multiline = save_multiline;
-            html += txt;
-            if (outputRoot)
-                html += "</head>";
-            break;
-        } else if (outputRoot) {
-            closed = (!(root.hasChildNodes() || !HTMLArea.isSingleTag(root)));
-            html = "<" + root.tagName.toLowerCase();
-            var attrs = root.attributes;
-            for (i = 0; i < attrs.length; ++i) {
-                var a = attrs.item(i);
-                if (!a.specified) {
-                    continue;
-                }
-                var name = a.nodeName.toLowerCase();
-                if (/_moz|contenteditable|_msh/.test(name)) {
-                    // avoid certain attributes
-                    continue;
-                }
-                var value;
-                if (name != "style") {
-                    //
-                    // Using Gecko the values of href and src are converted to absolute links
-                    // unless we get them using nodeValue()
-                    if (typeof root[a.nodeName] != "undefined" && name != "href" && name != "src") {
-                        value = root[a.nodeName];
-                    } else {
-                        // This seems to be working, but if it does cause
-                        // problems later on return the old value...
-                        if (name.toLowerCase() == "href" && name.toLowerCase() == "src") {
-                            value = root[a.nodeName];
-                        } else {
-                        value = a.nodeValue;
-                        }
-                        if (HTMLArea.is_ie && (name == "href" || name == "src")) {
-                            value = editor.stripBaseURL(value);
-                        }
-                    }
-                } else { // IE fails to put style in attributes list
-                    // FIXME: cssText reported by IE is UPPERCASE
-                    value = root.style.cssText.toLowerCase();
-                }
-                if (/(_moz|^$)/.test(value)) {
-                    // Mozilla reports some special tags
-                    // here; we don't need them.
-                    continue;
-                }
-                html += " " + name + '="' + value + '"';
-            }
-            html += closed ? " />" : ">";
-        }
-        for (i = root.firstChild; i; i = i.nextSibling) {
-            html += HTMLArea.getHTML(i, true, editor);
-        }
-        if (outputRoot && !closed) {
-            if ( HTMLArea.is_ie && !HTMLArea.isStandardTag(root) ) {
-                html += '';
-            } else {
-                html += "</" + root.tagName.toLowerCase() + ">";
-            }
-        }
-        break;
-        case 3: // Node.TEXT_NODE
-        // If a text node is alone in an element and all spaces, replace it with an non breaking one
-        // This partially undoes the damage done by moz, which translates '&nbsp;'s into spaces in the data element
-        if ( !root.previousSibling && !root.nextSibling && root.data.match(/^\s*$/i) && root.data.length > 1 ) html = '&nbsp;';
-        else html = HTMLArea.htmlEncode(root.data);
-        break;
-        case 8: // Node.COMMENT_NODE
-        html = "<!--" + root.data + "-->";
-        break;      // skip comments, for now.
-    }
-
-    return HTMLArea.indent(html);
-};
-
-HTMLArea.prototype.stripBaseURL = function(string) {
-    var baseurl = this.config.baseURL;
-
-    // IE adds the path to an anchor, converting #anchor
-    // to path/#anchor which of course needs to be fixed
-    var index = string.indexOf("/#")+1;
-    if ((index > 0) && (string.indexOf(baseurl) > -1)) {
-        return string.substr(index);
-    }
-    return string; // Moodle doesn't use the code below because
-                   // Moodle likes to keep absolute links
-
-    // strip to last directory in case baseurl points to a file
-    baseurl = baseurl.replace(/[^\/]+$/, '');
-    var basere = new RegExp(baseurl);
-    string = string.replace(basere, "");
-
-    // strip host-part of URL which is added by MSIE to links relative to server root
-    baseurl = baseurl.replace(/^(https?:\/\/[^\/]+)(.*)$/, '$1');
-    basere = new RegExp(baseurl);
-    return string.replace(basere, "");
-};
-
-String.prototype.trim = function() {
-    a = this.replace(/^\s+/, '');
-    return a.replace(/\s+$/, '');
-};
-
-// creates a rgb-style color from a number
-HTMLArea._makeColor = function(v) {
-    if (typeof v != "number") {
-        // already in rgb (hopefully); IE doesn't get here.
-        return v;
-    }
-    // IE sends number; convert to rgb.
-    var r = v & 0xFF;
-    var g = (v >> 8) & 0xFF;
-    var b = (v >> 16) & 0xFF;
-    return "rgb(" + r + "," + g + "," + b + ")";
-};
-
-// returns hexadecimal color representation from a number or a rgb-style color.
-HTMLArea._colorToRgb = function(v) {
-    if (!v)
-        return '';
-
-    // returns the hex representation of one byte (2 digits)
-    function hex(d) {
-        return (d < 16) ? ("0" + d.toString(16)) : d.toString(16);
-    };
-
-    if (typeof v == "number") {
-        // we're talking to IE here
-        var r = v & 0xFF;
-        var g = (v >> 8) & 0xFF;
-        var b = (v >> 16) & 0xFF;
-        return "#" + hex(r) + hex(g) + hex(b);
-    }
-
-    if (v.substr(0, 3) == "rgb") {
-        // in rgb(...) form -- Mozilla
-        var re = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/;
-        if (v.match(re)) {
-            var r = parseInt(RegExp.$1);
-            var g = parseInt(RegExp.$2);
-            var b = parseInt(RegExp.$3);
-            return "#" + hex(r) + hex(g) + hex(b);
-        }
-        // doesn't match RE?!  maybe uses percentages or float numbers
-        // -- FIXME: not yet implemented.
-        return null;
-    }
-
-    if (v.substr(0, 1) == "#") {
-        // already hex rgb (hopefully :D )
-        return v;
-    }
-
-    // if everything else fails ;)
-    return null;
-};
-
-HTMLArea.prototype._popupDialog = function(url, action, init) {
-    Dialog(this.popupURL(url), action, init);
-};
-
-// paths
-
-HTMLArea.prototype.imgURL = function(file, plugin) {
-    if (typeof plugin == "undefined")
-        return _editor_url + file;
-    else
-        return _editor_url + "plugins/" + plugin + "/img/" + file;
-};
-
-HTMLArea.prototype.popupURL = function(file) {
-    var url = "";
-    if (file.match(/^plugin:\/\/(.*?)\/(.*)/)) {
-        var plugin = RegExp.$1;
-        var popup = RegExp.$2;
-        if (!/\.html$/.test(popup))
-            popup += ".html";
-        url = _editor_url + "plugins/" + plugin + "/popups/" + popup;
-    } else
-        url = _editor_url + this.config.popupURL + file;
-    return url;
-};
-
-/**
- * FIX: Internet Explorer returns an item having the _name_ equal to the given
- * id, even if it's not having any id.  This way it can return a different form
- * field even if it's not a textarea.  This workarounds the problem by
- * specifically looking to search only elements having a certain tag name.
- */
-HTMLArea.getElementById = function(tag, id) {
-    var el, i, objs = document.getElementsByTagName(tag);
-    for (i = objs.length; --i >= 0 && (el = objs[i]);)
-        if (el.id == id)
-            return el;
-    return null;
-};
-// Modified version of GetHtml plugin's indent.
-HTMLArea.indent = function(s, sindentChar) {
-    var c = [
-    /*0*/  new RegExp().compile(/<\/?(div|p|h[1-6]|table|tr|td|th|ul|ol|li|blockquote|object|br|hr|img|embed|param|pre|script|html|head|body|meta|link|title|area)[^>]*>/g),
-    /*1*/  new RegExp().compile(/<\/(div|p|h[1-6]|table|tr|td|th|ul|ol|li|blockquote|object|html|head|body|script)( [^>]*)?>/g),//blocklevel closing tag
-    /*2*/  new RegExp().compile(/<(div|p|h[1-6]|table|tr|td|th|ul|ol|li|blockquote|object|html|head|body|script)( [^>]*)?>/g),//blocklevel opening tag
-    /*3*/  new RegExp().compile(/<(br|hr|img|embed|param|pre|meta|link|title|area)[^>]*>/g),//singlet tag
-    /*4*/  new RegExp().compile(/(^|<\/(pre|script)>)(\s|[^\s])*?(<(pre|script)[^>]*>|$)/g),//find content NOT inside pre and script tags
-    /*5*/  new RegExp().compile(/(<pre[^>]*>)(\s|[^\s])*?(<\/pre>)/g),//find content inside pre tags
-    /*6*/  new RegExp().compile(/(^|<!--(\s|\S)*?-->)((\s|\S)*?)(?=<!--(\s|\S)*?-->|$)/g),//find content NOT inside comments
-    /*7*/  new RegExp().compile(/<\/(table|tbody|tr|td|th|ul|ol|object|html|head|body)( [^>]*)?>/g),//blocklevel closing tag
-    ];
-    HTMLArea.__nindent = 0;
-    HTMLArea.__sindent = "";
-    HTMLArea.__sindentChar = (typeof sindentChar == "undefined") ? "  " : sindentChar;
-
-    if(HTMLArea.is_gecko) { //moz changes returns into <br> inside <pre> tags
-        s = s.replace(c[5], function(str){return str.replace(/<br \/>/g,"\n")});
-    }
-    s = s.replace(c[4], function(strn) { //skip pre and script tags
-      strn = strn.replace(c[6], function(st,$1,$2,$3) { //exclude comments
-        string = $3.replace(/[\n\r]/gi, " ").replace(/\s+/gi," ").replace(c[0], function(str) {
-            if (str.match(c[2])) {
-                var s = "\n" + HTMLArea.__sindent + str;
-                // blocklevel openingtag - increase indent
-                HTMLArea.__sindent += HTMLArea.__sindentChar;
-                ++HTMLArea.__nindent;
-                return s;
-            } else if (str.match(c[1])) {
-                // blocklevel closingtag - decrease indent
-                --HTMLArea.__nindent;
-                HTMLArea.__sindent = "";
-                for (var i=HTMLArea.__nindent;i>0;--i) {
-                    HTMLArea.__sindent += HTMLArea.__sindentChar;
-                }
-                return (str.match(c[7]) ? "\n" + HTMLArea.__sindent : "") + str;
-            }
-            return str; // this won't actually happen
-        });
-        return $1 + string;
-      });return strn;
-    });
-    if (s.charAt(0) == "\n") {
-        return s.substring(1, s.length);
-    }
-    s = s.replace(/ *\n/g,'\n');//strip spaces at end of lines
-    return s;
-};
diff --git a/lib/editor/htmlarea/htmlarea_bak.php b/lib/editor/htmlarea/htmlarea_bak.php
deleted file mode 100644 (file)
index bf9c16e..0000000
+++ /dev/null
@@ -1,2304 +0,0 @@
-<?php
-    include("../../config.php");
-
-    $lastmodified = filemtime("htmlarea.php");
-    $lifetime = 1800;
-
-    header("Content-type: application/x-javascript");  // Correct MIME type
-    header("Last-Modified: " . gmdate("D, d M Y H:i:s", $lastmodified) . " GMT");
-    header("Expires: " . gmdate("D, d M Y H:i:s", time() + $lifetime) . " GMT");
-    header("Cache-control: max_age = $lifetime");
-    header("Pragma: ");
-
-    $lang = current_language();
-
-    if (empty($lang)) {
-        $lang = "en";
-    }
-
-    $strheading = get_string("heading", "editor");
-    $strnormal = get_string("normal", "editor");
-    $straddress = get_string("address", "editor");
-    $strpreformatted = get_string("preformatted", "editor");
-?>
-
-// htmlArea v3.0 - Copyright (c) 2002, 2003 interactivetools.com, inc.
-// This copyright notice MUST stay intact for use (see license.txt).
-//
-// Portions (c) dynarch.com, 2003-2004
-//
-// A free WYSIWYG editor replacement for <textarea> fields.
-// For full source code and docs, visit http://www.interactivetools.com/
-//
-// Version 3.0 developed by Mihai Bazon.
-//   http://dynarch.com/mishoo
-//
-// $Id$
-
-if (typeof _editor_url == "string") {
-    // Leave exactly one backslash at the end of _editor_url
-    _editor_url = _editor_url.replace(/\x2f*$/, '/');
-} else {
-    //alert("WARNING: _editor_url is not set!  You should set this variable to the editor files path; it should preferably be an absolute path, like in '/htmlarea', but it can be relative if you prefer.  Further we will try to load the editor files correctly but we'll probably fail.");
-    _editor_url = '<?php print ($CFG->wwwroot); ?>/lib/editor/';
-}
-
-// make sure we have a language
-if (typeof _editor_lang == "string") {
-    _editor_lang = "en"; // should always be english in moodle.
-} else {
-    _editor_lang = "en";
-}
-
-// Creates a new HTMLArea object.  Tries to replace the textarea with the given
-// ID with it.
-function HTMLArea(textarea, config) {
-    if (HTMLArea.checkSupportedBrowser()) {
-        if (typeof config == "undefined") {
-            this.config = new HTMLArea.Config();
-        } else {
-            this.config = config;
-        }
-        this._htmlArea = null;
-        this._textArea = textarea;
-        this._editMode = "wysiwyg";
-        this.plugins = {};
-        this._timerToolbar = null;
-        this._timerUndo = null;
-        this._undoQueue = new Array(this.config.undoSteps);
-        this._undoPos = -1;
-        this._customUndo = true;
-        this._mdoc = document; // cache the document, we need it in plugins
-        this.doctype = '';
-    }
-};
-
-// load some scripts
-(function() {
-    var scripts = HTMLArea._scripts = [ _editor_url + "htmlarea.js",
-                        _editor_url + "dialog.js",
-                        _editor_url + "popupwin.js",
-                        _editor_url + "lang/" + _editor_lang + ".js" ];
-    var head = document.getElementsByTagName("head")[0];
-    // start from 1, htmlarea.js is already loaded
-    for (var i = 1; i < scripts.length; ++i) {
-        var script = document.createElement("script");
-        script.src = scripts[i];
-        head.appendChild(script);
-    }
-})();
-
-// cache some regexps
-HTMLArea.RE_tagName = /(<\/|<)\s*([^ \t\n>]+)/ig;
-HTMLArea.RE_doctype = /(<!doctype((.|\n)*?)>)\n?/i;
-HTMLArea.RE_head    = /<head>((.|\n)*?)<\/head>/i;
-HTMLArea.RE_body    = /<body>((.|\n)*?)<\/body>/i;
-
-HTMLArea.Config = function () {
-    this.version = "3.0";
-
-    this.width = "auto";
-    this.height = "auto";
-
-    // enable creation of a status bar?
-    this.statusBar = true;
-
-    // maximum size of the undo queue
-    this.undoSteps = 20;
-
-    // the time interval at which undo samples are taken
-    this.undoTimeout = 500; // 1/2 sec.
-
-    // the next parameter specifies whether the toolbar should be included
-    // in the size or not.
-    this.sizeIncludesToolbar = true;
-
-    // if true then HTMLArea will retrieve the full HTML, starting with the
-    // <HTML> tag.
-    this.fullPage = false;
-
-    // style included in the iframe document
-    this.pageStyle = "body { background-color: #fff; font-family: 'Times New Roman', Times; }";
-
-    // set to true if you want Word code to be cleaned upon Paste
-    this.killWordOnPaste = true;
-
-    // BaseURL included in the iframe document
-    this.baseURL = document.baseURI || document.URL;
-    if (this.baseURL && this.baseURL.match(/(.*)\/([^\/]+)/))
-        this.baseURL = RegExp.$1 + "/";
-
-    // URL-s
-    this.imgURL = "images/";
-    this.popupURL = "popups/";
-
-    /** CUSTOMIZING THE TOOLBAR
-     * -------------------------
-     *
-     * It is recommended that you customize the toolbar contents in an
-     * external file (i.e. the one calling HTMLArea) and leave this one
-     * unchanged.  That's because when we (InteractiveTools.com) release a
-     * new official version, it's less likely that you will have problems
-     * upgrading HTMLArea.
-     */
-    this.toolbar = [
-        [ "fontname", "space",
-          "fontsize", "space",
-          "formatblock", "space",
-          "bold", "italic", "underline", "strikethrough", "separator",
-          "subscript", "superscript", "separator",
-          "copy", "cut", "paste","clean", "separator", "undo", "redo" ],
-
-        [ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator",
-          "lefttoright", "righttoleft", "separator",
-          "insertorderedlist", "insertunorderedlist", "outdent", "indent", "separator",
-          "forecolor", "hilitecolor", "separator",
-          "inserthorizontalrule", "createlink", "unlink", "insertimage", "inserttable",
-          "insertsmile", "insertchar", "separator", "htmlmode", "separator", "popupeditor" ]
-    ];
-
-    this.fontname = {
-        "Arial":       'arial,helvetica,sans-serif',
-        "Courier New":     'courier new,courier,monospace',
-        "Georgia":     'georgia,times new roman,times,serif',
-        "Tahoma":      'tahoma,arial,helvetica,sans-serif',
-        "Times New Roman": 'times new roman,times,serif',
-        "Verdana":     'verdana,arial,helvetica,sans-serif',
-        "impact":      'impact',
-        "WingDings":       'wingdings'
-    };
-
-    this.fontsize = {
-        "1 (8 pt)":  "1",
-        "2 (10 pt)": "2",
-        "3 (12 pt)": "3",
-        "4 (14 pt)": "4",
-        "5 (18 pt)": "5",
-        "6 (24 pt)": "6",
-        "7 (36 pt)": "7"
-    };
-
-    this.formatblock = {
-        "<?php echo $strheading ?> 1": "h1",
-        "<?php echo $strheading ?> 2": "h2",
-        "<?php echo $strheading ?> 3": "h3",
-        "<?php echo $strheading ?> 4": "h4",
-        "<?php echo $strheading ?> 5": "h5",
-        "<?php echo $strheading ?> 6": "h6",
-        "<?php echo $strnormal ?>": "p",
-        "<?php echo $straddress ?>": "address",
-        "<?php echo $strpreformatted ?>": "pre"
-    };
-
-    this.customSelects = {};
-
-    function cut_copy_paste(e, cmd, obj) {
-            e.execCommand(cmd);
-    };
-
-    // ADDING CUSTOM BUTTONS: please read below!
-    // format of the btnList elements is "ID: [ ToolTip, Icon, Enabled in text mode?, ACTION ]"
-    //    - ID: unique ID for the button.  If the button calls document.execCommand
-    //      it's wise to give it the same name as the called command.
-    //    - ACTION: function that gets called when the button is clicked.
-    //              it has the following prototype:
-    //                 function(editor, buttonName)
-    //              - editor is the HTMLArea object that triggered the call
-    //              - buttonName is the ID of the clicked button
-    //              These 2 parameters makes it possible for you to use the same
-    //              handler for more HTMLArea objects or for more different buttons.
-    //    - ToolTip: default tooltip, for cases when it is not defined in the -lang- file (HTMLArea.I18N)
-    //    - Icon: path to an icon image file for the button (TODO: use one image for all buttons!)
-    //    - Enabled in text mode: if false the button gets disabled for text-only mode; otherwise enabled all the time.
-    this.btnList = {
-        bold: [ "Bold", "ed_format_bold.gif", false, function(e) {e.execCommand("bold");} ],
-        italic: [ "Italic", "ed_format_italic.gif", false, function(e) {e.execCommand("italic");} ],
-        underline: [ "Underline", "ed_format_underline.gif", false, function(e) {e.execCommand("underline");} ],
-        strikethrough: [ "Strikethrough", "ed_format_strike.gif", false, function(e) {e.execCommand("strikethrough");} ],
-        subscript: [ "Subscript", "ed_format_sub.gif", false, function(e) {e.execCommand("subscript");} ],
-        superscript: [ "Superscript", "ed_format_sup.gif", false, function(e) {e.execCommand("superscript");} ],
-        justifyleft: [ "Justify Left", "ed_align_left.gif", false, function(e) {e.execCommand("justifyleft");} ],
-        justifycenter: [ "Justify Center", "ed_align_center.gif", false, function(e) {e.execCommand("justifycenter");} ],
-        justifyright: [ "Justify Right", "ed_align_right.gif", false, function(e) {e.execCommand("justifyright");} ],
-        justifyfull: [ "Justify Full", "ed_align_justify.gif", false, function(e) {e.execCommand("justifyfull");} ],
-        insertorderedlist: [ "Ordered List", "ed_list_num.gif", false, function(e) {e.execCommand("insertorderedlist");} ],
-        insertunorderedlist: [ "Bulleted List", "ed_list_bullet.gif", false, function(e) {e.execCommand("insertunorderedlist");} ],
-        outdent: [ "Decrease Indent", "ed_indent_less.gif", false, function(e) {e.execCommand("outdent");} ],
-        indent: [ "Increase Indent", "ed_indent_more.gif", false, function(e) {e.execCommand("indent");} ],
-        forecolor: [ "Font Color", "ed_color_fg.gif", false, function(e) {e.execCommand("forecolor");} ],
-        hilitecolor: [ "Background Color", "ed_color_bg.gif", false, function(e) {e.execCommand("hilitecolor");} ],
-        inserthorizontalrule: [ "Horizontal Rule", "ed_hr.gif", false, function(e) {e.execCommand("inserthorizontalrule");} ],
-        createlink: [ "Insert Web Link", "ed_link.gif", false, function(e) {e.execCommand("createlink", true);} ],
-        unlink: [ "Remove Link", "ed_unlink.gif", false, function(e) {e.execCommand("unlink");} ],
-        insertimage: [ "Insert/Modify Image", "ed_image.gif", false, function(e) {e.execCommand("insertimage");} ],
-        inserttable: [ "Insert Table", "insert_table.gif", false, function(e) {e.execCommand("inserttable");} ],
-        htmlmode: [ "Toggle HTML Source", "ed_html.gif", true, function(e) {e.execCommand("htmlmode");} ],
-        popupeditor: [ "Enlarge Editor", "fullscreen_maximize.gif", true, function(e) {e.execCommand("popupeditor");} ],
-        about: [ "About this editor", "ed_about.gif", true, function(e) {e.execCommand("about");} ],
-        showhelp: [ "Help using editor", "ed_help.gif", true, function(e) {e.execCommand("showhelp");} ],
-        undo: [ "Undoes your last action", "ed_undo.gif", false, function(e) {e.execCommand("undo");} ],
-        redo: [ "Redoes your last action", "ed_redo.gif", false, function(e) {e.execCommand("redo");} ],
-        cut: [ "Cut selection", "ed_cut.gif", false, cut_copy_paste ],
-        copy: [ "Copy selection", "ed_copy.gif", false, cut_copy_paste ],
-        paste: [ "Paste from clipboard", "ed_paste.gif", false, cut_copy_paste ],
-        clean: [ "Clean Word HTML", "ed_wordclean.gif", false, function(e) {e.execCommand("killword"); }],
-        lefttoright: [ "Direction left to right", "ed_left_to_right.gif", false, function(e) {e.execCommand("lefttoright");} ],
-        righttoleft: [ "Direction right to left", "ed_right_to_left.gif", false, function(e) {e.execCommand("righttoleft");} ],
-        insertsmile: ["Insert Smiley", "em.icon.smile.gif", false, function(e) {e.execCommand("insertsmile");} ],
-        insertchar: [ "Insert Char", "icon_ins_char.gif", false, function(e) {e.execCommand("insertchar");} ]
-    };
-    /* ADDING CUSTOM BUTTONS
-     * ---------------------
-     *
-     * It is recommended that you add the custom buttons in an external
-     * file and leave this one unchanged.  That's because when we
-     * (InteractiveTools.com) release a new official version, it's less
-     * likely that you will have problems upgrading HTMLArea.
-     *
-     * Example on how to add a custom button when you construct the HTMLArea:
-     *
-     *   var editor = new HTMLArea("your_text_area_id");
-     *   var cfg = editor.config; // this is the default configuration
-     *   cfg.btnList["my-hilite"] =
-     *  [ function(editor) { editor.surroundHTML('<span style="background:yellow">', '</span>'); }, // action
-     *    "Highlight selection", // tooltip
-     *    "my_hilite.gif", // image
-     *    false // disabled in text mode
-     *  ];
-     *   cfg.toolbar.push(["linebreak", "my-hilite"]); // add the new button to the toolbar
-     *
-     * An alternate (also more convenient and recommended) way to
-     * accomplish this is to use the registerButton function below.
-     */
-    // initialize tooltips from the I18N module and generate correct image path
-    for (var i in this.btnList) {
-        var btn = this.btnList[i];
-        btn[1] = _editor_url + this.imgURL + btn[1];
-        if (typeof HTMLArea.I18N.tooltips[i] != "undefined") {
-            btn[0] = HTMLArea.I18N.tooltips[i];
-        }
-    }
-};
-
-/** Helper function: register a new button with the configuration.  It can be
- * called with all 5 arguments, or with only one (first one).  When called with
- * only one argument it must be an object with the following properties: id,
- * tooltip, image, textMode, action.  Examples:
- *
- * 1. config.registerButton("my-hilite", "Hilite text", "my-hilite.gif", false, function(editor) {...});
- * 2. config.registerButton({
- *      id       : "my-hilite",      // the ID of your button
- *      tooltip  : "Hilite text",    // the tooltip
- *      image    : "my-hilite.gif",  // image to be displayed in the toolbar
- *      textMode : false,            // disabled in text mode
- *      action   : function(editor) { // called when the button is clicked
- *                   editor.surroundHTML('<span class="hilite">', '</span>');
- *                 },
- *      context  : "p"               // will be disabled if outside a <p> element
- *    });
- */
-HTMLArea.Config.prototype.registerButton = function(id, tooltip, image, textMode, action, context) {
-    var the_id;
-    if (typeof id == "string") {
-        the_id = id;
-    } else if (typeof id == "object") {
-        the_id = id.id;
-    } else {
-        alert("ERROR [HTMLArea.Config::registerButton]:\ninvalid arguments");
-        return false;
-    }
-    // check for existing id
-    if (typeof this.customSelects[the_id] != "undefined") {
-        // alert("WARNING [HTMLArea.Config::registerDropdown]:\nA dropdown with the same ID already exists.");
-    }
-    if (typeof this.btnList[the_id] != "undefined") {
-        // alert("WARNING [HTMLArea.Config::registerDropdown]:\nA button with the same ID already exists.");
-    }
-    switch (typeof id) {
-        case "string": this.btnList[id] = [ tooltip, image, textMode, action, context ]; break;
-        case "object": this.btnList[id.id] = [ id.tooltip, id.image, id.textMode, id.action, id.context ]; break;
-    }
-};
-
-/** The following helper function registers a dropdown box with the editor
- * configuration.  You still have to add it to the toolbar, same as with the
- * buttons.  Call it like this:
- *
- * FIXME: add example
- */
-HTMLArea.Config.prototype.registerDropdown = function(object) {
-    // check for existing id
-    if (typeof this.customSelects[object.id] != "undefined") {
-        // alert("WARNING [HTMLArea.Config::registerDropdown]:\nA dropdown with the same ID already exists.");
-    }
-    if (typeof this.btnList[object.id] != "undefined") {
-        // alert("WARNING [HTMLArea.Config::registerDropdown]:\nA button with the same ID already exists.");
-    }
-    this.customSelects[object.id] = object;
-};
-
-/** Call this function to remove some buttons/drop-down boxes from the toolbar.
- * Pass as the only parameter a string containing button/drop-down names
- * delimited by spaces.  Note that the string should also begin with a space
- * and end with a space.  Example:
- *
- *   config.hideSomeButtons(" fontname fontsize textindicator ");
- *
- * It's useful because it's easier to remove stuff from the defaul toolbar than
- * create a brand new toolbar ;-)
- */
-HTMLArea.Config.prototype.hideSomeButtons = function(remove) {
-    var toolbar = this.toolbar;
-    for (var i in toolbar) {
-        var line = toolbar[i];
-        for (var j = line.length; --j >= 0; ) {
-            if (remove.indexOf(" " + line[j] + " ") >= 0) {
-                var len = 1;
-                if (/separator|space/.test(line[j + 1])) {
-                    len = 2;
-                }
-                line.splice(j, len);
-            }
-        }
-    }
-};
-
-/** Helper function: replace all TEXTAREA-s in the document with HTMLArea-s. */
-HTMLArea.replaceAll = function(config) {
-    var tas = document.getElementsByTagName("textarea");
-    for (var i = tas.length; i > 0; (new HTMLArea(tas[--i], config)).generate());
-};
-
-/** Helper function: replaces the TEXTAREA with the given ID with HTMLArea. */
-HTMLArea.replace = function(id, config) {
-    var ta = HTMLArea.getElementById("textarea", id);
-    return ta ? (new HTMLArea(ta, config)).generate() : null;
-};
-
-// Creates the toolbar and appends it to the _htmlarea
-HTMLArea.prototype._createToolbar = function () {
-    var editor = this;  // to access this in nested functions
-
-    var toolbar = document.createElement("div");
-    this._toolbar = toolbar;
-    toolbar.className = "toolbar";
-    toolbar.unselectable = "1";
-    var tb_row = null;
-    var tb_objects = new Object();
-    this._toolbarObjects = tb_objects;
-
-    // creates a new line in the toolbar
-    function newLine() {
-        var table = document.createElement("table");
-        table.border = "0px";
-        table.cellSpacing = "0px";
-        table.cellPadding = "0px";
-        toolbar.appendChild(table);
-        // TBODY is required for IE, otherwise you don't see anything
-        // in the TABLE.
-        var tb_body = document.createElement("tbody");
-        table.appendChild(tb_body);
-        tb_row = document.createElement("tr");
-        tb_body.appendChild(tb_row);
-    }; // END of function: newLine
-    // init first line
-    newLine();
-
-    // updates the state of a toolbar element.  This function is member of
-    // a toolbar element object (unnamed objects created by createButton or
-    // createSelect functions below).
-    function setButtonStatus(id, newval) {
-        var oldval = this[id];
-        var el = this.element;
-        if (oldval != newval) {
-            switch (id) {
-                case "enabled":
-                if (newval) {
-                    HTMLArea._removeClass(el, "buttonDisabled");
-                    el.disabled = false;
-                } else {
-                    HTMLArea._addClass(el, "buttonDisabled");
-                    el.disabled = true;
-                }
-                break;
-                case "active":
-                if (newval) {
-                    HTMLArea._addClass(el, "buttonPressed");
-                } else {
-                    HTMLArea._removeClass(el, "buttonPressed");
-                }
-                break;
-            }
-            this[id] = newval;
-        }
-    }; // END of function: setButtonStatus
-
-    // this function will handle creation of combo boxes.  Receives as
-    // parameter the name of a button as defined in the toolBar config.
-    // This function is called from createButton, above, if the given "txt"
-    // doesn't match a button.
-    function createSelect(txt) {
-        var options = null;
-        var el = null;
-        var cmd = null;
-        var customSelects = editor.config.customSelects;
-        var context = null;
-        switch (txt) {
-            case "fontsize":
-            case "fontname":
-            case "formatblock":
-            // the following line retrieves the correct
-            // configuration option because the variable name
-            // inside the Config object is named the same as the
-            // button/select in the toolbar.  For instance, if txt
-            // == "formatblock" we retrieve config.formatblock (or
-            // a different way to write it in JS is
-            // config["formatblock"].
-            options = editor.config[txt];
-            cmd = txt;
-            break;
-            default:
-            // try to fetch it from the list of registered selects
-            cmd = txt;
-            var dropdown = customSelects[cmd];
-            if (typeof dropdown != "undefined") {
-                options = dropdown.options;
-                context = dropdown.context;
-            } else {
-                alert("ERROR [createSelect]:\nCan't find the requested dropdown definition");
-            }
-            break;
-        }
-        if (options) {
-            el = document.createElement("select");
-            var obj = {
-                name    : txt, // field name
-                element : el,   // the UI element (SELECT)
-                enabled : true, // is it enabled?
-                text    : false, // enabled in text mode?
-                cmd : cmd, // command ID
-                state   : setButtonStatus, // for changing state
-                context : context
-            };
-            tb_objects[txt] = obj;
-            for (var i in options) {
-                var op = document.createElement("option");
-                op.appendChild(document.createTextNode(i));
-                op.value = options[i];
-                el.appendChild(op);
-            }
-            HTMLArea._addEvent(el, "change", function () {
-                editor._comboSelected(el, txt);
-            });
-        }
-        return el;
-    }; // END of function: createSelect
-
-    // appends a new button to toolbar
-    function createButton(txt) {
-        // the element that will be created
-        var el = null;
-        var btn = null;
-        switch (txt) {
-            case "separator":
-            el = document.createElement("div");
-            el.className = "separator";
-            break;
-            case "space":
-            el = document.createElement("div");
-            el.className = "space";
-            break;
-            case "linebreak":
-            newLine();
-            return false;
-            case "textindicator":
-            el = document.createElement("div");
-            el.appendChild(document.createTextNode("A"));
-            el.className = "indicator";
-            el.title = HTMLArea.I18N.tooltips.textindicator;
-            var obj = {
-                name    : txt, // the button name (i.e. 'bold')
-                element : el, // the UI element (DIV)
-                enabled : true, // is it enabled?
-                active  : false, // is it pressed?
-                text    : false, // enabled in text mode?
-                cmd : "textindicator", // the command ID
-                state   : setButtonStatus // for changing state
-            };
-            tb_objects[txt] = obj;
-            break;
-            default:
-            btn = editor.config.btnList[txt];
-        }
-        if (!el && btn) {
-            el = document.createElement("div");
-            el.title = btn[0];
-            el.className = "button";
-            // let's just pretend we have a button object, and
-            // assign all the needed information to it.
-            var obj = {
-                name    : txt, // the button name (i.e. 'bold')
-                element : el, // the UI element (DIV)
-                enabled : true, // is it enabled?
-                active  : false, // is it pressed?
-                text    : btn[2], // enabled in text mode?
-                cmd : btn[3], // the command ID
-                state   : setButtonStatus, // for changing state
-                context : btn[4] || null // enabled in a certain context?
-            };
-            tb_objects[txt] = obj;
-            // handlers to emulate nice flat toolbar buttons
-            HTMLArea._addEvent(el, "mouseover", function () {
-                if (obj.enabled) {
-                    HTMLArea._addClass(el, "buttonHover");
-                }
-            });
-            HTMLArea._addEvent(el, "mouseout", function () {
-                if (obj.enabled) with (HTMLArea) {
-                    _removeClass(el, "buttonHover");
-                    _removeClass(el, "buttonActive");
-                    (obj.active) && _addClass(el, "buttonPressed");
-                }
-            });
-            HTMLArea._addEvent(el, "mousedown", function (ev) {
-                if (obj.enabled) with (HTMLArea) {
-                    _addClass(el, "buttonActive");
-                    _removeClass(el, "buttonPressed");
-                    _stopEvent(is_ie ? window.event : ev);
-                }
-            });
-            // when clicked, do the following:
-            HTMLArea._addEvent(el, "click", function (ev) {
-                if (obj.enabled) with (HTMLArea) {
-                    _removeClass(el, "buttonActive");
-                    _removeClass(el, "buttonHover");
-                    obj.cmd(editor, obj.name, obj);
-                    _stopEvent(is_ie ? window.event : ev);
-                }
-            });
-            var img = document.createElement("img");
-            img.src = btn[1];
-            img.style.width = "18px";
-            img.style.height = "18px";
-            el.appendChild(img);
-        } else if (!el) {
-            el = createSelect(txt);
-        }
-        if (el) {
-            var tb_cell = document.createElement("td");
-            tb_row.appendChild(tb_cell);
-            tb_cell.appendChild(el);
-        } else {
-            alert("FIXME: Unknown toolbar item: " + txt);
-        }
-        return el;
-    };
-
-    var first = true;
-    for (var i in this.config.toolbar) {
-        if (!first) {
-            createButton("linebreak");
-        } else {
-            first = false;
-        }
-        var group = this.config.toolbar[i];
-        for (var j in group) {
-            var code = group[j];
-            if (/^([IT])\[(.*?)\]/.test(code)) {
-                // special case, create text label
-                var l7ed = RegExp.$1 == "I"; // localized?
-                var label = RegExp.$2;
-                if (l7ed) {
-                    label = HTMLArea.I18N.custom[label];
-                }
-                var tb_cell = document.createElement("td");
-                tb_row.appendChild(tb_cell);
-                tb_cell.className = "label";
-                tb_cell.innerHTML = label;
-            } else {
-                createButton(code);
-            }
-        }
-    }
-
-    this._htmlArea.appendChild(toolbar);
-};
-
-HTMLArea.prototype._createStatusBar = function() {
-    var statusbar = document.createElement("div");
-    statusbar.className = "statusBar";
-    this._htmlArea.appendChild(statusbar);
-    this._statusBar = statusbar;
-    // statusbar.appendChild(document.createTextNode(HTMLArea.I18N.msg["Path"] + ": "));
-    // creates a holder for the path view
-    div = document.createElement("span");
-    div.className = "statusBarTree";
-    div.innerHTML = HTMLArea.I18N.msg["Path"] + ": ";
-    this._statusBarTree = div;
-    this._statusBar.appendChild(div);
-    if (!this.config.statusBar) {
-        // disable it...
-        statusbar.style.display = "none";
-    }
-};
-
-// Creates the HTMLArea object and replaces the textarea with it.
-HTMLArea.prototype.generate = function () {
-    var editor = this;  // we'll need "this" in some nested functions
-    // get the textarea
-    var textarea = this._textArea;
-    if (typeof textarea == "string") {
-        // it's not element but ID
-        this._textArea = textarea = HTMLArea.getElementById("textarea", textarea);
-    }
-    this._ta_size = {
-        w: textarea.offsetWidth,
-        h: textarea.offsetHeight
-    };
-    textarea.style.display = "none";
-
-    // create the editor framework
-    var htmlarea = document.createElement("div");
-    htmlarea.className = "htmlarea";
-    this._htmlArea = htmlarea;
-
-    // insert the editor before the textarea.
-    textarea.parentNode.insertBefore(htmlarea, textarea);
-
-    if (textarea.form) {
-        // we have a form, on submit get the HTMLArea content and
-        // update original textarea.
-        var f = textarea.form;
-        if (typeof f.onsubmit == "function") {
-            var funcref = f.onsubmit;
-            if (typeof f.__msh_prevOnSubmit == "undefined") {
-                f.__msh_prevOnSubmit = [];
-            }
-            f.__msh_prevOnSubmit.push(funcref);
-        }
-        f.onsubmit = function() {
-            editor._textArea.value = editor.getHTML();
-            var a = this.__msh_prevOnSubmit;
-            // call previous submit methods if they were there.
-            if (typeof a != "undefined") {
-                for (var i in a) {
-                    a[i]();
-                }
-            }
-        };
-    }
-
-    // add a handler for the "back/forward" case -- on body.unload we save
-    // the HTML content into the original textarea.
-    window.onunload = function() {
-        editor._textArea.value = editor.getHTML();
-    };
-
-    // creates & appends the toolbar
-    this._createToolbar();
-
-    // create the IFRAME
-    var iframe = document.createElement("iframe");
-
-    if (HTMLArea.is_ie) {  // http://moodle.org/mod/forum/discuss.php?d=8555
-        // tricky! set src to local url to turn off SSL security alert
-        iframe.src = _editor_url + this.config.popupURL+"blank.html";
-    }
-
-    htmlarea.appendChild(iframe);
-
-    this._iframe = iframe;
-
-    // creates & appends the status bar, if the case
-    this._createStatusBar();
-
-    // remove the default border as it keeps us from computing correctly
-    // the sizes.  (somebody tell me why doesn't this work in IE)
-
-    if (!HTMLArea.is_ie) {
-        iframe.style.borderWidth = "1px";
-    // iframe.frameBorder = "1";
-    // iframe.marginHeight = "0";
-    // iframe.marginWidth = "0";
-    }
-
-    // size the IFRAME according to user's prefs or initial textarea
-    var height = (this.config.height == "auto" ? (this._ta_size.h + "px") : this.config.height);
-    height = parseInt(height);
-    var width = (this.config.width == "auto" ? (this._ta_size.w + 50 + "px") : this.config.width);
-    width = parseInt(width);
-
-    if (!HTMLArea.is_ie) {
-        height -= 2;
-        width -= 2;
-    }
-
-    iframe.style.width = width + "px";
-    if (this.config.sizeIncludesToolbar) {
-        // substract toolbar height
-        height -= this._toolbar.offsetHeight;
-        height -= this._statusBar.offsetHeight;
-    }
-    if (height < 0) {
-        height = 0;
-    }
-    iframe.style.height = height + "px";
-
-    // the editor including the toolbar now have the same size as the
-    // original textarea.. which means that we need to reduce that a bit.
-    textarea.style.width = iframe.style.width;
-    textarea.style.height = iframe.style.height;
-
-    // IMPORTANT: we have to allow Mozilla a short time to recognize the
-    // new frame.  Otherwise we get a stupid exception.
-    function initIframe() {
-        var doc = editor._iframe.contentWindow.document;
-        if (!doc) {
-            // Try again..
-            // FIXME: don't know what else to do here.  Normally
-            // we'll never reach this point.
-            if (HTMLArea.is_gecko) {
-                setTimeout(initIframe, 100);
-                return false;
-            } else {
-                alert("ERROR: IFRAME can't be initialized.");
-            }
-        }
-        if (HTMLArea.is_gecko) {
-            // enable editable mode for Mozilla
-            doc.designMode = "on";
-        }
-        editor._doc = doc;
-        if (!editor.config.fullPage) {
-            doc.open();
-            var html = "<html>\n";
-            html += "<head>\n";
-            if (editor.config.baseURL)
-                html += '<base href="' + editor.config.baseURL + '" />';
-            html += "<style>" + editor.config.pageStyle + " td { border: 1px dotted gray; }</style>\n";
-            html += "</head>\n";
-            html += "<body>\n";
-            html += editor._textArea.value;
-            html += "</body>\n";
-            html += "</html>";
-            doc.write(html);
-            doc.close();
-        } else {
-            var html = editor._textArea.value;
-            if (html.match(HTMLArea.RE_doctype)) {
-                editor.setDoctype(RegExp.$1);
-                html = html.replace(HTMLArea.RE_doctype, "");
-            }
-            doc.open();
-            doc.write(html);
-            doc.close();
-        }
-
-        if (HTMLArea.is_ie) {
-            // enable editable mode for IE.  For some reason this
-            // doesn't work if done in the same place as for Gecko
-            // (above).
-            doc.body.contentEditable = true;
-        }
-
-        editor.focusEditor();
-        // intercept some events; for updating the toolbar & keyboard handlers
-        HTMLArea._addEvents
-            (doc, ["keydown", "keypress", "mousedown", "mouseup", "drag"],
-             function (event) {
-                 return editor._editorEvent(HTMLArea.is_ie ? editor._iframe.contentWindow.event : event);
-             });
-
-        // check if any plugins have registered refresh handlers
-        for (var i in editor.plugins) {
-            var plugin = editor.plugins[i].instance;
-            if (typeof plugin.onGenerate == "function")
-                plugin.onGenerate();
-        }
-
-        setTimeout(function() {
-        editor.updateToolbar();
-        }, 250);
-
-        if (typeof editor.onGenerate == "function")
-            editor.onGenerate();
-    };
-    setTimeout(initIframe, 100);
-};
-
-// Switches editor mode; parameter can be "textmode" or "wysiwyg".  If no
-// parameter was passed this function toggles between modes.
-HTMLArea.prototype.setMode = function(mode) {
-    if (typeof mode == "undefined") {
-        mode = ((this._editMode == "textmode") ? "wysiwyg" : "textmode");
-    }
-    switch (mode) {
-        case "textmode":
-        this._textArea.value = this.getHTML();
-        this._iframe.style.display = "none";
-        this._textArea.style.display = "block";
-        if (this.config.statusBar) {
-            this._statusBar.innerHTML = HTMLArea.I18N.msg["TEXT_MODE"];
-        }
-        break;
-        case "wysiwyg":
-        if (HTMLArea.is_gecko) {
-            // disable design mode before changing innerHTML
-            try {
-            this._doc.designMode = "off";
-            } catch(e) {};
-        }
-        if (!this.config.fullPage)
-            this._doc.body.innerHTML = this.getHTML();
-        else
-            this.setFullHTML(this.getHTML());
-        this._iframe.style.display = "block";
-        this._textArea.style.display = "none";
-        if (HTMLArea.is_gecko) {
-            // we need to refresh that info for Moz-1.3a
-            try {
-            this._doc.designMode = "on";
-            //this._doc.focus();
-            } catch(e) {};
-        }
-        if (this.config.statusBar) {
-            this._statusBar.innerHTML = '';
-            this._statusBar.appendChild(document.createTextNode(HTMLArea.I18N.msg["Path"] + ": "));
-            this._statusBar.appendChild(this._statusBarTree);
-        }
-        break;
-        default:
-        alert("Mode <" + mode + "> not defined!");
-        return false;
-    }
-    this._editMode = mode;
-    this.focusEditor();
-};
-
-HTMLArea.prototype.setFullHTML = function(html) {
-    var save_multiline = RegExp.multiline;
-    RegExp.multiline = true;
-    if (html.match(HTMLArea.RE_doctype)) {
-        this.setDoctype(RegExp.$1);
-        html = html.replace(HTMLArea.RE_doctype, "");
-    }
-    RegExp.multiline = save_multiline;
-    if (!HTMLArea.is_ie) {
-        if (html.match(HTMLArea.RE_head))
-            this._doc.getElementsByTagName("head")[0].innerHTML = RegExp.$1;
-        if (html.match(HTMLArea.RE_body))
-            this._doc.getElementsByTagName("body")[0].innerHTML = RegExp.$1;
-    } else {
-        var html_re = /<html>((.|\n)*?)<\/html>/i;
-        html = html.replace(html_re, "$1");
-        this._doc.open();
-        this._doc.write(html);
-        this._doc.close();
-        this._doc.body.contentEditable = true;
-        return true;
-    }
-};
-
-/***************************************************
- *  Category: PLUGINS
- ***************************************************/
-
-// this is the variant of the function above where the plugin arguments are
-// already packed in an array.  Externally, it should be only used in the
-// full-screen editor code, in order to initialize plugins with the same
-// parameters as in the opener window.
-HTMLArea.prototype.registerPlugin2 = function(plugin, args) {
-    if (typeof plugin == "string")
-        plugin = eval(plugin);
-    var obj = new plugin(this, args);
-    if (obj) {
-        var clone = {};
-        var info = plugin._pluginInfo;
-        for (var i in info)
-            clone[i] = info[i];
-        clone.instance = obj;
-        clone.args = args;
-        this.plugins[plugin._pluginInfo.name] = clone;
-    } else
-        alert("Can't register plugin " + plugin.toString() + ".");
-};
-
-// Create the specified plugin and register it with this HTMLArea
-HTMLArea.prototype.registerPlugin = function() {
-    var plugin = arguments[0];
-    var args = [];
-    for (var i = 1; i < arguments.length; ++i)
-        args.push(arguments[i]);
-    this.registerPlugin2(plugin, args);
-};
-
-// static function that loads the required plugin and lang file, based on the
-// language loaded already for HTMLArea.  You better make sure that the plugin
-// _has_ that language, otherwise shit might happen ;-)
-HTMLArea.loadPlugin = function(pluginName) {
-    var dir = _editor_url + "plugins/" + pluginName;
-    var plugin = pluginName.replace(/([a-z])([A-Z])([a-z])/g,
-                    function (str, l1, l2, l3) {
-                        return l1 + "-" + l2.toLowerCase() + l3;
-                    }).toLowerCase() + ".js";
-    var plugin_file = dir + "/" + plugin;
-    var plugin_lang = dir + "/lang/" + HTMLArea.I18N.lang + ".js";
-    HTMLArea._scripts.push(plugin_file, plugin_lang);
-    document.write("<script type='text/javascript' src='" + plugin_file + "'></script>");
-    document.write("<script type='text/javascript' src='" + plugin_lang + "'></script>");
-};
-
-HTMLArea.loadStyle = function(style, plugin) {
-    var url = _editor_url || '';
-    if (typeof plugin != "undefined") {
-        url += "plugins/" + plugin + "/";
-    }
-    url += style;
-    document.write("<style type='text/css'>@import url(" + url + ");</style>");
-};
-HTMLArea.loadStyle("htmlarea.css");
-
-/***************************************************
- *  Category: EDITOR UTILITIES
- ***************************************************/
-
-// The following function is a slight variation of the word cleaner code posted
-// by Weeezl (user @ InteractiveTools forums).
-HTMLArea.prototype._wordClean = function() {
-    var D = this.getInnerHTML();
-    if (D.indexOf("class=Mso") >= 0 || D.indexOf("mso") >= 0 || D.indexOf("Mso") >= 0) {
-
-        // make one line
-        D = D.replace(/\r\n/g, ' ').
-            replace(/\n/g, ' ').
-            replace(/\r/g, ' ').
-            replace(/\&nbsp\;/g,' ');
-
-        // keep tags, strip attributes
-        D = D.replace(/ class=[^\s|>]*/gi,'').
-            //replace(/<p [^>]*TEXT-ALIGN: justify[^>]*>/gi,'<p align="justify">').
-            replace(/ style=\"[^>]*\"/gi,'').
-            replace(/ align=[^\s|>]*/gi,'');
-
-        //clean up tags
-        D = D.replace(/<b [^>]*>/gi,'<b>').
-            replace(/<i [^>]*>/gi,'<i>').
-            replace(/<li [^>]*>/gi,'<li>').
-            replace(/<ul [^>]*>/gi,'<ul>');
-
-        // replace outdated tags
-        D = D.replace(/<b>/gi,'<strong>').
-            replace(/<\/b>/gi,'</strong>');
-
-        // mozilla doesn't like <em> tags
-        D = D.replace(/<em>/gi,'<i>').
-            replace(/<\/em>/gi,'</i>');
-
-        // kill unwanted tags
-        D = D.replace(/<\?xml:[^>]*>/g, '').       // Word xml
-            replace(/<\/?st1:[^>]*>/g,'').     // Word SmartTags
-            replace(/<\/?[a-z]\:[^>]*>/g,'').  // All other funny Word non-HTML stuff
-            replace(/<\/?font[^>]*>/gi,'').    // Disable if you want to keep font formatting
-            replace(/<\/?span[^>]*>/gi,' ').
-            replace(/<\/?div[^>]*>/gi,' ').
-            replace(/<\/?pre[^>]*>/gi,' ').
-            replace(/<(\/?)(h[1-6]+)[^>]*>/gi,'<$1$2>');
-
-        //remove empty tags
-        //D = D.replace(/<strong><\/strong>/gi,'').
-        //replace(/<i><\/i>/gi,'').
-        //replace(/<P[^>]*><\/P>/gi,'');
-
-        // nuke double tags
-        oldlen = D.length + 1;
-        while(oldlen > D.length) {
-            oldlen = D.length;
-            // join us now and free the tags, we'll be free hackers, we'll be free... ;-)
-            D = D.replace(/<([a-z][a-z]*)> *<\/\1>/gi,' ').
-                replace(/<([a-z][a-z]*)> *<([a-z][^>]*)> *<\/\1>/gi,'<$2>');
-        }
-        D = D.replace(/<([a-z][a-z]*)><\1>/gi,'<$1>').
-            replace(/<\/([a-z][a-z]*)><\/\1>/gi,'<\/$1>');
-
-        // nuke double spaces
-        D = D.replace(/  */gi,' ');
-
-        this.setHTML(D);
-        this.updateToolbar();
-    }
-};
-
-HTMLArea.prototype.forceRedraw = function() {
-    this._doc.body.style.visibility = "hidden";
-    this._doc.body.style.visibility = "visible";
-    // this._doc.body.innerHTML = this.getInnerHTML();
-};
-
-// focuses the iframe window.  returns a reference to the editor document.
-HTMLArea.prototype.focusEditor = function() {
-    switch (this._editMode) {
-        case "wysiwyg" : this._iframe.contentWindow.focus(); break;
-        case "textmode": this._textArea.focus(); break;
-        default    : alert("ERROR: mode " + this._editMode + " is not defined");
-    }
-    return this._doc;
-};
-
-// takes a snapshot of the current text (for undo)
-HTMLArea.prototype._undoTakeSnapshot = function() {
-    ++this._undoPos;
-    if (this._undoPos >= this.config.undoSteps) {
-        // remove the first element
-        this._undoQueue.shift();
-        --this._undoPos;
-    }
-    // use the fasted method (getInnerHTML);
-    var take = true;
-    var txt = this.getInnerHTML();
-    if (this._undoPos > 0)
-        take = (this._undoQueue[this._undoPos - 1] != txt);
-    if (take) {
-        this._undoQueue[this._undoPos] = txt;
-    } else {
-        this._undoPos--;
-    }
-};
-
-HTMLArea.prototype.undo = function() {
-    if (this._undoPos > 0) {
-        var txt = this._undoQueue[--this._undoPos];
-        if (txt) this.setHTML(txt);
-        else ++this._undoPos;
-    }
-};
-
-HTMLArea.prototype.redo = function() {
-    if (this._undoPos < this._undoQueue.length - 1) {
-        var txt = this._undoQueue[++this._undoPos];
-        if (txt) this.setHTML(txt);
-        else --this._undoPos;
-    }
-};
-
-// updates enabled/disable/active state of the toolbar elements
-HTMLArea.prototype.updateToolbar = function(noStatus) {
-    var doc = this._doc;
-    var text = (this._editMode == "textmode");
-    var ancestors = null;
-    if (!text) {
-        ancestors = this.getAllAncestors();
-        if (this.config.statusBar && !noStatus) {
-            this._statusBarTree.innerHTML = HTMLArea.I18N.msg["Path"] + ": "; // clear
-            for (var i = ancestors.length; --i >= 0;) {
-                var el = ancestors[i];
-                if (!el) {
-                    // hell knows why we get here; this
-                    // could be a classic example of why
-                    // it's good to check for conditions
-                    // that are impossible to happen ;-)
-                    continue;
-                }
-                var a = document.createElement("a");
-                a.href = "#";
-                a.el = el;
-                a.editor = this;
-                a.onclick = function() {
-                    this.blur();
-                    this.editor.selectNodeContents(this.el);
-                    this.editor.updateToolbar(true);
-                    return false;
-                };
-                a.oncontextmenu = function() {
-                    // TODO: add context menu here
-                    this.blur();
-                    var info = "Inline style:\n\n";
-                    info += this.el.style.cssText.split(/;\s*/).join(";\n");
-                    alert(info);
-                    return false;
-                };
-                var txt = el.tagName.toLowerCase();
-                a.title = el.style.cssText;
-                if (el.id) {
-                    txt += "#" + el.id;
-                }
-                if (el.className) {
-                    txt += "." + el.className;
-                }
-                a.appendChild(document.createTextNode(txt));
-                this._statusBarTree.appendChild(a);
-                if (i != 0) {
-                    this._statusBarTree.appendChild(document.createTextNode(String.fromCharCode(0xbb)));
-                }
-            }
-        }
-    }
-    for (var i in this._toolbarObjects) {
-        var btn = this._toolbarObjects[i];
-        var cmd = i;
-        var inContext = true;
-        if (btn.context && !text) {
-            inContext = false;
-            var context = btn.context;
-            var attrs = [];
-            if (/(.*)\[(.*?)\]/.test(context)) {
-                context = RegExp.$1;
-                attrs = RegExp.$2.split(",");
-            }
-            context = context.toLowerCase();
-            var match = (context == "*");
-            for (var k in ancestors) {
-                if (!ancestors[k]) {
-                    // the impossible really happens.
-                    continue;
-                }
-                if (match || (ancestors[k].tagName.toLowerCase() == context)) {
-                    inContext = true;
-                    for (var ka in attrs) {
-                        if (!eval("ancestors[k]." + attrs[ka])) {
-                            inContext = false;
-                            break;
-                        }
-                    }
-                    if (inContext) {
-                        break;
-                    }
-                }
-            }
-        }
-        btn.state("enabled", (!text || btn.text) && inContext);
-        if (typeof cmd == "function") {
-            continue;
-        }
-        // look-it-up in the custom dropdown boxes
-        var dropdown = this.config.customSelects[cmd];
-        if ((!text || btn.text) && (typeof dropdown != "undefined")) {
-            dropdown.refresh(this);
-            continue;
-        }
-        switch (cmd) {
-            case "fontname":
-            case "fontsize":
-            case "formatblock":
-            if (!text) try {
-                var value = ("" + doc.queryCommandValue(cmd)).toLowerCase();
-                if (!value) {
-                    // FIXME: what do we do here?
-                    break;
-                }
-                // HACK -- retrieve the config option for this
-                // combo box.  We rely on the fact that the
-                // variable in config has the same name as
-                // button name in the toolbar.
-                var options = this.config[cmd];
-                var k = 0;
-                // btn.element.selectedIndex = 0;
-                for (var j in options) {
-                    // FIXME: the following line is scary.
-                    if ((j.toLowerCase() == value) ||
-                        (options[j].substr(0, value.length).toLowerCase() == value)) {
-                        btn.element.selectedIndex = k;
-                        break;
-                    }
-                    ++k;
-                }
-            } catch(e) {};
-            break;
-            case "textindicator":
-            if (!text) {
-                try {with (btn.element.style) {
-                    backgroundColor = HTMLArea._makeColor(
-                        doc.queryCommandValue(HTMLArea.is_ie ? "backcolor" : "hilitecolor"));
-                    if (/transparent/i.test(backgroundColor)) {
-                        // Mozilla
-                        backgroundColor = HTMLArea._makeColor(doc.queryCommandValue("backcolor"));
-                    }
-                    color = HTMLArea._makeColor(doc.queryCommandValue("forecolor"));
-                    fontFamily = doc.queryCommandValue("fontname");
-                    fontWeight = doc.queryCommandState("bold") ? "bold" : "normal";
-                    fontStyle = doc.queryCommandState("italic") ? "italic" : "normal";
-                }} catch (e) {
-                    // alert(e + "\n\n" + cmd);
-                }
-            }
-            break;
-            case "htmlmode": btn.state("active", text); break;
-            case "lefttoright":
-            case "righttoleft":
-            var el = this.getParentElement();
-            while (el && !HTMLArea.isBlockElement(el))
-                el = el.parentNode;
-            if (el)
-                btn.state("active", (el.style.direction == ((cmd == "righttoleft") ? "rtl" : "ltr")));
-            break;
-            default:
-            try {
-                btn.state("active", (!text && doc.queryCommandState(cmd)));
-            } catch (e) {}
-        }
-    }
-    // take undo snapshots
-    if (this._customUndo && !this._timerUndo) {
-        this._undoTakeSnapshot();
-        var editor = this;
-        this._timerUndo = setTimeout(function() {
-            editor._timerUndo = null;
-        }, this.config.undoTimeout);
-    }
-    // check if any plugins have registered refresh handlers
-    for (var i in this.plugins) {
-        var plugin = this.plugins[i].instance;
-        if (typeof plugin.onUpdateToolbar == "function")
-            plugin.onUpdateToolbar();
-    }
-};
-
-/** Returns a node after which we can insert other nodes, in the current
- * selection.  The selection is removed.  It splits a text node, if needed.
- */
-HTMLArea.prototype.insertNodeAtSelection = function(toBeInserted) {
-    if (!HTMLArea.is_ie) {
-        var sel = this._getSelection();
-        var range = this._createRange(sel);
-        // remove the current selection
-        sel.removeAllRanges();
-        range.deleteContents();
-        var node = range.startContainer;
-        var pos = range.startOffset;
-        switch (node.nodeType) {
-            case 3: // Node.TEXT_NODE
-            // we have to split it at the caret position.
-            if (toBeInserted.nodeType == 3) {
-                // do optimized insertion
-                node.insertData(pos, toBeInserted.data);
-                range = this._createRange();
-                range.setEnd(node, pos + toBeInserted.length);
-                range.setStart(node, pos + toBeInserted.length);
-                sel.addRange(range);
-            } else {
-                node = node.splitText(pos);
-                var selnode = toBeInserted;
-                if (toBeInserted.nodeType == 11 /* Node.DOCUMENT_FRAGMENT_NODE */) {
-                    selnode = selnode.firstChild;
-                }
-                node.parentNode.insertBefore(toBeInserted, node);
-                this.selectNodeContents(selnode);
-                this.updateToolbar();
-            }
-            break;
-            case 1: // Node.ELEMENT_NODE
-            var selnode = toBeInserted;
-            if (toBeInserted.nodeType == 11 /* Node.DOCUMENT_FRAGMENT_NODE */) {
-                selnode = selnode.firstChild;
-            }
-            node.insertBefore(toBeInserted, node.childNodes[pos]);
-            this.selectNodeContents(selnode);
-            this.updateToolbar();
-            break;
-        }
-    } else {
-        return null;    // this function not yet used for IE <FIXME>
-    }
-};
-
-// Returns the deepest node that contains both endpoints of the selection.
-HTMLArea.prototype.getParentElement = function() {
-    var sel = this._getSelection();
-    var range = this._createRange(sel);
-    if (HTMLArea.is_ie) {
-        switch (sel.type) {
-            case "Text":
-            case "None":
-            // It seems that even for selection of type "None",
-            // there _is_ a parent element and it's value is not
-            // only correct, but very important to us.  MSIE is
-            // certainly the buggiest browser in the world and I
-            // wonder, God, how can Earth stand it?
-            return range.parentElement();
-            case "Control":
-            return range.item(0);
-            default:
-            return this._doc.body;
-        }
-    } else try {
-        var p = range.commonAncestorContainer;
-        if (!range.collapsed && range.startContainer == range.endContainer &&
-            range.startOffset - range.endOffset <= 1 && range.startContainer.hasChildNodes())
-            p = range.startContainer.childNodes[range.startOffset];
-        /*
-        alert(range.startContainer + ":" + range.startOffset + "\n" +
-              range.endContainer + ":" + range.endOffset);
-        */
-        while (p.nodeType == 3) {
-            p = p.parentNode;
-        }
-        return p;
-    } catch (e) {
-        return null;
-    }
-};
-
-// Returns an array with all the ancestor nodes of the selection.
-HTMLArea.prototype.getAllAncestors = function() {
-    var p = this.getParentElement();
-    var a = [];
-    while (p && (p.nodeType == 1) && (p.tagName.toLowerCase() != 'body')) {
-        a.push(p);
-        p = p.parentNode;
-    }
-    a.push(this._doc.body);
-    return a;
-};
-
-// Selects the contents inside the given node
-HTMLArea.prototype.selectNodeContents = function(node, pos) {
-    this.focusEditor();
-    this.forceRedraw();
-    var range;
-    var collapsed = (typeof pos != "undefined");
-    if (HTMLArea.is_ie) {
-        range = this._doc.body.createTextRange();
-        range.moveToElementText(node);
-        (collapsed) && range.collapse(pos);
-        range.select();
-    } else {
-        var sel = this._getSelection();
-        range = this._doc.createRange();
-        range.selectNodeContents(node);
-        (collapsed) && range.collapse(pos);
-        sel.removeAllRanges();
-        sel.addRange(range);
-    }
-};
-
-/** Call this function to insert HTML code at the current position.  It deletes
- * the selection, if any.
- */
-HTMLArea.prototype.insertHTML = function(html) {
-    var sel = this._getSelection();
-    var range = this._createRange(sel);
-    if (HTMLArea.is_ie) {
-        range.pasteHTML(html);
-    } else {
-        // construct a new document fragment with the given HTML
-        var fragment = this._doc.createDocumentFragment();
-        var div = this._doc.createElement("div");
-        div.innerHTML = html;
-        while (div.firstChild) {
-            // the following call also removes the node from div
-            fragment.appendChild(div.firstChild);
-        }
-        // this also removes the selection
-        var node = this.insertNodeAtSelection(fragment);
-    }
-};
-
-/**
- *  Call this function to surround the existing HTML code in the selection with
- *  your tags.  FIXME: buggy!  This function will be deprecated "soon".
- */
-HTMLArea.prototype.surroundHTML = function(startTag, endTag) {
-    var html = this.getSelectedHTML();
-    // the following also deletes the selection
-    this.insertHTML(startTag + html + endTag);
-};
-
-/// Retrieve the selected block
-HTMLArea.prototype.getSelectedHTML = function() {
-    var sel = this._getSelection();
-    var range = this._createRange(sel);
-    var existing = null;
-    if (HTMLArea.is_ie) {
-        existing = range.htmlText;
-    } else {
-        existing = HTMLArea.getHTML(range.cloneContents(), false, this);
-    }
-    return existing;
-};
-
-/// Return true if we have some selection
-HTMLArea.prototype.hasSelectedText = function() {
-    // FIXME: come _on_ mishoo, you can do better than this ;-)
-    return this.getSelectedHTML() != '';
-};
-
-HTMLArea.prototype._createLink = function(link) {
-    var editor = this;
-    var outparam = null;
-    if (typeof link == "undefined") {
-        link = this.getParentElement();
-        if (link && !/^a$/i.test(link.tagName))
-            link = null;
-    }
-    if (link) outparam = {
-        f_href   : HTMLArea.is_ie ? editor.stripBaseURL(link.href) : link.getAttribute("href"),
-        f_title  : link.title,
-        f_target : link.target
-    };
-    this._popupDialog("link_std.php?id=<?php echo $id; ?>", function(param) {
-        if (!param)
-            return false;
-        var a = link;
-        if (!a) {
-            editor._doc.execCommand("createlink", false, param.f_href);
-            a = editor.getParentElement();
-            var sel = editor._getSelection();
-            var range = editor._createRange(sel);
-        //    if (!HTMLArea.is_ie) {           /// Removed by PJ and Martin, Moodle bug #1455
-        //        a = range.startContainer;
-        //        if (!/^a$/i.test(a.tagName))
-        //            a = a.nextSibling;
-        //    }
-        } else a.href = param.f_href.trim();
-        if (!/^a$/i.test(a.tagName))
-            return false;
-        a.target = param.f_target.trim();
-        a.title = param.f_title.trim();
-        editor.selectNodeContents(a);
-        editor.updateToolbar();
-    }, outparam);
-};
-
-// Called when the user clicks on "InsertImage" button.  If an image is already
-// there, it will just modify it's properties.
-HTMLArea.prototype._insertImage = function(image) {
-    var editor = this;  // for nested functions
-    var outparam = null;
-    if (typeof image == "undefined") {
-        image = this.getParentElement();
-        if (image && !/^img$/i.test(image.tagName))
-            image = null;
-    }
-    if (image) outparam = {
-        f_url    : HTMLArea.is_ie ? editor.stripBaseURL(image.src) : image.getAttribute("src"),
-        f_alt    : image.alt,
-        f_border : image.border,
-        f_align  : image.align,
-        f_vert   : image.vspace,
-        f_horiz  : image.hspace,
-        f_width  : image.width,
-        f_height : image.height
-    };
-    this._popupDialog("<?php
-    if (has_capability('moodle/course:managefiles', get_context_instance(CONTEXT_COURSE, $id))) {
-        echo "insert_image.php?id=$id";
-    } else {
-        echo "insert_image_std.php?id=$id";
-    }?>", function(param) {
-        if (!param) {   // user must have pressed Cancel
-            return false;
-        }
-        var img = image;
-        if (!img) {
-        var sel = editor._getSelection();
-        var range = editor._createRange(sel);
-            editor._doc.execCommand("insertimage", false, param.f_url);
-        if (HTMLArea.is_ie) {
-            img = range.parentElement();
-            // wonder if this works...
-            if (img.tagName.toLowerCase() != "img") {
-                img = img.previousSibling;
-            }
-        } else {
-            img = range.startContainer.previousSibling;
-        }
-        } else {
-            img.src = param.f_url;
-        }
-        for (field in param) {
-            var value = param[field];
-            switch (field) {
-                case "f_alt"    : img.alt    = value; break;
-                case "f_border" : img.border = parseInt(value || "0"); break;
-                case "f_align"  : img.align  = value; break;
-                case "f_vert"   : img.vspace = parseInt(value || "0"); break;
-                case "f_horiz"  : img.hspace = parseInt(value || "0"); break;
-                case "f_width"  :
-                    if(value != 0) {
-                        img.width = parseInt(value);
-                    } else {
-                        break;
-                    }
-                    break;
-                case "f_height"  :
-                    if(value != 0) {
-                        img.height = parseInt(value);
-                    } else {
-                        break;
-                    }
-                    break;
-            }
-        }
-    }, outparam);
-};
-
-// Called when the user clicks the Insert Table button
-HTMLArea.prototype._insertTable = function() {
-    var sel = this._getSelection();
-    var range = this._createRange(sel);
-    var editor = this;  // for nested functions
-    this._popupDialog("insert_table.php", function(param) {
-        if (!param) {   // user must have pressed Cancel
-            return false;
-        }
-        var doc = editor._doc;
-        // create the table element
-        var table = doc.createElement("table");
-        // assign the given arguments
-        for (var field in param) {
-            var value = param[field];
-            if (!value) {
-                continue;
-            }
-            switch (field) {
-                case "f_width"   : table.width = value + param["f_unit"]; break;
-                case "f_align"   : table.align   = value; break;
-                case "f_border"  : table.border  = parseInt(value); break;
-                case "f_spacing" : table.cellspacing = parseInt(value); break;
-                case "f_padding" : table.cellpadding = parseInt(value); break;
-            }
-        }
-        var tbody = doc.createElement("tbody");
-        table.appendChild(tbody);
-        for (var i = 0; i < param["f_rows"]; ++i) {
-            var tr = doc.createElement("tr");
-            tbody.appendChild(tr);
-            for (var j = 0; j < param["f_cols"]; ++j) {
-                var td = doc.createElement("td");
-                /// Moodle hack
-                if(param["f_unit"] == "px") {
-                    tdwidth = Math.round(table.width / param["f_cols"]);
-                } else {
-                    tdwidth = Math.round(100 / param["f_cols"]);
-                }
-                td.setAttribute("width",tdwidth + param["f_unit"]);
-                td.setAttribute("valign","top");
-                /// Moodle hack -ends
-                tr.appendChild(td);
-                // Mozilla likes to see something inside the cell.
-                (HTMLArea.is_gecko) && td.appendChild(doc.createElement("br"));
-            }
-        }
-        if (HTMLArea.is_ie) {
-            range.pasteHTML(table.outerHTML);
-        } else {
-            // insert the table
-            editor.insertNodeAtSelection(table);
-        }
-        return true;
-    }, null);
-};
-/******************************************************************
-* Moodle hack - insertSmile
-******************************************************************/
-/// since method insertimage doesn't work the same way in mozilla
-/// as it does in IE, let's go around this for both browsers.
-HTMLArea.prototype._insertSmile = function() {
-    var sel = this._getSelection();
-    var range = this._createRange(sel);
-    var editor = this;  // for nested functions
-    this._popupDialog("dlg_ins_smile.php", function(imgString) {
-        if(!imgString) {
-            return false;
-        }
-        if (HTMLArea.is_ie) {
-            range.pasteHTML(imgString);
-        } else {
-            // insert the table
-            editor.insertHTML(imgString);
-        }
-        return true;
-    }, null);
-};
-
-HTMLArea.prototype._insertChar = function() {
-    var sel = this._getSelection();
-    var range = this._createRange(sel);
-    var editor = this;  // for nested functions
-    this._popupDialog("dlg_ins_char.php", function(sChar) {
-        if(!sChar) {
-            return false;
-        }
-        if (HTMLArea.is_ie) {
-            range.pasteHTML(sChar);
-        } else {
-            // insert the table
-            editor.insertHTML(sChar);
-        }
-        return true;
-    }, null);
-};
-
-HTMLArea.prototype._removelink = function() {
-    var editor = this;
-    link = this.getParentElement();
-    editor.selectNodeContents(link);
-
-    this._doc.execCommand("unlink", false, null);
-    this.focusEditor();
-};
-/************************************************************************
-* Moodle hack's ends
-************************************************************************/
-/***************************************************
- *  Category: EVENT HANDLERS
- ***************************************************/
-
-// el is reference to the SELECT object
-// txt is the name of the select field, as in config.toolbar
-HTMLArea.prototype._comboSelected = function(el, txt) {
-    this.focusEditor();
-    var value = el.options[el.selectedIndex].value;
-    switch (txt) {
-        case "fontname":
-        case "fontsize": this.execCommand(txt, false, value); break;
-        case "formatblock":
-        (HTMLArea.is_ie) && (value = "<" + value + ">");
-        this.execCommand(txt, false, value);
-        break;
-        default:
-        // try to look it up in the registered dropdowns
-        var dropdown = this.config.customSelects[txt];
-        if (typeof dropdown != "undefined") {
-            dropdown.action(this);
-        } else {
-            alert("FIXME: combo box " + txt + " not implemented");
-        }
-    }
-};
-
-// the execCommand function (intercepts some commands and replaces them with
-// our own implementation)
-HTMLArea.prototype.execCommand = function(cmdID, UI, param) {
-    var editor = this;  // for nested functions
-    this.focusEditor();
-    cmdID = cmdID.toLowerCase();
-    switch (cmdID) {
-        case "htmlmode" : this.setMode(); break;
-        case "hilitecolor":
-        (HTMLArea.is_ie) && (cmdID = "backcolor");
-        case "forecolor":
-        this._popupDialog("select_color.php", function(color) {
-            if (color) { // selection not canceled
-                editor._doc.execCommand(cmdID, false, "#" + color);
-            }
-        }, HTMLArea._colorToRgb(this._doc.queryCommandValue(cmdID)));
-        break;
-        case "createlink":
-        this._createLink();
-        break;
-        case "unlink": this._removelink(); break;
-        case "popupeditor":
-        // this object will be passed to the newly opened window
-        HTMLArea._object = this;
-        if (HTMLArea.is_ie) {
-            //if (confirm(HTMLArea.I18N.msg["IE-sucks-full-screen"]))
-            {
-                window.open(this.popupURL("fullscreen.php?id=<?php print($id);?>"), "ha_fullscreen",
-                    "toolbar=no,location=no,directories=no,status=no,menubar=no," +
-                        "scrollbars=no,resizable=yes,width=800,height=600");
-            }
-        } else {
-            window.open(this.popupURL("fullscreen.php?id=<?php print($id);?>"), "ha_fullscreen",
-                    "toolbar=no,menubar=no,personalbar=no,width=800,height=600," +
-                    "scrollbars=no,resizable=yes");
-        }
-        break;
-        case "undo":
-        case "redo":
-        if (this._customUndo)
-            this[cmdID]();
-        else
-            this._doc.execCommand(cmdID, UI, param);
-        break;
-        case "inserttable": this._insertTable(); break;
-        case "insertimage": this._insertImage(); break;
-        case "insertsmile": this._insertSmile(); break;
-        case "insertchar": this._insertChar(); break;
-        case "about"    : this._popupDialog("about.html", null, this); break;
-        case "showhelp" : window.open(_editor_url + "reference.html", "ha_help"); break;
-
-        case "killword": this._wordClean(); break;
-
-        case "cut":
-        case "copy":
-        case "paste":
-        try {
-            if (this.config.killWordOnPaste)
-                this._wordClean();
-            this._doc.execCommand(cmdID, UI, param);
-        } catch (e) {
-            if (HTMLArea.is_gecko) {
-                if (confirm("Unprivileged scripts cannot access Cut/Copy/Paste programatically " +
-                        "for security reasons.  Click OK to see a technical note at mozilla.org " +
-                        "which shows you how to allow a script to access the clipboard." +
-                        "\n\nFor more information HOW TO enable Cut/Copy/Paste see moodle -discussion: " +
-                        "\nhttp://moodle.org/mod/forum/discuss.php?d=5880"))
-                    window.open("http://mozilla.org/editor/midasdemo/securityprefs.html");
-            }
-        }
-        break;
-        case "lefttoright":
-        case "righttoleft":
-        var dir = (cmdID == "righttoleft") ? "rtl" : "ltr";
-        var el = this.getParentElement();
-        while (el && !HTMLArea.isBlockElement(el))
-            el = el.parentNode;
-        if (el) {
-            if (el.style.direction == dir)
-                el.style.direction = "";
-            else
-                el.style.direction = dir;
-        }
-        break;
-        default: this._doc.execCommand(cmdID, UI, param);
-    }
-    this.updateToolbar();
-    return false;
-};
-
-/** A generic event handler for things that happen in the IFRAME's document.
- * This function also handles key bindings. */
-HTMLArea.prototype._editorEvent = function(ev) {
-    var editor = this;
-    var keyEvent = (HTMLArea.is_ie && ev.type == "keydown") || (ev.type == "keypress");
-    if (keyEvent) {
-        for (var i in editor.plugins) {
-            var plugin = editor.plugins[i].instance;
-            if (typeof plugin.onKeyPress == "function") plugin.onKeyPress(ev);
-        }
-    }
-    if (keyEvent && ev.ctrlKey && ! ev.altKey) {
-        var sel = null;
-        var range = null;
-        var key = String.fromCharCode(HTMLArea.is_ie ? ev.keyCode : ev.charCode).toLowerCase();
-        var cmd = null;
-        var value = null;
-        switch (key) {
-            case 'a':
-            if (!HTMLArea.is_ie) {
-                // KEY select all
-                sel = this._getSelection();
-                sel.removeAllRanges();
-                range = this._createRange();
-                range.selectNodeContents(this._doc.body);
-                sel.addRange(range);
-                HTMLArea._stopEvent(ev);
-            }
-            break;
-
-            // simple key commands follow
-
-            case 'b': cmd = "bold"; break;
-            case 'i': cmd = "italic"; break;
-            case 'u': cmd = "underline"; break;
-            case 's': cmd = "strikethrough"; break;
-            case 'l': cmd = "justifyleft"; break;
-            case 'e': cmd = "justifycenter"; break;
-            case 'r': cmd = "justifyright"; break;
-            case 'j': cmd = "justifyfull"; break;
-            case 'z': cmd = "undo"; break;
-            case 'y': cmd = "redo"; break;
-            case 'v': cmd = "paste"; break;
-
-            case '0': cmd = "killword"; break;
-
-            // headings
-            case '1':
-            case '2':
-            case '3':
-            case '4':
-            case '5':
-            case '6':
-            cmd = "formatblock";
-            value = "h" + key;
-            if (HTMLArea.is_ie) {
-                value = "<" + value + ">";
-            }
-            break;
-        }
-        if (cmd) {
-            // execute simple command
-            this.execCommand(cmd, false, value);
-            HTMLArea._stopEvent(ev);
-        }
-    }
-    /*
-    else if (keyEvent) {
-        // other keys here
-        switch (ev.keyCode) {
-            case 13: // KEY enter
-            // if (HTMLArea.is_ie) {
-            this.insertHTML("<br />");
-            HTMLArea._stopEvent(ev);
-            // }
-            break;
-        }
-    }
-    */
-    // update the toolbar state after some time
-    if (editor._timerToolbar) {
-        clearTimeout(editor._timerToolbar);
-    }
-    editor._timerToolbar = setTimeout(function() {
-        editor.updateToolbar();
-        editor._timerToolbar = null;
-    }, 50);
-};
-
-// retrieve the HTML
-HTMLArea.prototype.getHTML = function() {
-    switch (this._editMode) {
-        case "wysiwyg"  :
-        if (!this.config.fullPage) {
-            return HTMLArea.getHTML(this._doc.body, false, this);
-        } else
-            return this.doctype + "\n" + HTMLArea.getHTML(this._doc.documentElement, true, this);
-        case "textmode" : return this._textArea.value;
-        default     : alert("Mode <" + mode + "> not defined!");
-    }
-    return false;
-};
-
-// retrieve the HTML (fastest version, but uses innerHTML)
-HTMLArea.prototype.getInnerHTML = function() {
-    switch (this._editMode) {
-        case "wysiwyg"  :
-        if (!this.config.fullPage)
-            return this._doc.body.innerHTML;
-        else
-            return this.doctype + "\n" + this._doc.documentElement.innerHTML;
-        case "textmode" : return this._textArea.value;
-        default     : alert("Mode <" + mode + "> not defined!");
-    }
-    return false;
-};
-
-// completely change the HTML inside
-HTMLArea.prototype.setHTML = function(html) {
-    switch (this._editMode) {
-        case "wysiwyg"  :
-        if (!this.config.fullPage)
-            this._doc.body.innerHTML = html;
-        else
-            // this._doc.documentElement.innerHTML = html;
-            this._doc.body.innerHTML = html;
-        break;
-        case "textmode" : this._textArea.value = html; break;
-        default     : alert("Mode <" + mode + "> not defined!");
-    }
-    return false;
-};
-
-// sets the given doctype (useful when config.fullPage is true)
-HTMLArea.prototype.setDoctype = function(doctype) {
-    this.doctype = doctype;
-};
-
-/***************************************************
- *  Category: UTILITY FUNCTIONS
- ***************************************************/
-
-// browser identification
-
-HTMLArea.agt = navigator.userAgent.toLowerCase();
-HTMLArea.is_ie     = ((HTMLArea.agt.indexOf("msie") != -1) && (HTMLArea.agt.indexOf("opera") == -1));
-HTMLArea.is_opera  = (HTMLArea.agt.indexOf("opera") != -1);
-HTMLArea.is_mac    = (HTMLArea.agt.indexOf("mac") != -1);
-HTMLArea.is_mac_ie = (HTMLArea.is_ie && HTMLArea.is_mac);
-HTMLArea.is_win_ie = (HTMLArea.is_ie && !HTMLArea.is_mac);
-HTMLArea.is_gecko  = (navigator.product == "Gecko");
-
-// variable used to pass the object to the popup editor window.
-HTMLArea._object = null;
-
-// function that returns a clone of the given object
-HTMLArea.cloneObject = function(obj) {
-    var newObj = new Object;
-
-    // check for array objects
-    if (obj.constructor.toString().indexOf("function Array(") == 1) {
-        newObj = obj.constructor();
-    }
-
-    // check for function objects (as usual, IE is phucked up)
-    if (obj.constructor.toString().indexOf("function Function(") == 1) {
-        newObj = obj; // just copy reference to it
-    } else for (var n in obj) {
-        var node = obj[n];
-        if (typeof node == 'object') { newObj[n] = HTMLArea.cloneObject(node); }
-        else                         { newObj[n] = node; }
-    }
-
-    return newObj;
-};
-
-// FIXME!!! this should return false for IE < 5.5
-HTMLArea.checkSupportedBrowser = function() {
-    if (HTMLArea.is_gecko) {
-        if (navigator.productSub < 20021201) {
-            alert("You need at least Mozilla-1.3 Alpha.\n" +
-                  "Sorry, your Gecko is not supported.");
-            return false;
-        }
-        if (navigator.productSub < 20030210) {
-            alert("Mozilla < 1.3 Beta is not supported!\n" +
-                  "I'll try, though, but it might not work.");
-        }
-    }
-    return HTMLArea.is_gecko || HTMLArea.is_ie;
-};
-
-// selection & ranges
-
-// returns the current selection object
-HTMLArea.prototype._getSelection = function() {
-    if (HTMLArea.is_ie) {
-        return this._doc.selection;
-    } else {
-        return this._iframe.contentWindow.getSelection();
-    }
-};
-
-// returns a range for the current selection
-HTMLArea.prototype._createRange = function(sel) {
-    if (HTMLArea.is_ie) {
-        return sel.createRange();
-    } else {
-        this.focusEditor();
-        if (typeof sel != "undefined") {
-            try {
-            return sel.getRangeAt(0);
-            } catch(e) {
-                return this._doc.createRange();
-            }
-        } else {
-            return this._doc.createRange();
-        }
-    }
-};
-
-// event handling
-
-HTMLArea._addEvent = function(el, evname, func) {
-    if (HTMLArea.is_ie) {
-        el.attachEvent("on" + evname, func);
-    } else {
-        el.addEventListener(evname, func, true);
-    }
-};
-
-HTMLArea._addEvents = function(el, evs, func) {
-    for (var i in evs) {
-        HTMLArea._addEvent(el, evs[i], func);
-    }
-};
-
-HTMLArea._removeEvent = function(el, evname, func) {
-    if (HTMLArea.is_ie) {
-        el.detachEvent("on" + evname, func);
-    } else {
-        el.removeEventListener(evname, func, true);
-    }
-};
-
-HTMLArea._removeEvents = function(el, evs, func) {
-    for (var i in evs) {
-        HTMLArea._removeEvent(el, evs[i], func);
-    }
-};
-
-HTMLArea._stopEvent = function(ev) {
-    if (HTMLArea.is_ie) {
-        ev.cancelBubble = true;
-        ev.returnValue = false;
-    } else {
-        ev.preventDefault();
-        ev.stopPropagation();
-    }
-};
-
-HTMLArea._removeClass = function(el, className) {
-    if (!(el && el.className)) {
-        return;
-    }
-    var cls = el.className.split(" ");
-    var ar = new Array();
-    for (var i = cls.length; i > 0;) {
-        if (cls[--i] != className) {
-            ar[ar.length] = cls[i];
-        }
-    }
-    el.className = ar.join(" ");
-};
-
-HTMLArea._addClass = function(el, className) {
-    // remove the class first, if already there
-    HTMLArea._removeClass(el, className);
-    el.className += " " + className;
-};
-
-HTMLArea._hasClass = function(el, className) {
-    if (!(el && el.className)) {
-        return false;
-    }
-    var cls = el.className.split(" ");
-    for (var i = cls.length; i > 0;) {
-        if (cls[--i] == className) {
-            return true;
-        }
-    }
-    return false;
-};
-
-HTMLArea.isBlockElement = function(el) {
-    var blockTags = " body form textarea fieldset ul ol dl li div " +
-        "p h1 h2 h3 h4 h5 h6 quote pre table thead " +
-        "tbody tfoot tr td iframe address ";
-    return (blockTags.indexOf(" " + el.tagName.toLowerCase() + " ") != -1);
-};
-
-HTMLArea.needsClosingTag = function(el) {
-    var closingTags = " head script style div span tr td tbody table em strong font a title ";
-    return (closingTags.indexOf(" " + el.tagName.toLowerCase() + " ") != -1);
-};
-
-// performs HTML encoding of some given string
-HTMLArea.htmlEncode = function(str) {
-    // we don't need regexp for that, but.. so be it for now.
-    str = str.replace(/&/ig, "&amp;");
-    str = str.replace(/</ig, "&lt;");
-    str = str.replace(/>/ig, "&gt;");
-    str = str.replace(/\x22/ig, "&quot;");
-    // \x22 means '"' -- we use hex reprezentation so that we don't disturb
-    // JS compressors (well, at least mine fails.. ;)
-    return str;
-};
-
-// Retrieves the HTML code from the given node.  This is a replacement for
-// getting innerHTML, using standard DOM calls.
-HTMLArea.getHTML = function(root, outputRoot, editor) {
-    var html = "";
-    switch (root.nodeType) {
-        case 1: // Node.ELEMENT_NODE
-        case 11: // Node.DOCUMENT_FRAGMENT_NODE
-        var closed;
-        var i;
-        var root_tag = (root.nodeType == 1) ? root.tagName.toLowerCase() : '';
-        if (HTMLArea.is_ie && root_tag == "head") {
-            if (outputRoot)
-                html += "<head>";
-            // lowercasize
-            var save_multiline = RegExp.multiline;
-            RegExp.multiline = true;
-            var txt = root.innerHTML.replace(HTMLArea.RE_tagName, function(str, p1, p2) {
-                return p1 + p2.toLowerCase();
-            });
-            RegExp.multiline = save_multiline;
-            html += txt;
-            if (outputRoot)
-                html += "</head>";
-            break;
-        } else if (outputRoot) {
-            closed = (!(root.hasChildNodes() || HTMLArea.needsClosingTag(root)));
-            html = "<" + root.tagName.toLowerCase();
-            var attrs = root.attributes;
-            for (i = 0; i < attrs.length; ++i) {
-                var a = attrs.item(i);
-                if (!a.specified) {
-                    continue;
-                }
-                var name = a.nodeName.toLowerCase();
-                if (/_moz|contenteditable|_msh/.test(name)) {
-                    // avoid certain attributes
-                    continue;
-                }
-                var value;
-                if (name != "style") {
-                    // IE5.5 reports 25 when cellSpacing is
-                    // 1; other values might be doomed too.
-                    // For this reason we extract the
-                    // values directly from the root node.
-                    // I'm starting to HATE JavaScript
-                    // development.  Browser differences
-                    // suck.
-                    //
-                    // Using Gecko the values of href and src are converted to absolute links
-                    // unless we get them using nodeValue()
-                    if (typeof root[a.nodeName] != "undefined" && name != "href" && name != "src") {
-                        value = root[a.nodeName];
-                    } else {
-                        value = a.nodeValue;
-                        // IE seems not willing to return the original values - it converts to absolute
-                        // links using a.nodeValue, a.value, a.stringValue, root.getAttribute("href")
-                        // So we have to strip the baseurl manually -/
-                        if (HTMLArea.is_ie && (name == "href" || name == "src")) {
-                            value = editor.stripBaseURL(value);
-                        }
-                    }
-                } else { // IE fails to put style in attributes list
-                    // FIXME: cssText reported by IE is UPPERCASE
-                    value = root.style.cssText;
-                }
-                if (/(_moz|^$)/.test(value)) {
-                    // Mozilla reports some special tags
-                    // here; we don't need them.
-                    continue;
-                }
-                html += " " + name + '="' + value + '"';
-            }
-            html += closed ? " />" : ">";
-        }
-        for (i = root.firstChild; i; i = i.nextSibling) {
-            html += HTMLArea.getHTML(i, true, editor);
-        }
-        if (outputRoot && !closed) {
-            html += "</" + root.tagName.toLowerCase() + ">";
-        }
-        break;
-        case 3: // Node.TEXT_NODE
-        // If a text node is alone in an element and all spaces, replace it with an non breaking one
-        // This partially undoes the damage done by moz, which translates '&nbsp;'s into spaces in the data element
-        if ( !root.previousSibling && !root.nextSibling && root.data.match(/^\s*$/i) ) html = '&nbsp;';
-        else html = HTMLArea.htmlEncode(root.data);
-        break;
-        case 8: // Node.COMMENT_NODE
-        html = "<!--" + root.data + "-->";
-        break;      // skip comments, for now.
-    }
-    return html;
-};
-
-HTMLArea.prototype.stripBaseURL = function(string) {
-    var baseurl = this.config.baseURL;
-
-    // IE adds the path to an anchor, converting #anchor
-    // to path/#anchor which of course needs to be fixed
-    var index = string.indexOf("/#")+1;
-    if ((index > 0) && (string.indexOf(baseurl) > -1)) {
-        return string.substr(index);
-    }
-    return string; // Moodle doesn't use the code below because
-                   // Moodle likes to keep absolute links
-
-    // strip to last directory in case baseurl points to a file
-    baseurl = baseurl.replace(/[^\/]+$/, '');
-    var basere = new RegExp(baseurl);
-    string = string.replace(basere, "");
-
-    // strip host-part of URL which is added by MSIE to links relative to server root
-    baseurl = baseurl.replace(/^(https?:\/\/[^\/]+)(.*)$/, '$1');
-    basere = new RegExp(baseurl);
-    return string.replace(basere, "");
-};
-
-String.prototype.trim = function() {
-    a = this.replace(/^\s+/, '');
-    return a.replace(/\s+$/, '');
-};
-
-// creates a rgb-style color from a number
-HTMLArea._makeColor = function(v) {
-    if (typeof v != "number") {
-        // already in rgb (hopefully); IE doesn't get here.
-        return v;
-    }
-    // IE sends number; convert to rgb.
-    var r = v & 0xFF;
-    var g = (v >> 8) & 0xFF;
-    var b = (v >> 16) & 0xFF;
-    return "rgb(" + r + "," + g + "," + b + ")";
-};
-
-// returns hexadecimal color representation from a number or a rgb-style color.
-HTMLArea._colorToRgb = function(v) {
-    if (!v)
-        return '';
-
-    // returns the hex representation of one byte (2 digits)
-    function hex(d) {
-        return (d < 16) ? ("0" + d.toString(16)) : d.toString(16);
-    };
-
-    if (typeof v == "number") {
-        // we're talking to IE here
-        var r = v & 0xFF;
-        var g = (v >> 8) & 0xFF;
-        var b = (v >> 16) & 0xFF;
-        return "#" + hex(r) + hex(g) + hex(b);
-    }
-
-    if (v.substr(0, 3) == "rgb") {
-        // in rgb(...) form -- Mozilla
-        var re = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/;
-        if (v.match(re)) {
-            var r = parseInt(RegExp.$1);
-            var g = parseInt(RegExp.$2);
-            var b = parseInt(RegExp.$3);
-            return "#" + hex(r) + hex(g) + hex(b);
-        }
-        // doesn't match RE?!  maybe uses percentages or float numbers
-        // -- FIXME: not yet implemented.
-        return null;
-    }
-
-    if (v.substr(0, 1) == "#") {
-        // already hex rgb (hopefully :D )
-        return v;
-    }
-
-    // if everything else fails ;)
-    return null;
-};
-
-// modal dialogs for Mozilla (for IE we're using the showModalDialog() call).
-
-// receives an URL to the popup dialog and a function that receives one value;
-// this function will get called after the dialog is closed, with the return
-// value of the dialog.
-HTMLArea.prototype._popupDialog = function(url, action, init) {
-    Dialog(this.popupURL(url), action, init);
-};
-
-// paths
-
-HTMLArea.prototype.imgURL = function(file, plugin) {
-    if (typeof plugin == "undefined")
-        return _editor_url + file;
-    else
-        return _editor_url + "plugins/" + plugin + "/img/" + file;
-};
-
-HTMLArea.prototype.popupURL = function(file) {
-    var url = "";
-    if (file.match(/^plugin:\/\/(.*?)\/(.*)/)) {
-        var plugin = RegExp.$1;
-        var popup = RegExp.$2;
-        if (!/\.html$/.test(popup))
-            popup += ".html";
-        url = _editor_url + "plugins/" + plugin + "/popups/" + popup;
-    } else
-        url = _editor_url + this.config.popupURL + file;
-    return url;
-};
-
-/**
- * FIX: Internet Explorer returns an item having the _name_ equal to the given
- * id, even if it's not having any id.  This way it can return a different form
- * field even if it's not a textarea.  This workarounds the problem by
- * specifically looking to search only elements having a certain tag name.
- */
-HTMLArea.getElementById = function(tag, id) {
-    var el, i, objs = document.getElementsByTagName(tag);
-    for (i = objs.length; --i >= 0 && (el = objs[i]);)
-        if (el.id == id)
-            return el;
-    return null;
-};
-
-
-
-// EOF
-// Local variables: //
-// c-basic-offset:8 //
-// indent-tabs-mode:t //
-// End: //
diff --git a/lib/editor/htmlarea/images/ed_about.gif b/lib/editor/htmlarea/images/ed_about.gif
deleted file mode 100644 (file)
index d476271..0000000
Binary files a/lib/editor/htmlarea/images/ed_about.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_align_center.gif b/lib/editor/htmlarea/images/ed_align_center.gif
deleted file mode 100644 (file)
index 0966910..0000000
Binary files a/lib/editor/htmlarea/images/ed_align_center.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_align_justify.gif b/lib/editor/htmlarea/images/ed_align_justify.gif
deleted file mode 100644 (file)
index 94a1ea7..0000000
Binary files a/lib/editor/htmlarea/images/ed_align_justify.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_align_left.gif b/lib/editor/htmlarea/images/ed_align_left.gif
deleted file mode 100644 (file)
index 595eef6..0000000
Binary files a/lib/editor/htmlarea/images/ed_align_left.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_align_right.gif b/lib/editor/htmlarea/images/ed_align_right.gif
deleted file mode 100644 (file)
index 514a5e4..0000000
Binary files a/lib/editor/htmlarea/images/ed_align_right.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_anchor.gif b/lib/editor/htmlarea/images/ed_anchor.gif
deleted file mode 100644 (file)
index 65eca72..0000000
Binary files a/lib/editor/htmlarea/images/ed_anchor.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_blank.gif b/lib/editor/htmlarea/images/ed_blank.gif
deleted file mode 100644 (file)
index d7ae406..0000000
Binary files a/lib/editor/htmlarea/images/ed_blank.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_charmap.gif b/lib/editor/htmlarea/images/ed_charmap.gif
deleted file mode 100644 (file)
index b0dc889..0000000
Binary files a/lib/editor/htmlarea/images/ed_charmap.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_color_bg.gif b/lib/editor/htmlarea/images/ed_color_bg.gif
deleted file mode 100644 (file)
index f6ff05d..0000000
Binary files a/lib/editor/htmlarea/images/ed_color_bg.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_color_fg.gif b/lib/editor/htmlarea/images/ed_color_fg.gif
deleted file mode 100644 (file)
index 90e5123..0000000
Binary files a/lib/editor/htmlarea/images/ed_color_fg.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_copy.gif b/lib/editor/htmlarea/images/ed_copy.gif
deleted file mode 100644 (file)
index f598fa2..0000000
Binary files a/lib/editor/htmlarea/images/ed_copy.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_custom.gif b/lib/editor/htmlarea/images/ed_custom.gif
deleted file mode 100644 (file)
index 3c406a5..0000000
Binary files a/lib/editor/htmlarea/images/ed_custom.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_cut.gif b/lib/editor/htmlarea/images/ed_cut.gif
deleted file mode 100644 (file)
index 92972fc..0000000
Binary files a/lib/editor/htmlarea/images/ed_cut.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_delete.gif b/lib/editor/htmlarea/images/ed_delete.gif
deleted file mode 100644 (file)
index 1218349..0000000
Binary files a/lib/editor/htmlarea/images/ed_delete.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_format_bold.gif b/lib/editor/htmlarea/images/ed_format_bold.gif
deleted file mode 100644 (file)
index 3d01d0b..0000000
Binary files a/lib/editor/htmlarea/images/ed_format_bold.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_format_italic.gif b/lib/editor/htmlarea/images/ed_format_italic.gif
deleted file mode 100644 (file)
index e8e1cb0..0000000
Binary files a/lib/editor/htmlarea/images/ed_format_italic.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_format_strike.gif b/lib/editor/htmlarea/images/ed_format_strike.gif
deleted file mode 100644 (file)
index 4885361..0000000
Binary files a/lib/editor/htmlarea/images/ed_format_strike.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_format_sub.gif b/lib/editor/htmlarea/images/ed_format_sub.gif
deleted file mode 100644 (file)
index 489f7a9..0000000
Binary files a/lib/editor/htmlarea/images/ed_format_sub.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_format_sup.gif b/lib/editor/htmlarea/images/ed_format_sup.gif
deleted file mode 100644 (file)
index 8e66b99..0000000
Binary files a/lib/editor/htmlarea/images/ed_format_sup.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_format_underline.gif b/lib/editor/htmlarea/images/ed_format_underline.gif
deleted file mode 100644 (file)
index b05384e..0000000
Binary files a/lib/editor/htmlarea/images/ed_format_underline.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_help.gif b/lib/editor/htmlarea/images/ed_help.gif
deleted file mode 100644 (file)
index 4d66154..0000000
Binary files a/lib/editor/htmlarea/images/ed_help.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_hr.gif b/lib/editor/htmlarea/images/ed_hr.gif
deleted file mode 100644 (file)
index 92fc80e..0000000
Binary files a/lib/editor/htmlarea/images/ed_hr.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_html.gif b/lib/editor/htmlarea/images/ed_html.gif
deleted file mode 100644 (file)
index 380de29..0000000
Binary files a/lib/editor/htmlarea/images/ed_html.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_image.gif b/lib/editor/htmlarea/images/ed_image.gif
deleted file mode 100644 (file)
index a715019..0000000
Binary files a/lib/editor/htmlarea/images/ed_image.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_indent_less.gif b/lib/editor/htmlarea/images/ed_indent_less.gif
deleted file mode 100644 (file)
index 6054d61..0000000
Binary files a/lib/editor/htmlarea/images/ed_indent_less.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_indent_more.gif b/lib/editor/htmlarea/images/ed_indent_more.gif
deleted file mode 100644 (file)
index c5dd55d..0000000
Binary files a/lib/editor/htmlarea/images/ed_indent_more.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_left_to_right.gif b/lib/editor/htmlarea/images/ed_left_to_right.gif
deleted file mode 100644 (file)
index 5016b4b..0000000
Binary files a/lib/editor/htmlarea/images/ed_left_to_right.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_link.gif b/lib/editor/htmlarea/images/ed_link.gif
deleted file mode 100644 (file)
index 0482da3..0000000
Binary files a/lib/editor/htmlarea/images/ed_link.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_list_bullet.gif b/lib/editor/htmlarea/images/ed_list_bullet.gif
deleted file mode 100644 (file)
index 7b07303..0000000
Binary files a/lib/editor/htmlarea/images/ed_list_bullet.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_list_num.gif b/lib/editor/htmlarea/images/ed_list_num.gif
deleted file mode 100644 (file)
index ae4e03b..0000000
Binary files a/lib/editor/htmlarea/images/ed_list_num.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_nolink.gif b/lib/editor/htmlarea/images/ed_nolink.gif
deleted file mode 100644 (file)
index c9b8069..0000000
Binary files a/lib/editor/htmlarea/images/ed_nolink.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_paste.gif b/lib/editor/htmlarea/images/ed_paste.gif
deleted file mode 100644 (file)
index 6892053..0000000
Binary files a/lib/editor/htmlarea/images/ed_paste.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_redo.gif b/lib/editor/htmlarea/images/ed_redo.gif
deleted file mode 100644 (file)
index 2b5ebbd..0000000
Binary files a/lib/editor/htmlarea/images/ed_redo.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_replace.gif b/lib/editor/htmlarea/images/ed_replace.gif
deleted file mode 100644 (file)
index 58b379c..0000000
Binary files a/lib/editor/htmlarea/images/ed_replace.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_right_to_left.gif b/lib/editor/htmlarea/images/ed_right_to_left.gif
deleted file mode 100644 (file)
index fed7159..0000000
Binary files a/lib/editor/htmlarea/images/ed_right_to_left.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_show_border.gif b/lib/editor/htmlarea/images/ed_show_border.gif
deleted file mode 100644 (file)
index 23a01a4..0000000
Binary files a/lib/editor/htmlarea/images/ed_show_border.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_splitcel.gif b/lib/editor/htmlarea/images/ed_splitcel.gif
deleted file mode 100644 (file)
index 48442e2..0000000
Binary files a/lib/editor/htmlarea/images/ed_splitcel.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_undo.gif b/lib/editor/htmlarea/images/ed_undo.gif
deleted file mode 100644 (file)
index 05f041e..0000000
Binary files a/lib/editor/htmlarea/images/ed_undo.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_unlink.gif b/lib/editor/htmlarea/images/ed_unlink.gif
deleted file mode 100644 (file)
index f653109..0000000
Binary files a/lib/editor/htmlarea/images/ed_unlink.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/ed_wordclean.gif b/lib/editor/htmlarea/images/ed_wordclean.gif
deleted file mode 100644 (file)
index d695866..0000000
Binary files a/lib/editor/htmlarea/images/ed_wordclean.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/em.icon.smile.gif b/lib/editor/htmlarea/images/em.icon.smile.gif
deleted file mode 100644 (file)
index 5985cc0..0000000
Binary files a/lib/editor/htmlarea/images/em.icon.smile.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/folderup.gif b/lib/editor/htmlarea/images/folderup.gif
deleted file mode 100644 (file)
index 0a5800b..0000000
Binary files a/lib/editor/htmlarea/images/folderup.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/fullscreen_maximize.gif b/lib/editor/htmlarea/images/fullscreen_maximize.gif
deleted file mode 100644 (file)
index 0536fec..0000000
Binary files a/lib/editor/htmlarea/images/fullscreen_maximize.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/fullscreen_minimize.gif b/lib/editor/htmlarea/images/fullscreen_minimize.gif
deleted file mode 100644 (file)
index b12c3f7..0000000
Binary files a/lib/editor/htmlarea/images/fullscreen_minimize.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/icon_ins_char.gif b/lib/editor/htmlarea/images/icon_ins_char.gif
deleted file mode 100644 (file)
index 62cab1f..0000000
Binary files a/lib/editor/htmlarea/images/icon_ins_char.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/icon_smile.gif b/lib/editor/htmlarea/images/icon_smile.gif
deleted file mode 100644 (file)
index 46bafcd..0000000
Binary files a/lib/editor/htmlarea/images/icon_smile.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/insert_table.gif b/lib/editor/htmlarea/images/insert_table.gif
deleted file mode 100644 (file)
index 4ce3ff4..0000000
Binary files a/lib/editor/htmlarea/images/insert_table.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/kbhelp.gif b/lib/editor/htmlarea/images/kbhelp.gif
deleted file mode 100644 (file)
index 00e7ba3..0000000
Binary files a/lib/editor/htmlarea/images/kbhelp.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/images/spell-check.gif b/lib/editor/htmlarea/images/spell-check.gif
deleted file mode 100644 (file)
index 29bd11a..0000000
Binary files a/lib/editor/htmlarea/images/spell-check.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/index.html b/lib/editor/htmlarea/index.html
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/lib/editor/htmlarea/lang/en.js b/lib/editor/htmlarea/lang/en.js
deleted file mode 100644 (file)
index 70e0c35..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-// I18N constants
-
-// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
-// Author: Mihai Bazon, <mishoo@infoiasi.ro>
-
-// FOR TRANSLATORS:
-//
-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
-//      (at least a valid email address)
-//
-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
-//      (if this is not possible, please include a comment
-//       that states what encoding is necessary.)
-
-HTMLArea.I18N = {
-
-       // the following should be the filename without .js extension
-       // it will be used for automatically load plugin language.
-       lang: "en",
-
-       tooltips: {
-               bold:           "Bold",
-               italic:         "Italic",
-               underline:      "Underline",
-               strikethrough:  "Strikethrough",
-               subscript:      "Subscript",
-               superscript:    "Superscript",
-               justifyleft:    "Justify Left",
-               justifycenter:  "Justify Center",
-               justifyright:   "Justify Right",
-               justifyfull:    "Justify Full",
-               orderedlist:    "Ordered List",
-               unorderedlist:  "Bulleted List",
-               outdent:        "Decrease Indent",
-               indent:         "Increase Indent",
-               forecolor:      "Font Color",
-               hilitecolor:    "Background Color",
-               horizontalrule: "Horizontal Rule",
-               createlink:     "Insert Web Link",
-               insertimage:    "Insert Image",
-               inserttable:    "Insert Table",
-               htmlmode:       "Toggle HTML Source",
-               popupeditor:    "Enlarge Editor",
-               about:          "About this editor",
-               showhelp:       "Help using editor",
-               textindicator:  "Current style",
-               undo:           "Undoes your last action",
-               redo:           "Redoes your last action",
-               cut:            "Cut selection",
-               copy:           "Copy selection",
-               paste:          "Paste from clipboard"
-       },
-
-       buttons: {
-               "ok":           "OK",
-               "cancel":       "Cancel"
-       },
-
-       msg: {
-               "Path":         "Path",
-               "TEXT_MODE":    "You are in TEXT MODE.  Use the [<>] button to switch back to WYSIWIG."
-       }
-};
diff --git a/lib/editor/htmlarea/lang/en.php b/lib/editor/htmlarea/lang/en.php
deleted file mode 100644 (file)
index 41a261b..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-<?php // $Id$
-    include("../../../../config.php");
-    $lastmodified = filemtime("en.php");
-    $lifetime = 1800;
-
-    // Commenting this out since it's creating problems
-    // where solution seem to be hard to find...
-    // http://moodle.org/mod/forum/discuss.php?d=34376
-    //if ( function_exists('ob_gzhandler') ) {
-    //    ob_start("ob_gzhandler");
-    //}
-
-    header("Content-type: application/x-javascript; charset: utf-8");  // Correct MIME type
-    header("Last-Modified: " . gmdate("D, d M Y H:i:s", $lastmodified) . " GMT");
-    header("Expires: " . gmdate("D, d M Y H:i:s", time() + $lifetime) . " GMT");
-    // See Bug #2387
-    header("Cache-control: max_age = -1");
-    header("Pragma: no-cache");
-
-?>
-// I18N constants
-
-// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
-// Author: Mihai Bazon, <mishoo@infoiasi.ro>
-
-// FOR TRANSLATORS:
-//
-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
-//      (at least a valid email address)
-//
-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
-//      (if this is not possible, please include a comment
-//       that states what encoding is necessary.)
-HTMLArea.I18N = {
-
-    // the following should be the filename without .js extension
-    // it will be used for automatically load plugin language.
-    lang: "en",
-
-    tooltips: {
-        bold:           "<?php print_string("bold","editor") ?>",
-        italic:         "<?php print_string("italic","editor") ?>",
-        underline:      "<?php print_string("underline","editor") ?>",
-        strikethrough:  "<?php print_string("strikethrough","editor") ?>",
-        subscript:      "<?php print_string("subscript","editor") ?>",
-        superscript:    "<?php print_string("superscript","editor") ?>",
-        justifyleft:    "<?php print_string("justifyleft","editor") ?>",
-        justifycenter:  "<?php print_string("justifycenter","editor") ?>",
-        justifyright:   "<?php print_string("justifyright","editor") ?>",
-        justifyfull:    "<?php print_string("justifyfull","editor") ?>",
-        insertorderedlist:    "<?php print_string("orderedlist","editor") ?>",
-        insertunorderedlist:  "<?php print_string("unorderedlist","editor") ?>",
-        outdent:        "<?php print_string("outdent","editor") ?>",
-        indent:         "<?php print_string("indent","editor") ?>",
-        forecolor:      "<?php print_string("forecolor","editor") ?>",
-        hilitecolor:    "<?php print_string("hilitecolor","editor") ?>",
-        inserthorizontalrule: "<?php print_string("horizontalrule","editor") ?>",
-        createlink:     "<?php print_string("createlink","editor") ?>",
-        unlink:         "<?php print_string("removelink","editor") ?>",
-        nolink:         "<?php print_string("nolink","editor") ?>",
-        insertimage:    "<?php print_string("insertimage","editor") ?>",
-        inserttable:    "<?php print_string("inserttable","editor") ?>",
-        htmlmode:       "<?php print_string("htmlmode","editor") ?>",
-        popupeditor:    "<?php print_string("popupeditor","editor") ?>",
-        about:          "<?php print_string("about","editor") ?>",
-        showhelp:       "<?php print_string("showhelp","editor") ?>",
-        textindicator:  "<?php print_string("textindicator","editor") ?>",
-        undo:           "<?php print_string("undo","editor") ?>",
-        redo:           "<?php print_string("redo","editor") ?>",
-        cut:            "<?php print_string("cut","editor") ?>",
-        copy:           "<?php print_string("copy","editor") ?>",
-        paste:          "<?php print_string("paste","editor") ?>",
-        insertsmile:    "<?php print_string("insertsmile","editor") ?>",
-        insertchar:     "<?php print_string("insertchar","editor") ?>",
-        search_replace: "<?php print_string("searchandreplace","editor") ?>",
-        clean:          "<?php print_string("wordclean","editor") ?>",
-        lefttoright:    "<?php print_string("lefttoright","editor");?>",
-        righttoleft:    "<?php print_string("righttoleft","editor");?>"
-    },
-
-    buttons: {
-        "ok":           "<?php print_string("ok","editor") ?>",
-        "cancel":       "<?php print_string("cancel","editor") ?>",
-        "browse":       "<?php print_string("browse","editor") ?>"
-    },
-
-    msg: {
-        "Path":         "<?php print_string("path","editor") ?>",
-        "TEXT_MODE":    "<?php print_string("textmode","editor") ?>"
-    }
-};
diff --git a/lib/editor/htmlarea/license.txt b/lib/editor/htmlarea/license.txt
deleted file mode 100644 (file)
index 4365ee4..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-htmlArea License (based on BSD license)
-Copyright (c) 2002, interactivetools.com, inc.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
-1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 
-
-2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 
-
-3) Neither the name of interactivetools.com, inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/lib/editor/htmlarea/plugins/GetHtml/get-html.js b/lib/editor/htmlarea/plugins/GetHtml/get-html.js
deleted file mode 100644 (file)
index c9d74b2..0000000
+++ /dev/null
@@ -1,203 +0,0 @@
-/**
-  * Based on XML_Utility functions submitted by troels_kn.
-  * credit also to adios, who helped with reg exps:
-  * http://www.sitepoint.com/forums/showthread.php?t=201052
-  * 
-  * A replacement for HTMLArea.getHTML
-  *
-  * Features:
-  *   - Generates XHTML code
-  *   - Much faster than HTMLArea.getHTML
-  *   - Eliminates the hacks to accomodate browser quirks
-  *   - Returns correct code for Flash objects and scripts
-  *   - Formats html in an indented, readable format in html mode
-  *   - Preserves script and pre formatting
-  *   - Preserves formatting in comments
-  *   - Removes contenteditable from body tag in full-page mode
-  *   - Supports only7BitPrintablesInURLs config option
-  *   - Supports htmlRemoveTags config option
-  */
-  
-function GetHtml(editor) {
-    this.editor = editor;
-}
-
-GetHtml._pluginInfo = {
-       name          : "GetHtml",
-       version       : "1.0",
-       developer     : "Nelson Bright",
-       developer_url : "http://www.brightworkweb.com/",
-       license       : "htmlArea"
-};
-
-HTMLArea.RegExpCache = [
-/*00*/  new RegExp().compile(/<\s*\/?([^\s\/>]+)[\s*\/>]/gi),//lowercase tags
-/*01*/  new RegExp().compile(/(\S*\s*=\s*)?_moz[^=>]*(=\s*[^>]*)?/gi),//strip _moz attributes
-/*02*/  new RegExp().compile(/\s*=\s*(([^'"][^>\s]*)([>\s])|"([^"]+)"|'([^']+)')/g),// find attributes
-/*03*/  new RegExp().compile(/\/>/g),//strip singlet terminators
-/*04*/ // new RegExp().compile(/<(br|hr|img|input|link|meta|param|embed)([^>]*)>/g),//terminate singlet tags
-/*04*/  new RegExp().compile(/<(br|hr|img|input|link|meta|param|embed|area)((\s*\S*="[^"]*")*)>/g),//terminate singlet tags
-/*05*/  new RegExp().compile(/(checked|compact|declare|defer|disabled|ismap|multiple|no(href|resize|shade|wrap)|readonly|selected)([\s>])/gi),//expand singlet attributes
-/*06*/  new RegExp().compile(/(="[^']*)'([^'"]*")/),//check quote nesting
-/*07*/  new RegExp().compile(/&(?=[^<]*>)/g),//expand query ampersands
-/*08*/  new RegExp().compile(/<\s+/g),//strip tagstart whitespace
-/*09*/  new RegExp().compile(/\s+(\/)?>/g),//trim whitespace
-/*10*/  new RegExp().compile(/\s{2,}/g),//trim extra whitespace
-/*11*/  new RegExp().compile(/\s+([^=\s]+)(="[^"]+")/g),// lowercase attribute names
-/*12*/  new RegExp().compile(/(\S*\s*=\s*)?contenteditable[^=>]*(=\s*[^>\s\/]*)?/gi),//strip contenteditable
-/*13*/  new RegExp().compile(/((href|src)=")([^\s]*)"/g), //find href and src for stripBaseHref()
-/*14*/  new RegExp().compile(/<\/?(div|p|h[1-6]|table|tr|td|th|ul|ol|li|blockquote|object|br|hr|img|embed|param|pre|script|html|head|body|meta|link|title|area)[^>]*>/g),
-/*15*/  new RegExp().compile(/<\/(div|p|h[1-6]|table|tr|td|th|ul|ol|li|blockquote|object|html|head|body|script)( [^>]*)?>/g),//blocklevel closing tag
-/*16*/  new RegExp().compile(/<(div|p|h[1-6]|table|tr|td|th|ul|ol|li|blockquote|object|html|head|body|script)( [^>]*)?>/g),//blocklevel opening tag
-/*17*/  new RegExp().compile(/<(br|hr|img|embed|param|pre|meta|link|title|area)[^>]*>/g),//singlet tag
-/*18*/  new RegExp().compile(/(^|<\/(pre|script)>)(\s|[^\s])*?(<(pre|script)[^>]*>|$)/g),//find content NOT inside pre and script tags
-/*19*/  new RegExp().compile(/(<pre[^>]*>)(\s|[^\s])*?(<\/pre>)/g),//find content inside pre tags
-/*20*/  new RegExp().compile(/(^|<!--(\s|\S)*?-->)((\s|\S)*?)(?=<!--(\s|\S)*?-->|$)/g),//find content NOT inside comments
-/*21*/  new RegExp().compile(/\S*=""/g), //find empty attributes
-/*22*/  new RegExp().compile(/<!--[\s\S]*?-->|<\?[\s\S]*?\?>|<[^>]*>/g) //find all tags, including comments and php
-];
-
-/** 
-  * Cleans HTML into wellformed xhtml
-  */
-HTMLArea.prototype.cleanHTML = function(sHtml) {
-       var c = HTMLArea.RegExpCache;
-       sHtml = sHtml.
-               replace(c[0], function(str) { return str.toLowerCase(); } ).//lowercase tags/attribute names
-               replace(c[1], ' ').//strip _moz attributes
-               replace(c[12], ' ').//strip contenteditable
-               replace(c[2], '="$2$4$5"$3').//add attribute quotes
-               replace(c[21], ' ').//strip empty attributes
-               replace(c[11], function(str, p1, p2) { return ' '+p1.toLowerCase()+p2; }).//lowercase attribute names
-               replace(c[3], '>').//strip singlet terminators
-               replace(c[9], '$1>').//trim whitespace
-               replace(c[5], '$1="$1"$3').//expand singlet attributes
-               replace(c[4], '<$1$2 />').//terminate singlet tags
-               replace(c[6], '$1$2').//check quote nesting
-       //      replace(c[7], '&amp;').//expand query ampersands
-               replace(c[8], '<').//strip tagstart whitespace
-               replace(c[10], ' ');//trim extra whitespace
-       if(HTMLArea.is_ie && c[13].test(sHtml)) {//
-               sHtml = sHtml.replace(c[13],'$1'+this.stripBaseURL(RegExp.$3)+'"');
-       }
-       if(this.config.only7BitPrintablesInURLs && c[13].test(sHtml)) {
-         sHtml = sHtml.replace(c[13], '$1'+RegExp.$3.replace(/([^!-~]+)/g,function(chr){return escape(chr);})+'"');
-       }
-       return sHtml;
-};
-
-/**
-  * Prettyfies html by inserting linebreaks before tags, and indenting blocklevel tags
-  */
-HTMLArea.indent = function(s, sindentChar) {
-       HTMLArea.__nindent = 0;
-       HTMLArea.__sindent = "";
-       HTMLArea.__sindentChar = (typeof sindentChar == "undefined") ? "  " : sindentChar;
-       var c = HTMLArea.RegExpCache;
-       if(HTMLArea.is_gecko) { //moz changes returns into <br> inside <pre> tags
-               s = s.replace(c[19], function(str){return str.replace(/<br \/>/g,"\n")});
-       }
-       s = s.replace(c[18], function(strn) { //skip pre and script tags
-         strn = strn.replace(c[20], function(st,$1,$2,$3) { //exclude comments
-               string = $3.replace(/[\n\r]/gi, " ").replace(/\s+/gi," ").replace(c[14], function(str) {
-                       if (str.match(c[16])) {
-                               var s = "\n" + HTMLArea.__sindent + str;
-                               // blocklevel openingtag - increase indent
-                               HTMLArea.__sindent += HTMLArea.__sindentChar;
-                               ++HTMLArea.__nindent;
-                               return s;
-                       } else if (str.match(c[15])) {
-                               // blocklevel closingtag - decrease indent
-                               --HTMLArea.__nindent;
-                               HTMLArea.__sindent = "";
-                               for (var i=HTMLArea.__nindent;i>0;--i) {
-                                       HTMLArea.__sindent += HTMLArea.__sindentChar;
-                               }
-                               return "\n" + HTMLArea.__sindent + str;
-                       } else if (str.match(c[17])) {
-                               // singlet tag
-                               return "\n" + HTMLArea.__sindent + str;
-                       }
-                       return str; // this won't actually happen
-               });
-               return $1 + string;
-         });return strn;
-    });
-    if (s.charAt(0) == "\n") {
-        return s.substring(1, s.length);
-    }
-    s = s.replace(/ *\n/g,'\n');//strip spaces at end of lines
-    return s;
-};
-
-HTMLArea.getHTML = function(root, outputRoot, editor) {
-       var html = "";
-       var c = HTMLArea.RegExpCache;
-
-       if(root.nodeType == 11) {//document fragment
-           //we can't get innerHTML from the root (type 11) node, so we 
-           //copy all the child nodes into a new div and get innerHTML from the div
-           var div = document.createElement("div");
-           var temp = root.insertBefore(div,root.firstChild);
-           for (j = temp.nextSibling; j; j = j.nextSibling) { 
-                       temp.appendChild(j.cloneNode(true));
-           }
-           html += temp.innerHTML.replace(c[22], function(tag){
-                       if(/^<[!\?]/.test(tag)) return tag; //skip comments and php tags
-                       else return editor.cleanHTML(tag)});
-
-       } else {
-
-               var root_tag = (root.nodeType == 1) ? root.tagName.toLowerCase() : ''; 
-               if (outputRoot) { //only happens with <html> tag in fullpage mode
-                       html += "<" + root_tag;
-                       var attrs = root.attributes; // strangely, this doesn't work in moz
-                       for (i = 0; i < attrs.length; ++i) {
-                               var a = attrs.item(i);
-                               if (!a.specified) {
-                                 continue;
-                               }
-                               var name = a.nodeName.toLowerCase();
-                               var value = a.nodeValue;
-                               html += " " + name + '="' + value + '"';
-                       }
-                       html += ">";
-               }
-               if(root_tag == "html") {
-                       innerhtml = editor._doc.documentElement.innerHTML;
-               } else {
-                       innerhtml = root.innerHTML;
-               }
-               //pass tags to cleanHTML() one at a time
-               //includes support for htmlRemoveTags config option
-               html += innerhtml.replace(c[22], function(tag){
-                       if(/^<[!\?]/.test(tag)) return tag; //skip comments and php tags
-                       else if(!(editor.config.htmlRemoveTags && editor.config.htmlRemoveTags.test(tag.replace(/<([^\s>\/]+)/,'$1'))))
-                               return editor.cleanHTML(tag);
-                       else return ''});
-               //IE drops  all </li> tags in a list except the last one
-               if(HTMLArea.is_ie) {
-                       html = html.replace(/<li( [^>]*)?>/g,'</li><li$1>').
-                               replace(/(<(ul|ol)[^>]*>)[\s\n]*<\/li>/g, '$1').
-                               replace(/<\/li>([\s\n]*<\/li>)+/g, '<\/li>');
-               }
-               if(HTMLArea.is_gecko)
-                       html = html.replace(/(.*)<br \/>\n$/, '$1'). //strip trailing <br> added by moz
-                               replace(/^\n(.*)/, '$1'); //strip leading newline added by moz
-               if (outputRoot) {
-                       html += "</" + root_tag + ">";
-               }
-//             html = HTMLArea.indent(html);//see bug #6106
-       };
-//     html = HTMLArea.htmlEncode(html);
-
-       return html;
-};
-
-//override (hack) outwardHtml() to handle onclick suppression
-HTMLArea.prototype._origOutwardHtml = HTMLArea.prototype.outwardHtml;
-HTMLArea.prototype.outwardHtml = function(html) {
-       html = html.replace("onclick=\"try{if(document.designMode && document.designMode == 'on') return false;}catch(e){} window.open(", "onclick=\"window.open(");
-       html = this._origOutwardHtml(html);
-       return html;
-};
diff --git a/lib/editor/htmlarea/plugins/SpellChecker/img/spell-check.gif b/lib/editor/htmlarea/plugins/SpellChecker/img/spell-check.gif
deleted file mode 100644 (file)
index 29bd11a..0000000
Binary files a/lib/editor/htmlarea/plugins/SpellChecker/img/spell-check.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/plugins/SpellChecker/lang/en.js b/lib/editor/htmlarea/plugins/SpellChecker/lang/en.js
deleted file mode 100644 (file)
index c14d7d7..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-// I18N constants
-
-// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
-// Author: Mihai Bazon, <mishoo@infoiasi.ro>
-
-// FOR TRANSLATORS:
-//
-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
-//      (at least a valid email address)
-//
-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
-//      (if this is not possible, please include a comment
-//       that states what encoding is necessary.)
-
-SpellChecker.I18N = {
-       "CONFIRM_LINK_CLICK"                    : "Please confirm that you want to open this link",
-       "Cancel"                                : "Cancel",
-       "Dictionary"                            : "Dictionary",
-       "Finished list of mispelled words"      : "Finished list of mispelled words",
-       "I will open it in a new page."         : "I will open it in a new page.",
-       "Ignore all"                            : "Ignore all",
-       "Ignore"                                : "Ignore",
-       "NO_ERRORS"                             : "No mispelled words found with the selected dictionary.",
-       "NO_ERRORS_CLOSING"                     : "Spell check complete, didn't find any mispelled words.  Closing now...",
-       "OK"                                    : "OK",
-       "Original word"                         : "Original word",
-       "Please wait.  Calling spell checker."  : "Please wait.  Calling spell checker.",
-       "Please wait: changing dictionary to"   : "Please wait: changing dictionary to",
-       "QUIT_CONFIRMATION"                     : "This will drop changes and quit spell checker.  Please confirm.",
-       "Re-check"                              : "Re-check",
-       "Replace all"                           : "Replace all",
-       "Replace with"                          : "Replace with",
-       "Replace"                               : "Replace",
-       "SC-spell-check"                        : "Spell-check",
-       "Suggestions"                           : "Suggestions",
-       "pliz weit ;-)"                         : "pliz weit ;-)"
-};
diff --git a/lib/editor/htmlarea/plugins/SpellChecker/lang/ro.js b/lib/editor/htmlarea/plugins/SpellChecker/lang/ro.js
deleted file mode 100644 (file)
index 618b398..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-// I18N constants
-
-// LANG: "ro", ENCODING: UTF-8
-// Author: Mihai Bazon, <mishoo@infoiasi.ro>
-
-// FOR TRANSLATORS:
-//
-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
-//      (at least a valid email address)
-//
-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
-//      (if this is not possible, please include a comment
-//       that states what encoding is necessary.)
-
-SpellChecker.I18N = {
-       "CONFIRM_LINK_CLICK"                    : "Vă rog confirmaÅ£i că vreÅ£i să deschideÅ£i acest link",
-       "Cancel"                                : "Anulează",
-       "Dictionary"                            : "DicÅ£ionar",
-       "Finished list of mispelled words"      : "Am terminat lista de cuvinte greÅŸite",
-       "I will open it in a new page."         : "O voi deschide Ã®ntr-o altă fereastră.",
-       "Ignore all"                            : "Ignoră toate",
-       "Ignore"                                : "Ignoră",
-       "NO_ERRORS"                             : "Nu am găsit nici un cuvânt greÅŸit cu acest dicÅ£ionar.",
-       "NO_ERRORS_CLOSING"                     : "Am terminat, nu am detectat nici o greÅŸeală.  Acum Ã®nchid fereastra...",
-       "OK"                                    : "OK",
-       "Original word"                         : "Cuvântul original",
-       "Please wait.  Calling spell checker."  : "Vă rog aÅŸteptaÅ£i.  Apelez spell-checker-ul.",
-       "Please wait: changing dictionary to"   : "Vă rog aÅŸteptaÅ£i.  Schimb dicÅ£ionarul cu",
-       "QUIT_CONFIRMATION"                     : "DoriÅ£i să renunÅ£aÅ£i la modificări ÅŸi să Ã®nchid spell-checker-ul?",
-       "Re-check"                              : "Scanează",
-       "Replace all"                           : "ÃŽnlocuieÅŸte toate",
-       "Replace with"                          : "ÃŽnlocuieÅŸte cu",
-       "Replace"                               : "ÃŽnlocuieÅŸte",
-       "SC-spell-check"                        : "Detectează greÅŸeli",
-       "Suggestions"                           : "Sugestii",
-       "pliz weit ;-)"                         : "va rog ashteptatzi ;-)"
-};
diff --git a/lib/editor/htmlarea/plugins/SpellChecker/readme-tech.html b/lib/editor/htmlarea/plugins/SpellChecker/readme-tech.html
deleted file mode 100644 (file)
index 52bf4c6..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN">
-<html>
-  <head>
-    <title>HTMLArea Spell Checker</title>
-  </head>
-
-  <body>
-    <h1>HTMLArea Spell Checker</h1>
-
-    <p>The HTMLArea Spell Checker subsystem consists of the following
-      files:</p>
-
-    <ul>
-
-      <li>spell-checker.js &mdash; the spell checker plugin interface for
-        HTMLArea</li>
-
-      <li>spell-checker-ui.html &mdash; the HTML code for the user
-        interface</li>
-
-      <li>spell-checker-ui.js &mdash; functionality of the user
-        interface</li>
-
-      <li>spell-checker-logic.cgi &mdash; Perl CGI script that checks a text
-        given through POST for spelling errors</li>
-
-      <li>spell-checker-style.css &mdash; style for mispelled words</li>
-
-      <li>lang/en.js &mdash; main language file (English).</li>
-
-    </ul>
-
-    <h2>Process overview</h2>
-
-    <p>
-      When an end-user clicks the "spell-check" button in the HTMLArea
-      editor, a new window is opened with the URL of "spell-check-ui.html".
-      This window initializes itself with the text found in the editor (uses
-      <tt>window.opener.SpellChecker.editor</tt> global variable) and it
-      submits the text to the server-side script "spell-check-logic.cgi".
-      The target of the FORM is an inline frame which is used both to
-      display the text and correcting.
-    </p>
-
-    <p>
-      Further, spell-check-logic.cgi calls Aspell for each portion of plain
-      text found in the given HTML.  It rebuilds an HTML file that contains
-      clear marks of which words are incorrect, along with suggestions for
-      each of them.  This file is then loaded in the inline frame.  Upon
-      loading, a JavaScript function from "spell-check-ui.js" is called.
-      This function will retrieve all mispelled words from the HTML of the
-      iframe and will setup the user interface so that it allows correction.
-    </p>
-
-    <h2>The server-side script (spell-check-logic.cgi)</h2>
-
-    <p>
-      <strong>Unicode safety</strong> &mdash; the program <em>is</em>
-      Unicode safe.  HTML entities are expanded into their corresponding
-      Unicode characters.  These characters will be matched as part of the
-      word passed to Aspell.  All texts passed to Aspell are in Unicode
-      (when appropriate).  However, Aspell seems to not support Unicode
-      yet (<a
-        href="http://mail.gnu.org/archive/html/aspell-user/2000-11/msg00007.html">thread concerning Aspell and Unicode</a>).
-      This mean that words containing Unicode
-      characters that are not in 0..255 are likely to be reported as "mispelled" by Aspell.
-    </p>
-
-    <p>
-      I digged the Net for a couple of hours today and I can't seem to find
-      any open-source spell checker that has Unicode support.  For this
-      reason we keep using Aspell, because it also seems to have the
-      best suggestions engine.  Unicode support will eventually be
-      implemented in Aspell.  <a href="mailto:kevin@atkinson.dhs.org">Email
-        Kevin Atkinson</a> (Aspell author and maintainer) about this ;-)
-    </p>
-
-    <p>
-      The Perl Unicode manual (man perluniintro) states:
-    </p>
-
-    <blockquote>
-      <em>
-        Starting from Perl 5.6.0, Perl has had the capacity to handle Unicode
-        natively.  Perl 5.8.0, however, is the first recommended release for
-        serious Unicode work.  The maintenance release 5.6.1 fixed many of the
-        problems of the initial Unicode implementation, but for example regular
-        expressions still do not work with Unicode in 5.6.1.
-      </em>
-    </blockquote>
-
-    <p>In other words, do <em>not</em> assume that this script is
-      Unicode-safe on Perl interpreters older than 5.8.0.</p>
-
-    <p>The following Perl modules are required:</p>
-
-    <ul>
-      <li><a href="http://search.cpan.org/search?query=Text%3A%3AAspell&mode=all" target="_blank">Text::Aspell</a></li>
-      <li><a href="http://search.cpan.org/search?query=HTML%3A%3AParser&mode=all" target="_blank">HTML::Parser</a></li>
-      <li><a href="http://search.cpan.org/search?query=HTML%3A%3AEntities&mode=all" target="_blank">HTML::Entities</a></li>
-      <li><a href="http://search.cpan.org/search?query=CGI&mode=all" target="_blank">CGI</a></li>
-    </ul>
-
-    <p>Of these, only Text::Aspell might need to be installed manually.  The
-      others are likely to be available by default in most Perl distributions.</p>
-
-    <hr />
-    <address><a href="http://students.infoiasi.ro/~mishoo/">Mihai Bazon</a></address>
-<!-- Created: Thu Jul 17 13:22:27 EEST 2003 -->
-<!-- hhmts start -->
-Last modified on Sun Aug 10 12:28:24 2003
-<!-- hhmts end -->
-<!-- doc-lang: English -->
-  </body>
-</html>
diff --git a/lib/editor/htmlarea/plugins/SpellChecker/spell-check-logic.cgi b/lib/editor/htmlarea/plugins/SpellChecker/spell-check-logic.cgi
deleted file mode 100644 (file)
index 3b767b4..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-#! /usr/bin/perl -w
-
-# Spell Checker Plugin for HTMLArea-3.0
-# Implementation by Mihai Bazon.  Sponsored by www.americanbible.org
-#
-# htmlArea v3.0 - Copyright (c) 2002 interactivetools.com, inc.
-# This notice MUST stay intact for use (see license.txt).
-#
-# A free WYSIWYG editor replacement for <textarea> fields.
-# For full source code and docs, visit http://www.interactivetools.com/
-#
-# Version 3.0 developed by Mihai Bazon for InteractiveTools.
-#           http://students.infoiasi.ro/~mishoo
-#
-# $Id$
-
-use strict;
-use utf8;
-use Encode;
-use Text::Aspell;
-use HTML::Parser;
-use HTML::Entities;
-use CGI;
-
-my $debug = 0;
-
-open (DEBUG, '>:encoding(UTF-8)', '> /tmp/spell-check-debug.log') if $debug;
-
-# use Data::Dumper; # for debug only
-
-my $speller = new Text::Aspell;
-my $cgi = new CGI;
-
-# FIXME: report a nice error...
-die "Can't create speller!" unless $speller;
-
-# add configurable option for this
-my $dict = $cgi->param('dictionary') || 'en_US';
-$speller->set_option('lang', $dict);
-
-# ultra, fast, normal, bad-spellers
-# bad-spellers seems to cause segmentation fault
-$speller->set_option('sug-mode', 'ultra');
-
-my @replacements = ();
-
-sub text_handler {
-    my ($offset, $length, $text, $is_cdata) = @_;
-    if ($is_cdata or $text =~ /^\s*$/) {
-        return 0;
-    }
-    # print STDERR "*** OFFSET: $offset, LENGTH: $length, $text\n";
-    $text = decode_entities($text);
-    $text =~ s/&#([0-9]+);/chr($1)/eg;
-    $text =~ s/&#x([0-9a-fA-F]+);/chr(hex $1)/eg;
-    my $repl = spellcheck($text);
-    if ($repl) {
-        push(@replacements, [ $offset, $length, $repl ]);
-    }
-}
-
-my $p = HTML::Parser->new
-  (api_version => 3,
-   handlers => { start => [ sub {
-                                my ($self, $tagname, $attrs) = @_;
-                                # print STDERR "\033[1;31m parsing tag: $tagname\033[0m\n";
-                                # following we skip words that have already been marked as "fixed".
-                                if ($tagname eq "span" and $attrs->{class} =~ /HA-spellcheck-fixed/) {
-                                    $self->handler(text => undef);
-                                }
-                            }, "self, tagname, attr"
-                          ],
-                 end => [ sub {
-                              my ($self, $tagname) = @_;
-                              # print STDERR "\033[1;32m END tag: $tagname\033[0m\n";
-                              $self->handler(text => \&text_handler, 'offset, length, dtext, is_cdata');
-                          }, "self, tagname"
-                        ]
-               }
-  );
-$p->handler(text => \&text_handler, 'offset, length, dtext, is_cdata');
-$p->case_sensitive(1);
-my $file_content = $cgi->param('content');
-
-if ($debug) {
-    open (FOO, '>:encoding(UTF-8)', '/tmp/spell-check-before');
-    print FOO $file_content, "\n";
-    close(FOO);
-}
-
-$p->parse($file_content);
-$p->eof();
-
-foreach (reverse @replacements) {
-    substr($file_content, $_->[0], $_->[1], $_->[2]);
-}
-
-# we output UTF-8
-binmode(STDOUT, ':encoding(UTF-8)'); # apparently, this sucks.
-print "Content-type: text/html; charset: utf-8\n\n";
-print qq^
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<link rel="stylesheet" type="text/css" media="all" href="spell-check-style.css" />
-</head>
-<body onload="window.parent.finishedSpellChecking();">^;
-
-print $file_content;
-if ($cgi->param('init') eq '1') {
-    my @dicts = $speller->dictionary_info();
-    my $dictionaries = '';
-    foreach my $i (@dicts) {
-        $dictionaries .= ',' . $i->{name} unless $i->{jargon};
-    }
-    $dictionaries =~ s/^,//;
-    print qq^
-<div id="HA-spellcheck-dictionaries"
->$dictionaries</div>
-^;
-}
-
-if ($debug) {
-    open (FOO, '>:encoding(UTF-8)', '/tmp/spell-check-after');
-    print FOO $file_content, "\n";
-    close(FOO);
-}
-
-print '</body></html>';
-
-# Perl is beautiful.
-sub spellcheck {
-    my $text = shift;
-    sub check {                 # called for each word in the text
-        # input is in UTF-8
-        my $U_word = shift;
-        my $word = encode($speller->get_option('encoding'), $U_word);
-        print DEBUG "*$U_word* ----> |$word|\n" if $debug;
-        if ($speller->check($word)) {
-            return $U_word;      # we return the word in UTF-8
-        } else {
-            # we should have suggestions; give them back to browser in UTF-8
-            my $suggestions = decode($speller->get_option('encoding'), join(',', $speller->suggest($word)));
-            my $ret = '<span class="HA-spellcheck-error">'.$U_word.'</span><span class="HA-spellcheck-suggestions">'.$suggestions.'</span>';
-            return $ret;
-        }
-    }
-    $text =~ s/([[:word:]']+)/check($1)/egs;
-    # $text =~ s/(\w+)/check($1)/egs;
-
-    # the following is definitely what we want to use; too bad it sucks most.
-    # $text =~ s/(\p{IsWord}+)/check($1)/egs;
-    return $text;
-}
diff --git a/lib/editor/htmlarea/plugins/SpellChecker/spell-check-style.css b/lib/editor/htmlarea/plugins/SpellChecker/spell-check-style.css
deleted file mode 100644 (file)
index 9e71197..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-.HA-spellcheck-error { border-bottom: 2px dotted #f00; cursor: default; }
-.HA-spellcheck-same { background-color: #ff8; color: #000; }
-.HA-spellcheck-hover { background-color: #433; color: white; }
-.HA-spellcheck-fixed { border-bottom: 1px dotted #0b8; }
-.HA-spellcheck-current { background-color: #7be; color: #000; }
-.HA-spellcheck-suggestions { display: none; }
-
-#HA-spellcheck-dictionaries { display: none; }
-
-a:link, a:visited { color: #55e; }
diff --git a/lib/editor/htmlarea/plugins/SpellChecker/spell-check-ui.html b/lib/editor/htmlarea/plugins/SpellChecker/spell-check-ui.html
deleted file mode 100644 (file)
index 85e3e9e..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-<!--
-
-  Strangely, IE sucks with or without the DOCTYPE switch.
-  I thought it would only suck without it.
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
-    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-
-   Spell Checker Plugin for HTMLArea-3.0
-   Implementation by Mihai Bazon.  Sponsored by www.americanbible.org
-  
-   htmlArea v3.0 - Copyright (c) 2003 interactivetools.com, inc.
-   This notice MUST stay intact for use (see license.txt).
-  
-   A free WYSIWYG editor replacement for <textarea> fields.
-   For full source code and docs, visit http://www.interactivetools.com/
-  
-   Version 3.0 developed by Mihai Bazon for InteractiveTools.
-            http://students.infoiasi.ro/~mishoo
-  
-   $Id$
-
--->
-<html xmlns="http://www.w3.org/1999/xhtml">
-
-  <head>
-    <title>Spell Checker</title>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <script type="text/javascript" src="spell-check-ui.js"></script>
-
-    <style type="text/css">
-      html, body { height: 100%; margin: 0px; padding: 0px; background-color: #fff;
-      color: #000; }
-      a:link, a:visited { color: #00f; text-decoration: none; }
-      a:hover { color: #f00; text-decoration: underline; }
-
-      table { background-color: ButtonFace; color: ButtonText;
-      font-family: tahoma,verdana,sans-serif; font-size: 11px; }
-
-      iframe { background-color: #fff; color: #000; }
-
-      .controls { width: 13em; }
-      .controls .sectitle { /* background-color: #736c6c; color: #fff;
-      border-top: 1px solid #000; border-bottom: 1px solid #fff; */
-      text-align: center;
-      font-weight: bold; padding: 2px 4px; }
-      .controls .secbody { margin-bottom: 10px; }
-
-      button, select { font-family: tahoma,verdana,sans-serif; font-size: 11px; }
-      button { width: 6em; padding: 0px; }
-
-      input, select { font-family: fixed,"andale mono",monospace; }
-
-      #v_currentWord { color: #f00; font-weight: bold; font-size: 120%; }
-      #statusbar { padding: 7px 0px 0px 5px; }
-      #status { font-weight: bold; }
-    </style>
-
-  </head>
-
-  <body onload="initDocument()">
-
-    <form style="display: none;" action="spell-check-logic.cgi"
-        method="post" target="framecontent"
-        accept-charset="utf-8"
-        ><input type="hidden" name="content" id="f_content"
-        /><input type="hidden" name="dictionary" id="f_dictionary"
-        /><input type="hidden" name="init" id="f_init" value="1"
-        /></form>
-
-    <table style="height: 100%; width: 100%; border-collapse: collapse;" cellspacing="0" cellpadding="0">
-      <tr>
-        <td colspan="2" style="height: 1em; padding: 2px;">
-          <div style="float: right; padding: 2px;"><span>Dictionary</span>
-            <select id="v_dictionaries" style="width: 10em"></select>
-            <button id="b_recheck">Re-check</button>
-          </div>
-          <span id="status">Please wait.  Calling spell checker.</span>
-        </td>
-      </tr>
-      <tr>
-        <td valign="top" class="controls">
-          <div class="sectitle">Original word</div>
-          <div class="secbody" id="v_currentWord" style="text-align: center">pliz weit ;-)</div>
-          <div class="sectitle">Replace with</div>
-          <div class="secbody">
-            <input type="text" id="v_replacement" style="width: 94%; margin-left: 3%;" /><br />
-            <div style="text-align: center; margin-top: 2px;">
-              <button id="b_replace">Replace</button><button
-                id="b_replall">Replace all</button><br /><button
-                id="b_ignore">Ignore</button><button
-                id="b_ignall">Ignore all</button>
-            </div>
-          </div>
-          <div class="sectitle">Suggestions</div>
-          <div class="secbody">
-            <select size="11" style="width: 94%; margin-left: 3%;" id="v_suggestions"></select>
-          </div>
-        </td>
-
-        <td>
-          <iframe src="about:blank" width="100%" height="100%"
-            id="i_framecontent" name="framecontent"></iframe>
-        </td>
-      </tr>
-      <tr>
-        <td style="height: 1em;" colspan="2">
-          <div style="padding: 4px 2px 2px 2px; float: right;">
-            <button id="b_ok">OK</button>
-            <button id="b_cancel">Cancel</button>
-          </div>
-          <div id="statusbar"></div>
-        </td>
-      </tr>
-    </table>
-
-  </body>
-
-</html>
diff --git a/lib/editor/htmlarea/plugins/SpellChecker/spell-check-ui.js b/lib/editor/htmlarea/plugins/SpellChecker/spell-check-ui.js
deleted file mode 100644 (file)
index ac221d2..0000000
+++ /dev/null
@@ -1,334 +0,0 @@
-// Spell Checker Plugin for HTMLArea-3.0
-// Implementation by Mihai Bazon.  Sponsored by www.americanbible.org
-//
-// htmlArea v3.0 - Copyright (c) 2002 interactivetools.com, inc.
-// This notice MUST stay intact for use (see license.txt).
-//
-// A free WYSIWYG editor replacement for <textarea> fields.
-// For full source code and docs, visit http://www.interactivetools.com/
-//
-// Version 3.0 developed by Mihai Bazon for InteractiveTools.
-//          http://students.infoiasi.ro/~mishoo
-//
-// $Id$
-
-// internationalization file was already loaded in parent ;-)
-var SpellChecker = window.opener.SpellChecker;
-var i18n = SpellChecker.I18N;
-
-var is_ie = window.opener.HTMLArea.is_ie;
-var editor = SpellChecker.editor;
-var frame = null;
-var currentElement = null;
-var wrongWords = null;
-var modified = false;
-var allWords = {};
-
-function makeCleanDoc(leaveFixed) {
-       // document.getElementById("status").innerHTML = 'Please wait: rendering valid HTML';
-       for (var i in wrongWords) {
-               var el = wrongWords[i];
-               if (!(leaveFixed && /HA-spellcheck-fixed/.test(el.className))) {
-                       el.parentNode.insertBefore(el.firstChild, el);
-                       el.parentNode.removeChild(el.nextSibling);
-                       el.parentNode.removeChild(el);
-               } else {
-                       el.className = "HA-spellcheck-fixed";
-                       el.parentNode.removeChild(el.nextSibling);
-               }
-       }
-       // we should use innerHTML here, but IE6's implementation phucks up the
-       // HTML to such extent that our poor Perl parser doesn't understand it
-       // anymore.
-       return window.opener.HTMLArea.getHTML(frame.contentWindow.document.body, leaveFixed);
-};
-
-function recheckClicked() {
-       document.getElementById("status").innerHTML = i18n["Please wait: changing dictionary to"] + ': "' + document.getElementById("f_dictionary").value + '".';
-       var field = document.getElementById("f_content");
-       field.value = makeCleanDoc(true);
-       field.form.submit();
-};
-
-function saveClicked() {
-       if (modified) {
-               editor.setHTML(makeCleanDoc(false));
-       }
-       window.close();
-       return false;
-};
-
-function cancelClicked() {
-       var ok = true;
-       if (modified) {
-               ok = confirm(i18n["QUIT_CONFIRMATION"]);
-       }
-       if (ok) {
-               window.close();
-       }
-       return false;
-};
-
-function replaceWord(el) {
-       var replacement = document.getElementById("v_replacement").value;
-       modified = (el.innerHTML != replacement);
-       if (el) {
-               el.className = el.className.replace(/\s*HA-spellcheck-(hover|fixed)\s*/g, " ");
-       }
-       el.className += " HA-spellcheck-fixed";
-       el.__msh_fixed = true;
-       if (!modified) {
-               return false;
-       }
-       el.innerHTML = replacement;
-};
-
-function replaceClicked() {
-       replaceWord(currentElement);
-       var start = currentElement.__msh_id;
-       var index = start;
-       do {
-               ++index;
-               if (index == wrongWords.length) {
-                       index = 0;
-               }
-       } while ((index != start) && wrongWords[index].__msh_fixed);
-       if (index == start) {
-               index = 0;
-               alert(i18n["Finished list of mispelled words"]);
-       }
-       wrongWords[index].onclick();
-       return false;
-};
-
-function replaceAllClicked() {
-       var replacement = document.getElementById("v_replacement").value;
-       var ok = true;
-       var spans = allWords[currentElement.__msh_origWord];
-       if (spans.length == 0) {
-               alert("An impossible condition just happened.  Call FBI.  ;-)");
-       } else if (spans.length == 1) {
-               replaceClicked();
-               return false;
-       }
-       /*
-       var message = "The word \"" + currentElement.__msh_origWord + "\" occurs " + spans.length + " times.\n";
-       if (replacement == currentElement.__msh_origWord) {
-               ok = confirm(message + "Ignore all occurrences?");
-       } else {
-               ok = confirm(message + "Replace all occurrences with \"" + replacement + "\"?");
-       }
-       */
-       if (ok) {
-               for (var i in spans) {
-                       if (spans[i] != currentElement) {
-                               replaceWord(spans[i]);
-                       }
-               }
-               // replace current element the last, so that we jump to the next word ;-)
-               replaceClicked();
-       }
-       return false;
-};
-
-function ignoreClicked() {
-       document.getElementById("v_replacement").value = currentElement.__msh_origWord;
-       replaceClicked();
-       return false;
-};
-
-function ignoreAllClicked() {
-       document.getElementById("v_replacement").value = currentElement.__msh_origWord;
-       replaceAllClicked();
-       return false;
-};
-
-function learnClicked() {
-       alert("Not [yet] implemented");
-       return false;
-};
-
-function internationalizeWindow() {
-       var types = ["div", "span", "button"];
-       for (var i in types) {
-               var tag = types[i];
-               var els = document.getElementsByTagName(tag);
-               for (var j = els.length; --j >= 0;) {
-                       var el = els[j];
-                       if (el.childNodes.length == 1 && /\S/.test(el.innerHTML)) {
-                               var txt = el.innerHTML;
-                               if (typeof i18n[txt] != "undefined") {
-                                       el.innerHTML = i18n[txt];
-                               }
-                       }
-               }
-       }
-};
-
-function initDocument() {
-       internationalizeWindow();
-       modified = false;
-       frame = document.getElementById("i_framecontent");
-       var field = document.getElementById("f_content");
-       field.value = editor.getHTML();
-       field.form.submit();
-       document.getElementById("f_init").value = "0";
-
-       // assign some global event handlers
-
-       var select = document.getElementById("v_suggestions");
-       select.onchange = function() {
-               document.getElementById("v_replacement").value = this.value;
-       };
-       if (is_ie) {
-               select.attachEvent("ondblclick", replaceClicked);
-       } else {
-               select.addEventListener("dblclick", replaceClicked, true);
-       }
-
-       document.getElementById("b_replace").onclick = replaceClicked;
-       // document.getElementById("b_learn").onclick = learnClicked;
-       document.getElementById("b_replall").onclick = replaceAllClicked;
-       document.getElementById("b_ignore").onclick = ignoreClicked;
-       document.getElementById("b_ignall").onclick = ignoreAllClicked;
-       document.getElementById("b_recheck").onclick = recheckClicked;
-
-       document.getElementById("b_ok").onclick = saveClicked;
-       document.getElementById("b_cancel").onclick = cancelClicked;
-
-       select = document.getElementById("v_dictionaries");
-       select.onchange = function() {
-               document.getElementById("f_dictionary").value = this.value;
-       };
-};
-
-function wordClicked() {
-       if (currentElement) {
-               var a = allWords[currentElement.__msh_origWord];
-               currentElement.className = currentElement.className.replace(/\s*HA-spellcheck-current\s*/g, " ");
-               for (var i in a) {
-                       var el = a[i];
-                       if (el != currentElement) {
-                               el.className = el.className.replace(/\s*HA-spellcheck-same\s*/g, " ");
-                       }
-               }
-       }
-       currentElement = this;
-       this.className += " HA-spellcheck-current";
-       var a = allWords[currentElement.__msh_origWord];
-       for (var i in a) {
-               var el = a[i];
-               if (el != currentElement) {
-                       el.className += " HA-spellcheck-same";
-               }
-       }
-       document.getElementById("b_replall").disabled = (a.length <= 1);
-       document.getElementById("b_ignall").disabled = (a.length <= 1);
-       var txt;
-       if (a.length == 1) {
-               txt = "one occurrence";
-       } else if (a.length == 2) {
-               txt = "two occurrences";
-       } else {
-               txt = a.length + " occurrences";
-       }
-       document.getElementById("statusbar").innerHTML = "Found " + txt +
-               ' for word "<b>' + currentElement.__msh_origWord + '</b>"';
-       var select = document.getElementById("v_suggestions");
-       for (var i = select.length; --i >= 0;) {
-               select.remove(i);
-       }
-       var suggestions;
-       suggestions = this.nextSibling.firstChild.data.split(/,/);
-       for (var i = 0; i < suggestions.length; ++i) {
-               var txt = suggestions[i];
-               var option = document.createElement("option");
-               option.value = txt;
-               option.appendChild(document.createTextNode(txt));
-               select.appendChild(option);
-       }
-       document.getElementById("v_currentWord").innerHTML = this.__msh_origWord;
-       if (suggestions.length > 0) {
-               select.selectedIndex = 0;
-               select.onchange();
-       } else {
-               document.getElementById("v_replacement").value = this.innerHTML;
-       }
-       return false;
-};
-
-function wordMouseOver() {
-       this.className += " HA-spellcheck-hover";
-};
-
-function wordMouseOut() {
-       this.className = this.className.replace(/\s*HA-spellcheck-hover\s*/g, " ");
-};
-
-function finishedSpellChecking() {
-       // initialization of global variables
-       currentElement = null;
-       wrongWords = null;
-       allWords = {};
-
-       document.getElementById("status").innerHTML = "HTMLArea Spell Checker (<a href='readme-tech.html' target='_blank' title='Technical information'>info</a>)";
-       var doc = frame.contentWindow.document;
-        var spans = doc.getElementsByTagName("span");
-        var sps = [];
-       var id = 0;
-        for (var i = 0; i < spans.length; ++i) {
-                var el = spans[i];
-                if (/HA-spellcheck-error/.test(el.className)) {
-                        sps.push(el);
-                       el.onclick = wordClicked;
-                       el.onmouseover = wordMouseOver;
-                       el.onmouseout = wordMouseOut;
-                       el.__msh_id = id++;
-                       var txt = (el.__msh_origWord = el.firstChild.data);
-                       el.__msh_fixed = false;
-                       if (typeof allWords[txt] == "undefined") {
-                               allWords[txt] = [el];
-                       } else {
-                               allWords[txt].push(el);
-                       }
-                }
-        }
-       wrongWords = sps;
-       if (sps.length == 0) {
-               if (!modified) {
-                       alert(i18n["NO_ERRORS_CLOSING"]);
-                       window.close();
-               } else {
-                       alert(i18n["NO_ERRORS"]);
-               }
-               return false;
-       }
-       (currentElement = sps[0]).onclick();
-       var as = doc.getElementsByTagName("a");
-       for (var i = as.length; --i >= 0;) {
-               var a = as[i];
-               a.onclick = function() {
-                       if (confirm(i18n["CONFIRM_LINK_CLICK"] + ":\n" +
-                                   this.href + "\n" + i18n["I will open it in a new page."])) {
-                               window.open(this.href);
-                       }
-                       return false;
-               };
-       }
-       var dicts = doc.getElementById("HA-spellcheck-dictionaries");
-       if (dicts) {
-               dicts.parentNode.removeChild(dicts);
-               dicts = dicts.innerHTML.split(/,/);
-               var select = document.getElementById("v_dictionaries");
-               for (var i = select.length; --i >= 0;) {
-                       select.remove(i);
-               }
-               for (var i = 0; i < dicts.length; ++i) {
-                       var txt = dicts[i];
-                       var option = document.createElement("option");
-                       option.value = txt;
-                       option.appendChild(document.createTextNode(txt));
-                       select.appendChild(option);
-               }
-       }
-};
diff --git a/lib/editor/htmlarea/plugins/SpellChecker/spell-checker.js b/lib/editor/htmlarea/plugins/SpellChecker/spell-checker.js
deleted file mode 100644 (file)
index 48a8fa6..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-// Spell Checker Plugin for HTMLArea-3.0
-// Implementation by Mihai Bazon.  Sponsored by www.americanbible.org
-//
-// htmlArea v3.0 - Copyright (c) 2002 interactivetools.com, inc.
-// This notice MUST stay intact for use (see license.txt).
-//
-// A free WYSIWYG editor replacement for <textarea> fields.
-// For full source code and docs, visit http://www.interactivetools.com/
-//
-// Version 3.0 developed by Mihai Bazon for InteractiveTools.
-//          http://students.infoiasi.ro/~mishoo
-//
-// $Id$
-
-function SpellChecker(editor) {
-       this.editor = editor;
-
-       var cfg = editor.config;
-       var tt = SpellChecker.I18N;
-       var bl = SpellChecker.btnList;
-       var self = this;
-
-       // register the toolbar buttons provided by this plugin
-       var toolbar = [];
-       for (var i in bl) {
-               var btn = bl[i];
-               if (!btn) {
-                       toolbar.push("separator");
-               } else {
-                       var id = "SC-" + btn[0];
-                       cfg.registerButton(id, tt[id], "plugins/SpellChecker/img/" + btn[0] + ".gif", false,
-                                          function(editor, id) {
-                                                  // dispatch button press event
-                                                  self.buttonPress(editor, id);
-                                          }, btn[1]);
-                       toolbar.push(id);
-               }
-       }
-
-       for (var i in toolbar) {
-               cfg.toolbar[0].push(toolbar[i]);
-       }
-};
-
-SpellChecker.btnList = [
-       null, // separator
-       ["spell-check"]
-       ];
-
-SpellChecker.prototype.buttonPress = function(editor, id) {
-       switch (id) {
-           case "SC-spell-check":
-               SpellChecker.editor = editor;
-               SpellChecker.init = true;
-               var uiurl = editor.config.editorURL + "plugins/SpellChecker/spell-check-ui.html";
-               var win;
-               if (HTMLArea.is_ie) {
-                       win = window.open(uiurl, "SC_spell_checker",
-                                         "toolbar=no,location=no,directories=no,status=no,menubar=no," +
-                                         "scrollbars=no,resizable=yes,width=600,height=400");
-               } else {
-                       win = window.open(uiurl, "SC_spell_checker",
-                                         "toolbar=no,menubar=no,personalbar=no,width=600,height=400," +
-                                         "scrollbars=no,resizable=yes");
-               }
-               win.focus();
-               break;
-       }
-};
-
-// this needs to be global, it's accessed from spell-check-ui.html
-SpellChecker.editor = null;
diff --git a/lib/editor/htmlarea/plugins/TableOperations/img/cell-delete.gif b/lib/editor/htmlarea/plugins/TableOperations/img/cell-delete.gif
deleted file mode 100644 (file)
index df9594f..0000000
Binary files a/lib/editor/htmlarea/plugins/TableOperations/img/cell-delete.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/plugins/TableOperations/img/cell-insert-after.gif b/lib/editor/htmlarea/plugins/TableOperations/img/cell-insert-after.gif
deleted file mode 100644 (file)
index 6ff2154..0000000
Binary files a/lib/editor/htmlarea/plugins/TableOperations/img/cell-insert-after.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/plugins/TableOperations/img/cell-insert-before.gif b/lib/editor/htmlarea/plugins/TableOperations/img/cell-insert-before.gif
deleted file mode 100644 (file)
index 632b315..0000000
Binary files a/lib/editor/htmlarea/plugins/TableOperations/img/cell-insert-before.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/plugins/TableOperations/img/cell-merge.gif b/lib/editor/htmlarea/plugins/TableOperations/img/cell-merge.gif
deleted file mode 100644 (file)
index 35e4af1..0000000
Binary files a/lib/editor/htmlarea/plugins/TableOperations/img/cell-merge.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/plugins/TableOperations/img/cell-prop.gif b/lib/editor/htmlarea/plugins/TableOperations/img/cell-prop.gif
deleted file mode 100644 (file)
index 2f71bae..0000000
Binary files a/lib/editor/htmlarea/plugins/TableOperations/img/cell-prop.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/plugins/TableOperations/img/cell-split.gif b/lib/editor/htmlarea/plugins/TableOperations/img/cell-split.gif
deleted file mode 100644 (file)
index 8bd011e..0000000
Binary files a/lib/editor/htmlarea/plugins/TableOperations/img/cell-split.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/plugins/TableOperations/img/col-delete.gif b/lib/editor/htmlarea/plugins/TableOperations/img/col-delete.gif
deleted file mode 100644 (file)
index 565afdc..0000000
Binary files a/lib/editor/htmlarea/plugins/TableOperations/img/col-delete.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/plugins/TableOperations/img/col-insert-after.gif b/lib/editor/htmlarea/plugins/TableOperations/img/col-insert-after.gif
deleted file mode 100644 (file)
index 648e54f..0000000
Binary files a/lib/editor/htmlarea/plugins/TableOperations/img/col-insert-after.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/plugins/TableOperations/img/col-insert-before.gif b/lib/editor/htmlarea/plugins/TableOperations/img/col-insert-before.gif
deleted file mode 100644 (file)
index 9be8a6e..0000000
Binary files a/lib/editor/htmlarea/plugins/TableOperations/img/col-insert-before.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/plugins/TableOperations/img/col-split.gif b/lib/editor/htmlarea/plugins/TableOperations/img/col-split.gif
deleted file mode 100644 (file)
index 83f21d1..0000000
Binary files a/lib/editor/htmlarea/plugins/TableOperations/img/col-split.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/plugins/TableOperations/img/row-delete.gif b/lib/editor/htmlarea/plugins/TableOperations/img/row-delete.gif
deleted file mode 100644 (file)
index e649d9f..0000000
Binary files a/lib/editor/htmlarea/plugins/TableOperations/img/row-delete.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/plugins/TableOperations/img/row-insert-above.gif b/lib/editor/htmlarea/plugins/TableOperations/img/row-insert-above.gif
deleted file mode 100644 (file)
index e39c948..0000000
Binary files a/lib/editor/htmlarea/plugins/TableOperations/img/row-insert-above.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/plugins/TableOperations/img/row-insert-under.gif b/lib/editor/htmlarea/plugins/TableOperations/img/row-insert-under.gif
deleted file mode 100644 (file)
index 2005358..0000000
Binary files a/lib/editor/htmlarea/plugins/TableOperations/img/row-insert-under.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/plugins/TableOperations/img/row-prop.gif b/lib/editor/htmlarea/plugins/TableOperations/img/row-prop.gif
deleted file mode 100644 (file)
index 7639725..0000000
Binary files a/lib/editor/htmlarea/plugins/TableOperations/img/row-prop.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/plugins/TableOperations/img/row-split.gif b/lib/editor/htmlarea/plugins/TableOperations/img/row-split.gif
deleted file mode 100644 (file)
index 0df4697..0000000
Binary files a/lib/editor/htmlarea/plugins/TableOperations/img/row-split.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/plugins/TableOperations/img/table-prop.gif b/lib/editor/htmlarea/plugins/TableOperations/img/table-prop.gif
deleted file mode 100644 (file)
index e15a4a4..0000000
Binary files a/lib/editor/htmlarea/plugins/TableOperations/img/table-prop.gif and /dev/null differ
diff --git a/lib/editor/htmlarea/plugins/TableOperations/lang/en.js b/lib/editor/htmlarea/plugins/TableOperations/lang/en.js
deleted file mode 100644 (file)
index a0ed8ad..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-// I18N constants
-
-// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
-// Author: Mihai Bazon, <mishoo@infoiasi.ro>
-
-// FOR TRANSLATORS:
-//
-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
-//      (at least a valid email address)
-//
-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
-//      (if this is not possible, please include a comment
-//       that states what encoding is necessary.)
-
-TableOperations.I18N = {
-       "Align":                                          "Align",
-       "All four sides":                                 "All four sides",
-       "Background":                                     "Background",
-       "Baseline":                                       "Baseline",
-       "Border":                                         "Border",
-       "Borders":                                        "Borders",
-       "Bottom":                                         "Bottom",
-       "CSS Style":                                      "Style [CSS]",
-       "Caption":                                        "Caption",
-       "Cell Properties":                                "Cell Properties",
-       "Center":                                         "Center",
-       "Char":                                           "Char",
-       "Collapsed borders":                              "Collapsed borders",
-       "Color":                                          "Color",
-       "Description":                                    "Description",
-       "FG Color":                                       "FG Color",
-       "Float":                                          "Float",
-       "Frames":                                         "Frames",
-       "Height":                                         "Height",
-       "How many columns would you like to merge?":      "How many columns would you like to merge?",
-       "How many rows would you like to merge?":         "How many rows would you like to merge?",
-       "Image URL":                                      "Image URL",
-       "Justify":                                        "Justify",
-       "Layout":                                         "Layout",
-       "Left":                                           "Left",
-       "Margin":                                         "Margin",
-       "Middle":                                         "Middle",
-       "No rules":                                       "No rules",
-       "No sides":                                       "No sides",
-       "None":                                           "None",
-       "Padding":                                        "Padding",
-       "Please click into some cell":                    "Please click into some cell",
-       "Right":                                          "Right",
-       "Row Properties":                                 "Row Properties",
-       "Rules will appear between all rows and columns": "Rules will appear between all rows and columns",
-       "Rules will appear between columns only":         "Rules will appear between columns only",
-       "Rules will appear between rows only":            "Rules will appear between rows only",
-       "Rules":                                          "Rules",
-       "Spacing and padding":                            "Spacing and padding",
-       "Spacing":                                        "Spacing",
-       "Summary":                                        "Summary",
-       "TO-cell-delete":                                 "Delete cell",
-       "TO-cell-insert-after":                           "Insert cell after",
-       "TO-cell-insert-before":                          "Insert cell before",
-       "TO-cell-merge":                                  "Merge cells",
-       "TO-cell-prop":                                   "Cell properties",
-       "TO-cell-split":                                  "Split cell",
-       "TO-col-delete":                                  "Delete column",
-       "TO-col-insert-after":                            "Insert column after",
-       "TO-col-insert-before":                           "Insert column before",
-       "TO-col-split":                                   "Split column",
-       "TO-row-delete":                                  "Delete row",
-       "TO-row-insert-above":                            "Insert row before",
-       "TO-row-insert-under":                            "Insert row after",
-       "TO-row-prop":                                    "Row properties",
-       "TO-row-split":                                   "Split row",
-       "TO-table-prop":                                  "Table properties",
-       "Table Properties":                               "Table Properties",
-       "Text align":                                     "Text align",
-       "The bottom side only":                           "The bottom side only",
-       "The left-hand side only":                        "The left-hand side only",
-       "The right and left sides only":                  "The right and left sides only",
-       "The right-hand side only":                       "The right-hand side only",
-       "The top and bottom sides only":                  "The top and bottom sides only",
-       "The top side only":                              "The top side only",
-       "Top":                                            "Top",        
-       "Unset color":                                    "Unset color",
-       "Vertical align":                                 "Vertical align",
-       "Width":                                          "Width",
-       "not-del-last-cell":                              "HTMLArea cowardly refuses to delete the last cell in row.",
-       "not-del-last-col":                               "HTMLArea cowardly refuses to delete the last column in table.",
-       "not-del-last-row":                               "HTMLArea cowardly refuses to delete the last row in table.",
-       "percent":                                        "percent",
-       "pixels":                                         "pixels"
-};
diff --git a/lib/editor/htmlarea/plugins/TableOperations/lang/fi.js b/lib/editor/htmlarea/plugins/TableOperations/lang/fi.js
deleted file mode 100644 (file)
index 891f168..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-TableOperations.I18N = {
-       "Align":                                          "Kohdistus",
-       "All four sides":                                 "Kaikki neljä sivua",
-       "Background":                                     "Tausta",
-       "Baseline":                                       "Takaraja",
-       "Border":                                         "Reuna",
-       "Borders":                                        "Reunat",
-       "Bottom":                                         "Alle",
-       "CSS Style":                                      "Tyyli [CSS]",
-       "Caption":                                        "Otsikko",
-       "Cell Properties":                                "Solun asetukset",
-       "Center":                                         "Keskelle",
-       "Char":                                           "Merkki",
-       "Collapsed borders":                              "Luhistetut reunat",
-       "Color":                                          "Väri",
-       "Description":                                    "Kuvaus",
-       "FG Color":                                       "FG Väri",
-       "Frames":                                         "Kehykset",
-       "Image URL":                                      "Kuvan osoite",
-       "Layout":                                         "Sommittelu",
-       "Left":                                           "Vasen",
-       "Margin":                                         "Marginaali",
-       "Middle":                                         "Keskelle",
-       "No rules":                                       "Ei viivoja",
-       "No sides":                                       "Ei sivuja",
-       "Padding":                                        "Palstantäyte",
-       "Right":                                          "Oikea",
-       "Row Properties":                                 "Rivin asetukset",
-       "Rules will appear between all rows and columns": "Viivat jokaisen rivin ja sarakkeen välillä",
-       "Rules will appear between columns only":         "Viivat ainoastaan sarakkeiden välillä",
-       "Rules will appear between rows only":            "Viivat ainoastaan rivien välillä",
-       "Rules":                                          "Viivat",
-       "Spacing":                                        "Palstatila",
-       "Summary":                                        "Yhteenveto",
-       "TO-cell-delete":                                 "Poista solu",
-       "TO-cell-insert-after":                           "Lisää solu perään",
-       "TO-cell-insert-before":                          "Lisää solu ennen",
-       "TO-cell-merge":                                  "Yhdistä solut",
-       "TO-cell-prop":                                   "Solun asetukset",
-       "TO-cell-split":                                  "Jaa solu",
-       "TO-col-delete":                                  "Poista sarake",
-       "TO-col-insert-after":                            "Lisää sarake perään",
-       "TO-col-insert-before":                           "Lisää sarake ennen",
-       "TO-col-split":                                   "Jaa sarake",
-       "TO-row-delete":                                  "Poista rivi",
-       "TO-row-insert-above":                            "Lisää rivi yläpuolelle",
-       "TO-row-insert-under":                            "Lisää rivi alapuolelle",
-       "TO-row-prop":                                    "Rivin asetukset",
-       "TO-row-split":                                   "Jaa rivi",
-       "TO-table-prop":                                  "Taulukon asetukset",
-       "Top":                                            "Ylös",       
-       "Table Properties":                               "Taulukon asetukset",
-       "The bottom side only":                           "Ainoastaan alapuolelle",
-       "The left-hand side only":                        "Ainoastaan vasenreuna",
-       "The right and left sides only":                  "Oikea- ja vasenreuna",
-       "The right-hand side only":                       "Ainoastaan oikeareuna",
-       "The top and bottom sides only":                  "Ylä- ja alapuoli.",
-       "The top side only":                              "Ainoastaan yläpuoli",
-       "Vertical align":                                 "Vertikaali kohdistus",
-       "Width":                                          "Leveys",
-       "not-del-last-cell":                              "Ei voida poistaa viimeistä solua rivistä.",
-       "not-del-last-col":                               "Ei voida poistaa viimeistä saraketta taulusta.",
-       "not-del-last-row":                               "Ei voida poistaa viimeistä riviä taulusta.",
-       "percent":                                        "prosenttia",
-       "pixels":                                         "pikseliä"
-};
diff --git a/lib/editor/htmlarea/plugins/TableOperations/lang/ro.js b/lib/editor/htmlarea/plugins/TableOperations/lang/ro.js
deleted file mode 100644 (file)
index 0ca175c..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-// I18N constants
-
-// LANG: "ro", ENCODING: UTF-8
-// Author: Mihai Bazon, <mishoo@infoiasi.ro>
-
-// FOR TRANSLATORS:
-//
-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
-//      (at least a valid email address)
-//
-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
-//      (if this is not possible, please include a comment
-//       that states what encoding is necessary.)
-
-TableOperations.I18N = {
-       "Align":                                          "Aliniere",
-       "All four sides":                                 "Toate părÅ£ile",
-       "Background":                                     "Fundal",
-       "Baseline":                                       "Baseline",
-       "Border":                                         "Chenar",
-       "Borders":                                        "Chenare",
-       "Bottom":                                         "Jos",
-       "CSS Style":                                      "Stil [CSS]",
-       "Caption":                                        "Titlu de tabel",
-       "Cell Properties":                                "Proprietăţile celulei",
-       "Center":                                         "Centru",
-       "Char":                                           "Caracter",
-       "Collapsed borders":                              "Chenare asimilate",
-       "Color":                                          "Culoare",
-       "Description":                                    "Descriere",
-       "FG Color":                                       "Culoare text",
-       "Float":                                          "PoziÅ£ie",
-       "Frames":                                         "Chenare",
-       "Height":                                         "ÃŽnălÅ£imea",
-       "How many columns would you like to merge?":      "Câte coloane vrei să uneÅŸti?",
-       "How many rows would you like to merge?":         "Câte linii vrei să uneÅŸti?",
-       "Image URL":                                      "URL-ul imaginii",
-       "Justify":                                        "Justify",
-       "Layout":                                         "Aranjament",
-       "Left":                                           "Stânga",
-       "Margin":                                         "Margine",
-       "Middle":                                         "Mijloc",
-       "No rules":                                       "Fără linii",
-       "No sides":                                       "Fără părÅ£i",
-       "None":                                           "Nimic",
-       "Padding":                                        "SpaÅ£iere",
-       "Please click into some cell":                    "Vă rog să daÅ£i click Ã®ntr-o celulă",
-       "Right":                                          "Dreapta",
-       "Row Properties":                                 "Proprietăţile liniei",
-       "Rules will appear between all rows and columns": "Vor apărea linii Ã®ntre toate rândurile ÅŸi coloanele",
-       "Rules will appear between columns only":         "Vor apărea doar linii verticale",
-       "Rules will appear between rows only":            "Vor apărea doar linii orizontale",
-       "Rules":                                          "Linii",
-       "Spacing and padding":                            "SpaÅ£ierea",
-       "Spacing":                                        "ÃŽntre celule",
-       "Summary":                                        "Sumar",
-       "TO-cell-delete":                                 "Åžterge celula",
-       "TO-cell-insert-after":                           "Inserează o celulă la dreapta",
-       "TO-cell-insert-before":                          "Inserează o celulă la stânga",
-       "TO-cell-merge":                                  "UneÅŸte celulele",
-       "TO-cell-prop":                                   "Proprietăţile celulei",
-       "TO-cell-split":                                  "ÃŽmparte celula",
-       "TO-col-delete":                                  "Åžterge coloana",
-       "TO-col-insert-after":                            "Inserează o coloană la dreapta",
-       "TO-col-insert-before":                           "Inserează o coloană la stânga",
-       "TO-col-split":                                   "ÃŽmparte coloana",
-       "TO-row-delete":                                  "Åžterge rândul",
-       "TO-row-insert-above":                            "Inserează un rând Ã®nainte",
-       "TO-row-insert-under":                            "Inserează un rând după",
-       "TO-row-prop":                                    "Proprietăţile rândului",
-       "TO-row-split":                                   "ÃŽmparte rândul",
-       "TO-table-prop":                                  "Proprietăţile tabelei",
-       "Table Properties":                               "Proprietăţile tabelei",
-       "Text align":                                     "Aliniere",
-       "The bottom side only":                           "Doar partea de jos",
-       "The left-hand side only":                        "Doar partea din stânga",
-       "The right and left sides only":                  "Partea din stânga ÅŸi cea din dreapta",
-       "The right-hand side only":                       "Doar partea din dreapta",
-       "The top and bottom sides only":                  "Partea de sus si cea de jos",
-       "The top side only":                              "Doar partea de sus",
-       "Top":                                            "Sus",        
-       "Unset color":                                    "Dezactivează culoarea",
-       "Vertical align":                                 "Aliniere pe verticală",
-       "Width":                                          "Lăţime",
-       "not-del-last-cell":                              "HTMLArea refuză cu laÅŸitate să ÅŸteargă ultima celulă din rând.",
-       "not-del-last-col":                               "HTMLArea refuză cu laÅŸitate să ÅŸteargă ultima coloamă din tabela.",
-       "not-del-last-row":                               "HTMLArea refuză cu laÅŸitate să ÅŸteargă ultimul rând din tabela.",
-       "percent":                                        "procente",
-       "pixels":                                         "pixeli"
-};
diff --git a/lib/editor/htmlarea/plugins/TableOperations/makefile.xml b/lib/editor/htmlarea/plugins/TableOperations/makefile.xml
deleted file mode 100644 (file)
index f900fc7..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<files>
-  <file name="*.{js,html,cgi,css}" />
-
-  <dir name="lang" />
-  <dir name="img" />
-</files>
-
diff --git a/lib/editor/htmlarea/plugins/TableOperations/table-operations.js b/lib/editor/htmlarea/plugins/TableOperations/table-operations.js
deleted file mode 100644 (file)
index 7c838f4..0000000
+++ /dev/null
@@ -1,1167 +0,0 @@
-// Table Operations Plugin for HTMLArea-3.0
-// Implementation by Mihai Bazon.  Sponsored by http://www.bloki.com
-//
-// htmlArea v3.0 - Copyright (c) 2002 interactivetools.com, inc.
-// This notice MUST stay intact for use (see license.txt).
-//
-// A free WYSIWYG editor replacement for <textarea> fields.
-// For full source code and docs, visit http://www.interactivetools.com/
-//
-// Version 3.0 developed by Mihai Bazon for InteractiveTools.
-//   http://dynarch.com/mishoo
-//
-// $Id$
-
-// Object that will encapsulate all the table operations provided by
-// HTMLArea-3.0 (except "insert table" which is included in the main file)
-function TableOperations(editor) {
-    this.editor = editor;
-
-    var cfg = editor.config;
-    var tt = TableOperations.I18N;
-    var bl = TableOperations.btnList;
-    var self = this;
-
-    // register the toolbar buttons provided by this plugin
-    var toolbar = ["linebreak"];
-    for (var i in bl) {
-        var btn = bl[i];
-        if (!btn) {
-            toolbar.push("separator");
-        } else {
-            var id = "TO-" + btn[0];
-            cfg.registerButton(id, tt[id], editor.imgURL(btn[0] + ".gif", "TableOperations"), false,
-                       function(editor, id) {
-                           // dispatch button press event
-                           self.buttonPress(editor, id);
-                       }, btn[1]);
-            toolbar.push(id);
-        }
-    }
-
-    // add a new line in the toolbar
-    cfg.toolbar.push(toolbar);
-};
-
-TableOperations._pluginInfo = {
-    name          : "TableOperations",
-    version       : "1.0",
-    developer     : "Mihai Bazon",
-    developer_url : "http://dynarch.com/mishoo/",
-    c_owner       : "Mihai Bazon",
-    sponsor       : "Zapatec Inc.",
-    sponsor_url   : "http://www.bloki.com",
-    license       : "htmlArea"
-};
-
-/************************
- * UTILITIES
- ************************/
-
-// retrieves the closest element having the specified tagName in the list of
-// ancestors of the current selection/caret.
-TableOperations.prototype.getClosest = function(tagName) {
-    var editor = this.editor;
-    var ancestors = editor.getAllAncestors();
-    var ret = null;
-    tagName = ("" + tagName).toLowerCase();
-    for (var i in ancestors) {
-        var el = ancestors[i];
-        if (el.tagName.toLowerCase() == tagName) {
-            ret = el;
-            break;
-        }
-    }
-    return ret;
-};
-
-// this function requires the file PopupDiv/PopupWin to be loaded from browser
-TableOperations.prototype.dialogTableProperties = function() {
-    var i18n = TableOperations.I18N;
-    // retrieve existing values
-    var table = this.getClosest("table");
-    // this.editor.selectNodeContents(table);
-    // this.editor.updateToolbar();
-
-    var dialog = new PopupWin(this.editor, i18n["Table Properties"], function(dialog, params) {
-        TableOperations.processStyle(params, table);
-        for (var i in params) {
-            var val = params[i];
-            switch (i) {
-                case "f_caption":
-                if (/\S/.test(val)) {
-                    // contains non white-space characters
-                    var caption = table.getElementsByTagName("caption")[0];
-                    if (!caption) {
-                        caption = dialog.editor._doc.createElement("caption");
-                        table.insertBefore(caption, table.firstChild);
-                    }
-                    caption.innerHTML = val;
-                } else {
-                    // search for caption and delete it if found
-                    var caption = table.getElementsByTagName("caption")[0];
-                    if (caption) {
-                        caption.parentNode.removeChild(caption);
-                    }
-                }
-                break;
-                case "f_summary":
-                table.summary = val;
-                break;
-                case "f_width":
-                table.style.width = ("" + val) + params.f_unit;
-                break;
-                case "f_align":
-                table.align = val;
-                break;
-                case "f_spacing":
-                table.cellSpacing = val;
-                break;
-                case "f_padding":
-                table.cellPadding = val;
-                break;
-                case "f_borders":
-                table.border = val;
-                break;
-                case "f_frames":
-                table.frame = val;
-                break;
-                case "f_rules":
-                table.rules = val;
-                break;
-            }
-        }
-        // various workarounds to refresh the table display (Gecko,
-        // what's going on?! do not disappoint me!)
-        dialog.editor.forceRedraw();
-        dialog.editor.focusEditor();
-        dialog.editor.updateToolbar();
-        var save_collapse = table.style.borderCollapse;
-        table.style.borderCollapse = "collapse";
-        table.style.borderCollapse = "separate";
-        table.style.borderCollapse = save_collapse;
-    },
-
-    // this function gets called when the dialog needs to be initialized
-    function (dialog) {
-
-        var f_caption = "";
-        var capel = table.getElementsByTagName("caption")[0];
-        if (capel) {
-            f_caption = capel.innerHTML;
-        }
-        var f_summary = table.summary;
-        var f_width = parseInt(table.style.width);
-        isNaN(f_width) && (f_width = "");
-        var f_unit = /%/.test(table.style.width) ? 'percent' : 'pixels';
-        var f_align = table.align;
-        var f_spacing = table.cellSpacing;
-        var f_padding = table.cellPadding;
-        var f_borders = table.border;
-        var f_frames = table.frame;
-        var f_rules = table.rules;
-
-        function selected(val) {
-            return val ? " selected" : "";
-        };
-
-        // dialog contents
-
-        dialog.content.innerHTML = " \
-<div class='title'\
- style='background: url(" + dialog.baseURL + dialog.editor.imgURL("table-prop.gif", "TableOperations") + ") #fff 98% 50% no-repeat'>" + i18n["Table Properties"] + "\
-</div> \
-<table style='width:100%'> \
-  <tr> \
-    <td> \
-      <fieldset><legend>" + i18n["Description"] + "</legend> \
-       <table style='width:100%'> \
-        <tr> \
-          <td class='label'>" + i18n["Caption"] + ":</td> \
-          <td class='value'><input type='text' name='f_caption' value='" + f_caption + "'/></td> \
-        </tr><tr> \
-          <td class='label'>" + i18n["Summary"] + ":</td> \
-          <td class='value'><input type='text' name='f_summary' value='" + f_summary + "'/></td> \
-        </tr> \
-       </table> \
-      </fieldset> \
-    </td> \
-  </tr> \
-  <tr><td id='--HA-layout'></td></tr> \
-  <tr> \
-    <td> \
-      <fieldset><legend>" + i18n["Spacing and padding"] + "</legend> \
-       <table style='width:100%'> \
-"+//        <tr> \
-//           <td class='label'>" + i18n["Width"] + ":</td> \
-//           <td><input type='text' name='f_width' value='" + f_width + "' size='5' /> \
-//             <select name='f_unit'> \
-//               <option value='%'" + selected(f_unit == "percent") + ">" + i18n["percent"] + "</option> \
-//               <option value='px'" + selected(f_unit == "pixels") + ">" + i18n["pixels"] + "</option> \
-//             </select> &nbsp;&nbsp;" + i18n["Align"] + ": \
-//             <select name='f_align'> \
-//               <option value='left'" + selected(f_align == "left") + ">" + i18n["Left"] + "</option> \
-//               <option value='center'" + selected(f_align == "center") + ">" + i18n["Center"] + "</option> \
-//               <option value='right'" + selected(f_align == "right") + ">" + i18n["Right"] + "</option> \
-//             </select> \
-//           </td> \
-//         </tr> \
-"        <tr> \
-          <td class='label'>" + i18n["Spacing"] + ":</td> \
-          <td><input type='text' name='f_spacing' size='5' value='" + f_spacing + "' /> &nbsp;" + i18n["Padding"] + ":\
-            <input type='text' name='f_padding' size='5' value='" + f_padding + "' /> &nbsp;&nbsp;" + i18n["pixels"] + "\
-          </td> \
-        </tr> \
-       </table> \
-      </fieldset> \
-    </td> \
-  </tr> \
-  <tr> \
-    <td> \
-      <fieldset><legend>Frame and borders</legend> \
-        <table width='100%'> \
-          <tr> \
-            <td class='label'>" + i18n["Borders"] + ":</td> \
-            <td><input name='f_borders' type='text' size='5' value='" + f_borders + "' /> &nbsp;&nbsp;" + i18n["pixels"] + "</td> \
-          </tr> \
-          <tr> \
-            <td class='label'>" + i18n["Frames"] + ":</td> \
-            <td> \
-              <select name='f_frames'> \
-                <option value='void'" + selected(f_frames == "void") + ">" + i18n["No sides"] + "</option> \
-                <option value='above'" + selected(f_frames == "above") + ">" + i18n["The top side only"] + "</option> \
-                <option value='below'" + selected(f_frames == "below") + ">" + i18n["The bottom side only"] + "</option> \
-                <option value='hsides'" + selected(f_frames == "hsides") + ">" + i18n["The top and bottom sides only"] + "</option> \
-                <option value='vsides'" + selected(f_frames == "vsides") + ">" + i18n["The right and left sides only"] + "</option> \
-                <option value='lhs'" + selected(f_frames == "lhs") + ">" + i18n["The left-hand side only"] + "</option> \
-                <option value='rhs'" + selected(f_frames == "rhs") + ">" + i18n["The right-hand side only"] + "</option> \
-                <option value='box'" + selected(f_frames == "box") + ">" + i18n["All four sides"] + "</option> \
-              </select> \
-            </td> \
-          </tr> \
-          <tr> \
-            <td class='label'>" + i18n["Rules"] + ":</td> \
-            <td> \
-              <select name='f_rules'> \
-                <option value='none'" + selected(f_rules == "none") + ">" + i18n["No rules"] + "</option> \
-                <option value='rows'" + selected(f_rules == "rows") + ">" + i18n["Rules will appear between rows only"] + "</option> \
-                <option value='cols'" + selected(f_rules == "cols") + ">" + i18n["Rules will appear between columns only"] + "</option> \
-                <option value='all'" + selected(f_rules == "all") + ">" + i18n["Rules will appear between all rows and columns"] + "</option> \
-              </select> \
-            </td> \
-          </tr> \
-        </table> \
-      </fieldset> \
-    </td> \
-  </tr> \
-  <tr> \
-    <td id='--HA-style'></td> \
-  </tr> \
-</table> \
-";
-        var st_prop = TableOperations.createStyleFieldset(dialog.doc, dialog.editor, table);
-        var p = dialog.doc.getElementById("--HA-style");
-        p.appendChild(st_prop);
-        var st_layout = TableOperations.createStyleLayoutFieldset(dialog.doc, dialog.editor, table);
-        p = dialog.doc.getElementById("--HA-layout");
-        p.appendChild(st_layout);
-        dialog.modal = true;
-        dialog.addButtons("ok", "cancel");
-        dialog.showAtElement(dialog.editor._iframe, "c");
-        dialog.content.style.width = "400px";
-        if (document.all) {
-            dialog.content.style.height = dialog.content.clientHeight + 60 + 'px'; //moodlefix
-        }
-    });
-};
-
-// this function requires the file PopupDiv/PopupWin to be loaded from browser
-TableOperations.prototype.dialogRowCellProperties = function(cell) {
-    var i18n = TableOperations.I18N;
-    // retrieve existing values
-    var element = this.getClosest(cell ? "td" : "tr");
-    var table = this.getClosest("table");
-    // this.editor.selectNodeContents(element);
-    // this.editor.updateToolbar();
-
-    var dialog = new PopupWin(this.editor, i18n[cell ? "Cell Properties" : "Row Properties"], function(dialog, params) {
-        TableOperations.processStyle(params, element);
-        for (var i in params) {
-            var val = params[i];
-            switch (i) {
-                case "f_align":
-                element.align = val;
-                break;
-                case "f_char":
-                element.ch = val;
-                break;
-                case "f_valign":
-                element.vAlign = val;
-                break;
-            }
-        }
-        // various workarounds to refresh the table display (Gecko,
-        // what's going on?! do not disappoint me!)
-        dialog.editor.forceRedraw();
-        dialog.editor.focusEditor();
-        dialog.editor.updateToolbar();
-        var save_collapse = table.style.borderCollapse;
-        table.style.borderCollapse = "collapse";
-        table.style.borderCollapse = "separate";
-        table.style.borderCollapse = save_collapse;
-    },
-
-    // this function gets called when the dialog needs to be initialized
-    function (dialog) {
-
-        var f_align = element.align;
-        var f_valign = element.vAlign;
-        var f_char = element.ch;
-
-        function selected(val) {
-            return val ? " selected" : "";
-        };
-
-        // dialog contents
-        dialog.content.style.width = "400px";
-        dialog.content.innerHTML = " \
-<div class='title'\
- style='background: url(" + dialog.baseURL + dialog.editor.imgURL(cell ? "cell-prop.gif" : "row-prop.gif", "TableOperations") + ") #fff 98% 50% no-repeat'>" + i18n[cell ? "Cell Properties" : "Row Properties"] + "</div> \
-<table style='width:100%'> \
-  <tr> \
-    <td id='--HA-layout'> \
-"+//      <fieldset><legend>" + i18n["Layout"] + "</legend> \
-//        <table style='width:100%'> \
-//         <tr> \
-//           <td class='label'>" + i18n["Align"] + ":</td> \
-//           <td> \
-//             <select name='f_align'> \
-//               <option value='left'" + selected(f_align == "left") + ">" + i18n["Left"] + "</option> \
-//               <option value='center'" + selected(f_align == "center") + ">" + i18n["Center"] + "</option> \
-//               <option value='right'" + selected(f_align == "right") + ">" + i18n["Right"] + "</option> \
-//               <option value='char'" + selected(f_align == "char") + ">" + i18n["Char"] + "</option> \
-//             </select> \
-//             &nbsp;&nbsp;" + i18n["Char"] + ": \
-//             <input type='text' style='font-family: monospace; text-align: center' name='f_char' size='1' value='" + f_char + "' /> \
-//           </td> \
-//         </tr><tr> \
-//           <td class='label'>" + i18n["Vertical align"] + ":</td> \
-//           <td> \
-//             <select name='f_valign'> \
-//               <option value='top'" + selected(f_valign == "top") + ">" + i18n["Top"] + "</option> \
-//               <option value='middle'" + selected(f_valign == "middle") + ">" + i18n["Middle"] + "</option> \
-//               <option value='bottom'" + selected(f_valign == "bottom") + ">" + i18n["Bottom"] + "</option> \
-//               <option value='baseline'" + selected(f_valign == "baseline") + ">" + i18n["Baseline"] + "</option> \
-//             </select> \
-//           </td> \
-//         </tr> \
-//        </table> \
-//       </fieldset> \
-"    </td> \
-  </tr> \
-  <tr> \
-    <td id='--HA-style'></td> \
-  </tr> \
-</table> \
-";
-        var st_prop = TableOperations.createStyleFieldset(dialog.doc, dialog.editor, element);
-        var p = dialog.doc.getElementById("--HA-style");
-        p.appendChild(st_prop);
-        var st_layout = TableOperations.createStyleLayoutFieldset(dialog.doc, dialog.editor, element);
-        p = dialog.doc.getElementById("--HA-layout");
-        p.appendChild(st_layout);
-        dialog.modal = true;
-        dialog.addButtons("ok", "cancel");
-        dialog.showAtElement(dialog.editor._iframe, "c");
-        if (document.all) {
-            dialog.content.style.height = dialog.content.clientHeight + 60 + 'px'; //moodlefix
-        }
-    });
-};
-
-// this function gets called when some button from the TableOperations toolbar
-// was pressed.
-TableOperations.prototype.buttonPress = function(editor, button_id) {
-    this.editor = editor;
-    var mozbr = HTMLArea.is_gecko ? "<br />" : "";
-    var i18n = TableOperations.I18N;
-
-    // helper function that clears the content in a table row
-    function clearRow(tr) {
-        var tds = tr.getElementsByTagName("td");
-        for (var i = tds.length; --i >= 0;) {
-            var td = tds[i];
-            td.rowSpan = 1;
-            td.innerHTML = mozbr;
-        }
-    };
-
-    function splitRow(td) {
-        var n = parseInt("" + td.rowSpan);
-        var nc = parseInt("" + td.colSpan);
-        td.rowSpan = 1;
-        tr = td.parentNode;
-        var itr = tr.rowIndex;
-        var trs = tr.parentNode.rows;
-        var index = td.cellIndex;
-        while (--n > 0) {
-            tr = trs[++itr];
-            var otd = editor._doc.createElement("td");
-            otd.colSpan = td.colSpan;
-            otd.innerHTML = mozbr;
-            tr.insertBefore(otd, tr.cells[index]);
-        }
-        editor.forceRedraw();
-        editor.updateToolbar();
-    };
-
-    function splitCol(td) {
-        var nc = parseInt("" + td.colSpan);
-        td.colSpan = 1;
-        tr = td.parentNode;
-        var ref = td.nextSibling;
-        while (--nc > 0) {
-            var otd = editor._doc.createElement("td");
-            otd.rowSpan = td.rowSpan;
-            otd.innerHTML = mozbr;
-            tr.insertBefore(otd, ref);
-        }
-        editor.forceRedraw();
-        editor.updateToolbar();
-    };
-
-    function splitCell(td) {
-        var nc = parseInt("" + td.colSpan);
-        splitCol(td);
-        var items = td.parentNode.cells;
-        var index = td.cellIndex;
-        while (nc-- > 0) {
-            splitRow(items[index++]);
-        }
-    };
-
-    function selectNextNode(el) {
-        var node = el.nextSibling;
-        while (node && node.nodeType != 1) {
-            node = node.nextSibling;
-        }
-        if (!node) {
-            node = el.previousSibling;
-            while (node && node.nodeType != 1) {
-                node = node.previousSibling;
-            }
-        }
-        if (!node) {
-            node = el.parentNode;
-        }
-        editor.selectNodeContents(node);
-    };
-
-    switch (button_id) {
-        // ROWS
-
-        case "TO-row-insert-above":
-        case "TO-row-insert-under":
-        var tr = this.getClosest("tr");
-        if (!tr) {
-            break;
-        }
-        var otr = tr.cloneNode(true);
-        clearRow(otr);
-        tr.parentNode.insertBefore(otr, /under/.test(button_id) ? tr.nextSibling : tr);
-        editor.forceRedraw();
-        editor.focusEditor();
-        break;
-        case "TO-row-delete":
-        var tr = this.getClosest("tr");
-        if (!tr) {
-            break;
-        }
-        var par = tr.parentNode;
-        if (par.rows.length == 1) {
-            alert(i18n["not-del-last-row"]);
-            break;
-        }
-        // set the caret first to a position that doesn't
-        // disappear.
-        selectNextNode(tr);
-        par.removeChild(tr);
-        editor.forceRedraw();
-        editor.focusEditor();
-        editor.updateToolbar();
-        break;
-        case "TO-row-split":
-        var td = this.getClosest("td");
-        if (!td) {
-            break;
-        }
-        splitRow(td);
-        break;
-
-        // COLUMNS
-
-        case "TO-col-insert-before":
-        case "TO-col-insert-after":
-        var td = this.getClosest("td");
-        if (!td) {
-            break;
-        }
-        var rows = td.parentNode.parentNode.rows;
-        var index = td.cellIndex;
-        for (var i = rows.length; --i >= 0;) {
-            var tr = rows[i];
-            var ref = tr.cells[index + (/after/.test(button_id) ? 1 : 0)];
-            var otd = editor._doc.createElement("td");
-            otd.innerHTML = mozbr;
-            tr.insertBefore(otd, ref);
-        }
-        editor.focusEditor();
-        break;
-        case "TO-col-split":
-        var td = this.getClosest("td");
-        if (!td) {
-            break;
-        }
-        splitCol(td);
-        break;
-        case "TO-col-delete":
-        var td = this.getClosest("td");
-        if (!td) {
-            break;
-        }
-        var index = td.cellIndex;
-        if (td.parentNode.cells.length == 1) {
-            alert(i18n["not-del-last-col"]);
-            break;
-        }
-        // set the caret first to a position that doesn't disappear
-        selectNextNode(td);
-        var rows = td.parentNode.parentNode.rows;
-        for (var i = rows.length; --i >= 0;) {
-            var tr = rows[i];
-            tr.removeChild(tr.cells[index]);
-        }
-        editor.forceRedraw();
-        editor.focusEditor();
-        editor.updateToolbar();
-        break;
-
-        // CELLS
-
-        case "TO-cell-split":
-        var td = this.getClosest("td");
-        if (!td) {
-            break;
-        }
-        splitCell(td);
-        break;
-        case "TO-cell-insert-before":
-        case "TO-cell-insert-after":
-        var td = this.getClosest("td");
-        if (!td) {
-            break;
-        }
-        var tr = td.parentNode;
-        var otd = editor._doc.createElement("td");
-        otd.innerHTML = mozbr;
-        tr.insertBefore(otd, /after/.test(button_id) ? td.nextSibling : td);
-        editor.forceRedraw();
-        editor.focusEditor();
-        break;
-        case "TO-cell-delete":
-        var td = this.getClosest("td");
-        if (!td) {
-            break;
-        }
-        if (td.parentNode.cells.length == 1) {
-            alert(i18n["not-del-last-cell"]);
-            break;
-        }
-        // set the caret first to a position that doesn't disappear
-        selectNextNode(td);
-        td.parentNode.removeChild(td);
-        editor.forceRedraw();
-        editor.updateToolbar();
-        break;
-        case "TO-cell-merge":
-        // !! FIXME: Mozilla specific !!
-        var sel = editor._getSelection();
-        var range, i = 0;
-        var rows = [];
-        var row = null;
-        var cells = null;
-        if (!HTMLArea.is_ie) {
-            try {
-                while (range = sel.getRangeAt(i++)) {
-                    var td = range.startContainer.childNodes[range.startOffset];
-                    if (td.parentNode != row) {
-                        row = td.parentNode;
-                        (cells) && rows.push(cells);
-                        cells = [];
-                    }
-                    cells.push(td);
-                }
-            } catch(e) {/* finished walking through selection */}
-            rows.push(cells);
-        } else {
-            // Internet Explorer "browser"
-            var td = this.getClosest("td");
-            if (!td) {
-                alert(i18n["Please click into some cell"]);
-                break;
-            }
-            var tr = td.parentElement;
-            var no_cols = prompt(i18n["How many columns would you like to merge?"], 2);
-            if (!no_cols) {
-                // cancelled
-                break;
-            }
-            var no_rows = prompt(i18n["How many rows would you like to merge?"], 2);
-            if (!no_rows) {
-                // cancelled
-                break;
-            }
-            var cell_index = td.cellIndex;
-            while (no_rows-- > 0) {
-                td = tr.cells[cell_index];
-                cells = [td];
-                for (var i = 1; i < no_cols; ++i) {
-                    td = td.nextSibling;
-                    if (!td) {
-                        break;
-                    }
-                    cells.push(td);
-                }
-                rows.push(cells);
-                tr = tr.nextSibling;
-                if (!tr) {
-                    break;
-                }
-            }
-        }
-        var HTML = "";
-        for (i = 0; i < rows.length; ++i) {
-            // i && (HTML += "<br />");
-            var cells = rows[i];
-            for (var j = 0; j < cells.length; ++j) {
-                // j && (HTML += "&nbsp;");
-                var cell = cells[j];
-                HTML += cell.innerHTML;
-                (i || j) && (cell.parentNode.removeChild(cell));
-            }
-        }
-        var td = rows[0][0];
-        td.innerHTML = HTML;
-        td.rowSpan = rows.length;
-        td.colSpan = rows[0].length;
-        editor.selectNodeContents(td);
-        editor.forceRedraw();
-        editor.focusEditor();
-        break;
-
-        // PROPERTIES
-
-        case "TO-table-prop":
-        this.dialogTableProperties();
-        break;
-
-        case "TO-row-prop":
-        this.dialogRowCellProperties(false);
-        break;
-
-        case "TO-cell-prop":
-        this.dialogRowCellProperties(true);
-        break;
-
-        default:
-        alert("Button [" + button_id + "] not yet implemented");
-    }
-};
-
-// the list of buttons added by this plugin
-TableOperations.btnList = [
-    // table properties button
-    ["table-prop",       "table"],
-    null,           // separator
-
-    // ROWS
-    ["row-prop",         "tr"],
-    ["row-insert-above", "tr"],
-    ["row-insert-under", "tr"],
-    ["row-delete",       "tr"],
-    ["row-split",        "td[rowSpan!=1]"],
-    null,
-
-    // COLS
-    ["col-insert-before", "td"],
-    ["col-insert-after",  "td"],
-    ["col-delete",        "td"],
-    ["col-split",         "td[colSpan!=1]"],
-    null,
-
-    // CELLS
-    ["cell-prop",          "td"],
-    ["cell-insert-before", "td"],
-    ["cell-insert-after",  "td"],
-    ["cell-delete",        "td"],
-    ["cell-merge",         "tr"],
-    ["cell-split",         "td[colSpan!=1,rowSpan!=1]"]
-    ];
-
-
-
-//// GENERIC CODE [style of any element; this should be moved into a separate
-//// file as it'll be very useful]
-//// BEGIN GENERIC CODE -----------------------------------------------------
-
-TableOperations.getLength = function(value) {
-    var len = parseInt(value);
-    if (isNaN(len)) {
-        len = "";
-    }
-    return len;
-};
-
-// Applies the style found in "params" to the given element.
-TableOperations.processStyle = function(params, element) {
-    var style = element.style;
-    for (var i in params) {
-        var val = params[i];
-        switch (i) {
-            case "f_st_backgroundColor":
-            style.backgroundColor = val;
-            break;
-            case "f_st_color":
-            style.color = val;
-            break;
-            case "f_st_backgroundImage":
-            if (/\S/.test(val)) {
-                style.backgroundImage = "url(" + val + ")";
-            } else {
-                style.backgroundImage = "none";
-            }
-            break;
-            case "f_st_borderWidth":
-            style.borderWidth = val;
-            break;
-            case "f_st_borderStyle":
-            style.borderStyle = val;
-            break;
-            case "f_st_borderColor":
-            style.borderColor = val;
-            break;
-            case "f_st_borderCollapse":
-            style.borderCollapse = val ? "collapse" : "";
-            break;
-            case "f_st_width":
-            if (/\S/.test(val)) {
-                style.width = val + params["f_st_widthUnit"];
-            } else {
-                style.width = "";
-            }
-            break;
-            case "f_st_height":
-            if (/\S/.test(val)) {
-                style.height = val + params["f_st_heightUnit"];
-            } else {
-                style.height = "";
-            }
-            break;
-            case "f_st_textAlign":
-            if (val == "char") {
-                var ch = params["f_st_textAlignChar"];
-                if (ch == '"') {
-                    ch = '\\"';
-                }
-                style.textAlign = '"' + ch + '"';
-            } else {
-                style.textAlign = val;
-            }
-            break;
-            case "f_st_verticalAlign":
-            style.verticalAlign = val;
-            break;
-            case "f_st_float":
-            style.cssFloat = val;
-            break;
-//          case "f_st_margin":
-//          style.margin = val + "px";
-//          break;
-//          case "f_st_padding":
-//          style.padding = val + "px";
-//          break;
-        }
-    }
-};
-
-// Returns an HTML element for a widget that allows color selection.  That is,
-// a button that contains the given color, if any, and when pressed will popup
-// the sooner-or-later-to-be-rewritten select_color.html dialog allowing user
-// to select some color.  If a color is selected, an input field with the name
-// "f_st_"+name will be updated with the color value in #123456 format.
-TableOperations.createColorButton = function(doc, editor, color, name) {
-    if (!color) {
-        color = "";
-    } else if (!/#/.test(color)) {
-        color = HTMLArea._colorToRgb(color);
-    }
-
-    var df = doc.createElement("span");
-    var field = doc.createElement("input");
-    field.type = "hidden";
-    df.appendChild(field);
-    field.name = "f_st_" + name;
-    field.value = color;
-    var button = doc.createElement("span");
-    button.className = "buttonColor";
-    df.appendChild(button);
-    var span = doc.createElement("span");
-    span.className = "chooser";
-    // span.innerHTML = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
-    span.style.backgroundColor = color;
-    button.appendChild(span);
-    button.onmouseover = function() { if (!this.disabled) { this.className += " buttonColor-hilite"; }};
-    button.onmouseout = function() { if (!this.disabled) { this.className = "buttonColor"; }};
-    span.onclick = function() {
-        if (this.parentNode.disabled) {
-            return false;
-        }
-        editor._popupDialog("select_color.php", function(color) {
-            if (color) {
-                span.style.backgroundColor = "#" + color;
-                field.value = "#" + color;
-            }
-        }, color);
-    };
-    var span2 = doc.createElement("span");
-    span2.innerHTML = "&#x00d7;";
-    span2.className = "nocolor";
-    span2.title = TableOperations.I18N["Unset color"];
-    button.appendChild(span2);
-    span2.onmouseover = function() { if (!this.parentNode.disabled) { this.className += " nocolor-hilite"; }};
-    span2.onmouseout = function() { if (!this.parentNode.disabled) { this.className = "nocolor"; }};
-    span2.onclick = function() {
-        span.style.backgroundColor = "";
-        field.value = "";
-    };
-    return df;
-};
-
-TableOperations.createStyleLayoutFieldset = function(doc, editor, el) {
-    var i18n = TableOperations.I18N;
-    var fieldset = doc.createElement("fieldset");
-    var legend = doc.createElement("legend");
-    fieldset.appendChild(legend);
-    legend.innerHTML = i18n["Layout"];
-    var table = doc.createElement("table");
-    fieldset.appendChild(table);
-    table.style.width = "100%";
-    var tbody = doc.createElement("tbody");
-    table.appendChild(tbody);
-
-    var tagname = el.tagName.toLowerCase();
-    var tr, td, input, select, option, options, i;
-
-    if (tagname != "td" && tagname != "tr" && tagname != "th") {
-        tr = doc.createElement("tr");
-        tbody.appendChild(tr);
-        td = doc.createElement("td");
-        td.className = "label";
-        tr.appendChild(td);
-        td.innerHTML = i18n["Float"] + ":";
-        td = doc.createElement("td");
-        tr.appendChild(td);
-        select = doc.createElement("select");
-        td.appendChild(select);
-        select.name = "f_st_float";
-        options = ["None", "Left", "Right"];
-        for (i in options) {
-            var Val = options[i];
-            var val = options[i].toLowerCase();
-            option = doc.createElement("option");
-            option.innerHTML = i18n[Val];
-            option.value = val;
-            option.selected = (("" + el.style.cssFloat).toLowerCase() == val);
-            select.appendChild(option);
-        }
-    }
-
-    tr = doc.createElement("tr");
-    tbody.appendChild(tr);
-    td = doc.createElement("td");
-    td.className = "label";
-    tr.appendChild(td);
-    td.innerHTML = i18n["Width"] + ":";
-    td = doc.createElement("td");
-    tr.appendChild(td);
-    input = doc.createElement("input");
-    input.type = "text";
-    input.value = TableOperations.getLength(el.style.width);
-    input.size = "5";
-    input.name = "f_st_width";
-    input.style.marginRight = "0.5em";
-    td.appendChild(input);
-    select = doc.createElement("select");
-    select.name = "f_st_widthUnit";
-    option = doc.createElement("option");
-    option.innerHTML = i18n["percent"];
-    option.value = "%";
-    option.selected = /%/.test(el.style.width);
-    select.appendChild(option);
-    option = doc.createElement("option");
-    option.innerHTML = i18n["pixels"];
-    option.value = "px";
-    option.selected = /px/.test(el.style.width);
-    select.appendChild(option);
-    td.appendChild(select);
-
-    select.style.marginRight = "0.5em";
-    td.appendChild(doc.createTextNode(i18n["Text align"] + ":"));
-    select = doc.createElement("select");
-    select.style.marginLeft = select.style.marginRight = "0.5em";
-    td.appendChild(select);
-    select.name = "f_st_textAlign";
-    options = ["Left", "Center", "Right", "Justify"];
-    if (tagname == "td") {
-        options.push("Char");
-    }
-    input = doc.createElement("input");
-    input.name = "f_st_textAlignChar";
-    input.size = "1";
-    input.style.fontFamily = "monospace";
-    td.appendChild(input);
-    for (i in options) {
-        var Val = options[i];
-        var val = Val.toLowerCase();
-        option = doc.createElement("option");
-        option.value = val;
-        option.innerHTML = i18n[Val];
-        option.selected = (el.style.textAlign.toLowerCase() == val);
-        select.appendChild(option);
-    }
-    function setCharVisibility(value) {
-        input.style.visibility = value ? "visible" : "hidden";
-        if (value) {
-            input.focus();
-            input.select();
-        }
-    };
-    select.onchange = function() { setCharVisibility(this.value == "char"); };
-    setCharVisibility(select.value == "char");
-
-    tr = doc.createElement("tr");
-    tbody.appendChild(tr);
-    td = doc.createElement("td");
-    td.className = "label";
-    tr.appendChild(td);
-    td.innerHTML = i18n["Height"] + ":";
-    td = doc.createElement("td");
-    tr.appendChild(td);
-    input = doc.createElement("input");
-    input.type = "text";
-    input.value = TableOperations.getLength(el.style.height);
-    input.size = "5";
-    input.name = "f_st_height";
-    input.style.marginRight = "0.5em";
-    td.appendChild(input);
-    select = doc.createElement("select");
-    select.name = "f_st_heightUnit";
-    option = doc.createElement("option");
-    option.innerHTML = i18n["percent"];
-    option.value = "%";
-    option.selected = /%/.test(el.style.height);
-    select.appendChild(option);
-    option = doc.createElement("option");
-    option.innerHTML = i18n["pixels"];
-    option.value = "px";
-    option.selected = /px/.test(el.style.height);
-    select.appendChild(option);
-    td.appendChild(select);
-
-    select.style.marginRight = "0.5em";
-    td.appendChild(doc.createTextNode(i18n["Vertical align"] + ":"));
-    select = doc.createElement("select");
-    select.name = "f_st_verticalAlign";
-    select.style.marginLeft = "0.5em";
-    td.appendChild(select);
-    options = ["Top", "Middle", "Bottom", "Baseline"];
-    for (i in options) {
-        var Val = options[i];
-        var val = Val.toLowerCase();
-        option = doc.createElement("option");
-        option.value = val;
-        option.innerHTML = i18n[Val];
-        option.selected = (el.style.verticalAlign.toLowerCase() == val);
-        select.appendChild(option);
-    }
-
-    return fieldset;
-};
-
-// Returns an HTML element containing the style attributes for the given
-// element.  This can be easily embedded into any dialog; the functionality is
-// also provided.
-TableOperations.createStyleFieldset = function(doc, editor, el) {
-    var i18n = TableOperations.I18N;
-    var fieldset = doc.createElement("fieldset");
-    var legend = doc.createElement("legend");
-    fieldset.appendChild(legend);
-    legend.innerHTML = i18n["CSS Style"];
-    var table = doc.createElement("table");
-    fieldset.appendChild(table);
-    table.style.width = "100%";
-    var tbody = doc.createElement("tbody");
-    table.appendChild(tbody);
-
-    var tr, td, input, select, option, options, i;
-
-    tr = doc.createElement("tr");
-    tbody.appendChild(tr);
-    td = doc.createElement("td");
-    tr.appendChild(td);
-    td.className = "label";
-    td.innerHTML = i18n["Background"] + ":";
-    td = doc.createElement("td");
-    tr.appendChild(td);
-    var df = TableOperations.createColorButton(doc, editor, el.style.backgroundColor, "backgroundColor");
-    df.firstChild.nextSibling.style.marginRight = "0.5em";
-    td.appendChild(df);
-    td.appendChild(doc.createTextNode(i18n["Image URL"] + ": "));
-    input = doc.createElement("input");
-    input.type = "text";
-    input.name = "f_st_backgroundImage";
-    if (el.style.backgroundImage.match(/url\(\s*(.*?)\s*\)/)) {
-        input.value = RegExp.$1;
-    }
-    // input.style.width = "100%";
-    td.appendChild(input);
-
-    tr = doc.createElement("tr");
-    tbody.appendChild(tr);
-    td = doc.createElement("td");
-    tr.appendChild(td);
-    td.className = "label";
-    td.innerHTML = i18n["FG Color"] + ":";
-    td = doc.createElement("td");
-    tr.appendChild(td);
-    td.appendChild(TableOperations.createColorButton(doc, editor, el.style.color, "color"));
-
-    // for better alignment we include an invisible field.
-    input = doc.createElement("input");
-    input.style.visibility = "hidden";
-    input.type = "text";
-    td.appendChild(input);
-
-    tr = doc.createElement("tr");
-    tbody.appendChild(tr);
-    td = doc.createElement("td");
-    tr.appendChild(td);
-    td.className = "label";
-    td.innerHTML = i18n["Border"] + ":";
-    td = doc.createElement("td");
-    tr.appendChild(td);
-
-    var colorButton = TableOperations.createColorButton(doc, editor, el.style.borderColor, "borderColor");
-    var btn = colorButton.firstChild.nextSibling;
-    td.appendChild(colorButton);
-    // borderFields.push(btn);
-    btn.style.marginRight = "0.5em";
-
-    select = doc.createElement("select");
-    var borderFields = [];
-    td.appendChild(select);
-    select.name = "f_st_borderStyle";
-    options = ["none", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"];
-    var currentBorderStyle = el.style.borderStyle;
-    // Gecko reports "solid solid solid solid" for "border-style: solid".
-    // That is, "top right bottom left" -- we only consider the first
-    // value.
-    (currentBorderStyle.match(/([^\s]*)\s/)) && (currentBorderStyle = RegExp.$1);
-    for (i in options) {
-        var val = options[i];
-        option = doc.createElement("option");
-        option.value = val;
-        option.innerHTML = val;
-        (val == currentBorderStyle) && (option.selected = true);
-        select.appendChild(option);
-    }
-    select.style.marginRight = "0.5em";
-    function setBorderFieldsStatus(value) {
-        for (i in borderFields) {
-            var el = borderFields[i];
-            el.style.visibility = value ? "hidden" : "visible";
-            if (!value && (el.tagName.toLowerCase() == "input")) {
-                el.focus();
-                el.select();
-            }
-        }
-    };
-    select.onchange = function() { setBorderFieldsStatus(this.value == "none"); };
-
-    input = doc.createElement("input");
-    borderFields.push(input);
-    input.type = "text";
-    input.name = "f_st_borderWidth";
-    input.value = TableOperations.getLength(el.style.borderWidth);
-    input.size = "5";
-    td.appendChild(input);
-    input.style.marginRight = "0.5em";
-    var span = doc.createElement("span");
-    span.innerHTML = i18n["pixels"];
-    td.appendChild(span);
-    borderFields.push(span);
-
-    setBorderFieldsStatus(select.value == "none");
-
-    if (el.tagName.toLowerCase() == "table") {
-        // the border-collapse style is only for tables
-        tr = doc.createElement("tr");
-        tbody.appendChild(tr);
-        td = doc.createElement("td");
-        td.className = "label";
-        tr.appendChild(td);
-        input = doc.createElement("input");
-        input.type = "checkbox";
-        input.name = "f_st_borderCollapse";
-        input.id = "f_st_borderCollapse";
-        var val = (/collapse/i.test(el.style.borderCollapse));
-        input.checked = val ? 1 : 0;
-        td.appendChild(input);
-
-        td = doc.createElement("td");
-        tr.appendChild(td);
-        var label = doc.createElement("label");
-        label.htmlFor = "f_st_borderCollapse";
-        label.innerHTML = i18n["Collapsed borders"];
-        td.appendChild(label);
-    }
-
-//  tr = doc.createElement("tr");
-//  tbody.appendChild(tr);
-//  td = doc.createElement("td");
-//  td.className = "label";
-//  tr.appendChild(td);
-//  td.innerHTML = i18n["Margin"] + ":";
-//  td = doc.createElement("td");
-//  tr.appendChild(td);
-//  input = doc.createElement("input");
-//  input.type = "text";
-//  input.size = "5";
-//  input.name = "f_st_margin";
-//  td.appendChild(input);
-//  input.style.marginRight = "0.5em";
-//  td.appendChild(doc.createTextNode(i18n["Padding"] + ":"));
-
-//  input = doc.createElement("input");
-//  input.type = "text";
-//  input.size = "5";
-//  input.name = "f_st_padding";
-//  td.appendChild(input);
-//  input.style.marginLeft = "0.5em";
-//  input.style.marginRight = "0.5em";
-//  td.appendChild(doc.createTextNode(i18n["pixels"]));
-
-    return fieldset;
-};
-
-//// END GENERIC CODE -------------------------------------------------------
diff --git a/lib/editor/htmlarea/popupdiv.js b/lib/editor/htmlarea/popupdiv.js
deleted file mode 100644 (file)
index 084ff8e..0000000
+++ /dev/null
@@ -1,369 +0,0 @@
-/** This file is derived from PopupDiv, developed by Mihai Bazon for
- * SamWare.net.  Modifications were needed to make it usable in HTMLArea.
- * HTMLArea is a free WYSIWYG online HTML editor from InteractiveTools.com.
- *
- * This file does not function standalone.  It is dependent of global functions
- * defined in HTMLArea-3.0 (htmlarea.js).
- *
- * Please see file htmlarea.js for further details.
- **/
-
-var is_ie = ( (navigator.userAgent.toLowerCase().indexOf("msie") != -1) &&
-             (navigator.userAgent.toLowerCase().indexOf("opera") == -1) );
-var is_compat = (document.compatMode == "BackCompat");
-
-function PopupDiv(editor, titleText, handler, initFunction) {
-       var self = this;
-
-       this.editor = editor;
-       this.doc = editor._mdoc;
-       this.handler = handler;
-
-       var el = this.doc.createElement("div");
-       el.className = "content";
-
-       var popup = this.doc.createElement("div");
-       popup.className = "dialog popupdiv";
-       this.element = popup;
-       var s = popup.style;
-       s.position = "absolute";
-       s.left = "0px";
-       s.top = "0px";
-
-       var title = this.doc.createElement("div");
-       title.className = "title";
-       this.title = title;
-       popup.appendChild(title);
-
-       HTMLArea._addEvent(title, "mousedown", function(ev) {
-               self._dragStart(is_ie ? window.event : ev);
-       });
-
-       var button = this.doc.createElement("div");
-       button.className = "button";
-       title.appendChild(button);
-       button.innerHTML = "&#x00d7;";
-       title.appendChild(this.doc.createTextNode(titleText));
-       this.titleText = titleText;
-
-       button.onmouseover = function() {
-               this.className += " button-hilite";
-       };
-       button.onmouseout = function() {
-               this.className = this.className.replace(/\s*button-hilite\s*/g, " ");
-       };
-       button.onclick = function() {
-               this.className = this.className.replace(/\s*button-hilite\s*/g, " ");
-               self.close();
-       };
-
-       popup.appendChild(el);
-       this.content = el;
-
-       this.doc.body.appendChild(popup);
-
-       this.dragging = false;
-       this.onShow = null;
-       this.onClose = null;
-       this.modal = false;
-
-       initFunction(this);
-};
-
-PopupDiv.currentPopup = null;
-
-PopupDiv.prototype.showAtElement = function(el, mode) {
-       this.defaultSize();
-       var pos, ew, eh;
-       var popup = this.element;
-       popup.style.display = "block";
-       var w = popup.offsetWidth;
-       var h = popup.offsetHeight;
-       popup.style.display = "none";
-       if (el != window) {
-               pos = PopupDiv.getAbsolutePos(el);
-               ew = el.offsetWidth;
-               eh = el.offsetHeight;
-       } else {
-               pos = {x:0, y:0};
-               var size = PopupDiv.getWindowSize();
-               ew = size.x;
-               eh = size.y;
-       }
-       var FX = false, FY = false;
-       if (mode.indexOf("l") != -1) {
-               pos.x -= w;
-               FX = true;
-       }
-       if (mode.indexOf("r") != -1) {
-               pos.x += ew;
-               FX = true;
-       }
-       if (mode.indexOf("t") != -1) {
-               pos.y -= h;
-               FY = true;
-       }
-       if (mode.indexOf("b") != -1) {
-               pos.y += eh;
-               FY = true;
-       }
-       if (mode.indexOf("c") != -1) {
-               FX || (pos.x += Math.round((ew - w) / 2));
-               FY || (pos.y += Math.round((eh - h) / 2));
-       }
-       this.showAt(pos.x, pos.y);
-};
-
-PopupDiv.prototype.defaultSize = function() {
-       var s = this.element.style;
-       var cs = this.element.currentStyle;
-       var addX = (is_ie && is_compat) ? (parseInt(cs.borderLeftWidth) +
-                                          parseInt(cs.borderRightWidth) +
-                                          parseInt(cs.paddingLeft) +
-                                          parseInt(cs.paddingRight)) : 0;
-       var addY = (is_ie && is_compat) ? (parseInt(cs.borderTopWidth) +
-                                          parseInt(cs.borderBottomWidth) +
-                                          parseInt(cs.paddingTop) +
-                                          parseInt(cs.paddingBottom)) : 0;
-       s.display = "block";
-       s.width = (this.content.offsetWidth + addX) + "px";
-       s.height = (this.content.offsetHeight + this.title.offsetHeight) + "px";
-       s.display = "none";
-};
-
-PopupDiv.prototype.showAt = function(x, y) {
-       this.defaultSize();
-       var s = this.element.style;
-       s.display = "block";
-       s.left = x + "px";
-       s.top = y + "px";
-       this.hideShowCovered();
-
-       PopupDiv.currentPopup = this;
-       HTMLArea._addEvents(this.doc.body, ["mousedown", "click"], PopupDiv.checkPopup);
-       HTMLArea._addEvents(this.editor._doc.body, ["mousedown", "click"], PopupDiv.checkPopup);
-       if (is_ie && this.modal) {
-               this.doc.body.setCapture(false);
-               this.doc.body.onlosecapture = function() {
-                       (PopupDiv.currentPopup) && (this.doc.body.setCapture(false));
-               };
-       }
-       window.event && HTMLArea._stopEvent(window.event);
-
-       if (typeof this.onShow == "function") {
-               this.onShow();
-       } else if (typeof this.onShow == "string") {
-               eval(this.onShow);
-       }
-
-       var field = this.element.getElementsByTagName("input")[0];
-       if (!field) {
-               field = this.element.getElementsByTagName("select")[0];
-       }
-       if (!field) {
-               field = this.element.getElementsByTagName("textarea")[0];
-       }
-       if (field) {
-               field.focus();
-       }
-};
-
-PopupDiv.prototype.close = function() {
-       this.element.style.display = "none";
-       PopupDiv.currentPopup = null;
-       this.hideShowCovered();
-       HTMLArea._removeEvents(this.doc.body, ["mousedown", "click"], PopupDiv.checkPopup);
-       HTMLArea._removeEvents(this.editor._doc.body, ["mousedown", "click"], PopupDiv.checkPopup);
-       is_ie && this.modal && this.doc.body.releaseCapture();
-       if (typeof this.onClose == "function") {
-               this.onClose();
-       } else if (typeof this.onClose == "string") {
-               eval(this.onClose);
-       }
-       this.element.parentNode.removeChild(this.element);
-};
-
-PopupDiv.prototype.getForm = function() {
-       var forms = this.content.getElementsByTagName("form");
-       return (forms.length > 0) ? forms[0] : null;
-};
-
-PopupDiv.prototype.callHandler = function() {
-       var tags = ["input", "textarea", "select"];
-       var params = new Object();
-       for (var ti in tags) {
-               var tag = tags[ti];
-               var els = this.content.getElementsByTagName(tag);
-               for (var j = 0; j < els.length; ++j) {
-                       var el = els[j];
-                       params[el.name] = el.value;
-               }
-       }
-       this.handler(this, params);
-       return false;
-};
-
-PopupDiv.getAbsolutePos = function(el) {
-       var r = { x: el.offsetLeft, y: el.offsetTop };
-       if (el.offsetParent) {
-               var tmp = PopupDiv.getAbsolutePos(el.offsetParent);
-               r.x += tmp.x;
-               r.y += tmp.y;
-       }
-       return r;
-};
-
-PopupDiv.getWindowSize = function() {
-       if (window.innerHeight) {
-               return { y: window.innerHeight, x: window.innerWidth };
-       }
-       if (this.doc.body.clientHeight) {
-               return { y: this.doc.body.clientHeight, x: this.doc.body.clientWidth };
-       }
-       return { y: this.doc.documentElement.clientHeight, x: this.doc.documentElement.clientWidth };
-};
-
-PopupDiv.prototype.hideShowCovered = function () {
-       var self = this;
-       function isContained(el) {
-               while (el) {
-                       if (el == self.element) {
-                               return true;
-                       }
-                       el = el.parentNode;
-               }
-               return false;
-       };
-       var tags = new Array("applet", "select");
-       var el = this.element;
-
-       var p = PopupDiv.getAbsolutePos(el);
-       var EX1 = p.x;
-       var EX2 = el.offsetWidth + EX1;
-       var EY1 = p.y;
-       var EY2 = el.offsetHeight + EY1;
-
-       if (el.style.display == "none") {
-               EX1 = EX2 = EY1 = EY2 = 0;
-       }
-
-       for (var k = tags.length; k > 0; ) {
-               var ar = this.doc.getElementsByTagName(tags[--k]);
-               var cc = null;
-
-               for (var i = ar.length; i > 0;) {
-                       cc = ar[--i];
-                       if (isContained(cc)) {
-                               cc.style.visibility = "visible";
-                               continue;
-                       }
-
-                       p = PopupDiv.getAbsolutePos(cc);
-                       var CX1 = p.x;
-                       var CX2 = cc.offsetWidth + CX1;
-                       var CY1 = p.y;
-                       var CY2 = cc.offsetHeight + CY1;
-
-                       if ((CX1 > EX2) || (CX2 < EX1) || (CY1 > EY2) || (CY2 < EY1)) {
-                               cc.style.visibility = "visible";
-                       } else {
-                               cc.style.visibility = "hidden";
-                       }
-               }
-       }
-};
-
-PopupDiv.prototype._dragStart = function (ev) {
-       if (this.dragging) {
-               return false;
-       }
-       this.dragging = true;
-       PopupDiv.currentPopup = this;
-       var posX = ev.clientX;
-       var posY = ev.clientY;
-       if (is_ie) {
-               posY += this.doc.body.scrollTop;
-               posX += this.doc.body.scrollLeft;
-       } else {
-               posY += window.scrollY;
-               posX += window.scrollX;
-       }
-       var st = this.element.style;
-       this.xOffs = posX - parseInt(st.left);
-       this.yOffs = posY - parseInt(st.top);
-       HTMLArea._addEvent(this.doc, "mousemove", PopupDiv.dragIt);
-       HTMLArea._addEvent(this.doc, "mouseover", HTMLArea._stopEvent);
-       HTMLArea._addEvent(this.doc, "mouseup", PopupDiv.dragEnd);
-       HTMLArea._stopEvent(ev);
-};
-
-PopupDiv.dragIt = function (ev) {
-       var popup = PopupDiv.currentPopup;
-       if (!(popup && popup.dragging)) {
-               return false;
-       }
-       is_ie && (ev = window.event);
-       var posX = ev.clientX;
-       var posY = ev.clientY;
-       if (is_ie) {
-               posY += this.doc.body.scrollTop;
-               posX += this.doc.body.scrollLeft;
-       } else {
-               posY += window.scrollY;
-               posX += window.scrollX;
-       }
-       popup.hideShowCovered();
-       var st = popup.element.style;
-       st.left = (posX - popup.xOffs) + "px";
-       st.top = (posY - popup.yOffs) + "px";
-       HTMLArea._stopEvent(ev);
-};
-
-PopupDiv.dragEnd = function () {
-       var popup = PopupDiv.currentPopup;
-       if (!popup) {
-               return false;
-       }
-       popup.dragging = false;
-       HTMLArea._removeEvent(popup.doc, "mouseup", PopupDiv.dragEnd);
-       HTMLArea._removeEvent(popup.doc, "mouseover", HTMLArea._stopEvent);
-       HTMLArea._removeEvent(popup.doc, "mousemove", PopupDiv.dragIt);
-       popup.hideShowCovered();
-};
-
-PopupDiv.checkPopup = function (ev) {
-       is_ie && (ev = window.event);
-       var el = is_ie ? ev.srcElement : ev.target;
-       var cp = PopupDiv.currentPopup;
-       for (; (el != null) && (el != cp.element); el = el.parentNode);
-       if (el == null) {
-               cp.modal || ev.type == "mouseover" || cp.close();
-               HTMLArea._stopEvent(ev);
-       }
-};
-
-PopupDiv.prototype.addButtons = function() {
-       var self = this;
-       var div = this.doc.createElement("div");
-       this.content.appendChild(div);
-       div.className = "buttons";
-       for (var i = 0; i < arguments.length; ++i) {
-               var btn = arguments[i];
-               var button = this.doc.createElement("button");
-               div.appendChild(button);
-               button.innerHTML = HTMLArea.I18N.buttons[btn];
-               switch (btn) {
-                   case "ok":
-                       button.onclick = function() {
-                               self.callHandler();
-                               self.close();
-                       };
-                       break;
-                   case "cancel":
-                       button.onclick = function() {
-                               self.close();
-                       };
-                       break;
-               }
-       }
-};
diff --git a/lib/editor/htmlarea/popups/about.html b/lib/editor/htmlarea/popups/about.html
deleted file mode 100644 (file)
index 9b05218..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-<html style="width: 380px; height: 250px;">
-<head><title>About HTMLArea</title>
-<script type="text/javascript" src="popup.js"></script>
-<script type="text/javascript">
-function closeAbout() {
-  __dlg_close(null);
-}
-</script>
-<style>
-  html,body,textarea { font-family: tahoma,verdana,arial; font-size: 11px;
-padding: 0px; margin: 0px; }
-  tt { font-size: 120%; }
-  body { padding: 0px; background: ButtonFace; color: ButtonText; }
-  a:link, a:visited { color: #00f; }
-  a:hover { color: #f00; }
-  a:active { color: #f80; }
-  button { font: 11px tahoma,verdana,sans-serif; }
-</style></head>
-<body onload="__dlg_init()">
-
-<div style="background-color: #fff; color: #000; padding: 3px; border-bottom: 1px solid #000;">
-<div style="font-family: 'arial black',arial,sans-serif; font-size: 28px;
-letter-spacing: -1px;">
-<span style="position: relative; top: -0.2em">H</span><span
-style="position: relative; top: 0.1em">T</span><span
-style="position: relative; top: -0.1em">M</span><span
-style="position: relative; top: 0.2em">L</span> Area
-3.0 <span style="position: relative; top: -0.6em; font-size: 50%; font-weight: normal">[ rev. beta ]</span></div>
-
-<div style="text-align: right; font-size: 90%; margin-bottom: 1em">
-Released on Aug 11, 2003 [21:30] GMT
-</div>
-</div>
-
-<div style="margin: 1em">
-
-<p>A free WYSIWYG editor replacement for <tt>&lt;textarea&gt;</tt> fields.</p>
-
-<p>For full source code and docs, visit:<br />
-<a href="http://www.interactivetools.com/products/htmlarea/" target="_blank"
->http://www.interactivetools.com/products/htmlarea/</a></p>
-
-<p>Version 3.0 developed and maintained by <a href="http://students.infoiasi.ro/~mishoo/" target="_blank">mishoo</a>.</p>
-
-<p>&copy; 2002, 2003 <a href="http://interactivetools.com" target="_blank">interactivetools.com</a>, inc. All Rights Reserved.</p>
-
-</div>
-
-<div style="text-align: right; padding: 0px 3px 3px 0px;">
-<button type="button" onclick="closeAbout()">I agree it's cool</button>
-</div>
-
-</body></html>
-
-
diff --git a/lib/editor/htmlarea/popups/blank.html b/lib/editor/htmlarea/popups/blank.html
deleted file mode 100644 (file)
index 8c7fe21..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-<html>
-</html>
\ No newline at end of file
diff --git a/lib/editor/htmlarea/popups/createanchor.php b/lib/editor/htmlarea/popups/createanchor.php
deleted file mode 100644 (file)
index 0aa34ee..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-<?php // $Id$
-    require("../../../../config.php");
-
-    $id = optional_param('id', SITEID, PARAM_INT);
-
-    require_course_login($id);
-    @header('Content-Type: text/html; charset=utf-8');
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
-<head>
-<meta http-equiv="content-type" content="text/html; charset=utf-8" />
-<title>Create anchor</title>
-<script type="text/javascript" src="popup.js"></script>
-<script type="text/javascript">
-//<![CDATA[
-function Init() {
-    __dlg_init();
-}
-
-function onOK() {
-  var required = {
-    "f_anc": "You must enter the URL where this link points to"
-  };
-  var txt = document.forms[0].anc.value;
-  if (!txt) {
-    alert(required[f_anc]);
-    el.focus();
-    return false;
-  }
-  // pass data back to the calling window
-  var param = new Object();
-  param.anchor = txt;
-  __dlg_close(param);
-  return false;
-};
-
-function onCancel() {
-  __dlg_close(null);
-  return false;
-};
-//]]>
-</script>
-<style type="text/css">
-<!--
-body { background: ButtonFace; font-family: Tahoma, sans-serif; }
-td, button, input { font-family: Tahoma, verdana, sans-serif; font-size: 8pt; }
-button { width: 70px; }
-.title { background: #ddf; color: #000; font-weight: bold; font-size: 10pt; padding: 3px 10px; margin-bottom: 10px;
-border-bottom: 1px solid black; letter-spacing: 2px;
-}
-.note { font-size: 8pt; }
--->
-</style>
-</head>
-<body>
-<div class="title"><?php print_string("createanchor","editor");?></div>
-<form id="fie">
-<table border="0" cellpadding="2" cellspacing="0">
-<tr>
-    <td><?php print_string("anchorname","editor");?>: <input id="f_anc" name="anc" type="text" size="30" /></td>
-</tr>
-<tr>
-    <td align="right">
-    <br />
-    <button onclick="return onOK();" type="button"><?php print_string("ok","editor");?></button>&nbsp;<button onclick="return onCancel();" type="button"><?php print_string("cancel","editor");?></button>&nbsp;
-    <button type="button" onclick="javascript: void(0); alert('<?php print_string("anchorhelp","editor");?>');"><?php print_string("help");?></button></td>
-</tr>
-</table>
-</form>
-</body>
-</html>
diff --git a/lib/editor/htmlarea/popups/dialog.css b/lib/editor/htmlarea/popups/dialog.css
deleted file mode 100644 (file)
index 17b3347..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
-**
-** HTML Text Editing Component for hosting in Web Pages
-** Copyright (C) 2001  Ramesys (Contracting Services) Limited
-** 
-** This library is free software; you can redistribute it and/or
-** modify it under the terms of the GNU Lesser General Public
-** License as published by the Free Software Foundation; either
-** version 2.1 of the License, or (at your option) any later version.
-**
-** This library is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** Lesser General Public License for more details.
-**
-** You should have received a copy of the GNU LesserGeneral Public License
-** along with this program; if not a copy can be obtained from 
-**
-**    http://www.gnu.org/copyleft/lesser.html
-**
-** or by writing to:
-**
-**    Free Software Foundation, Inc.
-**    59 Temple Place - Suite 330,
-**    Boston,
-**    MA  02111-1307,
-**    USA.
-** 
-** Original Developer:
-**
-**     Austin David France
-**     Ramesys (Contracting Services) Limited
-**     Mentor House
-**     Ainsworth Street
-**     Blackburn
-**     Lancashire
-**     BB1 6AY
-**     United Kingdom
-**  email: Austin.France@Ramesys.com
-**
-** Home Page:    http://richtext.sourceforge.net/
-** Support:      http://richtext.sourceforge.net/
-** 
-*******************************************************************************/
-html, body {
-  background: ButtonFace;
-  color: ButtonText;
-  font: 11px Tahoma,Verdana,sans-serif;
-  margin: 0px;
-  padding: 0px;
-}
-body { padding: 5px; }
-table {
-font: 11px Tahoma,Verdana,sans-serif;
-}
-form p {
-  margin-top: 5px;
-  margin-bottom: 5px;
-}
-td.smile {
-background-color: transparent;
-font-family: "Courier New", courier;
-font-size: 10pt;
-}
-select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
-button { width: 70px; }
-.space { padding: 2px; }
-
-.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
-border-bottom: 1px solid black; letter-spacing: 2px;
-}
-form { padding: 0px; margin: 0px; }
diff --git a/lib/editor/htmlarea/popups/dlg_ins_char.php b/lib/editor/htmlarea/popups/dlg_ins_char.php
deleted file mode 100644 (file)
index e59e570..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-<!--
-################################################################################
-##
-## HTML Text Editing Component for hosting in Web Pages
-## Copyright (C) 2001  Ramesys (Contracting Services) Limited
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU LesserGeneral Public License
-## along with this program; if not a copy can be obtained from
-##
-##    http://www.gnu.org/copyleft/lesser.html
-##
-## or by writing to:
-##
-##    Free Software Foundation, Inc.
-##    59 Temple Place - Suite 330,
-##    Boston,
-##    MA  02111-1307,
-##    USA.
-##
-## Original Developer:
-##
-##  Austin David France
-##  Ramesys (Contracting Services) Limited
-##  Mentor House
-##  Ainsworth Street
-##  Blackburn
-##  Lancashire
-##  BB1 6AY
-##  United Kingdom
-##  email: Austin.France@Ramesys.com
-##
-## Home Page:    http://richtext.sourceforge.net/
-## Support:      http://richtext.sourceforge.net/
-##
-################################################################################
--->
-<?php
-    require("../../../../config.php");
-
-    $id = optional_param('id', SITEID, PARAM_INT);
-
-    require_course_login($id);
-    @header('Content-Type: text/html; charset=utf-8');
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
-<head>
-<meta http-equiv="content-type" content="text/html; charset=utf-8" />
-<style type="text/css">
-<!--
-body { background: ButtonFace; color: ButtonText; font: 11px Tahoma,Verdana,sans-serif;
-margin: 0px; padding: 0px; }
-form p { margin-top: 5px; margin-bottom: 5px; }
-select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
-button { width: 70px; }
-.space { padding: 2px; }
-.title { background: #ddf; color: #000; font-weight: bold; font-size: 14px; padding: 3px 10px; margin-bottom: 10px;
-border-bottom: 1px solid black; letter-spacing: 2px; }
-form { padding: 0px; margin: 0px; }
-.chr { background-color: transparent; border: 1px solid #dcdcdc; font-family: "Times New Roman", times;
-font-size: small; }
-// -->
-</style>
-<script type="text/javascript" src="popup.js"></script>
-<script type="text/javascript">
-//<![CDATA[
-function Init() {
-  __dlg_init();
-}
-var chars = ["!","&quot;","#","$","%","&","'","(",")","*","+","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","&lt;","=","&gt;","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","&euro;","Æ’","„","…","†","‡","ˆ","\‰","Å ","‹","Å’","&lsquo;","&rsquo;","&rsquo;","&ldquo;","&rdquo;","•","&ndash;","&mdash;","Ëœ","â„¢","Å¡","›","Å“","Ÿ","&iexcl;","&cent;","&pound;","&pound;","&curren;","&yen;","&brvbar;","&sect;","&uml;","&copy;","&ordf;","&laquo;","&not;","­","&reg;","&macr;","&deg;","&plusmn;","&sup2;","&sup3;","&acute;","&micro;","&para;","&middot;","&cedil;","&sup1;","&ordm;","&raquo;","&frac14;","&frac12;","&frac34;","&iquest;","&Agrave;","&Aacute;","&Acirc;","&Atilde;","&Auml;","&Aring;","&AElig;","&Ccedil;","&Egrave;","&Eacute;","&Ecirc;","&Euml;","&Igrave;","&Iacute;","&Icirc;","&Iuml;","&ETH;","&Ntilde;","&Ograve;","&Oacute;","&Ocirc;","&Otilde;","&Ouml;","&times;","&Oslash;","&Ugrave;","&Uacute;","&Ucirc;","&Uuml;","&Yacute;","&THORN;","&szlig;","&agrave;","&aacute;","&acirc;","&atilde;","&auml;","&aring;","&aelig;","&ccedil;","&egrave;","&eacute;","&ecirc;","&euml;","&igrave;","&iacute;","&icirc;","&iuml;","&eth;","&ntilde;","&ograve;","&oacute;","&ocirc;","&otilde;","&ouml;","&divide;","&oslash;","&ugrave;","&uacute;","&ucirc;","&uuml;","&uuml;","&yacute;","&thorn;","&yuml;"]
-
-function tab(w,h) {
-    var strtab = ["<table border='0' cellspacing='0' cellpadding='0' align='center' bordercolor='#dcdcdc' bgcolor='#C0C0C0'>"]
-    var k = 0;
-    for(var i = 0; i < w; i++) {
-        strtab[strtab.length] = "<tr>";
-        for(var j = 0; j < h; j++) {
-            strtab[strtab.length] = "<td class='chr' width='14' align='center' onClick='getchar(this)' onMouseOver='hover(this,true)' onMouseOut='hover(this,false)'>"+(chars[k]||'')+"</td>";
-            k++;
-        }
-        strtab[strtab.length]="</tr>";
-    }
-    strtab[strtab.length] = "</table>";
-    return strtab.join("\n");
-}
-
-function hover(obj,val) {
-    if (!obj.innerHTML) {
-        obj.style.cursor = "default";
-        return;
-    }
-    obj.style.border = val ? "1px solid black" : "1px solid #dcdcdc";
-    //obj.style.backgroundColor = val ? "black" : "#C0C0C0"
-    //obj.style.color = val ? "white" : "black";
-}
-function getchar(obj) {
-    if(!obj.innerHTML) return;
-    var sChar = obj.innerHTML || "";
-    __dlg_close(sChar);
-    return false;
-}
-function cancel() {
-    __dlg_close(null);
-    return false;
-}
-//]]>
-</script>
-<title><?php print_string("choosechar","editor");?></title>
-</head>
-<body onload="Init()">
-<table class="dlg" cellpadding="0" cellspacing="2">
-<tr><td><table width="100%"><tr><td class="title" nowrap><?php print_string("choosechar","editor") ?></td></tr></table></td></tr>
-<tr>
-<td>
-    <table border="0" align="center" cellpadding="5">
-      <tr valign="top">
-        <td>
-
-       <script type="text/javascript">
-       //<![CDATA[
-       document.write(tab(7,32))
-       //]]>
-       </script>
-
-        </td>
-      </tr>
-    </table>
-    </td>
-  </tr>
-<tr><td><table width="100%"><tr><td valign="middle" width="90%"><hr width="100%"></td></tr></table></td></tr>
-<tr><td align="right">
-    <button type="button" onclick="cancel()"><?php print_string("close","editor") ?></button></td></tr>
-</table>
-</body>
-</body>
-</html>
diff --git a/lib/editor/htmlarea/popups/dlg_ins_smile.php b/lib/editor/htmlarea/popups/dlg_ins_smile.php
deleted file mode 100644 (file)
index 0f5657d..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-<?php
-
-#################################################################################
-##
-## $Id$
-##
-#################################################################################
-
-    require("../../../../config.php");
-
-    $id = optional_param('id', SITEID, PARAM_INT);
-
-    require_course_login($id);
-    @header('Content-Type: text/html; charset=utf-8');
-
-    $pixpath = "$CFG->pixpath/s";
-
-    $fullnames = get_list_of_pixnames();
-
-    $emoticons = array ( 'smiley'     => ':-)',
-                         'biggrin'    => ':-D',
-                         'wink'       => ';-)',
-                         'mixed'      => ':-/',
-                         'thoughtful' => 'V-.',
-                         'tongueout'  => ':-P',
-                         'cool'       => 'B-)',
-                         'approve'    => '^-)',
-                         'wideeyes'   => '8-)',
-                         'clown'      => ':o)',
-                         'sad'        => ':-(',
-                         'shy'        => '8-.',
-                         'blush'      => ':-I',
-                         'kiss'       => ':-X',
-                         'surprise'   => '8-o',
-                         'blackeye'   => 'P-|',
-                         'angry'      => '8-[',
-                         'dead'       => 'xx-P',
-                         'sleepy'     => '|-.',
-                         'evil'       => '}-]' );
-
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
-<head>
-<meta http-equiv="content-type" content="text/html; charset=utf-8" />
-<title><?php print_string('insertsmile', 'editor'); ?></title>
-<link rel="stylesheet" href="dialog.css" type="text/css" />
-<script type="text/javascript" src="popup.js"></script>
-<script type="text/javascript">
-//<![CDATA[
-function Init() {
-  __dlg_init();
-}
-function attr(name, value) {
-    if (!value || value == "") return "";
-    return ' ' + name + '="' + value + '"';
-}
-function insert(img,text) {
-    if (img) {
-            var strImage = img;
-            var strAlt = text;
-            var imgString = "<img src=\"" + strImage +"\" alt=\"" + strAlt +"\" title=\"" + strAlt +"\" />";
-    }
-  // pass data back to the calling window
-  __dlg_close(imgString);
-  return false;
-};
-
-function cancel() {
-  __dlg_close(null);
-  return false;
-};
-//]]>
-</script>
-</head>
-<body onload="Init()">
-<table class="dlg" cellpadding="0" cellspacing="2" width="100%">
-<tr><td><table width="100%"><tr><td class="title" nowrap="nowrap"><?php print_string('chooseicon', 'editor'); ?></td></tr></table></td></tr>
-<tr>
-<td>
-    <table border="0" align="center" cellpadding="5">
-      <tr valign="top">
-        <td>
-        <table border="0">
-<?php
-        $list = array('smiley', 'biggrin', 'wink', 'mixed', 'thoughtful',
-                      'tongueout', 'cool', 'approve', 'wideeyes', 'surprise');
-        foreach ($list as $image) {
-            $name = $fullnames[$image];
-            $icon = $emoticons[$image];
-            echo '<tr>';
-            echo "<td><img alt=\"$name\" class=\"icon\" src=\"$pixpath/$image.gif\" ".
-                 " onclick=\"insert('$pixpath/$image.gif','$name')\" /></td>";
-            echo "<td>$name</td>";
-            echo "<td class=\"smile\">$icon</td>";
-            echo "</tr>";
-        }
-?>
-        </table>
-        </td>
-        <td>
-        <table border="0" align="center">
-
-<?php
-        $list = array('sad', 'shy', 'blush', 'kiss', 'clown', 'blackeye',
-                      'angry', 'dead', 'sleepy', 'evil');
-        foreach ($list as $image) {
-            $name = $fullnames[$image];
-            $icon = $emoticons[$image];
-            echo '<tr>';
-            echo "<td><img alt=\"$name\" class=\"icon\" src=\"$pixpath/$image.gif\" ".
-                 " onclick=\"insert('$pixpath/$image.gif','$name')\" /></td>";
-            echo "<td>$name</td>";
-            echo "<td class=\"smile\">$icon</td>";
-            echo "</tr>";
-        }
-?>
-        </table>
-        </td>
-      </tr>
-    </table>
-
-    </td>
-  </tr>
-<tr><td><table width="100%"><tr><td valign="middle" width="90%"><hr width="100%" /></td></tr></table></td></tr>
-<tr><td align="right">
-    <button type="button" onclick="return cancel();"><?php print_string('close', 'editor'); ?></button></td></tr>
-</table>
-</body>
-</html>
diff --git a/lib/editor/htmlarea/popups/editor_help.html b/lib/editor/htmlarea/popups/editor_help.html
deleted file mode 100644 (file)
index b34de82..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<html>
- <head>
-  <title>Editor Help</title>
-  <style>
-    body, td, p, div { font-family: arial; font-size: x-small; }
-  </style>
- </head>
-<body>
-
-<h2>Editor Help<hr></h2>
-
-Todo...
-
-
-</body>
-</html>
\ No newline at end of file
diff --git a/lib/editor/htmlarea/popups/fullscreen.php b/lib/editor/htmlarea/popups/fullscreen.php
deleted file mode 100644 (file)
index 721810f..0000000
+++ /dev/null
@@ -1,174 +0,0 @@
-<?php // $Id$
-    require("../../../../config.php");
-
-    $id = optional_param('id', SITEID, PARAM_INT);
-
-    require_course_login($id);
-    @header('Content-Type: text/html; charset=utf-8');
-?>
-<html>
-<head><title><?php print_string("fullscreen","editor");?></title>
-<meta http-equiv="content-type" content="text/html; charset=utf-8" />
-<style type="text/css">
-@import url(../htmlarea.css);
-html, body {    margin: 0px; border: 0px; background-color: buttonface; } </style>
-
-
-<script type="text/javascript" src="../htmlarea.php?id=<?php p($id); ?>"></script>
-<script type="text/javascript" src="../lang/en.php"></script>
-<script type="text/javascript" src="../dialog.js" charset="utf-8"></script>
-<script type="text/javascript" src="../plugins/TableOperations/table-operations.js" charset="utf-8"></script>
-<script type="text/javascript" src="../plugins/TableOperations/lang/en.js" charset="utf-8"></script>
-<script type="text/javascript">
-// load same scripts that were present in the opener page
-var scripts = opener.document.getElementsByTagName("script");
-var head = document.getElementsByTagName("head")[0];
-for (var i = 0; i < scripts.length; ++i) {
-  var script = scripts[i];
-  if (typeof script.src != "undefined" && /\S/.test(script.src)) {
-    // document.write("<scr" + "ipt type=" + "\"script/javascript\"");
-    // document.write(" src=\"../" + script.src + "\"></scr" + "ipt>");
-    var new_script = document.createElement("script");
-    if (/^https?:/i.test(script.src)) {
-      new_script.src = script.src;
-    } else {
-      new_script.src = "../" + script.src;
-    }
-    head.appendChild(new_script);
-  }
-}
-</script>
-
-<script type="text/javascript">
-
-var parent_object  = null;
-var editor         = null;      // to be initialized later [ function init() ]
-
-/* ---------------------------------------------------------------------- *\
-  Function    :
-  Description :
-\* ---------------------------------------------------------------------- */
-
-function _CloseOnEsc(ev) {
-    try {
-        if (document.all) {
-            // IE
-            ev || (ev = editor._iframe.contentWindow.event);
-        }
-        if (ev.keyCode == 27) {
-            // update_parent();
-            window.close();
-            return;
-        }
-    } catch(e) {}
-}
-
-/* ---------------------------------------------------------------------- *\
-  Function    : cloneObject
-  Description : copy an object by value instead of by reference
-  Usage       : var newObj = cloneObject(oldObj);
-\* ---------------------------------------------------------------------- */
-
-function cloneObject(obj) {
-  var newObj          = new Object;
-
-  // check for array objects
-  if (obj.constructor.toString().indexOf("function Array(") >= 0) {
-    newObj = obj.constructor();
-  }
-
-  // check for function objects (as usual, IE is phucked up)
-  if (obj.constructor.toString().indexOf("function Function(") >= 0) {
-    newObj = obj; // just copy reference to it
-  } else for (var n in obj) {
-    var node = obj[n];
-    if (typeof node == 'object') { newObj[n] = cloneObject(node); }
-    else                         { newObj[n] = node; }
-  }
-
-  return newObj;
-}
-
-/* ---------------------------------------------------------------------- *\
-  Function    : resize_editor
-  Description : resize the editor when the user resizes the popup
-\* ---------------------------------------------------------------------- */
-
-function resize_editor() {  // resize editor to fix window
-  var newHeight;
-  if (document.all) {
-    // IE
-    newHeight = document.body.offsetHeight - editor._toolbar.offsetHeight;
-    if (newHeight < 0) { newHeight = 0; }
-  } else {
-    // Gecko
-    newHeight = window.innerHeight - editor._toolbar.offsetHeight;
-  }
-  if (editor.config.statusBar) {
-    newHeight -= editor._statusBar.offsetHeight;
-  }
-  editor._textArea.style.height = editor._iframe.style.height = newHeight + "px";
-}
-
-/* ---------------------------------------------------------------------- *\
-  Function    : init
-  Description : run this code on page load
-\* ---------------------------------------------------------------------- */
-
-function init() {
-  parent_object      = opener.HTMLArea._object;
-  var config         = cloneObject( parent_object.config );
-  config.editorURL   = "../";
-  config.width       = "100%";
-  config.height      = "auto";
-
-  // change maximize button to minimize button
-  config.btnList["popupeditor"] = [ "<?php print_string("minimize","editor");?>", "<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/fullscreen_minimize.gif", true,
-                                    function() { window.close(); } ];
-
-  // generate editor and resize it
-  editor = new HTMLArea("editor", config);
-  editor.registerPlugin(TableOperations);
-  editor.generate();
-  editor._iframe.style.width = "100%";
-  editor._textArea.style.width = "100%";
-  resize_editor();
-
-  // set child window contents and event handlers, after a small delay
-  setTimeout(function() {
-    editor.setHTML(parent_object.getInnerHTML());
-
-    // switch mode if needed
-    if (parent_object._mode == "textmode") { editor.setMode("textmode"); }
-
-    // continuously update parent editor window
-    setInterval(update_parent, 500);
-
-    // setup event handlers FAST FIX IS UNCOMMENT THESE, NOT WORKING!
-    //document.body.onkeypress = _CloseOnEsc;
-    //editor._doc.body.onkeypress = _CloseOnEsc;
-    //editor._textArea.onkeypress = _CloseOnEsc;
-    window.onresize = resize_editor;
-  }, 333);                      // give it some time to meet the new frame
-}
-
-/* ---------------------------------------------------------------------- *\
-  Function    : update_parent
-  Description : update parent window editor field with contents from child window
-\* ---------------------------------------------------------------------- */
-
-function update_parent() {
-  // use the fast version
-  parent_object.setHTML(editor.getInnerHTML());
-}
-
-
-</script>
-</head>
-<body scroll="no" onload="init()" onunload="update_parent()">
-
-<form style="margin: 0px; border: 1px solid; border-color: threedshadow threedhighlight threedhighlight threedshadow;">
-<textarea name="editor" id="editor" style="width:100%; height:300px">&nbsp;</textarea>
-</form>
-
-</body></html>
diff --git a/lib/editor/htmlarea/popups/insert_image.php b/lib/editor/htmlarea/popups/insert_image.php
deleted file mode 100644 (file)
index 3a3c4c3..0000000
+++ /dev/null
@@ -1,338 +0,0 @@
-<?php // $Id$
-
-    require("../../../../config.php");
-
-    $id = optional_param('id', SITEID, PARAM_INT);
-
-    require_login($id);
-    require_capability('moodle/course:managefiles', get_context_instance(CONTEXT_COURSE, $id));
-
-    @header('Content-Type: text/html; charset=utf-8');
-
-    $upload_max_filesize = get_max_upload_file_size($CFG->maxbytes);
-
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
-<head>
-<meta http-equiv="content-type" content="text/html; charset=utf-8" />
-<title><?php print_string("insertimage","editor");?></title>
-<script type="text/javascript" src="popup.js"></script>
-<script type="text/javascript">
-//<![CDATA[
-var preview_window = null;
-
-function Init() {
-  __dlg_init();
-  var param = window.dialogArguments;
-  if (param) {
-      var alt = param["f_url"].substring(param["f_url"].lastIndexOf('/') + 1);
-      document.getElementById("f_url").value = param["f_url"];
-      document.getElementById("f_alt").value = param["f_alt"] ? param["f_alt"] : alt;
-      document.getElementById("f_border").value = parseInt(param["f_border"] || 0);
-      document.getElementById("f_align").value = param["f_align"];
-      document.getElementById("f_vert").value = param["f_vert"] != -1 ? param["f_vert"] : 0;
-      document.getElementById("f_horiz").value = param["f_horiz"] != -1 ? param["f_horiz"] : 0;
-      document.getElementById("f_width").value = param["f_width"];
-      document.getElementById("f_height").value = param["f_height"];
-      window.ipreview.location.replace('preview.php?id='+ <?php print($id);?> +'&imageurl='+ param.f_url);
-  }
-  document.getElementById("f_url").focus();
-};
-
-function onOK() {
-  var required = {
-    "f_url": "<?php print_string("mustenterurl", "editor");?>",
-    "f_alt": "<?php print_string("pleaseenteralt", "editor");?>"
-  };
-  for (var i in required) {
-    var el = document.getElementById(i);
-    if (!el.value) {
-      alert(required[i]);
-      el.focus();
-      return false;
-    }
-  }
-  // pass data back to the calling window
-  var fields = ["f_url", "f_alt", "f_align", "f_border",
-                "f_horiz", "f_vert","f_width","f_height"];
-  var param = new Object();
-  for (var i in fields) {
-    var id = fields[i];
-    var el = document.getElementById(id);
-    param[id] = el.value;
-  }
-  if (preview_window) {
-    preview_window.close();
-  }
-  __dlg_close(param);
-  return false;
-};
-
-function onCancel() {
-  if (preview_window) {
-    preview_window.close();
-  }
-  __dlg_close(null);
-  return false;
-};
-
-function onPreview() {
-  var f_url = document.getElementById("f_url");
-  var url = f_url.value;
-  if (!url) {
-    alert("<?php print_string("enterurlfirst","editor");?>");
-    f_url.focus();
-    return false;
-  }
-  var img = new Image();
-  img.src = url;
-  var win = null;
-  if (!document.all) {
-    win = window.open("about:blank", "ha_imgpreview", "toolbar=no,menubar=no,personalbar=no,innerWidth=100,innerHeight=100,scrollbars=no,resizable=yes");
-  } else {
-    win = window.open("about:blank", "ha_imgpreview", "channelmode=no,directories=no,height=100,width=100,location=no,menubar=no,resizable=yes,scrollbars=no,toolbar=no");
-  }
-  preview_window = win;
-  var doc = win.document;
-  var body = doc.body;
-  if (body) {
-    body.innerHTML = "";
-    body.style.padding = "0px";
-    body.style.margin = "0px";
-    var el = doc.createElement("img");
-    el.src = url;
-
-    var table = doc.createElement("table");
-    body.appendChild(table);
-    table.style.width = "100%";
-    table.style.height = "100%";
-    var tbody = doc.createElement("tbody");
-    table.appendChild(tbody);
-    var tr = doc.createElement("tr");
-    tbody.appendChild(tr);
-    var td = doc.createElement("td");
-    tr.appendChild(td);
-    td.style.textAlign = "center";
-
-    td.appendChild(el);
-    win.resizeTo(el.offsetWidth + 30, el.offsetHeight + 30);
-  }
-  win.focus();
-  return false;
-};
-
-function checkvalue(elm,formname) {
-    var el = document.getElementById(elm);
-    if(!el.value) {
-        alert("Nothing to do!");
-        el.focus();
-        return false;
-    }
-}
-
-function submit_form(dothis) {
-    if(dothis == "delete") {
-        window.ibrowser.document.dirform.action.value = "delete";
-    }
-    if(dothis == "move") {
-        window.ibrowser.document.dirform.action.value = "move";
-    }
-    if(dothis == "zip") {
-        window.ibrowser.document.dirform.action.value = "zip";
-    }
-
-    window.ibrowser.document.dirform.submit();
-    return false;
-}
-
-//]]>
-</script>
-<style type="text/css">
-html, body {
-margin: 2px;
-background-color: rgb(212,208,200);
-font-family: Tahoma, Verdana, sans-serif;
-font-size: 11px;
-}
-.title {
-background-color: #ddddff;
-padding: 5px;
-border-bottom: 1px solid black;
-font-family: Tahoma, sans-serif;
-font-weight: bold;
-font-size: 14px;
-color: black;
-}
-td, input, select, button {
-font-family: Tahoma, Verdana, sans-serif;
-font-size: 11px;
-}
-button { width: 70px; }
-.space { padding: 2px; }
-form { margin-bottom: 0px; margin-top: 0px; }
-</style>
-</head>
-<body onload="Init()">
-  <div class="title"><?php print_string("insertimage","editor");?></div>
-  <div class="space"></div>
-  <div class="space"></div>
-  <div class="space"></div>
-  <form action="" method="get" id="first">
-    <table width="100%" border="0" cellspacing="0" cellpadding="0">
-      <tr>
-        <td width="15%" align="right"><?php print_string("imageurl","editor");?>:</td>
-        <td width="60%"><input name="f_url" type="text" id="f_url" style="width: 100%;" /></td>
-        <td width="23%" align="center">
-          <button name="btnOK" type="button" id="btnOK" onclick="return onOK();"><?php print_string("ok","editor") ?></button></td>
-      </tr>
-      <tr>
-        <td align="right"><?php print_string("alternatetext","editor");?>:</td>
-        <td><input name="f_alt" type="text" id="f_alt" style="width: 100%;" /></td>
-        <td align="center">
-          <button name="btnCancel" type="button" id="btnCancel" onclick="return onCancel();"><?php print_string("cancel","editor") ?></button></td>
-      </tr>
-    </table>
-    <div class="space"></div>
-    <table width="100%" border="0" cellspacing="0" cellpadding="0">
-      <tr>
-        <td width="32%" valign="top">
-        <fieldset><legend><?php print_string("layout","editor");?></legend>
-        <div class="space"></div>
-          <table width="100%" border="0" cellspacing="0" cellpadding="0">
-            <tr>
-              <td width="40%" align="right"><?php print_string("alignment","editor");?>:</td>
-              <td width="60%">
-                <select size="1" name="f_align" id="f_align"
-                title="Positioning of this image">
-                <option value=""                       ><?php print_string("notset","editor") ?></option>
-                <option value="left"                   ><?php print_string("left","editor") ?></option>
-                <option value="right"                  ><?php print_string("right","editor") ?></option>
-                <option value="texttop"                ><?php print_string("texttop","editor") ?></option>
-                <option value="middle"              ><?php print_string("middle","editor") ?></option>
-                <option value="baseline" selected="1"  ><?php print_string("baseline","editor") ?></option>
-                <option value="absbottom"              ><?php print_string("absbottom","editor") ?></option>
-                <option value="bottom"                 ><?php print_string("bottom","editor") ?></option>
-                <option value="middle"                 ><?php print_string("middle","editor") ?></option>
-                <option value="top"                    ><?php print_string("top","editor") ?></option>
-                </select></td>
-      </tr>
-      <tr>
-              <td width="40%" align="right"><?php print_string("borderthickness","editor") ?>:</td>
-              <td width="60%">
-                <input type="text" id="f_border" name="f_border" size="5" /></td>
-            </tr>
-        </table><div class="space"></div>
-        </fieldset>&nbsp;</td>
-        <td width="34%" valign="top">
-        <fieldset><legend><?php print_string("spacing","editor");?></legend>
-        <div class="space"></div>
-          <table width="100%" border="0" cellspacing="0" cellpadding="0">
-            <tr>
-              <td width="40%" align="right"><?php print_string("horizontal","editor");?>: </td>
-              <td width="60%">
-                <input name="f_horiz" type="text" id="f_horiz" size="5" />
-              </td>
-            </tr>
-            <tr>
-              <td width="40%" align="right"><?php print_string("vertical","editor");?>:</td>
-              <td width="60%">
-                <input name="f_vert" type="text" id="f_vert" size="5" /></td>
-            </tr>
-          </table><div class="space"></div></fieldset></td>
-        <td width="34%" valign="top">
-        <fieldset><legend><?php print_string("size","editor");?></legend>
-        <div class="space"></div>
-          <table width="100%" border="0" cellspacing="0" cellpadding="0">
-            <tr>
-              <td width="40%" align="right"><?php print_string("width","editor");?>:</td>
-              <td width="60%">
-                <input name="f_width" type="text" id="f_width" size="5" />
-              </td>
-            </tr>
-            <tr>
-              <td width="40%" align="right"><?php print_string("height","editor");?>:</td>
-              <td width="60%">
-                <input name="f_height" type="text" id="f_height" size="5" /></td>
-            </tr>
-            </table><div class="space"></div>
-            </fieldset></td>
-    </tr>
-  </table></form>
-  <table width="100%" border="0" cellspacing="0" cellpadding="0">
-    <tr>
-      <td width="55%" valign="top"><?php
-          print_string("filebrowser","editor");
-          echo "<br />";
-          echo "<iframe id=\"ibrowser\" name=\"ibrowser\" src=\"{$CFG->wwwroot}/lib/editor/htmlarea/coursefiles.php?usecheckboxes=1&id=$id\" style=\"width: 100%; height: 200px;\"></iframe>";
-      ?>
-      </td>
-      <td width="45%" valign="top"><?php print_string("preview","editor");?>:<br />
-      <iframe id="ipreview" name="ipreview" src="about:blank" style="width: 100%; height: 200px;"></iframe>
-      </td>
-    </tr>
-  </table>
-    <table width="100%" border="0" cellspacing="0" cellpadding="0">
-      <tr>
-        <td width="55%"><div class="space"></div>
-        <?php if(has_capability('moodle/course:managefiles', get_context_instance(CONTEXT_COURSE, $id))) { ?>
-        <table border="0" cellpadding="2" cellspacing="0">
-          <tr><td><?php print_string("selection","editor");?>: </td>
-          <td><form id="idelete">
-          <input name="btnDelete" type="submit" id="btnDelete" value="<?php print_string("delete","editor");?>" onclick="return submit_form('delete');" /></form></td>
-          <td><form id="imove">
-          <input name="btnMove" type="submit" id="btnMove" value="<?php print_string("move","editor");?>" onclick="return submit_form('move');" /></td>
-          <td><form id="izip">
-          <input name="btnZip" type="submit" id="btnZip" value="<?php print_string("zip","editor");?>" onclick="return submit_form('zip');" /></form></td>
-          <td><form method="post" action="../coursefiles.php" target="ibrowser">
-          <input type="hidden" name="id" value="<?php print($id);?>" />
-          <input type="hidden" name="wdir" value="" />
-          <input type="hidden" id="irename" name="file" value="" />
-          <input type="hidden" name="action" value="rename" />
-          <input type="hidden" name="sesskey" value="<?php p($USER->sesskey) ?>" />
-          <input name="btnRename" type="submit" id="btnRename" value="<?php print_string("rename","editor");?>" /></form></td>
-          <tr></table>
-          <br />
-          <?php
-          } else {
-              print "";
-          } ?>
-        </td>
-      <td width="45%" rowspan="2" valign="top"><fieldset>
-          <legend><?php print_string("properties","editor");?></legend>
-          <div class="space"></div>
-          <div class="space"></div>
-          &nbsp;&nbsp;<?php print_string("size","editor");?>:
-          <input type="text" id="isize" name="isize" size="10" style="background: transparent; border: none;" />
-      <?php print_string("type","editor");?>: <input type="text" id="itype" name="itype" size="10" style="background: transparent; border: none;" />
-      <div class="space"></div>
-      <div class="space"></div>
-      </fieldset></td>
-    </tr>
-    <tr>
-      <td height="22">
-          <form id="cfolder" action="../coursefiles.php" method="post" target="ibrowser">
-          <input type="hidden" name="id" value="<?php print($id);?>" />
-          <input type="hidden" name="wdir" value="" />
-          <input type="hidden" name="action" value="mkdir" />
-          <input type="hidden" name="sesskey" value="<?php p($USER->sesskey) ?>" />
-          <input name="name" type="text" id="foldername" size="35" />
-          <input name="btnCfolder" type="submit" id="btnCfolder" value="<?php print_string("createfolder","editor");?>" onclick="return checkvalue('foldername','cfolder');" />
-          </form>
-          <div class="space"></div>
-          <form action="../coursefiles.php?id=<?php print($id);?>" method="post" enctype="multipart/form-data" target="ibrowser" id="uploader">
-          <input type="hidden" name="MAX_FILE_SIZE" value="<?php print($upload_max_filesize);?>" />
-          <input type="hidden" name="id" VALUE="<?php print($id);?>" />
-          <input type="hidden" name="wdir" value="" />
-          <input type="hidden" name="action" value="upload" />
-          <input type="hidden" name="sesskey" value="<?php p($USER->sesskey) ?>" />
-          <input type="file" name="userfile" id="userfile" size="35" />
-          <input name="save" type="submit" id="save" onclick="return checkvalue('userfile','uploader');" value="<?php print_string("upload","editor");?>" />
-          </form>
-      </td>
-    </tr>
-  </table>
-  <p>&nbsp;</p>
-</body>
-</html>
diff --git a/lib/editor/htmlarea/popups/insert_image_std.php b/lib/editor/htmlarea/popups/insert_image_std.php
deleted file mode 100644 (file)
index 6f12d9c..0000000
+++ /dev/null
@@ -1,230 +0,0 @@
-<?php // $Id$
-    require("../../../../config.php");
-
-    $id = optional_param('id', SITEID, PARAM_INT);
-
-    require_course_login($id);
-    @header('Content-Type: text/html; charset=utf-8');
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
-<head>
-<meta http-equiv="content-type" content="text/html; charset=utf-8" />
-  <title><?php print_string("insertimage","editor");?></title>
-
-<script type="text/javascript" src="popup.js"></script>
-
-<script type="text/javascript">
-//<![CDATA[
-var preview_window = null;
-
-function Init() {
-  __dlg_init();
-  var param = window.dialogArguments;
-  if (param) {
-      var alt = param["f_url"].substring(param["f_url"].lastIndexOf('/') + 1);
-      document.getElementById("f_url").value = param["f_url"];
-      document.getElementById("f_alt").value = param["f_alt"] ? param["f_alt"] : alt;
-      document.getElementById("f_border").value = parseInt(param["f_border"] || 0);
-      document.getElementById("f_vert").value = param["f_vert"] != -1 ? param["f_vert"] : 0;
-      document.getElementById("f_horiz").value = param["f_horiz"] != -1 ? param["f_horiz"] : 0;
-  }
-  document.getElementById("f_url").focus();
-};
-
-function onOK() {
-  var required = {
-    "f_url": "<?php print_string("mustenterurl", "editor");?>",
-    "f_url": "<?php print_string("pleaseenteralt", "editor");?>"
-  };
-  for (var i in required) {
-    var el = document.getElementById(i);
-    if (!el.value) {
-      alert(required[i]);
-      el.focus();
-      return false;
-    }
-  }
-  // pass data back to the calling window
-  var fields = ["f_url", "f_alt", "f_align", "f_border",
-                "f_horiz", "f_vert"];
-  var param = new Object();
-  for (var i in fields) {
-    var id = fields[i];
-    var el = document.getElementById(id);
-    param[id] = el.value;
-  }
-  if (preview_window) {
-    preview_window.close();
-  }
-  __dlg_close(param);
-  return false;
-};
-
-function onCancel() {
-  if (preview_window) {
-    preview_window.close();
-  }
-  __dlg_close(null);
-  return false;
-};
-
-function onPreview() {
-  var f_url = document.getElementById("f_url");
-  var url = f_url.value;
-  if (!url) {
-    alert("<?php print_string("enterurlfirst","editor");?>");
-    f_url.focus();
-    return false;
-  }
-  var img = new Image();
-  img.src = url;
-  var win = null;
-  if (!document.all) {
-    win = window.open("about:blank", "ha_imgpreview", "toolbar=no,menubar=no,personalbar=no,innerWidth=100,innerHeight=100,scrollbars=no,resizable=yes");
-  } else {
-    win = window.open("about:blank", "ha_imgpreview", "channelmode=no,directories=no,height=100,width=100,location=no,menubar=no,resizable=yes,scrollbars=no,toolbar=no");
-  }
-  preview_window = win;
-  var doc = win.document;
-  var body = doc.body;
-  if (body) {
-    body.innerHTML = "";
-    body.style.padding = "0px";
-    body.style.margin = "0px";
-    var el = doc.createElement("img");
-    el.src = url;
-
-    var table = doc.createElement("table");
-    body.appendChild(table);
-    table.style.width = "100%";
-    table.style.height = "100%";
-    var tbody = doc.createElement("tbody");
-    table.appendChild(tbody);
-    var tr = doc.createElement("tr");
-    tbody.appendChild(tr);
-    var td = doc.createElement("td");
-    tr.appendChild(td);
-    td.style.textAlign = "center";
-
-    td.appendChild(el);
-    win.resizeTo(el.offsetWidth + 30, el.offsetHeight + 30);
-  }
-  win.focus();
-  return false;
-};
-//]]>
-</script>
-
-<style type="text/css">
-html, body {
-  background: ButtonFace;
-  color: ButtonText;
-  font: 11px Tahoma,Verdana,sans-serif;
-  margin: 0px;
-  padding: 0px;
-}
-body { padding: 5px; }
-table {
-  font: 11px Tahoma,Verdana,sans-serif;
-}
-form p {
-  margin-top: 5px;
-  margin-bottom: 5px;
-}
-.fl { width: 9em; float: left; padding: 2px 5px; text-align: right; }
-.fr { width: 6em; float: left; padding: 2px 5px; text-align: right; }
-fieldset { padding: 0px 10px 5px 5px; }
-select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
-button { width: 70px; }
-.space { padding: 2px; }
-
-.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
-border-bottom: 1px solid black; letter-spacing: 2px;
-}
-form { padding: 0px; margin: 0px; }
-</style>
-</head>
-<body onload="Init()">
-
-<div class="title"><?php print_string("insertimage","editor");?></div>
-
-<form action="" method="get">
-<table border="0" width="100%" style="padding: 0px; margin: 0px">
-  <tbody>
-
-  <tr>
-    <td style="width: 7em; text-align: right"><?php print_string("imageurl","editor");?>:</td>
-    <td><input type="text" name="url" id="f_url" style="width:75%"
-      title="Enter the image URL here" />
-      <button name="preview" onclick="return onPreview()"
-      title="Preview the image in a new window"><?php print_string("preview","editor");?></button>
-    </td>
-  </tr>
-  <tr>
-    <td style="width: 7em; text-align: right"><?php print_string("alternatetext","editor");?>:</td>
-    <td><input type="text" name="alt" id="f_alt" style="width:100%"
-      title="For browsers that don't support images" /></td>
-  </tr>
-  </tbody>
-</table>
-
-<p />
-<fieldset style="float: left; margin-left: 5px;">
-<legend><?php print_string("layout","editor");?></legend>
-
-<div class="space"></div>
-
-<div class="fl"><?php print_string("alignment","editor");?>:</div>
-<select size="1" name="align" id="f_align"
-  title="Positioning of this image">
-  <option value=""                       ><?php print_string("notset","editor") ?></option>
-  <option value="left"                   ><?php print_string("left","editor") ?></option>
-  <option value="right"                  ><?php print_string("right","editor") ?></option>
-  <option value="texttop"                ><?php print_string("texttop","editor") ?></option>
-  <option value="middle"              ><?php print_string("middle","editor") ?></option>
-  <option value="baseline" selected="1"  ><?php print_string("baseline","editor") ?></option>
-  <option value="absbottom"              ><?php print_string("absbottom","editor") ?></option>
-  <option value="bottom"                 ><?php print_string("bottom","editor") ?></option>
-  <option value="middle"                 ><?php print_string("middle","editor") ?></option>
-  <option value="top"                    ><?php print_string("top","editor") ?></option>
-</select>
-
-<p />
-
-<div class="fl"><?php print_string("borderthickness","editor");?>:</div>
-<input type="text" name="border" id="f_border" size="5"
-title="Leave empty for no border" />
-
-<div class="space"></div>
-
-</fieldset>
-
-<fieldset style="float:right; margin-right: 5px;">
-<legend><?php print_string("spacing","editor");?></legend>
-
-<div class="space"></div>
-
-<div class="fr"><?php print_string("horizontal","editor");?>:</div>
-<input type="text" name="horiz" id="f_horiz" size="5"
-title="Horizontal padding" />
-
-<p />
-
-<div class="fr"><?php print_string("vertical","editor");?>:</div>
-<input type="text" name="vert" id="f_vert" size="5"
-title="Vertical padding" />
-
-<div class="space"></div>
-
-</fieldset>
-
-<div style="margin-top: 85px; text-align: right;">
-<hr />
-<button type="button" name="ok" onclick="return onOK();"><?php print_string("ok","editor");?></button>
-<button type="button" name="cancel" onclick="return onCancel();"><?php print_string("cancel","editor");?></button>
-</div>
-</form>
-</body>
-</html>
diff --git a/lib/editor/htmlarea/popups/insert_table.php b/lib/editor/htmlarea/popups/insert_table.php
deleted file mode 100644 (file)
index 1055855..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-<?php // $Id$
-    require("../../../../config.php");
-
-    $id = optional_param('id', SITEID, PARAM_INT);
-
-    require_course_login($id);
-    @header('Content-Type: text/html; charset=utf-8');
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
-<head>
-<meta http-equiv="content-type" content="text/html; charset=utf-8" />
-  <title><?php print_string("inserttable","editor");?></title>
-<script type="text/javascript" src="popup.js"></script>
-<script type="text/javascript">
-//<![CDATA[
-
-function Init() {
-  __dlg_init();
-  document.getElementById('f_rows').focus();
-};
-
-function onOK() {
-  var required = {
-    "f_rows": "You must enter a number of rows",
-    "f_cols": "You must enter a number of columns"
-  };
-  for (var i in required) {
-    var el = document.getElementById(i);
-    if (!el.value) {
-      alert(required[i]);
-      el.focus();
-      return false;
-    }
-  }
-  var fields = ["f_rows", "f_cols", "f_width", "f_unit",
-                "f_align", "f_border", "f_spacing", "f_padding"];
-  var param = new Object();
-  for (var i in fields) {
-    var id = fields[i];
-    var el = document.getElementById(id);
-    param[id] = el.value;
-  }
-  __dlg_close(param);
-  return false;
-};
-
-function onCancel() {
-  __dlg_close(null);
-  return false;
-};
-//[[>
-</script>
-
-<style type="text/css">
-html, body {
-  background: ButtonFace;
-  color: ButtonText;
-  font: 11px Tahoma,Verdana,sans-serif;
-  margin: 0px;
-  padding: 0px;
-}
-body { padding: 5px; }
-table {
-  font: 11px Tahoma,Verdana,sans-serif;
-}
-form p {
-  margin-top: 5px;
-  margin-bottom: 5px;
-}
-.fl { width: 9em; float: left; padding: 2px 5px; text-align: right; }
-.fr { width: 7em; float: left; padding: 2px 5px; text-align: right; }
-fieldset { padding: 0px 10px 5px 5px; }
-select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
-button { width: 70px; }
-.space { padding: 2px; }
-
-.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
-border-bottom: 1px solid black; letter-spacing: 2px;
-}
-form { padding: 0px; margin: 0px; }
-</style>
-</head>
-<body onload="Init()">
-
-<div class="title"><?php print_string("inserttable","editor") ?></div>
-
-<form action="" method="get">
-<table border="0" style="padding: 0px; margin: 0px">
-  <tbody>
-
-  <tr>
-    <td style="width: 4em; text-align: right"><?php print_string("rows","editor") ?>:</td>
-    <td><input type="text" name="f_rows" id="f_rows" size="5" title="Number of rows" value="2" /></td>
-    <td></td>
-    <td></td>
-    <td></td>
-  </tr>
-  <tr>
-    <td style="width: 4em; text-align: right"><?php print_string("cols","editor") ?>:</td>
-    <td><input type="text" name="f_cols" id="f_cols" size="5" title="Number of columns" value="4" /></td>
-    <td style="width: 4em; text-align: right"><?php print_string("width","editor") ?>:</td>
-    <td><input type="text" name="f_width" id="f_width" size="5" title="Width of the table" value="100" /></td>
-    <td><select size="1" name="f_unit" id="f_unit" title="Width unit">
-      <option value="%" selected="selected"  ><?php print_string("percent","editor") ?></option>
-      <option value="px"              ><?php print_string("pixels","editor") ?></option>
-      <option value="em"              >Em</option>
-    </select></td>
-  </tr>
-
-  </tbody>
-</table>
-
-<p />
-
-<fieldset style="float: left; margin-left: 5px;">
-<legend><?php print_string("layout","editor") ?></legend>
-
-<div class="space"></div>
-
-<div class="fl"><?php print_string("alignment","editor") ?>:</div>
-<select size="1" name="f_align" id="f_align"
-  title="Positioning of this image">
-  <option value="" selected="selected"                ><?php print_string("notset","editor") ?></option>
-  <option value="left"                         ><?php print_string("left","editor") ?></option>
-  <option value="right"                        ><?php print_string("right","editor") ?></option>
-  <option value="texttop"                      ><?php print_string("texttop","editor") ?></option>
-  <option value="middle"                    ><?php print_string("middle","editor") ?></option>
-  <option value="baseline"                     ><?php print_string("baseline","editor") ?></option>
-  <option value="absbottom"                    ><?php print_string("absbottom","editor") ?></option>
-  <option value="bottom"                       ><?php print_string("bottom","editor") ?></option>
-  <option value="middle"                       ><?php print_string("middle","editor") ?></option>
-  <option value="top"                          ><?php print_string("top","editor") ?></option>
-</select>
-
-<p />
-
-<div class="fl"><?php print_string("borderthickness","editor") ?>:</div>
-<input type="text" name="f_border" id="f_border" size="5" value="1"
-title="Leave empty for no border" />
-<!--
-<p />
-
-<div class="fl">Collapse borders:</div>
-<input type="checkbox" name="collapse" id="f_collapse" />
--->
-<div class="space"></div>
-
-</fieldset>
-
-<fieldset style="float:right; margin-right: 5px;">
-<legend><?php print_string("spacing","editor") ?></legend>
-
-<div class="space"></div>
-
-<div class="fr"><?php print_string("cellspacing","editor") ?>:</div>
-<input type="text" name="f_spacing" id="f_spacing" size="5" value="1"
-title="Space between adjacent cells" />
-
-<p />
-
-<div class="fr"><?php print_string("cellpadding","editor") ?>:</div>
-<input type="text" name="f_padding" id="f_padding" size="5" value="1"
-title="Space between content and border in cell" />
-
-<div class="space"></div>
-
-</fieldset>
-
-<div style="margin-top: 85px; text-align: right;">
-<hr />
-<button type="button" name="ok" onclick="return onOK();"><?php print_string("ok","editor") ?></button>
-<button type="button" name="cancel" onclick="return onCancel();"><?php print_string("cancel","editor") ?></button>
-</div>
-</form>
-</body>
-</html>
diff --git a/lib/editor/htmlarea/popups/link.php b/lib/editor/htmlarea/popups/link.php
deleted file mode 100644 (file)
index fd9b451..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-<?php // $Id$
-    require("../../../../config.php");
-
-    $id = optional_param('id', SITEID, PARAM_INT);
-
-    require_course_login($id);
-    @header('Content-Type: text/html; charset=utf-8');
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
-<head>
-<title><?php print_string("insertlink","editor");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<script type="text/javascript">
-//<![CDATA[
-
-function onCancel() {
-  window.close();
-  return false;
-}
-
-function checkvalue(elm,formname) {
-    var el = document.getElementById(elm);
-    if(!el.value) {
-        alert("Nothing to do!");
-        el.focus();
-        return false;
-    }
-}
-
-function submit_form(dothis) {
-    if(dothis == "delete") {
-        window.fbrowser.document.dirform.action.value = "delete";
-    }
-    if(dothis == "move") {
-        window.fbrowser.document.dirform.action.value = "move";
-    }
-    if(dothis == "zip") {
-        window.fbrowser.document.dirform.action.value = "zip";
-    }
-
-    window.fbrowser.document.dirform.submit();
-    return false;
-}
-//]]>
-</script>
-<style type="text/css">
-html, body { background-color: rgb(212,208,200); }
-.title {
-background-color: #ddddff;
-padding: 5px;
-border-bottom: 1px solid black;
-font-family: Tahoma, sans-serif;
-font-weight: bold;
-font-size: 14px;
-color: black;
-}
-input,select { font-family: Tahoma, sans-serif; font-size: 11px; }
-legend { font-family: Tahoma, sans-serif; font-size: 11px; }
-p { margin-left: 10px;
-background-color: transparent; font-family: Tahoma, sans-serif;
-font-size: 11px; color: black; }
-td { font-family: Tahoma, sans-serif; font-size: 11px; }
-button { width: 70px; font-family: Tahoma, sans-serif; font-size: 11px; }
-#imodified,#itype,#isize {
-background-color: rgb(212,208,200);
-border: none;
-font-family: Tahoma, sans-serif;
-font-size: 11px;
-color: black;
-}
-.space { padding: 2px; }
-form { margin-bottom: 1px; margin-top: 1px; }
-</style>
-</head>
-<body>
-<div class="title"><?php print_string("insertlink","editor");?></div>
-  <table width="450" border="0" cellspacing="0" cellpadding="2">
-    <tr>
-      <td width="450" valign="top"><fieldset>
-        <legend><?php
-        if(has_capability('moodle/course:managefiles', get_context_instance(CONTEXT_COURSE, $id))) {
-            print_string("filebrowser","editor");
-        } else {
-            print "";
-        }?></legend>
-
-        <div class="space"></div>
-        <?php print(has_capability('moodle/course:managefiles', get_context_instance(CONTEXT_COURSE, $id)))?
-        "<iframe id=\"fbrowser\" name=\"fbrowser\" src=\"../coursefiles.php?id=".$id."\" width=\"420\" height=\"180\"></iframe>":
-        ""; ?>
-        <p>
-        </p>
-        <div class="space"></div>
-        </fieldset>&nbsp;</td>
-    </tr>
-  </table>
-  <table width="100%" border="0" cellpadding="0" cellspacing="0">
-  <tr>
-  <td>
-    <table border="0" cellpadding="2" cellspacing="0">
-          <tr><td><?php print_string("selection","editor");?>: </td>
-          <td><form id="idelete">
-          <input name="btnDelete" type="submit" id="btnDelete" value="<?php print_string("delete","editor");?>" onclick="return submit_form('delete');" /></form></td>
-          <td><form  id="imove">
-          <input name="btnMove" type="submit" id="btnMove" value="<?php print_string("move","editor");?>" onclick="return submit_form('move');" /></form></td>
-          <td><form id="izip">
-          <input name="btnZip" type="submit" id="btnZip" value="<?php print_string("zip","editor");?>" onclick="return submit_form('zip');" /></form></td>
-          <td><form id="irename" method="post" action="../coursefiles.php" target="fbrowser">
-          <input type="hidden" name="id" value="<?php print($id);?>" />
-          <input type="hidden" name="wdir" value="" />
-          <input type="hidden" name="file" value="" />
-          <input type="hidden" name="action" value="rename" />
-          <input type="hidden" name="sesskey" value="<?php p($USER->sesskey) ?>" />
-          <input name="btnRename" type="submit" id="btnRename" value="<?php print_string("rename","editor");?>" /></form></td>
-          </tr>
-    </table>
-  </td>
-  <td>
-    <button type="button" name="close" onclick="return onCancel();"><?php print_string("close","editor");?></button>
-  </td>
-  </tr>
-  </table>
-    <table border="0" cellpadding="1" cellspacing="1">
-    <tr>
-      <td height="22"><?php
-      if(has_capability('moodle/course:managefiles', get_context_instance(CONTEXT_COURSE, $id))) { ?>
-          <form id="cfolder" action="../coursefiles.php" method="post" target="fbrowser">
-          <input type="hidden" name="id" value="<?php print($id);?>" />
-          <input type="hidden" name="wdir" value="" />
-          <input type="hidden" name="action" value="mkdir" />
-          <input type="hidden" name="sesskey" value="<?php p($USER->sesskey) ?>" />
-          <input name="name" type="text" id="foldername" size="35" />
-          <input name="btnCfolder" type="submit" id="btnCfolder" value="<?php print_string("createfolder","editor");?>" onclick="return checkvalue('foldername','cfolder');" />
-          </form>
-          <form action="../coursefiles.php?id=<?php print($id);?>" method="post" enctype="multipart/form-data" target="fbrowser" id="uploader">
-          <input type="hidden" name="MAX_FILE_SIZE" value="<?php print($upload_max_filesize);?>" />
-          <input type="hidden" name="id" VALUE="<?php print($id);?>" />
-          <input type="hidden" name="wdir" value="" />
-          <input type="hidden" name="action" value="upload" />
-          <input type="hidden" name="sesskey" value="<?php p($USER->sesskey) ?>" />
-          <input type="file" name="userfile" id="userfile" size="35" />
-          <input name="save" type="submit" id="save" onclick="return checkvalue('userfile','uploader');" value="<?php print_string("upload","editor");?>" />
-          </form>
-          <?php
-          } else {
-              print "";
-          } ?>
-          </td>
-    </tr>
-  </table>
-<p>&nbsp;</p>
-</body>
-</html>
diff --git a/lib/editor/htmlarea/popups/link_std.php b/lib/editor/htmlarea/popups/link_std.php
deleted file mode 100644 (file)
index f3f354a..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-<?php // $Id$
-    require("../../../../config.php");
-
-    $id = optional_param('id', SITEID, PARAM_INT);
-
-    require_course_login($id);
-    @header('Content-Type: text/html; charset=utf-8');
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-  <title><?php print_string("insertlink","editor");?></title>
-  <script type="text/javascript" src="popup.js"></script>
-  <script type="text/javascript">
-//<![CDATA[
-function onTargetChanged() {
-  var f = document.getElementById("f_other_target");
-  if (this.value == "_other") {
-    f.style.visibility = "visible";
-    f.select();
-    f.focus();
-  } else f.style.visibility = "hidden";
-};
-function Init() {
-  //__dlg_translate(I18N);
-  __dlg_init();
-
-  var param = window.dialogArguments;
-  if(param.f_anchors) {
-      //anchors = param.f_anchors;
-      var anchor = document.getElementById('f_anchors');
-      for(var a in param.f_anchors) {
-        var opti = document.createElement('option');
-        opti.value = '#' + param.f_anchors[a];
-        opti.innerHTML = opti.value;
-        anchor.appendChild(opti);
-    }
-  }
-  var target_select = document.getElementById("f_target");
-  if (param.f_href) {
-      document.getElementById("f_href").value = param["f_href"];
-      document.getElementById("f_title").value = param["f_title"];
-      //comboSelectValue(target_select, param["f_target"]);
-      if (target_select.value != param.f_target) {
-        var opt = document.createElement("option");
-        opt.value = param.f_target;
-        opt.innerHTML = opt.value;
-        target_select.appendChild(opt);
-        opt.selected = true;
-      }
-  } else {
-      document.getElementById("f_href").value = "http://";
-  }
-  var opt = document.createElement("option");
-  opt.value = "_other";
-  opt.innerHTML = "<?php print_string("linktargetother","editor");?>";
-  target_select.appendChild(opt);
-  target_select.onchange = onTargetChanged;
-  document.getElementById("f_href").focus();
-  document.getElementById("f_href").select();
-};
-
-function onOK() {
-  var required = {
-    "f_href": "You must enter the URL where this link points to"
-  };
-  for (var i in required) {
-    var el = document.getElementById(i);
-    if (!el.value) {
-      alert(required[i]);
-      el.focus();
-      return false;
-    }
-  }
-  // pass data back to the calling window
-  var fields = ["f_href", "f_title", "f_target" ];
-  var param = new Object();
-  for (var i in fields) {
-    var id = fields[i];
-    var el = document.getElementById(id);
-    param[id] = el.value;
-  }
-  if (param.f_target == "_other") {
-    param.f_target = document.getElementById("f_other_target").value;
-  }
-  __dlg_close(param);
-  return false;
-};
-
-function onCancel() {
-  __dlg_close(null);
-  return false;
-};
-
-function onBrowse() {
-    var lx = (screen.width - 470) / 2;
-    var tx = (screen.height - 400) / 2;
-
-    var settings = "toolbar=no,";
-    settings += " location=no,";
-    settings += " directories=no,";
-    settings += " status=no,";
-    settings += " menubar=no,";
-    settings += " scrollbars=no,";
-    settings += " resizable=no,";
-    settings += " width=470,";
-    settings += " height=400,";
-
-    var newwin = window.open("link.php?id=<?php echo $id; ?>","",""+ settings +" left="+ lx +", top="+ tx +"");
-    return false;
-}
-function seturl() {
-    var sel = document.getElementById('f_anchors');
-    var txt = sel.options[sel.selectedIndex].text;
-    if(txt != '----') {
-        var f_url = document.getElementById('f_href');
-        f_url.value = txt;
-    }
-}
-//]]>
-</script>
-<style type="text/css">
-html, body {
-  background: ButtonFace;
-  color: ButtonText;
-  font: 11px Tahoma,Verdana,sans-serif;
-  margin: 0px;
-  padding: 0px;
-}
-body { padding: 5px; }
-table { font: 11px Tahoma,Verdana,sans-serif; }
-select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
-button { width: 70px; }
-table .label { text-align: right; width: 8em; }
-
-.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 3px;
-border-bottom: 1px solid black; letter-spacing: 2px;
-}
-
-#buttons {
-      margin-top: 1em; border-top: 1px solid #999;
-      padding: 2px; text-align: right;
-}
-</style>
-</head>
-<body onload="Init()">
-<div class="title"><?php print_string("insertlink","editor");?></div>
-<table border="0" style="width: 100%;">
-  <tr>
-    <td class="label"><?php print_string("linkurl","editor");?>:</td>
-    <td><input type="text" id="f_href" style="width: 100%" /></td>
-  </tr>
-  <tr>
-    <td class="label"><?php print_string("linktitle","editor");?>:</td>
-    <td><input type="text" id="f_title" style="width: 100%" /></td>
-  </tr>
-  <tr>
-    <td class="label"><?php print_string("linktarget","editor");?>:</td>
-    <td><select id="f_target">
-      <option value=""><?php print_string("linktargetnone","editor");?></option>
-      <option value="_blank"><?php print_string("linktargetblank","editor");?></option>
-      <option value="_self"><?php print_string("linktargetself","editor");?></option>
-      <option value="_top"><?php print_string("linktargettop","editor");?></option>
-    </select>
-  <tr>
-    <td class="label"><?php print_string("anchors","editor");?>:</td>
-    <td><select id="f_anchors" onchange="seturl()">
-    <option value="">----</option></select></td>
-  </tr>
-    <input type="text" name="f_other_target" id="f_other_target" size="10" style="visibility: hidden" />
-    </td>
-  </tr>
-</table>
-
-<div id="buttons">
-  <?php if (has_capability('moodle/course:managefiles', get_context_instance(CONTEXT_COURSE, $id))) {
-            echo "<button type=\"button\" name=\"browse\" onclick=\"return onBrowse();\">".get_string("browse","editor")."...</button>";
-        }
-  ?>
-  <button type="button" name="ok" onclick="return onOK();"><?php print_string("ok","editor");?></button>
-  <button type="button" name="cancel" onclick="return onCancel();"><?php print_string("cancel","editor");?></button>
-</div>
-
-</body>
-</html>
diff --git a/lib/editor/htmlarea/popups/popup.js b/lib/editor/htmlarea/popups/popup.js
deleted file mode 100644 (file)
index 8c3afe4..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-// htmlArea v3.0 - Copyright (c) 2002, 2003 interactivetools.com, inc.
-// This copyright notice MUST stay intact for use (see license.txt).
-//
-// Portions (c) dynarch.com, 2003
-//
-// A free WYSIWYG editor replacement for <textarea> fields.
-// For full source code and docs, visit http://www.interactivetools.com/
-//
-// Version 3.0 developed by Mihai Bazon.
-//   http://dynarch.com/mishoo
-//
-// $Id$
-
-function getAbsolutePos(el) {
-    var r = { x: el.offsetLeft, y: el.offsetTop };
-    if (el.offsetParent) {
-        var tmp = getAbsolutePos(el.offsetParent);
-        r.x += tmp.x;
-        r.y += tmp.y;
-    }
-    return r;
-};
-
-function comboSelectValue(c, val) {
-    var ops = c.getElementsByTagName("option");
-    for (var i = ops.length; --i >= 0;) {
-        var op = ops[i];
-        op.selected = (op.value == val);
-    }
-    c.value = val;
-};
-
-function __dlg_onclose() {
-        opener.Dialog._return(null);
-};
-
-function __dlg_init(bottom) {
-        var body = document.body;
-    var body_height = 0;
-    if (typeof bottom == "undefined") {
-        var div = document.createElement("div");
-        body.appendChild(div);
-        var pos = getAbsolutePos(div);
-        body_height = pos.y;
-    } else {
-        var pos = getAbsolutePos(bottom);
-        body_height = pos.y + bottom.offsetHeight;
-    }
-    window.dialogArguments = opener.Dialog._arguments;
-
-    document.body.onkeypress = __dlg_close_on_esc;
-    window.focus();
-};
-
-function __dlg_translate(i18n) {
-    var types = ["span", "option", "td", "button", "div"];
-    for (var type in types) {
-        var spans = document.getElementsByTagName(types[type]);
-        for (var i = spans.length; --i >= 0;) {
-            var span = spans[i];
-            if (span.firstChild && span.firstChild.data) {
-                var txt = i18n[span.firstChild.data];
-                if (txt)
-                    span.firstChild.data = txt;
-            }
-        }
-    }
-    var txt = i18n[document.title];
-    if (txt)
-        document.title = txt;
-};
-
-// closes the dialog and passes the return info upper.
-function __dlg_close(val) {
-        opener.Dialog._return(val);
-    window.close();
-};
-
-function __dlg_close_on_esc(ev) {
-    ev || (ev = window.event);
-    if (ev.keyCode == 27) {
-        window.close();
-        return false;
-    }
-    return true;
-};
diff --git a/lib/editor/htmlarea/popups/preview.php b/lib/editor/htmlarea/popups/preview.php
deleted file mode 100644 (file)
index 0bf291d..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php // $Id$ preview for insert image dialog
-
-    require("../../../../config.php");
-
-    $id = optional_param('id', SITEID, PARAM_INT);
-    $imageurl = required_param('imageurl', PARAM_RAW);
-
-    require_login($id);
-    require_capability('moodle/course:managefiles', get_context_instance(CONTEXT_COURSE, $id));
-
-    @header('Content-Type: text/html; charset=utf-8');
-
-
-    $imagetag = clean_text('<img src="'.htmlSpecialChars($imageurl).'" alt="" />');
-
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
-<head>
-<title><?php echo get_string('preview') ?></title>
-<style type="text/css">
- body { margin: 2px; }
-</style>
-</head>
-<body bgcolor="#ffffff">
-
-<?php echo $imagetag ?>
-
-</body>
-</html>
diff --git a/lib/editor/htmlarea/popups/searchandreplace.php b/lib/editor/htmlarea/popups/searchandreplace.php
deleted file mode 100644 (file)
index 0b3e817..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-<?php // $Id$
-    require("../../../../config.php");
-
-    $id = optional_param('id', SITEID, PARAM_INT);
-
-    require_course_login($id);
-    @header('Content-Type: text/html; charset=utf-8');
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
-<head>
-<meta http-equiv="content-type" content="text/html; charset=utf-8" />
-<title><?php print_string("searchandreplace","editor");?></title>
-<script type="text/javascript" src="popup.js"></script>
-<script type="text/javascript">
-//<![CDATA[
-function _CloseOnEsc(ev) {
-    ev || (ev = window.event) || (ev = editor._iframe.contentWindow.event);
-    if (ev.keyCode == 27) {
-        // update_parent();
-        window.close();
-        return;
-    }
-}
-
-//Initialize
-function Init() {
-
-  __dlg_init();
-
-  document.body.onkeypress = _CloseOnEsc;
-  var param = window.dialogArguments;
-  document.getElementById("f_search").value = param["f_search"];
-
-  document.getElementById("f_search").focus();
-  document.getElementById("f_search").select();
-
-};
-
-//Actions
-function onReplaceAll() {
-    var searchtxt = document.getElementById("f_search").value;
-
-    //Check a search string
-    if (searchtxt.length < 1 ) {
-        alert ("Search string is empty!");
-        return true;
-    }
-
-    var replacetxt = document.getElementById("f_replace").value;
-    var stringcase =  (document.getElementById("f_case").checked) ? "g" : "gi";
-    var regularx = (document.getElementById("f_regx").checked) ? 1 : 0;
-    //var closesar = (document.getElementById("f_csar").checked) ? 1 : 0;
-    var closesar = 1;
-    var param = [ searchtxt , replacetxt, stringcase, regularx, closesar ];
-
-    //looks that not workin in ie :( need to fix!
-    if (closesar) {
-        __dlg_close(param);
-        window.close();
-        return false;
-    } else {
-        return true;
-    }
-};
-
-function onCancel() {
-  __dlg_close(null);
-  return false;
-};
-
-//]]>
-</script>
-
-<style type="text/css">
-html, body {
-  background: ButtonFace;
-  color: ButtonText;
-  font: 11px Tahoma,Verdana,sans-serif;
-  margin: 0px;
-  padding: 0px;
-}
-body { padding: 5px; }
-table {
-  font: 11px Tahoma,Verdana,sans-serif;
-}
-form p {
-  margin-top: 5px;
-  margin-bottom: 5px;
-}
-.fl { width: 9em; float: left; padding: 2px 5px; text-align: right; }
-.fr { width: 7em; float: left; padding: 2px 5px; text-align: right; }
-fieldset { padding: 0px 10px 5px 5px; }
-select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
-button { width: 70px; }
-#buttons {
-      margin-top: 1em; border-top: 1px solid #999;
-      padding: 2px; text-align: right;
-}
-
-.space { padding: 2px; }
-
-.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
-border-bottom: 1px solid black; letter-spacing: 2px;
-}
-form { padding: 0px; margin: 0px; }
-</style>
-</head>
-<body onload="Init()">
-<div class="title"><?php print_string("searchandreplace","editor");?></div>
-<form>
-<table border="0" style="width: 100%;">
-  <tr>
-    <td class="label"><?php print_string("findwhat","editor");?>:</td>
-    <td align="left"><input type="text" id="f_search" style="width: 280px" /></td>
-  </tr>
-  <tr>
-    <td class="label"><?php print_string("replacewith","editor");?>:</td>
-    <td align="left"><input type="text" id="f_replace" style="width: 280px" /></td>
-  </tr>
-
-  </table>
-  <fieldset>
-    <legend><span style="font-weight: bold;"><?php print_string("options","editor");?>:</span></legend>
-<table border="0" style="width: 100%;">
-  <tr>
-    <td style="width: 20px;"><input type="checkbox" id="f_regx" checked="checked" /></td>
-    <td><label for="f_regx"><?php print_string("regularexpressions","editor");?></label></td>
-  </tr>
-  <tr>
-    <td style="width: 20px;"><input type="checkbox" id="f_case" checked="checked" /></td>
-    <td><label for="f_case"><?php print_string("matchcase","editor");?></label></td>
-  </tr>
-  <!-- <tr>
-    <td style="width: 20px;"><input type="checkbox" id="f_csar" checked="checked" /></td>
-    <td><label for="f_csar"><?php print_string("closeafterreplace","editor");?></label></td>
-  </tr> -->
-</table>
-</fieldset>
-<div id="buttons">
-  <button type="button" name="ok" onclick="return onReplaceAll();" style="width: 120px;"><?php print_string("replaceall","editor");?></button>
-  <button type="button" name="cancel" onclick="return onCancel();"><?php print_string("cancel","editor");?></button>
-</div>
-</form>
-</body>
-</html>
diff --git a/lib/editor/htmlarea/popups/select_color.php b/lib/editor/htmlarea/popups/select_color.php
deleted file mode 100644 (file)
index 8ec7f7c..0000000
+++ /dev/null
@@ -1,363 +0,0 @@
-<?php
-    require("../../../../config.php");
-
-    $id = optional_param('id', SITEID, PARAM_INT);
-
-    require_course_login($id);
-    @header('Content-Type: text/html; charset=utf-8');
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
-<head>
-<meta http-equiv="content-type" content="text/html; charset=utf-8" />
-<title><?php print_string("selectcolor","editor");?></title>
-<style type="text/css">
-html, body { width: 238; height: 188; }
-</style>
-<script type="text/javascript" src="popup.js"></script>
-<script type="text/javascript">
-function _CloseOnEsc() {
-    if (event.keyCode == 27) {
-        window.close();
-        return;
-    }
-}
-
-function Init() {
-    // run on page load
-    __dlg_init();
-    document.body.onkeypress = _CloseOnEsc;
-
-    var color = window.dialogArguments;
-    color = ValidateColor(color) || '000000';
-    View(color); // set default color
-}
-
-function View(color) {
-    // preview color
-    document.getElementById("ColorPreview").style.backgroundColor = '#' + color;
-    document.getElementById("ColorHex").value = '#' + color;
-}
-
-function Set(string) {
-    // select color
-    var color = ValidateColor(string);
-    if (color == null) { alert("Invalid color code: " + string); }        // invalid color
-    else {                                                                // valid color
-        View(color); // show selected color
-        __dlg_close(color);
-    }
-}
-
-function ValidateColor(string) {                // return valid color code
-    string = string || '';
-    string = string + "";
-    string = string.toUpperCase();
-    var chars = '0123456789ABCDEF';
-    var out   = '';
-
-    for (var i=0; i<string.length; i++) {             // remove invalid color chars
-        var schar = string.charAt(i);
-        if (chars.indexOf(schar) != -1) { out += schar; }
-    }
-
-    if (out.length != 6) { return null; }            // check length
-    return out;
-}
-
-</script>
-</head>
-<body style="background:ButtonFace; margin:0px; padding:0px" onload="Init()">
-
-<form method="get" style="margin:0px; padding:0px" onSubmit="Set(document.getElementById('ColorHex').value); return false;">
-<table border="0px" cellspacing="0px" cellpadding="4" width="100%">
- <tr>
-  <td style="background:buttonface" valign=center><div style="background-color: #000000; padding: 1; height: 21px; width: 50px"><div id="ColorPreview" style="height: 100%; width: 100%"></div></div></td>
-  <td style="background:buttonface" valign=center><input type="text" name="ColorHex"
-    id="ColorHex" value="" size=15 style="font-size: 12px" /></td>
-  <td style="background:buttonface" width=100%></td>
- </tr>
-</table>
-</form>
-
-<table border="0" cellspacing="1px" cellpadding="0px" width="100%" bgcolor="#000000" style="cursor: hand;">
-<tr>
-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
-<td bgcolor=#003300 onMouseOver=View('003300') onClick=Set('003300') height="10px" width="10px"></td>
-<td bgcolor=#006600 onMouseOver=View('006600') onClick=Set('006600') height="10px" width="10px"></td>
-<td bgcolor=#009900 onMouseOver=View('009900') onClick=Set('009900') height="10px" width="10px"></td>
-<td bgcolor=#00CC00 onMouseOver=View('00CC00') onClick=Set('00CC00') height="10px" width="10px"></td>
-<td bgcolor=#00FF00 onMouseOver=View('00FF00') onClick=Set('00FF00') height="10px" width="10px"></td>
-<td bgcolor=#330000 onMouseOver=View('330000') onClick=Set('330000') height="10px" width="10px"></td>
-<td bgcolor=#333300 onMouseOver=View('333300') onClick=Set('333300') height="10px" width="10px"></td>
-<td bgcolor=#336600 onMouseOver=View('336600') onClick=Set('336600') height="10px" width="10px"></td>
-<td bgcolor=#339900 onMouseOver=View('339900') onClick=Set('339900') height="10px" width="10px"></td>
-<td bgcolor=#33CC00 onMouseOver=View('33CC00') onClick=Set('33CC00') height="10px" width="10px"></td>
-<td bgcolor=#33FF00 onMouseOver=View('33FF00') onClick=Set('33FF00') height="10px" width="10px"></td>
-<td bgcolor=#660000 onMouseOver=View('660000') onClick=Set('660000') height="10px" width="10px"></td>
-<td bgcolor=#663300 onMouseOver=View('663300') onClick=Set('663300') height="10px" width="10px"></td>
-<td bgcolor=#666600 onMouseOver=View('666600') onClick=Set('666600') height="10px" width="10px"></td>
-<td bgcolor=#669900 onMouseOver=View('669900') onClick=Set('669900') height="10px" width="10px"></td>
-<td bgcolor=#66CC00 onMouseOver=View('66CC00') onClick=Set('66CC00') height="10px" width="10px"></td>
-<td bgcolor=#66FF00 onMouseOver=View('66FF00') onClick=Set('66FF00') height="10px" width="10px"></td>
-</tr>
-<tr>
-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
-<td bgcolor=#333333 onMouseOver=View('333333') onClick=Set('333333') height="10px" width="10px"></td>
-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
-<td bgcolor=#000033 onMouseOver=View('000033') onClick=Set('000033') height="10px" width="10px"></td>
-<td bgcolor=#003333 onMouseOver=View('003333') onClick=Set('003333') height="10px" width="10px"></td>
-<td bgcolor=#006633 onMouseOver=View('006633') onClick=Set('006633') height="10px" width="10px"></td>
-<td bgcolor=#009933 onMouseOver=View('009933') onClick=Set('009933') height="10px" width="10px"></td>
-<td bgcolor=#00CC33 onMouseOver=View('00CC33') onClick=Set('00CC33') height="10px" width="10px"></td>
-<td bgcolor=#00FF33 onMouseOver=View('00FF33') onClick=Set('00FF33') height="10px" width="10px"></td>
-<td bgcolor=#330033 onMouseOver=View('330033') onClick=Set('330033') height="10px" width="10px"></td>
-<td bgcolor=#333333 onMouseOver=View('333333') onClick=Set('333333') height="10px" width="10px"></td>
-<td bgcolor=#336633 onMouseOver=View('336633') onClick=Set('336633') height="10px" width="10px"></td>
-<td bgcolor=#339933 onMouseOver=View('339933') onClick=Set('339933') height="10px" width="10px"></td>
-<td bgcolor=#33CC33 onMouseOver=View('33CC33') onClick=Set('33CC33') height="10px" width="10px"></td>
-<td bgcolor=#33FF33 onMouseOver=View('33FF33') onClick=Set('33FF33') height="10px" width="10px"></td>
-<td bgcolor=#660033 onMouseOver=View('660033') onClick=Set('660033') height="10px" width="10px"></td>
-<td bgcolor=#663333 onMouseOver=View('663333') onClick=Set('663333') height="10px" width="10px"></td>
-<td bgcolor=#666633 onMouseOver=View('666633') onClick=Set('666633') height="10px" width="10px"></td>
-<td bgcolor=#669933 onMouseOver=View('669933') onClick=Set('669933') height="10px" width="10px"></td>
-<td bgcolor=#66CC33 onMouseOver=View('66CC33') onClick=Set('66CC33') height="10px" width="10px"></td>
-<td bgcolor=#66FF33 onMouseOver=View('66FF33') onClick=Set('66FF33') height="10px" width="10px"></td>
-</tr>
-<tr>
-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
-<td bgcolor=#666666 onMouseOver=View('666666') onClick=Set('666666') height="10px" width="10px"></td>
-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
-<td bgcolor=#000066 onMouseOver=View('000066') onClick=Set('000066') height="10px" width="10px"></td>
-<td bgcolor=#003366 onMouseOver=View('003366') onClick=Set('003366') height="10px" width="10px"></td>
-<td bgcolor=#006666 onMouseOver=View('006666') onClick=Set('006666') height="10px" width="10px"></td>
-<td bgcolor=#009966 onMouseOver=View('009966') onClick=Set('009966') height="10px" width="10px"></td>
-<td bgcolor=#00CC66 onMouseOver=View('00CC66') onClick=Set('00CC66') height="10px" width="10px"></td>
-<td bgcolor=#00FF66 onMouseOver=View('00FF66') onClick=Set('00FF66') height="10px" width="10px"></td>
-<td bgcolor=#330066 onMouseOver=View('330066') onClick=Set('330066') height="10px" width="10px"></td>
-<td bgcolor=#333366 onMouseOver=View('333366') onClick=Set('333366') height="10px" width="10px"></td>
-<td bgcolor=#336666 onMouseOver=View('336666') onClick=Set('336666') height="10px" width="10px"></td>
-<td bgcolor=#339966 onMouseOver=View('339966') onClick=Set('339966') height="10px" width="10px"></td>
-<td bgcolor=#33CC66 onMouseOver=View('33CC66') onClick=Set('33CC66') height="10px" width="10px"></td>
-<td bgcolor=#33FF66 onMouseOver=View('33FF66') onClick=Set('33FF66') height="10px" width="10px"></td>
-<td bgcolor=#660066 onMouseOver=View('660066') onClick=Set('660066') height="10px" width="10px"></td>
-<td bgcolor=#663366 onMouseOver=View('663366') onClick=Set('663366') height="10px" width="10px"></td>
-<td bgcolor=#666666 onMouseOver=View('666666') onClick=Set('666666') height="10px" width="10px"></td>
-<td bgcolor=#669966 onMouseOver=View('669966') onClick=Set('669966') height="10px" width="10px"></td>
-<td bgcolor=#66CC66 onMouseOver=View('66CC66') onClick=Set('66CC66') height="10px" width="10px"></td>
-<td bgcolor=#66FF66 onMouseOver=View('66FF66') onClick=Set('66FF66') height="10px" width="10px"></td>
-</tr>
-<tr>
-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
-<td bgcolor=#999999 onMouseOver=View('999999') onClick=Set('999999') height="10px" width="10px"></td>
-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
-<td bgcolor=#000099 onMouseOver=View('000099') onClick=Set('000099') height="10px" width="10px"></td>
-<td bgcolor=#003399 onMouseOver=View('003399') onClick=Set('003399') height="10px" width="10px"></td>
-<td bgcolor=#006699 onMouseOver=View('006699') onClick=Set('006699') height="10px" width="10px"></td>
-<td bgcolor=#009999 onMouseOver=View('009999') onClick=Set('009999') height="10px" width="10px"></td>
-<td bgcolor=#00CC99 onMouseOver=View('00CC99') onClick=Set('00CC99') height="10px" width="10px"></td>
-<td bgcolor=#00FF99 onMouseOver=View('00FF99') onClick=Set('00FF99') height="10px" width="10px"></td>
-<td bgcolor=#330099 onMouseOver=View('330099') onClick=Set('330099') height="10px" width="10px"></td>
-<td bgcolor=#333399 onMouseOver=View('333399') onClick=Set('333399') height="10px" width="10px"></td>
-<td bgcolor=#336699 onMouseOver=View('336699') onClick=Set('336699') height="10px" width="10px"></td>
-<td bgcolor=#339999 onMouseOver=View('339999') onClick=Set('339999') height="10px" width="10px"></td>
-<td bgcolor=#33CC99 onMouseOver=View('33CC99') onClick=Set('33CC99') height="10px" width="10px"></td>
-<td bgcolor=#33FF99 onMouseOver=View('33FF99') onClick=Set('33FF99') height="10px" width="10px"></td>
-<td bgcolor=#660099 onMouseOver=View('660099') onClick=Set('660099') height="10px" width="10px"></td>
-<td bgcolor=#663399 onMouseOver=View('663399') onClick=Set('663399') height="10px" width="10px"></td>
-<td bgcolor=#666699 onMouseOver=View('666699') onClick=Set('666699') height="10px" width="10px"></td>
-<td bgcolor=#669999 onMouseOver=View('669999') onClick=Set('669999') height="10px" width="10px"></td>
-<td bgcolor=#66CC99 onMouseOver=View('66CC99') onClick=Set('66CC99') height="10px" width="10px"></td>
-<td bgcolor=#66FF99 onMouseOver=View('66FF99') onClick=Set('66FF99') height="10px" width="10px"></td>
-</tr>
-<tr>
-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
-<td bgcolor=#CCCCCC onMouseOver=View('CCCCCC') onClick=Set('CCCCCC') height="10px" width="10px"></td>
-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
-<td bgcolor=#0000CC onMouseOver=View('0000CC') onClick=Set('0000CC') height="10px" width="10px"></td>
-<td bgcolor=#0033CC onMouseOver=View('0033CC') onClick=Set('0033CC') height="10px" width="10px"></td>
-<td bgcolor=#0066CC onMouseOver=View('0066CC') onClick=Set('0066CC') height="10px" width="10px"></td>
-<td bgcolor=#0099CC onMouseOver=View('0099CC') onClick=Set('0099CC') height="10px" width="10px"></td>
-<td bgcolor=#00CCCC onMouseOver=View('00CCCC') onClick=Set('00CCCC') height="10px" width="10px"></td>
-<td bgcolor=#00FFCC onMouseOver=View('00FFCC') onClick=Set('00FFCC') height="10px" width="10px"></td>
-<td bgcolor=#3300CC onMouseOver=View('3300CC') onClick=Set('3300CC') height="10px" width="10px"></td>
-<td bgcolor=#3333CC onMouseOver=View('3333CC') onClick=Set('3333CC') height="10px" width="10px"></td>
-<td bgcolor=#3366CC onMouseOver=View('3366CC') onClick=Set('3366CC') height="10px" width="10px"></td>
-<td bgcolor=#3399CC onMouseOver=View('3399CC') onClick=Set('3399CC') height="10px" width="10px"></td>
-<td bgcolor=#33CCCC onMouseOver=View('33CCCC') onClick=Set('33CCCC') height="10px" width="10px"></td>
-<td bgcolor=#33FFCC onMouseOver=View('33FFCC') onClick=Set('33FFCC') height="10px" width="10px"></td>
-<td bgcolor=#6600CC onMouseOver=View('6600CC') onClick=Set('6600CC') height="10px" width="10px"></td>
-<td bgcolor=#6633CC onMouseOver=View('6633CC') onClick=Set('6633CC') height="10px" width="10px"></td>
-<td bgcolor=#6666CC onMouseOver=View('6666CC') onClick=Set('6666CC') height="10px" width="10px"></td>
-<td bgcolor=#6699CC onMouseOver=View('6699CC') onClick=Set('6699CC') height="10px" width="10px"></td>
-<td bgcolor=#66CCCC onMouseOver=View('66CCCC') onClick=Set('66CCCC') height="10px" width="10px"></td>
-<td bgcolor=#66FFCC onMouseOver=View('66FFCC') onClick=Set('66FFCC') height="10px" width="10px"></td>
-</tr>
-<tr>
-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
-<td bgcolor=#FFFFFF onMouseOver=View('FFFFFF') onClick=Set('FFFFFF') height="10px" width="10px"></td>
-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
-<td bgcolor=#0000FF onMouseOver=View('0000FF') onClick=Set('0000FF') height="10px" width="10px"></td>
-<td bgcolor=#0033FF onMouseOver=View('0033FF') onClick=Set('0033FF') height="10px" width="10px"></td>
-<td bgcolor=#0066FF onMouseOver=View('0066FF') onClick=Set('0066FF') height="10px" width="10px"></td>
-<td bgcolor=#0099FF onMouseOver=View('0099FF') onClick=Set('0099FF') height="10px" width="10px"></td>
-<td bgcolor=#00CCFF onMouseOver=View('00CCFF') onClick=Set('00CCFF') height="10px" width="10px"></td>
-<td bgcolor=#00FFFF onMouseOver=View('00FFFF') onClick=Set('00FFFF') height="10px" width="10px"></td>
-<td bgcolor=#3300FF onMouseOver=View('3300FF') onClick=Set('3300FF') height="10px" width="10px"></td>
-<td bgcolor=#3333FF onMouseOver=View('3333FF') onClick=Set('3333FF') height="10px" width="10px"></td>
-<td bgcolor=#3366FF onMouseOver=View('3366FF') onClick=Set('3366FF') height="10px" width="10px"></td>
-<td bgcolor=#3399FF onMouseOver=View('3399FF') onClick=Set('3399FF') height="10px" width="10px"></td>
-<td bgcolor=#33CCFF onMouseOver=View('33CCFF') onClick=Set('33CCFF') height="10px" width="10px"></td>
-<td bgcolor=#33FFFF onMouseOver=View('33FFFF') onClick=Set('33FFFF') height="10px" width="10px"></td>
-<td bgcolor=#6600FF onMouseOver=View('6600FF') onClick=Set('6600FF') height="10px" width="10px"></td>
-<td bgcolor=#6633FF onMouseOver=View('6633FF') onClick=Set('6633FF') height="10px" width="10px"></td>
-<td bgcolor=#6666FF onMouseOver=View('6666FF') onClick=Set('6666FF') height="10px" width="10px"></td>
-<td bgcolor=#6699FF onMouseOver=View('6699FF') onClick=Set('6699FF') height="10px" width="10px"></td>
-<td bgcolor=#66CCFF onMouseOver=View('66CCFF') onClick=Set('66CCFF') height="10px" width="10px"></td>
-<td bgcolor=#66FFFF onMouseOver=View('66FFFF') onClick=Set('66FFFF') height="10px" width="10px"></td>
-</tr>
-<tr>
-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
-<td bgcolor=#FF0000 onMouseOver=View('FF0000') onClick=Set('FF0000') height="10px" width="10px"></td>
-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
-<td bgcolor=#990000 onMouseOver=View('990000') onClick=Set('990000') height="10px" width="10px"></td>
-<td bgcolor=#993300 onMouseOver=View('993300') onClick=Set('993300') height="10px" width="10px"></td>
-<td bgcolor=#996600 onMouseOver=View('996600') onClick=Set('996600') height="10px" width="10px"></td>
-<td bgcolor=#999900 onMouseOver=View('999900') onClick=Set('999900') height="10px" width="10px"></td>
-<td bgcolor=#99CC00 onMouseOver=View('99CC00') onClick=Set('99CC00') height="10px" width="10px"></td>
-<td bgcolor=#99FF00 onMouseOver=View('99FF00') onClick=Set('99FF00') height="10px" width="10px"></td>
-<td bgcolor=#CC0000 onMouseOver=View('CC0000') onClick=Set('CC0000') height="10px" width="10px"></td>
-<td bgcolor=#CC3300 onMouseOver=View('CC3300') onClick=Set('CC3300') height="10px" width="10px"></td>
-<td bgcolor=#CC6600 onMouseOver=View('CC6600') onClick=Set('CC6600') height="10px" width="10px"></td>
-<td bgcolor=#CC9900 onMouseOver=View('CC9900') onClick=Set('CC9900') height="10px" width="10px"></td>
-<td bgcolor=#CCCC00 onMouseOver=View('CCCC00') onClick=Set('CCCC00') height="10px" width="10px"></td>
-<td bgcolor=#CCFF00 onMouseOver=View('CCFF00') onClick=Set('CCFF00') height="10px" width="10px"></td>
-<td bgcolor=#FF0000 onMouseOver=View('FF0000') onClick=Set('FF0000') height="10px" width="10px"></td>
-<td bgcolor=#FF3300 onMouseOver=View('FF3300') onClick=Set('FF3300') height="10px" width="10px"></td>
-<td bgcolor=#FF6600 onMouseOver=View('FF6600') onClick=Set('FF6600') height="10px" width="10px"></td>
-<td bgcolor=#FF9900 onMouseOver=View('FF9900') onClick=Set('FF9900') height="10px" width="10px"></td>
-<td bgcolor=#FFCC00 onMouseOver=View('FFCC00') onClick=Set('FFCC00') height="10px" width="10px"></td>
-<td bgcolor=#FFFF00 onMouseOver=View('FFFF00') onClick=Set('FFFF00') height="10px" width="10px"></td>
-</tr>
-<tr>
-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
-<td bgcolor=#00FF00 onMouseOver=View('00FF00') onClick=Set('00FF00') height="10px" width="10px"></td>
-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
-<td bgcolor=#990033 onMouseOver=View('990033') onClick=Set('990033') height="10px" width="10px"></td>
-<td bgcolor=#993333 onMouseOver=View('993333') onClick=Set('993333') height="10px" width="10px"></td>
-<td bgcolor=#996633 onMouseOver=View('996633') onClick=Set('996633') height="10px" width="10px"></td>
-<td bgcolor=#999933 onMouseOver=View('999933') onClick=Set('999933') height="10px" width="10px"></td>
-<td bgcolor=#99CC33 onMouseOver=View('99CC33') onClick=Set('99CC33') height="10px" width="10px"></td>
-<td bgcolor=#99FF33 onMouseOver=View('99FF33') onClick=Set('99FF33') height="10px" width="10px"></td>
-<td bgcolor=#CC0033 onMouseOver=View('CC0033') onClick=Set('CC0033') height="10px" width="10px"></td>
-<td bgcolor=#CC3333 onMouseOver=View('CC3333') onClick=Set('CC3333') height="10px" width="10px"></td>
-<td bgcolor=#CC6633 onMouseOver=View('CC6633') onClick=Set('CC6633') height="10px" width="10px"></td>
-<td bgcolor=#CC9933 onMouseOver=View('CC9933') onClick=Set('CC9933') height="10px" width="10px"></td>
-<td bgcolor=#CCCC33 onMouseOver=View('CCCC33') onClick=Set('CCCC33') height="10px" width="10px"></td>
-<td bgcolor=#CCFF33 onMouseOver=View('CCFF33') onClick=Set('CCFF33') height="10px" width="10px"></td>
-<td bgcolor=#FF0033 onMouseOver=View('FF0033') onClick=Set('FF0033') height="10px" width="10px"></td>
-<td bgcolor=#FF3333 onMouseOver=View('FF3333') onClick=Set('FF3333') height="10px" width="10px"></td>
-<td bgcolor=#FF6633 onMouseOver=View('FF6633') onClick=Set('FF6633') height="10px" width="10px"></td>
-<td bgcolor=#FF9933 onMouseOver=View('FF9933') onClick=Set('FF9933') height="10px" width="10px"></td>
-<td bgcolor=#FFCC33 onMouseOver=View('FFCC33') onClick=Set('FFCC33') height="10px" width="10px"></td>
-<td bgcolor=#FFFF33 onMouseOver=View('FFFF33') onClick=Set('FFFF33') height="10px" width="10px"></td>
-</tr>
-<tr>
-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
-<td bgcolor=#0000FF onMouseOver=View('0000FF') onClick=Set('0000FF') height="10px" width="10px"></td>
-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
-<td bgcolor=#990066 onMouseOver=View('990066') onClick=Set('990066') height="10px" width="10px"></td>
-<td bgcolor=#993366 onMouseOver=View('993366') onClick=Set('993366') height="10px" width="10px"></td>
-<td bgcolor=#996666 onMouseOver=View('996666') onClick=Set('996666') height="10px" width="10px"></td>
-<td bgcolor=#999966 onMouseOver=View('999966') onClick=Set('999966') height="10px" width="10px"></td>
-<td bgcolor=#99CC66 onMouseOver=View('99CC66') onClick=Set('99CC66') height="10px" width="10px"></td>
-<td bgcolor=#99FF66 onMouseOver=View('99FF66') onClick=Set('99FF66') height="10px" width="10px"></td>
-<td bgcolor=#CC0066 onMouseOver=View('CC0066') onClick=Set('CC0066') height="10px" width="10px"></td>
-<td bgcolor=#CC3366 onMouseOver=View('CC3366') onClick=Set('CC3366') height="10px" width="10px"></td>
-<td bgcolor=#CC6666 onMouseOver=View('CC6666') onClick=Set('CC6666') height="10px" width="10px"></td>
-<td bgcolor=#CC9966 onMouseOver=View('CC9966') onClick=Set('CC9966') height="10px" width="10px"></td>
-<td bgcolor=#CCCC66 onMouseOver=View('CCCC66') onClick=Set('CCCC66') height="10px" width="10px"></td>
-<td bgcolor=#CCFF66 onMouseOver=View('CCFF66') onClick=Set('CCFF66') height="10px" width="10px"></td>
-<td bgcolor=#FF0066 onMouseOver=View('FF0066') onClick=Set('FF0066') height="10px" width="10px"></td>
-<td bgcolor=#FF3366 onMouseOver=View('FF3366') onClick=Set('FF3366') height="10px" width="10px"></td>
-<td bgcolor=#FF6666 onMouseOver=View('FF6666') onClick=Set('FF6666') height="10px" width="10px"></td>
-<td bgcolor=#FF9966 onMouseOver=View('FF9966') onClick=Set('FF9966') height="10px" width="10px"></td>
-<td bgcolor=#FFCC66 onMouseOver=View('FFCC66') onClick=Set('FFCC66') height="10px" width="10px"></td>
-<td bgcolor=#FFFF66 onMouseOver=View('FFFF66') onClick=Set('FFFF66') height="10px" width="10px"></td>
-</tr>
-<tr>
-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
-<td bgcolor=#FFFF00 onMouseOver=View('FFFF00') onClick=Set('FFFF00') height="10px" width="10px"></td>
-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
-<td bgcolor=#990099 onMouseOver=View('990099') onClick=Set('990099') height="10px" width="10px"></td>
-<td bgcolor=#993399 onMouseOver=View('993399') onClick=Set('993399') height="10px" width="10px"></td>
-<td bgcolor=#996699 onMouseOver=View('996699') onClick=Set('996699') height="10px" width="10px"></td>
-<td bgcolor=#999999 onMouseOver=View('999999') onClick=Set('999999') height="10px" width="10px"></td>
-<td bgcolor=#99CC99 onMouseOver=View('99CC99') onClick=Set('99CC99') height="10px" width="10px"></td>
-<td bgcolor=#99FF99 onMouseOver=View('99FF99') onClick=Set('99FF99') height="10px" width="10px"></td>
-<td bgcolor=#CC0099 onMouseOver=View('CC0099') onClick=Set('CC0099') height="10px" width="10px"></td>
-<td bgcolor=#CC3399 onMouseOver=View('CC3399') onClick=Set('CC3399') height="10px" width="10px"></td>
-<td bgcolor=#CC6699 onMouseOver=View('CC6699') onClick=Set('CC6699') height="10px" width="10px"></td>
-<td bgcolor=#CC9999 onMouseOver=View('CC9999') onClick=Set('CC9999') height="10px" width="10px"></td>
-<td bgcolor=#CCCC99 onMouseOver=View('CCCC99') onClick=Set('CCCC99') height="10px" width="10px"></td>
-<td bgcolor=#CCFF99 onMouseOver=View('CCFF99') onClick=Set('CCFF99') height="10px" width="10px"></td>
-<td bgcolor=#FF0099 onMouseOver=View('FF0099') onClick=Set('FF0099') height="10px" width="10px"></td>
-<td bgcolor=#FF3399 onMouseOver=View('FF3399') onClick=Set('FF3399') height="10px" width="10px"></td>
-<td bgcolor=#FF6699 onMouseOver=View('FF6699') onClick=Set('FF6699') height="10px" width="10px"></td>
-<td bgcolor=#FF9999 onMouseOver=View('FF9999') onClick=Set('FF9999') height="10px" width="10px"></td>
-<td bgcolor=#FFCC99 onMouseOver=View('FFCC99') onClick=Set('FFCC99') height="10px" width="10px"></td>
-<td bgcolor=#FFFF99 onMouseOver=View('FFFF99') onClick=Set('FFFF99') height="10px" width="10px"></td>
-</tr>
-<tr>
-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
-<td bgcolor=#00FFFF onMouseOver=View('00FFFF') onClick=Set('00FFFF') height="10px" width="10px"></td>
-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
-<td bgcolor=#9900CC onMouseOver=View('9900CC') onClick=Set('9900CC') height="10px" width="10px"></td>
-<td bgcolor=#9933CC onMouseOver=View('9933CC') onClick=Set('9933CC') height="10px" width="10px"></td>
-<td bgcolor=#9966CC onMouseOver=View('9966CC') onClick=Set('9966CC') height="10px" width="10px"></td>
-<td bgcolor=#9999CC onMouseOver=View('9999CC') onClick=Set('9999CC') height="10px" width="10px"></td>
-<td bgcolor=#99CCCC onMouseOver=View('99CCCC') onClick=Set('99CCCC') height="10px" width="10px"></td>
-<td bgcolor=#99FFCC onMouseOver=View('99FFCC') onClick=Set('99FFCC') height="10px" width="10px"></td>
-<td bgcolor=#CC00CC onMouseOver=View('CC00CC') onClick=Set('CC00CC') height="10px" width="10px"></td>
-<td bgcolor=#CC33CC onMouseOver=View('CC33CC') onClick=Set('CC33CC') height="10px" width="10px"></td>
-<td bgcolor=#CC66CC onMouseOver=View('CC66CC') onClick=Set('CC66CC') height="10px" width="10px"></td>
-<td bgcolor=#CC99CC onMouseOver=View('CC99CC') onClick=Set('CC99CC') height="10px" width="10px"></td>
-<td bgcolor=#CCCCCC onMouseOver=View('CCCCCC') onClick=Set('CCCCCC') height="10px" width="10px"></td>
-<td bgcolor=#CCFFCC onMouseOver=View('CCFFCC') onClick=Set('CCFFCC') height="10px" width="10px"></td>
-<td bgcolor=#FF00CC onMouseOver=View('FF00CC') onClick=Set('FF00CC') height="10px" width="10px"></td>
-<td bgcolor=#FF33CC onMouseOver=View('FF33CC') onClick=Set('FF33CC') height="10px" width="10px"></td>
-<td bgcolor=#FF66CC onMouseOver=View('FF66CC') onClick=Set('FF66CC') height="10px" width="10px"></td>
-<td bgcolor=#FF99CC onMouseOver=View('FF99CC') onClick=Set('FF99CC') height="10px" width="10px"></td>
-<td bgcolor=#FFCCCC onMouseOver=View('FFCCCC') onClick=Set('FFCCCC') height="10px" width="10px"></td>
-<td bgcolor=#FFFFCC onMouseOver=View('FFFFCC') onClick=Set('FFFFCC') height="10px" width="10px"></td>
-</tr>
-<tr>
-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
-<td bgcolor=#FF00FF onMouseOver=View('FF00FF') onClick=Set('FF00FF') height="10px" width="10px"></td>
-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
-<td bgcolor=#9900FF onMouseOver=View('9900FF') onClick=Set('9900FF') height="10px" width="10px"></td>
-<td bgcolor=#9933FF onMouseOver=View('9933FF') onClick=Set('9933FF') height="10px" width="10px"></td>
-<td bgcolor=#9966FF onMouseOver=View('9966FF') onClick=Set('9966FF') height="10px" width="10px"></td>
-<td bgcolor=#9999FF onMouseOver=View('9999FF') onClick=Set('9999FF') height="10px" width="10px"></td>
-<td bgcolor=#99CCFF onMouseOver=View('99CCFF') onClick=Set('99CCFF') height="10px" width="10px"></td>
-<td bgcolor=#99FFFF onMouseOver=View('99FFFF') onClick=Set('99FFFF') height="10px" width="10px"></td>
-<td bgcolor=#CC00FF onMouseOver=View('CC00FF') onClick=Set('CC00FF') height="10px" width="10px"></td>
-<td bgcolor=#CC33FF onMouseOver=View('CC33FF') onClick=Set('CC33FF') height="10px" width="10px"></td>
-<td bgcolor=#CC66FF onMouseOver=View('CC66FF') onClick=Set('CC66FF') height="10px" width="10px"></td>
-<td bgcolor=#CC99FF onMouseOver=View('CC99FF') onClick=Set('CC99FF') height="10px" width="10px"></td>
-<td bgcolor=#CCCCFF onMouseOver=View('CCCCFF') onClick=Set('CCCCFF') height="10px" width="10px"></td>
-<td bgcolor=#CCFFFF onMouseOver=View('CCFFFF') onClick=Set('CCFFFF') height="10px" width="10px"></td>
-<td bgcolor=#FF00FF onMouseOver=View('FF00FF') onClick=Set('FF00FF') height="10px" width="10px"></td>
-<td bgcolor=#FF33FF onMouseOver=View('FF33FF') onClick=Set('FF33FF') height="10px" width="10px"></td>
-<td bgcolor=#FF66FF onMouseOver=View('FF66FF') onClick=Set('FF66FF') height="10px" width="10px"></td>
-<td bgcolor=#FF99FF onMouseOver=View('FF99FF') onClick=Set('FF99FF') height="10px" width="10px"></td>
-<td bgcolor=#FFCCFF onMouseOver=View('FFCCFF') onClick=Set('FFCCFF') height="10px" width="10px"></td>
-<td bgcolor=#FFFFFF onMouseOver=View('FFFFFF') onClick=Set('FFFFFF') height="10px" width="10px"></td>
-</tr>
-</table>
-
-</body></html>
diff --git a/lib/editor/htmlarea/popupwin.js b/lib/editor/htmlarea/popupwin.js
deleted file mode 100644 (file)
index e5fad1a..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-// $Id$
-function PopupWin(editor, title, handler, initFunction) {
-    this.editor = editor;
-    this.handler = handler;
-    var dlg = window.open("", "__ha_dialog",
-                  "toolbar=no,menubar=no,personalbar=no,width=600,height=600," +
-                  "scrollbars=no,resizable=no");
-    this.window = dlg;
-    var doc = dlg.document;
-    this.doc = doc;
-    var self = this;
-
-    var base = document.baseURI || document.URL;
-    if (base && base.match(/(.*)\/([^\/]+)/)) {
-        base = RegExp.$1 + "/";
-    }
-    this.baseURL = base;
-
-    doc.open();
-    var html = "<html><head><title>" + title + "</title>\n";
-    // html += "<base href='" + base + "htmlarea.js' />\n";
-    //html += "<style type='text/css'>@import url(" + base + "htmlarea.css);</style></head>\n";
-    html += "<style type='text/css'>@import url(../htmlarea.css);</style></head>\n";
-    html += "<body class='dialog popupwin' id='--HA-body'></body></html>";
-    doc.write(html);
-    doc.close();
-
-    // sometimes I Hate Mozilla... ;-(
-    function init2() {
-        var body = doc.body;
-        if (!body) {
-            setTimeout(init2, 25);
-            return false;
-        }
-        dlg.title = title;
-        doc.documentElement.style.padding = "0px";
-        doc.documentElement.style.margin = "0px";
-        var content = doc.createElement("div");
-        content.className = "content";
-        self.content = content;
-        body.appendChild(content);
-        self.element = body;
-        initFunction(self);
-        dlg.focus();
-    };
-    init2();
-};
-
-PopupWin.prototype.callHandler = function() {
-    var tags = ["input", "textarea", "select"];
-    var params = new Object();
-    for (var ti in tags) {
-        var tag = tags[ti];
-        var els = this.content.getElementsByTagName(tag);
-        for (var j = 0; j < els.length; ++j) {
-            var el = els[j];
-            var val = el.value;
-            if (el.tagName.toLowerCase() == "input") {
-                if (el.type == "checkbox") {
-                    val = el.checked;
-                }
-            }
-            params[el.name] = val;
-        }
-    }
-    this.handler(this, params);
-    return false;
-};
-
-PopupWin.prototype.close = function() {
-    this.window.close();
-};
-
-PopupWin.prototype.addButtons = function() {
-    var self = this;
-    var div = this.doc.createElement("div");
-    this.content.appendChild(div);
-    div.className = "buttons";
-    for (var i = 0; i < arguments.length; ++i) {
-        var btn = arguments[i];
-        var button = this.doc.createElement("button");
-        div.appendChild(button);
-        button.innerHTML = HTMLArea.I18N.buttons[btn];
-        switch (btn) {
-            case "ok":
-            button.onclick = function() {
-                self.callHandler();
-                self.close();
-                return false;
-            };
-            break;
-            case "cancel":
-            button.onclick = function() {
-                self.close();
-                return false;
-            };
-            break;
-        }
-    }
-};
-
-PopupWin.prototype.showAtElement = function() {
-    var self = this;
-    // Mozilla needs some time to realize what's goin' on..
-    setTimeout(function() {
-        var w = self.content.offsetWidth + 4;
-        var h = self.content.offsetHeight + 4;
-        // size to content -- that's phuckin' buggy in all phuckin' browsers!!!
-        // so that we set a larger size for the dialog window and then center
-        // the element inside... phuck!
-
-        // center...
-        var el = self.content;
-        var s = el.style;
-        // s.width = el.offsetWidth + "px";
-        // s.height = el.offsetHeight + "px";
-        s.position = "absolute";
-        s.left = (w - el.offsetWidth) / 2 + "px";
-        s.top = (h - el.offsetHeight) / 2 + "px";
-        if (HTMLArea.is_gecko) {
-            self.window.innerWidth = w;
-            self.window.innerHeight = h;
-        } else {
-            self.window.resizeTo(w + 8, h + 35);
-        }
-    }, 25);
-};
diff --git a/lib/editor/htmlarea/release-notes.html b/lib/editor/htmlarea/release-notes.html
deleted file mode 100644 (file)
index f37d40a..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN">
-<html>
-  <head>
-    <title>HTMLArea-3.0-beta release notes</title>
-  </head>
-
-  <body>
-
-    <h1>HTMLArea-3.0-beta release notes</h1>
-
-    <p>This release was compiled on Aug 11, 2003 [21:30] GMT.</p>
-
-
-    <p>Changes since 3.0-Alpha:</p>
-
-    <ul>
-
-      <li>Performance improvements.</li>
-
-      <li>Many bugs fixed.</li>
-
-      <li>Plugin infrastructure.</li>
-
-      <li>TableOperations plugin.</li>
-
-      <li>SpellChecker plugin.</li>
-
-      <li>Status bar.</li>
-
-      <li>API for registering custom buttons and drop-down boxes in the
-        toolbar.</li>
-
-      <li>Toolbar can contain text labels.</li>
-
-      <li>Cut, copy, paste, undo, redo buttons.</li>
-
-    </ul>
-
-    <h2>Rationale for Beta</h2>
-
-    <p>Why was this released as "Beta"?  The code is quite stable and it
-    didn't deserve a "Beta" qualification.  However, there are some things
-    left to do for the real 3.0 version.  These things will not affect the
-    API to work with HTMLArea, in other words, you can install the Beta
-    right now and then install the final release without modifying your
-    code.  That's if you don't modify HTMLArea itself.  ;-)</p>
-
-    <h2>To-Do before 3.0 final</h2>
-
-    <ol>
-
-      <li>We should use a single popup interface.  Currently there are two:
-      dialog.js and popupwin.js; dialog.js emulates modal dialogs, which
-      sucks when you want to open "select-color" from another popup and not
-      from the editor itself.  Very buggy in IE.  We should probably use only
-      modeless dialogs (that is, popupwin.js).</li>
-
-      <li>Internationalization for the SpellChecker plugin.</li>
-
-      <li>Internationalization for the TableOperations plugin.</li>
-
-      <li>People who sent translations are invited to re-iterate through
-        their work and make it up-to-date with lang/en.js which is the main
-        lang file for HTMLArea-3.0.  Some things have changed but not all
-        translations are updated.</li>
-
-      <li><strong>Documentation</strong>.</li>
-
-    </ol>
-
-
-    <hr />
-    <address><a href="http://students.infoiasi.ro/~mishoo/">Mihai Bazon</a></address>
-<!-- Created: Sun Aug  3 16:55:08 EEST 2003 -->
-<!-- hhmts start -->
-Last modified on Sun Aug 10 19:31:39 2003
-<!-- hhmts end -->
-<!-- doc-lang: English -->
-  </body>
-</html>
-
-