HTMLArea 3.0, slightly edited by Janne Mikkonen. Alpha version.
857
lib/editor/courseimages.php
Normal file
|
@ -0,0 +1,857 @@
|
||||||
|
<?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("../../files/mimetypes.php");
|
||||||
|
|
||||||
|
require_variable($id);
|
||||||
|
optional_variable($file, "");
|
||||||
|
optional_variable($wdir, "");
|
||||||
|
optional_variable($action, "");
|
||||||
|
|
||||||
|
if (! $course = get_record("course", "id", $id) ) {
|
||||||
|
error("That's an invalid course id");
|
||||||
|
}
|
||||||
|
|
||||||
|
require_login($course->id);
|
||||||
|
|
||||||
|
if (! isteacher($course->id) ) {
|
||||||
|
error("Only teachers can edit files");
|
||||||
|
}
|
||||||
|
|
||||||
|
function html_footer() {
|
||||||
|
echo "</td></tr></table></body></html>";
|
||||||
|
}
|
||||||
|
|
||||||
|
function html_header($course, $wdir, $formfield=""){
|
||||||
|
|
||||||
|
global $CFG;
|
||||||
|
|
||||||
|
if (! $site = get_site()) {
|
||||||
|
error("Invalid site!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($course->id == $site->id) {
|
||||||
|
$strfiles = get_string("sitefiles");
|
||||||
|
} else {
|
||||||
|
$strfiles = get_string("files");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($wdir == "/") {
|
||||||
|
$fullnav = "$strfiles";
|
||||||
|
} else {
|
||||||
|
$dirs = explode("/", $wdir);
|
||||||
|
$numdirs = count($dirs);
|
||||||
|
$link = "";
|
||||||
|
$navigation = "";
|
||||||
|
for ($i=1; $i<$numdirs; $i++) {
|
||||||
|
$navigation .= " -> ";
|
||||||
|
$link .= "/".urlencode($dirs[$i]);
|
||||||
|
$navigation .= "<a href=\"".$_SERVER['PHP_SELF']."?id=$course->id&wdir=$link\">".$dirs[$i]."</a>";
|
||||||
|
}
|
||||||
|
$fullnav = "<a href=\"".$_SERVER['PHP_SELF']."?id=$course->id&wdir=/\">$strfiles</a> $navigation";
|
||||||
|
}
|
||||||
|
|
||||||
|
print_header();
|
||||||
|
?>
|
||||||
|
<script language="javscript" type="text/javascript">
|
||||||
|
<!--
|
||||||
|
function set_value(url) {
|
||||||
|
var str_url = url;
|
||||||
|
//if(document.all) {
|
||||||
|
// window.returnValue = str_url;
|
||||||
|
// window.close();
|
||||||
|
//}
|
||||||
|
//else {
|
||||||
|
window.opener.document.forms[0].url.value = str_url;
|
||||||
|
window.close();
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
-->
|
||||||
|
</script>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
echo '<table border="0" cellpadding="3" cellspacing="0" width="100%">';
|
||||||
|
echo '<tr>';
|
||||||
|
echo '<td bgcolor="'.$THEME->cellheading.'" class="navbar">';
|
||||||
|
echo '<font size="2"><b>'."$course->shortname -> $fullnav".'</b></font>';
|
||||||
|
echo '</td>';
|
||||||
|
echo '</tr>';
|
||||||
|
echo '</table>';
|
||||||
|
|
||||||
|
if ($course->id == $site->id) {
|
||||||
|
print_heading(get_string("publicsitefileswarning"), "center", 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "<table border=0 align=center cellspacing=3 cellpadding=3 width=640>";
|
||||||
|
echo "<tr>";
|
||||||
|
echo "<td colspan=\"2\">";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $basedir = make_upload_directory("$course->id")) {
|
||||||
|
error("The site administrator needs to fix the file permissions");
|
||||||
|
}
|
||||||
|
|
||||||
|
$baseweb = $CFG->wwwroot;
|
||||||
|
|
||||||
|
// End of configuration and access control
|
||||||
|
|
||||||
|
|
||||||
|
$regexp="\\.\\.";
|
||||||
|
if (ereg( $regexp, $file, $regs )| ereg( $regexp, $wdir,$regs )) {
|
||||||
|
$message = "Error: Directories can not contain \"..\"";
|
||||||
|
$wdir = "/";
|
||||||
|
$action = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$wdir) {
|
||||||
|
$wdir="/";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
switch ($action) {
|
||||||
|
|
||||||
|
case "upload":
|
||||||
|
html_header($course, $wdir);
|
||||||
|
|
||||||
|
if (!empty($_FILES['userfile'])) {
|
||||||
|
$userfile = $_FILES['userfile'];
|
||||||
|
} else {
|
||||||
|
$save = false;
|
||||||
|
}
|
||||||
|
if (!empty($save)) {
|
||||||
|
if (!is_uploaded_file($userfile['tmp_name']) or $userfile['size'] == 0) {
|
||||||
|
notify(get_string("uploadnofilefound"));
|
||||||
|
} else {
|
||||||
|
$userfile_name = clean_filename($userfile['name']);
|
||||||
|
if ($userfile_name) {
|
||||||
|
$newfile = "$basedir$wdir/$userfile_name";
|
||||||
|
if (move_uploaded_file($userfile['tmp_name'], $newfile)) {
|
||||||
|
chmod($newfile, 0666);
|
||||||
|
$a = NULL;
|
||||||
|
$a->file = "$userfile_name (".$userfile['type'].")";
|
||||||
|
$a->directory = $wdir;
|
||||||
|
print_string("uploadedfileto", "", $a);
|
||||||
|
} else {
|
||||||
|
notify(get_string("uploadproblem", "", $userfile_name));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
displaydir($wdir);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$upload_max_filesize = get_max_upload_file_size();
|
||||||
|
$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) --> <B>$wdir</B>";
|
||||||
|
echo "<TABLE><TR><TD COLSPAN=2>";
|
||||||
|
echo "<FORM ENCTYPE=\"multipart/form-data\" METHOD=\"post\" ACTION=\"".$_SERVER['PHP_SELF']."\">";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=MAX_FILE_SIZE value=\"$upload_max_filesize\">";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=action VALUE=upload>";
|
||||||
|
echo " <INPUT NAME=\"userfile\" TYPE=\"file\" size=\"60\">";
|
||||||
|
echo " </TD><TR><TD WIDTH=10>";
|
||||||
|
echo " <INPUT TYPE=submit NAME=save VALUE=\"$struploadthisfile\">";
|
||||||
|
echo "</FORM>";
|
||||||
|
echo "</TD><TD WIDTH=100%>";
|
||||||
|
echo "<FORM ACTION=\"".$_SERVER['PHP_SELF']."\" METHOD=\"get\">";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=action VALUE=cancel>";
|
||||||
|
echo " <INPUT TYPE=submit VALUE=\"$strcancel\">";
|
||||||
|
echo "</FORM>";
|
||||||
|
echo "</TD></TR></TABLE>";
|
||||||
|
}
|
||||||
|
html_footer();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "delete":
|
||||||
|
if (!empty($confirm)) {
|
||||||
|
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 />";
|
||||||
|
notice_yesno (get_string("deletecheckfiles"),
|
||||||
|
"".basename($_SERVER['PHP_SELF'])."?id=$id&wdir=$wdir&action=delete&confirm=1",
|
||||||
|
"".basename($_SERVER['PHP_SELF'])."?id=$id&wdir=$wdir&action=cancel");
|
||||||
|
} else {
|
||||||
|
displaydir($wdir);
|
||||||
|
}
|
||||||
|
html_footer();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "move":
|
||||||
|
html_header($course, $wdir);
|
||||||
|
if ($count = setfilelist($_POST)) {
|
||||||
|
$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") {
|
||||||
|
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)) {
|
||||||
|
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><TR><TD>";
|
||||||
|
echo "<FORM ACTION=\"".$_SERVER['PHP_SELF']."\" METHOD=\"post\" NAME=\"form\">";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=action VALUE=rename>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=oldname VALUE=\"$file\">";
|
||||||
|
echo " <INPUT TYPE=text NAME=name SIZE=35 VALUE=\"$file\">";
|
||||||
|
echo " <INPUT TYPE=submit VALUE=\"$strrename\">";
|
||||||
|
echo "</FORM>";
|
||||||
|
echo "</TD><TD>";
|
||||||
|
echo "<FORM ACTION=\"".$_SERVER['PHP_SELF']."\" METHOD=get>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=action VALUE=cancel>";
|
||||||
|
echo " <INPUT TYPE=submit VALUE=\"$strcancel\">";
|
||||||
|
echo "</FORM>";
|
||||||
|
echo "</TD></TR></TABLE>";
|
||||||
|
}
|
||||||
|
html_footer();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "mkdir":
|
||||||
|
if (!empty($name)) {
|
||||||
|
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><TR><TD>";
|
||||||
|
echo "<FORM ACTION=\"".$_SERVER['PHP_SELF']."\" METHOD=post NAME=form>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=action VALUE=mkdir>";
|
||||||
|
echo " <INPUT TYPE=text NAME=name SIZE=35>";
|
||||||
|
echo " <INPUT TYPE=submit VALUE=\"$strcreate\">";
|
||||||
|
echo "</FORM>";
|
||||||
|
echo "</TD><TD>";
|
||||||
|
echo "<FORM ACTION=\"".$_SERVER['PHP_SELF']."\" METHOD=get>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=action VALUE=cancel>";
|
||||||
|
echo " <INPUT TYPE=submit VALUE=\"$strcancel\">";
|
||||||
|
echo "</FORM>";
|
||||||
|
echo "</TD></TR></TABLE>";
|
||||||
|
}
|
||||||
|
html_footer();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "edit":
|
||||||
|
html_header($course, $wdir);
|
||||||
|
if (isset($text)) {
|
||||||
|
$fileptr = fopen($basedir.$file,"w");
|
||||||
|
fputs($fileptr, stripslashes($text));
|
||||||
|
fclose($fileptr);
|
||||||
|
displaydir($wdir);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$streditfile = get_string("edit", "", "<B>$file</B>");
|
||||||
|
$fileptr = fopen($basedir.$file, "r");
|
||||||
|
$contents = fread($fileptr, filesize($basedir.$file));
|
||||||
|
fclose($fileptr);
|
||||||
|
|
||||||
|
if (mimeinfo("type", $file) == "text/html") {
|
||||||
|
if ($usehtmleditor = can_use_richtext_editor()) {
|
||||||
|
$onsubmit = "onsubmit=\"copyrichtext(document.form.text);\"";
|
||||||
|
} else {
|
||||||
|
$onsubmit = "";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$usehtmleditor = false;
|
||||||
|
$onsubmit = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
print_heading("$streditfile");
|
||||||
|
|
||||||
|
echo "<TABLE><TR><TD COLSPAN=2>";
|
||||||
|
echo "<FORM ACTION=\"".$_SERVER['PHP_SELF']."\" METHOD=\"post\" NAME=\"form\" $onsubmit>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\">";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=file VALUE=\"$file\">";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=action VALUE=edit>";
|
||||||
|
print_textarea($usehtmleditor, 25, 80, 680, 400, "text", $contents);
|
||||||
|
echo "</TD></TR><TR><TD>";
|
||||||
|
echo " <INPUT TYPE=submit VALUE=\"".get_string("savechanges")."\">";
|
||||||
|
echo "</FORM>";
|
||||||
|
echo "</TD><TD>";
|
||||||
|
echo "<FORM ACTION=\"".$_SERVER['PHP_SELF']."\" METHOD=get>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=action VALUE=cancel>";
|
||||||
|
echo " <INPUT TYPE=submit VALUE=\"".get_string("cancel")."\">";
|
||||||
|
echo "</FORM>";
|
||||||
|
echo "</TD></TR></TABLE>";
|
||||||
|
|
||||||
|
if ($usehtmleditor) {
|
||||||
|
print_richedit_javascript("form", "text", "yes");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
html_footer();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "zip":
|
||||||
|
if (!empty($name)) {
|
||||||
|
html_header($course, $wdir);
|
||||||
|
$name = clean_filename($name);
|
||||||
|
if (empty($CFG->zip)) { // Use built-in php-based zip function
|
||||||
|
$files = array();
|
||||||
|
foreach ($USER->filelist as $file) {
|
||||||
|
$files[] = "$basedir/$file";
|
||||||
|
}
|
||||||
|
include_once('../pclzip/pclzip.lib.php');
|
||||||
|
$archive = new PclZip("$basedir/$wdir/$name");
|
||||||
|
if (($list = $archive->create($files,'',"$basedir/$wdir/")) == 0) {
|
||||||
|
error($archive->errorInfo(true));
|
||||||
|
}
|
||||||
|
} else { // Use external zip program
|
||||||
|
$files = "";
|
||||||
|
foreach ($USER->filelist as $file) {
|
||||||
|
$files .= basename($file);
|
||||||
|
$files .= " ";
|
||||||
|
}
|
||||||
|
$command = "cd $basedir/$wdir ; $CFG->zip -r $name $files";
|
||||||
|
Exec($command);
|
||||||
|
}
|
||||||
|
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><TR><TD>";
|
||||||
|
echo "<FORM ACTION=\"".$_SERVER['PHP_SELF']."\" METHOD=post NAME=form>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\">";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=action VALUE=zip>";
|
||||||
|
echo " <INPUT TYPE=text NAME=name SIZE=35 VALUE=\"new.zip\">";
|
||||||
|
echo " <INPUT TYPE=submit VALUE=\"".get_string("createziparchive")."\">";
|
||||||
|
echo "</FORM>";
|
||||||
|
echo "</TD><TD>";
|
||||||
|
echo "<FORM ACTION=\"".$_SERVER['PHP_SELF']."\" METHOD=get>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=action VALUE=cancel>";
|
||||||
|
echo " <INPUT TYPE=submit VALUE=\"".get_string("cancel")."\">";
|
||||||
|
echo "</FORM>";
|
||||||
|
echo "</TD></TR></TABLE>";
|
||||||
|
} else {
|
||||||
|
displaydir($wdir);
|
||||||
|
clearfilelist();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
html_footer();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "unzip":
|
||||||
|
html_header($course, $wdir);
|
||||||
|
if (!empty($file)) {
|
||||||
|
$strname = get_string("name");
|
||||||
|
$strsize = get_string("size");
|
||||||
|
$strmodified = get_string("modified");
|
||||||
|
$strstatus = get_string("status");
|
||||||
|
$strok = get_string("ok");
|
||||||
|
$strunpacking = get_string("unpacking", "", $file);
|
||||||
|
|
||||||
|
echo "<P ALIGN=CENTER>$strunpacking:</P>";
|
||||||
|
|
||||||
|
$file = basename($file);
|
||||||
|
|
||||||
|
if (empty($CFG->unzip)) { // Use built-in php-based unzip function
|
||||||
|
include_once('../pclzip/pclzip.lib.php');
|
||||||
|
$archive = new PclZip("$basedir/$wdir/$file");
|
||||||
|
if (!$list = $archive->extract("$basedir/$wdir")) {
|
||||||
|
error($archive->errorInfo(true));
|
||||||
|
} else { // print some output
|
||||||
|
echo "<table cellpadding=\"4\" cellspacing=\"2\" border=\"0\" width=640>";
|
||||||
|
echo "<tr><th align=left>$strname</th>";
|
||||||
|
echo "<th align=right>$strsize</th>";
|
||||||
|
echo "<th align=right>$strmodified</th>";
|
||||||
|
echo "<th align=right>$strstatus</th></tr>";
|
||||||
|
foreach ($list as $item) {
|
||||||
|
echo "<tr>";
|
||||||
|
$item['filename'] = str_replace("$basedir/$wdir/", "", $item['filename']);
|
||||||
|
print_cell("left", $item['filename']);
|
||||||
|
if (! $item['folder']) {
|
||||||
|
print_cell("right", display_size($item['size']));
|
||||||
|
} else {
|
||||||
|
echo "<td> </td>";
|
||||||
|
}
|
||||||
|
$filedate = userdate($item['mtime'], get_string("strftimedatetime"));
|
||||||
|
print_cell("right", $filedate);
|
||||||
|
print_cell("right", $item['status']);
|
||||||
|
echo "</tr>";
|
||||||
|
}
|
||||||
|
echo "</table>";
|
||||||
|
}
|
||||||
|
|
||||||
|
} else { // Use external unzip program
|
||||||
|
print_simple_box_start("center");
|
||||||
|
echo "<PRE>";
|
||||||
|
$command = "cd $basedir/$wdir ; $CFG->unzip -o $file 2>&1";
|
||||||
|
passthru($command);
|
||||||
|
echo "</PRE>";
|
||||||
|
print_simple_box_end();
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "<CENTER><FORM ACTION=\"".$_SERVER['PHP_SELF']."\" METHOD=get>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=action VALUE=cancel>";
|
||||||
|
echo " <INPUT TYPE=submit VALUE=\"$strok\">";
|
||||||
|
echo "</FORM>";
|
||||||
|
echo "</CENTER>";
|
||||||
|
} else {
|
||||||
|
displaydir($wdir);
|
||||||
|
}
|
||||||
|
html_footer();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "listzip":
|
||||||
|
html_header($course, $wdir);
|
||||||
|
if (!empty($file)) {
|
||||||
|
$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);
|
||||||
|
|
||||||
|
include_once('../lib/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\" width=640>";
|
||||||
|
echo "<tr><th align=left>$strname</th><th align=right>$strsize</th><th align=right>$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> </td>";
|
||||||
|
}
|
||||||
|
$filedate = userdate($item['mtime'], get_string("strftimedatetime"));
|
||||||
|
print_cell("right", $filedate);
|
||||||
|
echo "</tr>";
|
||||||
|
}
|
||||||
|
echo "</table>";
|
||||||
|
}
|
||||||
|
echo "<br><center><form action=\"".$_SERVER['PHP_SELF']."\" method=get>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=action VALUE=cancel>";
|
||||||
|
echo " <INPUT TYPE=submit VALUE=\"$strok\">";
|
||||||
|
echo "</FORM>";
|
||||||
|
echo "</CENTER>";
|
||||||
|
} else {
|
||||||
|
displaydir($wdir);
|
||||||
|
}
|
||||||
|
html_footer();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "torte":
|
||||||
|
if($_POST)
|
||||||
|
{
|
||||||
|
while(list($key, $val) = each($_POST))
|
||||||
|
{
|
||||||
|
if(ereg("file([0-9]+)", $key, $regs))
|
||||||
|
{
|
||||||
|
$file = $val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(@filetype($CFG->dataroot ."/". $course->id . $file) == "file")
|
||||||
|
{
|
||||||
|
if(mimeinfo("icon", $file) == "image.gif")
|
||||||
|
{
|
||||||
|
$url = $CFG->wwwroot ."/file.php?file=/" .$course->id . $file;
|
||||||
|
runjavascript($url);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print "File is not a image!";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print "You cannot insert FOLDER into richtext editor!!!";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "cancel";
|
||||||
|
clearfilelist();
|
||||||
|
|
||||||
|
default:
|
||||||
|
html_header($course, $wdir);
|
||||||
|
displaydir($wdir);
|
||||||
|
html_footer();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// FILE FUNCTIONS ///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
function fulldelete($location) {
|
||||||
|
if (is_dir($location)) {
|
||||||
|
$currdir = opendir($location);
|
||||||
|
while ($file = readdir($currdir)) {
|
||||||
|
if ($file <> ".." && $file <> ".") {
|
||||||
|
$fullfile = $location."/".$file;
|
||||||
|
if (is_dir($fullfile)) {
|
||||||
|
if (!fulldelete($fullfile)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!unlink($fullfile)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
closedir($currdir);
|
||||||
|
if (! rmdir($location)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if (!unlink($location)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function setfilelist($VARS) {
|
||||||
|
global $USER;
|
||||||
|
|
||||||
|
$USER->filelist = array ();
|
||||||
|
$USER->fileop = "";
|
||||||
|
|
||||||
|
$count = 0;
|
||||||
|
foreach ($VARS as $key => $val) {
|
||||||
|
if (substr($key,0,4) == "file") {
|
||||||
|
$count++;
|
||||||
|
$USER->filelist[] = rawurldecode($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->wwwroot/files/pix/folder.gif\" HEIGHT=16 WIDTH=16> $file<BR>";
|
||||||
|
$subfilelist = array();
|
||||||
|
$currdir = opendir($basedir.$file);
|
||||||
|
while ($subfile = readdir($currdir)) {
|
||||||
|
if ($subfile <> ".." && $subfile <> ".") {
|
||||||
|
$subfilelist[] = $file."/".$subfile;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
printfilelist($subfilelist);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$icon = mimeinfo("icon", $file);
|
||||||
|
echo "<IMG SRC=\"$CFG->wwwroot/files/pix/$icon\" HEIGHT=16 WIDTH=16> $file<BR>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function print_cell($alignment="center", $text=" ") {
|
||||||
|
echo "<TD ALIGN=\"$alignment\" NOWRAP>";
|
||||||
|
echo "<FONT SIZE=\"-1\" FACE=\"Arial, Helvetica\">";
|
||||||
|
echo "$text";
|
||||||
|
echo "</FONT>";
|
||||||
|
echo "</TD>\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
function displaydir ($wdir) {
|
||||||
|
// $wdir == / or /a or /a/b/c/d etc
|
||||||
|
|
||||||
|
global $basedir;
|
||||||
|
global $id;
|
||||||
|
global $USER, $CFG;
|
||||||
|
|
||||||
|
$fullpath = $basedir.$wdir;
|
||||||
|
|
||||||
|
$directory = opendir($fullpath); // Find all files
|
||||||
|
while ($file = readdir($directory)) {
|
||||||
|
if ($file == "." || $file == "..") {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_dir($fullpath."/".$file)) {
|
||||||
|
$dirlist[] = $file;
|
||||||
|
} else {
|
||||||
|
$filelist[] = $file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
closedir($directory);
|
||||||
|
|
||||||
|
$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=\"".$_SERVER['PHP_SELF']."\" METHOD=post NAME=dirform>";
|
||||||
|
echo "<TABLE BORDER=0 cellspacing=2 cellpadding=2 width=640>";
|
||||||
|
echo "<TR>";
|
||||||
|
echo "<TH WIDTH=5></TH>";
|
||||||
|
echo "<TH ALIGN=left>$strname</TH>";
|
||||||
|
echo "<TH ALIGN=right>$strsize</TH>";
|
||||||
|
echo "<TH ALIGN=right>$strmodified</TH>";
|
||||||
|
echo "<TH ALIGN=right>$straction</TH>";
|
||||||
|
echo "</TR>\n";
|
||||||
|
|
||||||
|
if ($wdir == "/") {
|
||||||
|
$wdir = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
$count = 0;
|
||||||
|
|
||||||
|
if (!empty($dirlist)) {
|
||||||
|
asort($dirlist);
|
||||||
|
foreach ($dirlist as $dir) {
|
||||||
|
|
||||||
|
$count++;
|
||||||
|
|
||||||
|
$filename = $fullpath."/".$dir;
|
||||||
|
$fileurl = rawurlencode($wdir."/".$dir);
|
||||||
|
$filesafe = rawurlencode($dir);
|
||||||
|
$filedate = userdate(filectime($filename), "%d %b %Y, %I:%M %p");
|
||||||
|
|
||||||
|
echo "<TR>";
|
||||||
|
|
||||||
|
print_cell("center", "<INPUT TYPE=checkbox NAME=\"file$count\" VALUE=\"$fileurl\">");
|
||||||
|
print_cell("left", "<A HREF=\"".basename($_SERVER['PHP_SELF'])."?id=$id&wdir=$fileurl\"><IMG SRC=\"$CFG->wwwroot/files/pix/folder.gif\" HEIGHT=16 WIDTH=16 BORDER=0 ALT=\"Folder\"></A> <A HREF=\"".basename($_SERVER['PHP_SELF'])."?id=$id&wdir=$fileurl\">".htmlspecialchars($dir)."</A>");
|
||||||
|
print_cell("right", "-");
|
||||||
|
print_cell("right", $filedate);
|
||||||
|
print_cell("right", "<A HREF=\"".basename($_SERVER['PHP_SELF'])."?id=$id&wdir=$wdir&file=$filesafe&action=rename\">$strrename</A>");
|
||||||
|
|
||||||
|
echo "</TR>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (!empty($filelist)) {
|
||||||
|
asort($filelist);
|
||||||
|
foreach ($filelist as $file) {
|
||||||
|
|
||||||
|
$icon = mimeinfo("icon", $file);
|
||||||
|
|
||||||
|
$count++;
|
||||||
|
$filename = $fullpath."/".$file;
|
||||||
|
$fileurl = "$wdir/$file";
|
||||||
|
$filesafe = rawurlencode($file);
|
||||||
|
$fileurlsafe = rawurlencode($fileurl);
|
||||||
|
$filedate = userdate(filectime($filename), "%d %b %Y, %I:%M %p");
|
||||||
|
|
||||||
|
echo "<tr>";
|
||||||
|
|
||||||
|
print_cell("center", "<INPUT TYPE=\"checkbox\" NAME=\"file$count\" VALUE=\"$fileurl\">");
|
||||||
|
echo "<td align=left nowrap>";
|
||||||
|
if ($CFG->slasharguments) {
|
||||||
|
$ffurl = "/file.php/$id$fileurl";
|
||||||
|
} else {
|
||||||
|
$ffurl = "/file.php?file=/$id$fileurl";
|
||||||
|
}
|
||||||
|
link_to_popup_window ($ffurl, "display",
|
||||||
|
"<IMG SRC=\"$CFG->wwwroot/files/pix/$icon\" HEIGHT=16 WIDTH=16 BORDER=0 ALT=\"File\">",
|
||||||
|
480, 640);
|
||||||
|
echo "<font size=\"-1\" face=\"Arial, Helvetica\">";
|
||||||
|
link_to_popup_window ($ffurl, "display",
|
||||||
|
htmlspecialchars($file),
|
||||||
|
480, 640);
|
||||||
|
echo "</font></td>";
|
||||||
|
|
||||||
|
$file_size = filesize($filename);
|
||||||
|
print_cell("right", display_size($file_size));
|
||||||
|
print_cell("right", $filedate);
|
||||||
|
|
||||||
|
if ($icon == "text.gif" || $icon == "html.gif") {
|
||||||
|
$edittext = "<a href=\"".basename($_SERVER['PHP_SELF'])."?id=$id&wdir=$wdir&file=$fileurl&action=edit\">$stredit</a>";
|
||||||
|
} else if ($icon == "zip.gif") {
|
||||||
|
$edittext = "<a href=\"".basename($_SERVER['PHP_SELF'])."?id=$id&wdir=$wdir&file=$fileurl&action=unzip\">$strunzip</a> ";
|
||||||
|
$edittext .= "<a href=\"".basename($_SERVER['PHP_SELF'])."?id=$id&wdir=$wdir&file=$fileurl&action=listzip\">$strlist</a> ";
|
||||||
|
} else if ($icon == "image.gif") {
|
||||||
|
$edittext = "<b><a onMouseDown=\"return set_value('$CFG->wwwroot$ffurl')\" href=\"\">$strchoose</a></b>";
|
||||||
|
} else {
|
||||||
|
$edittext = "";
|
||||||
|
}
|
||||||
|
print_cell("right", "$edittext <A HREF=\"".basename($_SERVER['PHP_SELF'])."?id=$id&wdir=$wdir&file=$filesafe&action=rename\">$strrename</A>");
|
||||||
|
|
||||||
|
echo "</TR>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
echo "</TABLE>";
|
||||||
|
echo "<hr width=640 align=center noshade size=1>";
|
||||||
|
|
||||||
|
if (empty($wdir)) {
|
||||||
|
$wdir = "/";
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "<TABLE BORDER=0 cellspacing=2 cellpadding=2 width=640>";
|
||||||
|
echo "<TR><TD>";
|
||||||
|
echo "<INPUT TYPE=hidden NAME=id VALUE=\"$id\">";
|
||||||
|
echo "<INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\"> ";
|
||||||
|
$options = array (
|
||||||
|
"move" => "$strmovetoanotherfolder",
|
||||||
|
"delete" => "$strdeletecompletely",
|
||||||
|
"zip" => "$strcreateziparchive"
|
||||||
|
);
|
||||||
|
if (!empty($count)) {
|
||||||
|
choose_from_menu ($options, "action", "", "$strwithchosenfiles...", "javascript:document.dirform.submit()");
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "</FORM>";
|
||||||
|
echo "<TD ALIGN=center>";
|
||||||
|
if (!empty($USER->fileop) and ($USER->fileop == "move") and ($USER->filesource <> $wdir)) {
|
||||||
|
echo "<FORM ACTION=\"".$_SERVER['PHP_SELF']."\" METHOD=get>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\">";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=action VALUE=paste>";
|
||||||
|
echo " <INPUT TYPE=submit VALUE=\"$strmovefilestohere\">";
|
||||||
|
echo "</FORM>";
|
||||||
|
}
|
||||||
|
echo "<TD ALIGN=right>";
|
||||||
|
echo "<FORM ACTION=\"".$_SERVER['PHP_SELF']."\" METHOD=get>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\">";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=action VALUE=mkdir>";
|
||||||
|
echo " <INPUT TYPE=submit VALUE=\"$strmakeafolder\">";
|
||||||
|
echo "</FORM>";
|
||||||
|
echo "</TD>";
|
||||||
|
echo "<TD ALIGN=right>";
|
||||||
|
echo "<FORM ACTION=\"".$_SERVER['PHP_SELF']."\" METHOD=get>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\">";
|
||||||
|
echo " <INPUT TYPE=hidden NAME=action VALUE=upload>";
|
||||||
|
echo " <INPUT TYPE=submit VALUE=\"$struploadafile\">";
|
||||||
|
echo "</FORM>";
|
||||||
|
echo "</TD></TR>";
|
||||||
|
echo "</TABLE>";
|
||||||
|
echo "<HR WIDTH=640 ALIGN=CENTER NOSHADE SIZE=1>";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
72
lib/editor/dialog.js
Normal file
|
@ -0,0 +1,72 @@
|
||||||
|
// 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
|
||||||
|
}
|
||||||
|
if (document.all) { // here we hope that Mozilla will never support document.all
|
||||||
|
var value =
|
||||||
|
showModalDialog(url, init,
|
||||||
|
//window.open(url, '_blank',
|
||||||
|
"resizable: no; help: no; status: no; scroll: no");
|
||||||
|
if (action) {
|
||||||
|
action(value);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return Dialog._geckoOpenModal(url, action, init);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Dialog._parentEvent = function(ev) {
|
||||||
|
if (Dialog._modal && !Dialog._modal.closed) {
|
||||||
|
Dialog._modal.focus();
|
||||||
|
// we get here in Mozilla only, anyway, so we can safely use
|
||||||
|
// the DOM version.
|
||||||
|
ev.preventDefault();
|
||||||
|
ev.stopPropagation();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 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 dlg = window.open(url, "ha_dialog",
|
||||||
|
"toolbar=no,menubar=no,personalbar=no,width=10,height=10," +
|
||||||
|
"scrollbars=no,resizable=no");
|
||||||
|
Dialog._modal = dlg;
|
||||||
|
Dialog._arguments = init;
|
||||||
|
|
||||||
|
// capture some window's events
|
||||||
|
function capwin(w) {
|
||||||
|
w.addEventListener("click", Dialog._parentEvent, true);
|
||||||
|
w.addEventListener("mousedown", Dialog._parentEvent, true);
|
||||||
|
w.addEventListener("focus", Dialog._parentEvent, true);
|
||||||
|
};
|
||||||
|
// release the captured events
|
||||||
|
function relwin(w) {
|
||||||
|
w.removeEventListener("focus", Dialog._parentEvent, true);
|
||||||
|
w.removeEventListener("mousedown", Dialog._parentEvent, true);
|
||||||
|
w.removeEventListener("click", Dialog._parentEvent, true);
|
||||||
|
};
|
||||||
|
capwin(window);
|
||||||
|
// capture other frames
|
||||||
|
//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) {
|
||||||
|
if (val && action) {
|
||||||
|
action(val);
|
||||||
|
}
|
||||||
|
relwin(window);
|
||||||
|
// capture other frames
|
||||||
|
//for (var i = 0; i < window.frames.length; relwin(window.frames[i++]));
|
||||||
|
Dialog._modal = null;
|
||||||
|
};
|
||||||
|
};
|
180
lib/editor/htmlarea.css
Normal file
|
@ -0,0 +1,180 @@
|
||||||
|
.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; }
|
1839
lib/editor/htmlarea.js
Normal file
1911
lib/editor/htmlarea.php
Normal file
BIN
lib/editor/images/ed_about.gif
Normal file
After Width: | Height: | Size: 87 B |
BIN
lib/editor/images/ed_align_center.gif
Normal file
After Width: | Height: | Size: 69 B |
BIN
lib/editor/images/ed_align_justify.gif
Normal file
After Width: | Height: | Size: 69 B |
BIN
lib/editor/images/ed_align_left.gif
Normal file
After Width: | Height: | Size: 69 B |
BIN
lib/editor/images/ed_align_right.gif
Normal file
After Width: | Height: | Size: 68 B |
BIN
lib/editor/images/ed_blank.gif
Normal file
After Width: | Height: | Size: 56 B |
BIN
lib/editor/images/ed_charmap.gif
Normal file
After Width: | Height: | Size: 143 B |
BIN
lib/editor/images/ed_color_bg.gif
Normal file
After Width: | Height: | Size: 181 B |
BIN
lib/editor/images/ed_color_fg.gif
Normal file
After Width: | Height: | Size: 171 B |
BIN
lib/editor/images/ed_copy.gif
Normal file
After Width: | Height: | Size: 110 B |
BIN
lib/editor/images/ed_custom.gif
Normal file
After Width: | Height: | Size: 67 B |
BIN
lib/editor/images/ed_cut.gif
Normal file
After Width: | Height: | Size: 91 B |
BIN
lib/editor/images/ed_delete.gif
Normal file
After Width: | Height: | Size: 90 B |
BIN
lib/editor/images/ed_format_bold.gif
Normal file
After Width: | Height: | Size: 74 B |
BIN
lib/editor/images/ed_format_italic.gif
Normal file
After Width: | Height: | Size: 77 B |
BIN
lib/editor/images/ed_format_strike.gif
Normal file
After Width: | Height: | Size: 78 B |
BIN
lib/editor/images/ed_format_sub.gif
Normal file
After Width: | Height: | Size: 78 B |
BIN
lib/editor/images/ed_format_sup.gif
Normal file
After Width: | Height: | Size: 77 B |
BIN
lib/editor/images/ed_format_underline.gif
Normal file
After Width: | Height: | Size: 85 B |
BIN
lib/editor/images/ed_help.gif
Normal file
After Width: | Height: | Size: 70 B |
BIN
lib/editor/images/ed_hr.gif
Normal file
After Width: | Height: | Size: 70 B |
BIN
lib/editor/images/ed_html.gif
Normal file
After Width: | Height: | Size: 75 B |
BIN
lib/editor/images/ed_image.gif
Normal file
After Width: | Height: | Size: 148 B |
BIN
lib/editor/images/ed_indent_less.gif
Normal file
After Width: | Height: | Size: 87 B |
BIN
lib/editor/images/ed_indent_more.gif
Normal file
After Width: | Height: | Size: 87 B |
BIN
lib/editor/images/ed_link.gif
Normal file
After Width: | Height: | Size: 97 B |
BIN
lib/editor/images/ed_list_bullet.gif
Normal file
After Width: | Height: | Size: 80 B |
BIN
lib/editor/images/ed_list_num.gif
Normal file
After Width: | Height: | Size: 82 B |
BIN
lib/editor/images/ed_paste.gif
Normal file
After Width: | Height: | Size: 164 B |
BIN
lib/editor/images/ed_redo.gif
Normal file
After Width: | Height: | Size: 80 B |
BIN
lib/editor/images/ed_show_border.gif
Normal file
After Width: | Height: | Size: 104 B |
BIN
lib/editor/images/ed_splitcel.gif
Normal file
After Width: | Height: | Size: 925 B |
BIN
lib/editor/images/ed_undo.gif
Normal file
After Width: | Height: | Size: 81 B |
BIN
lib/editor/images/em.icon.smile.gif
Normal file
After Width: | Height: | Size: 962 B |
BIN
lib/editor/images/fullscreen_maximize.gif
Normal file
After Width: | Height: | Size: 97 B |
BIN
lib/editor/images/fullscreen_minimize.gif
Normal file
After Width: | Height: | Size: 97 B |
BIN
lib/editor/images/icon_ins_char.gif
Normal file
After Width: | Height: | Size: 169 B |
BIN
lib/editor/images/icon_smile.gif
Normal file
After Width: | Height: | Size: 244 B |
BIN
lib/editor/images/insert_table.gif
Normal file
After Width: | Height: | Size: 121 B |
190
lib/editor/index.html
Normal file
|
@ -0,0 +1,190 @@
|
||||||
|
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>HTMLArea -- the free, customizable online editor</title>
|
||||||
|
|
||||||
|
<style type="text/css">
|
||||||
|
html, body { font-family: georgia,"times new roman",serif; background-color: #fff; color: #000; }
|
||||||
|
.label { text-align: right; padding-right: 0.3em; }
|
||||||
|
.bline { border-bottom: 1px solid #aaa; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div style="float: right; border: 1px solid #aaa; background-color: #eee; padding: 3px; margin-left: 10px; margin-bottom: 10px;">
|
||||||
|
<table cellspacing="0" cellpadding="0" border="0">
|
||||||
|
<tr>
|
||||||
|
<td class="label">Version:</td><td>3.0</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="label">Release:</td><td>beta (<a href="release-notes.html">release notes</a>)</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="label bline">Compiled at:</td><td class="bline">Aug 11, 2003 [21:30] GMT</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="label">SourceForge page:</td><td><a href="http://sf.net/projects/itools-htmlarea/">http://sf.net/projects/itools-htmlarea/</a></td>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<h1>HTMLArea -- the free<br/>customizable online editor</h1>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
HTMLArea is a free, customizable online editor. It works inside your
|
||||||
|
browser. It uses a non-standard feature implemented in Internet
|
||||||
|
Explorer 5.5 or better for Windows and Mozilla 1.3 or better (any
|
||||||
|
platform), therefore it will only work in one of these browsers.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
HTMLArea is copyright <a
|
||||||
|
href="http://interactivetools.com">InteractiveTools.com</a> and
|
||||||
|
released under a BSD-style license. HTMLArea is created and developed
|
||||||
|
upto version 2.03 by InteractiveTools.com. Version 3.0 developed by
|
||||||
|
<a href="http://students.infoiasi.ro/~mishoo/">Mihai Bazon</a> for
|
||||||
|
InteractiveTools. It contains code sponsored by other companies as
|
||||||
|
well.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h2>Online demos</h2>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li><a href="example.html">HTMLArea standard</a> -- contains the core
|
||||||
|
editor.</li>
|
||||||
|
|
||||||
|
<li><a href="example-table-operations.html">HTMLArea + tables</a> --
|
||||||
|
loads the <tt>TableOperations</tt> plugin, sponsored by <a
|
||||||
|
href="http://bloki.com">Zapatec Inc.</a></li>
|
||||||
|
|
||||||
|
<li><a href="example-spell-checker.html">HTMLArea + spell checher</a>
|
||||||
|
-- loads the <tt>SpellChecker</tt> plugin, sponsored by <a
|
||||||
|
href="http://americanbible.org">American Bible Society</a>.</li>
|
||||||
|
|
||||||
|
<li><a href="example-fully-loaded.html">HTMLArea fully loaded</a> ;-)</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h2>Installation</h2>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Installation is (or should be) easy. You need to unpack the ZIP file
|
||||||
|
in a directory accessible through your webserver. Supposing you
|
||||||
|
unpack in your <tt>DocumentRoot</tt> and your <tt>DocumentRoot</tt> is
|
||||||
|
<tt>/var/www/html</tt> as in a standard RedHat installation, you need
|
||||||
|
to acomplish the following steps: (the example is for a Unix-like
|
||||||
|
operating system)
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<pre style="margin-left: 2em"
|
||||||
|
>
|
||||||
|
cd /var/www/html
|
||||||
|
unzip /path/to/archive/HTMLArea-3.0-beta.zip
|
||||||
|
mv HTMLArea-3.0-beta htmlarea
|
||||||
|
find htmlarea/ -type f -exec chmod 644 {} \;
|
||||||
|
find htmlarea/ -type d -exec chmod 755 {} \;
|
||||||
|
find htmlarea/ -name "*.cgi" -exec chmod 755 {} \;</pre>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<strong>Notes.</strong> You may chose to symlink "htmlarea" to "HTMLArea-3.0-beta", in which case your server needs to be configured to
|
||||||
|
"<tt>FollowSymLinks</tt>". You need to make sure that *.cgi files are
|
||||||
|
interpreted as CGI scripts. If you want to use the SpellChecker
|
||||||
|
plugin you need to have a recent version of Perl installed (I
|
||||||
|
recommend 5.8.0) on the server, and the module Text::Aspell, available
|
||||||
|
from CPAN. More info in "<a
|
||||||
|
href="plugins/SpellChecker/readme-tech.html">plugins/SpellChecker/readme-tech.html</a>".
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>About how to setup your pages to use the editor, please read the
|
||||||
|
[outdated yet generally valid] <a
|
||||||
|
href="reference.html">documentation</a>.</p>
|
||||||
|
|
||||||
|
<h2>Status and links</h2>
|
||||||
|
|
||||||
|
<p>HTMLArea has reached version 3.0. As of this version, it
|
||||||
|
supports:</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li>Customizable toolbar</li>
|
||||||
|
|
||||||
|
<li>Easy internationalization</li>
|
||||||
|
|
||||||
|
<li>Plugin-based infrastructure</li>
|
||||||
|
|
||||||
|
<li>Delivers W3-compliant HTML (with few exceptions)</li>
|
||||||
|
|
||||||
|
<li>Has a subset of Microsoft Word's keyboard shortcuts</li>
|
||||||
|
|
||||||
|
<li>Full-screen editor</li>
|
||||||
|
|
||||||
|
<li>Advanced table operations (by external plugin
|
||||||
|
"TableOperations")</li>
|
||||||
|
|
||||||
|
<li>Spell checker (by external plugin "SpellChecker")</li>
|
||||||
|
|
||||||
|
<li>probably more... ;-)</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>We have a <a
|
||||||
|
href="http://sourceforge.net/projects/itools-htmlarea/">project page</a>
|
||||||
|
at <a href="http://sourceforge.net">SourceForge.net</a>. There you can
|
||||||
|
also find out <a href="http://sourceforge.net/cvs/?group_id=69750">how
|
||||||
|
to retrieve the code from CVS</a>, or you can <a
|
||||||
|
href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/itools-htmlarea">browse
|
||||||
|
the CVS online</a>. We also have a <a
|
||||||
|
href="http://sourceforge.net/tracker/?atid=525656&group_id=69750&func=browse">bug
|
||||||
|
system</a>, a <a
|
||||||
|
href="http://sourceforge.net/tracker/?atid=525658&group_id=69750&func=browse">patch
|
||||||
|
tracking system</a> and a <a
|
||||||
|
href="http://sourceforge.net/tracker/?atid=525659&group_id=69750&func=browse">feature
|
||||||
|
request page</a>.</p>
|
||||||
|
|
||||||
|
<p>We invite you to say everything you want about HTMLArea <a
|
||||||
|
href="http://www.interactivetools.com/forum/gforum.cgi?forum=14;">on the
|
||||||
|
forums</a> at InteractiveTools.com. There you should also find the
|
||||||
|
latest news.</p>
|
||||||
|
|
||||||
|
<p>Sometimes I post news about the latest developments on <a
|
||||||
|
href="http://students.infoiasi.ro/~mishoo/">my personal homepage</a>.</p>
|
||||||
|
|
||||||
|
<h2>"It doesn't work, what's wrong?"</h2>
|
||||||
|
|
||||||
|
<p>If it doesn't work, you have several options:</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li>Post a message to the forum. Describe your problem in as much
|
||||||
|
detail as possible. Include errors you might find in the JavaScript
|
||||||
|
console (if you are a Mozilla user), or errors displayed by IE (though
|
||||||
|
they're most of the times useless).</li>
|
||||||
|
|
||||||
|
<li>If you're positive that you discovered a bug in HTMLArea then feel
|
||||||
|
free to fill a bug report in our bug system. If you have the time you
|
||||||
|
should check to see if a similar bug was reported or not; it might be
|
||||||
|
fixed already in the CVS ;-) If you're positive that a similar bug was
|
||||||
|
not yet reported, do fill a bug report and please include as much
|
||||||
|
detail as possible, such as your browser, OS, errors from JavaScript
|
||||||
|
console, etc.</li>
|
||||||
|
|
||||||
|
<li>If you want a new feature to be implemented, post it on the
|
||||||
|
features request and someone will hopefully take care of it.</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>You can <a href="mailto:mishoo@infoiasi.ro">contact me directly</a>
|
||||||
|
<em>only</em> if you want to pay me for implementing custom features to
|
||||||
|
HTMLArea. If you want to sponsor these features (that is, allow them to
|
||||||
|
get back into the public HTMLArea distribution) I'll be cheaper. ;-)</p>
|
||||||
|
|
||||||
|
<hr />
|
||||||
|
<address><a href="http://students.infoiasi.ro/~mishoo/">Mihai Bazon</a></address>
|
||||||
|
<!-- Created: Sun Aug 3 14:11:26 EEST 2003 -->
|
||||||
|
<!-- hhmts start -->
|
||||||
|
Last modified on Tue Aug 12 00:23:26 2003
|
||||||
|
<!-- hhmts end -->
|
||||||
|
<!-- doc-lang: English -->
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
|
36
lib/editor/lang/b5.js
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
// I18N constants -- Chinese Big-5
|
||||||
|
// by Dave Lo -- dlo@interactivetools.com
|
||||||
|
HTMLArea.I18N = {
|
||||||
|
|
||||||
|
// the following should be the filename without .js extension
|
||||||
|
// it will be used for automatically load plugin language.
|
||||||
|
lang: "b5",
|
||||||
|
|
||||||
|
tooltips: {
|
||||||
|
bold: "粗體",
|
||||||
|
italic: "斜體",
|
||||||
|
underline: "底線",
|
||||||
|
strikethrough: "刪除線",
|
||||||
|
subscript: "下標",
|
||||||
|
superscript: "上標",
|
||||||
|
justifyleft: "位置靠左",
|
||||||
|
justifycenter: "位置居中",
|
||||||
|
justifyright: "位置靠右",
|
||||||
|
justifyfull: "位置左右平等",
|
||||||
|
orderedlist: "順序清單",
|
||||||
|
unorderedlist: "無序清單",
|
||||||
|
outdent: "減小行前空白",
|
||||||
|
indent: "加寬行前空白",
|
||||||
|
forecolor: "文字顏色",
|
||||||
|
backcolor: "背景顏色",
|
||||||
|
horizontalrule: "水平線",
|
||||||
|
createlink: "插入連結",
|
||||||
|
insertimage: "插入圖形",
|
||||||
|
inserttable: "插入表格",
|
||||||
|
htmlmode: "切換HTML原始碼",
|
||||||
|
popupeditor: "放大",
|
||||||
|
about: "關於 HTMLArea",
|
||||||
|
help: "說明",
|
||||||
|
textindicator: "字體例子"
|
||||||
|
}
|
||||||
|
};
|
38
lib/editor/lang/da.js
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
// danish version for htmlArea v3.0 - Alpha Release
|
||||||
|
// - translated by rene<rene@laerke.net>
|
||||||
|
// term´s and licenses are equal to htmlarea!
|
||||||
|
|
||||||
|
HTMLArea.I18N = {
|
||||||
|
|
||||||
|
// the following should be the filename without .js extension
|
||||||
|
// it will be used for automatically load plugin language.
|
||||||
|
lang: "da",
|
||||||
|
|
||||||
|
tooltips: {
|
||||||
|
bold: "Fed",
|
||||||
|
italic: "Kursiv",
|
||||||
|
underline: "Understregning",
|
||||||
|
strikethrough: "Overstregning ",
|
||||||
|
subscript: "Sænket skrift",
|
||||||
|
superscript: "Hævet skrift",
|
||||||
|
justifyleft: "Venstrejuster",
|
||||||
|
justifycenter: "Centrer",
|
||||||
|
justifyright: "Højrejuster",
|
||||||
|
justifyfull: "Lige margener",
|
||||||
|
orderedlist: "Opstilling med tal",
|
||||||
|
unorderedlist: "Opstilling med punkttegn",
|
||||||
|
outdent: "Formindsk indrykning",
|
||||||
|
indent: "Forøg indrykning",
|
||||||
|
forecolor: "Skriftfarve",
|
||||||
|
backcolor: "Baggrundsfarve",
|
||||||
|
horizontalrule: "Horisontal linie",
|
||||||
|
createlink: "Indsæt hyperlink",
|
||||||
|
insertimage: "Indsæt billede",
|
||||||
|
inserttable: "Indsæt tabel",
|
||||||
|
htmlmode: "HTML visning",
|
||||||
|
popupeditor: "Vis editor i popup",
|
||||||
|
about: "Om htmlarea",
|
||||||
|
help: "Hjælp",
|
||||||
|
textindicator: "Anvendt stil"
|
||||||
|
}
|
||||||
|
};
|
38
lib/editor/lang/de.js
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
// german version for htmlArea v3.0 - Alpha Release
|
||||||
|
// - translated by AtK<atk@chello.at>
|
||||||
|
// term´s and licenses are equal to htmlarea!
|
||||||
|
|
||||||
|
HTMLArea.I18N = {
|
||||||
|
|
||||||
|
// the following should be the filename without .js extension
|
||||||
|
// it will be used for automatically load plugin language.
|
||||||
|
lang: "de",
|
||||||
|
|
||||||
|
tooltips: {
|
||||||
|
bold: "Fett",
|
||||||
|
italic: "Kursiv",
|
||||||
|
underline: "Unterstrichen",
|
||||||
|
strikethrough: "Durchgestrichen",
|
||||||
|
subscript: "hochgestellt",
|
||||||
|
superscript: "tiefgestellt",
|
||||||
|
justifyleft: "Links ausrichten",
|
||||||
|
justifycenter: "Zentrieren",
|
||||||
|
justifyright: "Rechts ausrichten",
|
||||||
|
justifyfull: "Blocksatz",
|
||||||
|
orderedlist: "Nummerierung",
|
||||||
|
unorderedlist: "Aufzählungszeichen",
|
||||||
|
outdent: "Einzug verkleinern",
|
||||||
|
indent: "Einzug vergrössern",
|
||||||
|
forecolor: "Text Farbe",
|
||||||
|
backcolor: "Hintergrund Farbe",
|
||||||
|
horizontalrule: "Horizontale Linie",
|
||||||
|
createlink: "Hyperlink einfügen",
|
||||||
|
insertimage: "Bild einfügen",
|
||||||
|
inserttable: "Tabelle einfügen",
|
||||||
|
htmlmode: "HTML Modus",
|
||||||
|
popupeditor: "Editor im Popup öffnen",
|
||||||
|
about: "Über htmlarea",
|
||||||
|
help: "Hilfe",
|
||||||
|
textindicator: "derzeitiger Stil"
|
||||||
|
}
|
||||||
|
};
|
63
lib/editor/lang/en.js
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
// 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."
|
||||||
|
}
|
||||||
|
};
|
69
lib/editor/lang/en.php
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
// 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.)
|
||||||
|
<?php
|
||||||
|
include("../../../config.php");
|
||||||
|
|
||||||
|
?>
|
||||||
|
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(get_string("bold","htmlarea"));?>",
|
||||||
|
italic: "<?php print(get_string("italic","htmlarea"));?>",
|
||||||
|
underline: "<?php print(get_string("underline","htmlarea"));?>",
|
||||||
|
strikethrough: "<?php print(get_string("strikethrough","htmlarea"));?>",
|
||||||
|
subscript: "<?php print(get_string("subscript","htmlarea"));?>",
|
||||||
|
superscript: "<?php print(get_string("superscript","htmlarea"));?>",
|
||||||
|
justifyleft: "<?php print(get_string("justifyleft","htmlarea"));?>",
|
||||||
|
justifycenter: "<?php print(get_string("justifycenter","htmlarea"));?>",
|
||||||
|
justifyright: "<?php print(get_string("justifyright","htmlarea"));?>",
|
||||||
|
justifyfull: "<?php print(get_string("justifyfull","htmlarea"));?>",
|
||||||
|
insertorderedlist: "<?php print(get_string("orderedlist","htmlarea"));?>",
|
||||||
|
insertunorderedlist: "<?php print(get_string("unorderedlist","htmlarea"));?>",
|
||||||
|
outdent: "<?php print(get_string("outdent","htmlarea"));?>",
|
||||||
|
indent: "<?php print(get_string("indent","htmlarea"));?>",
|
||||||
|
forecolor: "<?php print(get_string("forecolor","htmlarea"));?>",
|
||||||
|
hilitecolor: "<?php print(get_string("hilitecolor","htmlarea"));?>",
|
||||||
|
inserthorizontalrule: "<?php print(get_string("horizontalrule","htmlarea"));?>",
|
||||||
|
createlink: "<?php print(get_string("createlink","htmlarea"));?>",
|
||||||
|
insertimage: "<?php print(get_string("insertimage","htmlarea"));?>",
|
||||||
|
inserttable: "<?php print(get_string("inserttable","htmlarea"));?>",
|
||||||
|
htmlmode: "<?php print(get_string("htmlmode","htmlarea"));?>",
|
||||||
|
popupeditor: "<?php print(get_string("popupeditor","htmlarea"));?>",
|
||||||
|
about: "<?php print(get_string("about","htmlarea"));?>",
|
||||||
|
showhelp: "<?php print(get_string("showhelp","htmlarea"));?>",
|
||||||
|
textindicator: "<?php print(get_string("textindicator","htmlarea"));?>",
|
||||||
|
undo: "<?php print(get_string("undo","htmlarea"));?>",
|
||||||
|
redo: "<?php print(get_string("redo","htmlarea"));?>",
|
||||||
|
cut: "<?php print(get_string("cut","htmlarea"));?>",
|
||||||
|
copy: "<?php print(get_string("copy","htmlarea"));?>",
|
||||||
|
paste: "<?php print(get_string("paste","htmlarea"));?>",
|
||||||
|
insertsmile: "<?php print(get_string("insertsmile","htmlarea"));?>",
|
||||||
|
insertchar: "<?php print(get_string("insertchar","htmlarea"));?>"
|
||||||
|
},
|
||||||
|
|
||||||
|
buttons: {
|
||||||
|
"ok": "<?php print(get_string("ok","htmlarea"));?>",
|
||||||
|
"cancel": "<?php print(get_string("cancel","htmlarea"));?>",
|
||||||
|
"browse": "<?php print(get_string("browse","htmlarea"));?>"
|
||||||
|
},
|
||||||
|
|
||||||
|
msg: {
|
||||||
|
"Path": "<?php print(get_string("Path","htmlarea"));?>",
|
||||||
|
"TEXT_MODE": "<?php print(get_string("TEXT_MODE","htmlarea"));?>"
|
||||||
|
}
|
||||||
|
};
|
36
lib/editor/lang/es.js
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
// I18N constants
|
||||||
|
|
||||||
|
HTMLArea.I18N = {
|
||||||
|
|
||||||
|
// the following should be the filename without .js extension
|
||||||
|
// it will be used for automatically load plugin language.
|
||||||
|
lang: "es",
|
||||||
|
|
||||||
|
tooltips: {
|
||||||
|
bold: "Negritas",
|
||||||
|
italic: "Cursiva",
|
||||||
|
underline: "Subrayado",
|
||||||
|
strikethrough: "Texto Cruzado",
|
||||||
|
subscript: "Subscript",
|
||||||
|
superscript: "Superscript",
|
||||||
|
justifyleft: "Alinear a la Izquierda",
|
||||||
|
justifycenter: "Centrar",
|
||||||
|
justifyright: "Alinear a la Derecha",
|
||||||
|
justifyfull: "Justificar",
|
||||||
|
orderedlist: "Lista Ordenada",
|
||||||
|
unorderedlist: "Lista No Ordenada",
|
||||||
|
outdent: "Aumentar Sangría",
|
||||||
|
indent: "Disminuir Sangría",
|
||||||
|
forecolor: "Color del Texto",
|
||||||
|
backcolor: "Color del Fondo",
|
||||||
|
horizontalrule: "Línea Horizontal",
|
||||||
|
createlink: "Insertar Enlace",
|
||||||
|
insertimage: "Insertar Imagen",
|
||||||
|
inserttable: "Insertar Tabla",
|
||||||
|
htmlmode: "Ver Documento en HTML",
|
||||||
|
popupeditor: "Ampliar Editor",
|
||||||
|
about: "Acerca del Editor",
|
||||||
|
help: "Ayuda",
|
||||||
|
textindicator: "Estilo Actual"
|
||||||
|
}
|
||||||
|
};
|
63
lib/editor/lang/fi.js
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
// 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: "fi",
|
||||||
|
|
||||||
|
tooltips: {
|
||||||
|
bold: "Lihavointi",
|
||||||
|
italic: "Kursivointi",
|
||||||
|
underline: "Alleviivaus",
|
||||||
|
strikethrough: "Päälleviivaus",
|
||||||
|
subscript: "Alaindeksi",
|
||||||
|
superscript: "Yläindeksi",
|
||||||
|
justifyleft: "Tasaa vasemmat reunat",
|
||||||
|
justifycenter: "Keskitä",
|
||||||
|
justifyright: "Tasaa oikeat reunat",
|
||||||
|
justifyfull: "Tasaa molemmat reunat",
|
||||||
|
orderedlist: "Numerointi",
|
||||||
|
unorderedlist: "Luettelomerkit",
|
||||||
|
outdent: "Lisää sisennystä",
|
||||||
|
indent: "Vähennä sisennystä",
|
||||||
|
forecolor: "Tekstin väri",
|
||||||
|
hilitecolor: "Taustan väri",
|
||||||
|
horizontalrule: "Vaakaviiva",
|
||||||
|
createlink: "Lisää linkki",
|
||||||
|
insertimage: "Lisää kuva",
|
||||||
|
inserttable: "Lisää taulukko",
|
||||||
|
htmlmode: "Näytä HTML koodi",
|
||||||
|
popupeditor: "Suurenna editori",
|
||||||
|
about: "Tietoja editorista",
|
||||||
|
showhelp: "Ohje",
|
||||||
|
textindicator: "Nykyinen tyyli",
|
||||||
|
undo: "Peruuta viimeinen toiminto",
|
||||||
|
redo: "Palauta viimeinen toiminto",
|
||||||
|
cut: "Leikkaa",
|
||||||
|
copy: "Kopioi",
|
||||||
|
paste: "Liitä"
|
||||||
|
},
|
||||||
|
|
||||||
|
buttons: {
|
||||||
|
"ok": "OK",
|
||||||
|
"cancel": "Peruuta",
|
||||||
|
},
|
||||||
|
|
||||||
|
msg: {
|
||||||
|
"Path": "Polku",
|
||||||
|
"TEXT_MODE": "Olet tekstitilassa. Käytä [<>] painiketta palataksesi WYSIWIG -tilaan."
|
||||||
|
}
|
||||||
|
};
|
36
lib/editor/lang/fr.js
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
// I18N constants
|
||||||
|
|
||||||
|
HTMLArea.I18N = {
|
||||||
|
|
||||||
|
// the following should be the filename without .js extension
|
||||||
|
// it will be used for automatically load plugin language.
|
||||||
|
lang: "fr",
|
||||||
|
|
||||||
|
tooltips: {
|
||||||
|
bold: "Gras",
|
||||||
|
italic: "Italique",
|
||||||
|
underline: "Souligné",
|
||||||
|
strikethrough: "Barré",
|
||||||
|
subscript: "Subscript",
|
||||||
|
superscript: "Superscript",
|
||||||
|
justifyleft: "Aligné à gauche",
|
||||||
|
justifycenter: "Centré",
|
||||||
|
justifyright: "Aligné à droite",
|
||||||
|
justifyfull: "Justifié",
|
||||||
|
orderedlist: "Numérotation",
|
||||||
|
unorderedlist: "Puces",
|
||||||
|
outdent: "Augmenter le retrait",
|
||||||
|
indent: "Diminuer le retrait",
|
||||||
|
forecolor: "Couleur du texte",
|
||||||
|
backcolor: "Couleur du fond",
|
||||||
|
horizontalrule: "Ligne horizontale",
|
||||||
|
createlink: "Insérer un lien",
|
||||||
|
insertimage: "Insérer une image",
|
||||||
|
inserttable: "Insérer un tableau",
|
||||||
|
htmlmode: "Passer au code source HTML",
|
||||||
|
popupeditor: "Agrandir l'éditeur",
|
||||||
|
about: "A propos de cet éditeur",
|
||||||
|
help: "Aide sur l'éditeur",
|
||||||
|
textindicator: "Style courant"
|
||||||
|
}
|
||||||
|
};
|
36
lib/editor/lang/gb.js
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
// I18N constants -- Chinese GB
|
||||||
|
// by Dave Lo -- dlo@interactivetools.com
|
||||||
|
HTMLArea.I18N = {
|
||||||
|
|
||||||
|
// the following should be the filename without .js extension
|
||||||
|
// it will be used for automatically load plugin language.
|
||||||
|
lang: "gb",
|
||||||
|
|
||||||
|
tooltips: {
|
||||||
|
bold: "粗体",
|
||||||
|
italic: "斜体",
|
||||||
|
underline: "底线",
|
||||||
|
strikethrough: "删除线",
|
||||||
|
subscript: "下标",
|
||||||
|
superscript: "上标",
|
||||||
|
justifyleft: "位置靠左",
|
||||||
|
justifycenter: "位置居中",
|
||||||
|
justifyright: "位置靠右",
|
||||||
|
justifyfull: "位置左右平等",
|
||||||
|
orderedlist: "顺序清单",
|
||||||
|
unorderedlist: "无序清单",
|
||||||
|
outdent: "减小行前空白",
|
||||||
|
indent: "加宽行前空白",
|
||||||
|
forecolor: "文字颜色",
|
||||||
|
backcolor: "背景颜色",
|
||||||
|
horizontalrule: "水平线",
|
||||||
|
createlink: "插入连结",
|
||||||
|
insertimage: "插入图形",
|
||||||
|
inserttable: "插入表格",
|
||||||
|
htmlmode: "切换HTML原始码",
|
||||||
|
popupeditor: "放大",
|
||||||
|
about: "关於 HTMLArea",
|
||||||
|
help: "说明",
|
||||||
|
textindicator: "字体例子"
|
||||||
|
}
|
||||||
|
};
|
36
lib/editor/lang/it.js
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
// I18N constants
|
||||||
|
|
||||||
|
HTMLArea.I18N = {
|
||||||
|
|
||||||
|
// the following should be the filename without .js extension
|
||||||
|
// it will be used for automatically load plugin language.
|
||||||
|
lang: "it",
|
||||||
|
|
||||||
|
tooltips: {
|
||||||
|
bold: "Grassetto",
|
||||||
|
italic: "Corsivo",
|
||||||
|
underline: "Sottolineato",
|
||||||
|
strikethrough: "Barrato",
|
||||||
|
subscript: "Pedice",
|
||||||
|
superscript: "Apice",
|
||||||
|
justifyleft: "Allinea a sinistra",
|
||||||
|
justifycenter: "Centra",
|
||||||
|
justifyright: "Allinea a destra",
|
||||||
|
justifyfull: "Giustifica",
|
||||||
|
orderedlist: "Elenco numerato",
|
||||||
|
unorderedlist: "Elenco puntato",
|
||||||
|
outdent: "Riduci rientro",
|
||||||
|
indent: "Aumenta rientro",
|
||||||
|
forecolor: "Colore carattere",
|
||||||
|
backcolor: "Colore di sfondo",
|
||||||
|
horizontalrule: "Linea orizzontale",
|
||||||
|
createlink: "Inserisci collegamento ipertestuale",
|
||||||
|
insertimage: "Inserisci immagine",
|
||||||
|
inserttable: "Inserisci tabella",
|
||||||
|
htmlmode: "Passa alla visualizzazione HTML",
|
||||||
|
popupeditor: "Ingrandisci editor",
|
||||||
|
about: "Info",
|
||||||
|
help: "Aiuto",
|
||||||
|
textindicator: "Stile utilizzato"
|
||||||
|
}
|
||||||
|
};
|
37
lib/editor/lang/ja-euc.js
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
// I18N constants -- Japanese EUC
|
||||||
|
// by Manabu Onoue -- tmocsys@tmocsys.com
|
||||||
|
|
||||||
|
HTMLArea.I18N = {
|
||||||
|
|
||||||
|
// the following should be the filename without .js extension
|
||||||
|
// it will be used for automatically load plugin language.
|
||||||
|
lang: "ja-euc",
|
||||||
|
|
||||||
|
tooltips: {
|
||||||
|
bold: "太字",
|
||||||
|
italic: "斜体",
|
||||||
|
underline: "下線",
|
||||||
|
strikethrough: "打ち消し線",
|
||||||
|
subscript: "下付き添え字",
|
||||||
|
superscript: "上付き添え字",
|
||||||
|
justifyleft: "左寄せ",
|
||||||
|
justifycenter: "中央寄せ",
|
||||||
|
justifyright: "右寄せ",
|
||||||
|
justifyfull: "均等割付",
|
||||||
|
orderedlist: "番号付き箇条書き",
|
||||||
|
unorderedlist: "記号付き箇条書き",
|
||||||
|
outdent: "インデント解除",
|
||||||
|
indent: "インデント設定",
|
||||||
|
forecolor: "文字色",
|
||||||
|
backcolor: "背景色",
|
||||||
|
horizontalrule: "水平線",
|
||||||
|
createlink: "リンク作成",
|
||||||
|
insertimage: "画像挿入",
|
||||||
|
inserttable: "テーブル挿入",
|
||||||
|
htmlmode: "HTML表示切替",
|
||||||
|
popupeditor: "エディタ拡大",
|
||||||
|
about: "バージョン情報",
|
||||||
|
help: "ヘルプ",
|
||||||
|
textindicator: "現在のスタイル"
|
||||||
|
}
|
||||||
|
};
|
37
lib/editor/lang/ja-jis.js
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
// I18N constants -- Japanese JIS
|
||||||
|
// by Manabu Onoue -- tmocsys@tmocsys.com
|
||||||
|
|
||||||
|
HTMLArea.I18N = {
|
||||||
|
|
||||||
|
// the following should be the filename without .js extension
|
||||||
|
// it will be used for automatically load plugin language.
|
||||||
|
lang: "ja-jis",
|
||||||
|
|
||||||
|
tooltips: {
|
||||||
|
bold: "$BB@;z(B",
|
||||||
|
italic: "$B<PBN(B",
|
||||||
|
underline: "$B2<@~(B",
|
||||||
|
strikethrough: "$BBG$A>C$7@~(B",
|
||||||
|
subscript: "$B2<IU$-E:$(;z(B",
|
||||||
|
superscript: "$B>eIU$-E:$(;z(B",
|
||||||
|
justifyleft: "$B:84s$;(B",
|
||||||
|
justifycenter: "$BCf1{4s$;(B",
|
||||||
|
justifyright: "$B1&4s$;(B",
|
||||||
|
justifyfull: "$B6QEy3dIU(B",
|
||||||
|
orderedlist: "$BHV9fIU$-2U>r=q$-(B",
|
||||||
|
unorderedlist: "$B5-9fIU$-2U>r=q$-(B",
|
||||||
|
outdent: "$B%$%s%G%s%H2r=|(B",
|
||||||
|
indent: "$B%$%s%G%s%H@_Dj(B",
|
||||||
|
forecolor: "$BJ8;z?'(B",
|
||||||
|
backcolor: "$BGX7J?'(B",
|
||||||
|
horizontalrule: "$B?eJ?@~(B",
|
||||||
|
createlink: "$B%j%s%/:n@.(B",
|
||||||
|
insertimage: "$B2hA|A^F~(B",
|
||||||
|
inserttable: "$B%F!<%V%kA^F~(B",
|
||||||
|
htmlmode: "HTML$BI=<(@ZBX(B",
|
||||||
|
popupeditor: "$B%(%G%#%?3HBg(B",
|
||||||
|
about: "$B%P!<%8%g%s>pJs(B",
|
||||||
|
help: "$B%X%k%W(B",
|
||||||
|
textindicator: "$B8=:_$N%9%?%$%k(B"
|
||||||
|
}
|
||||||
|
};
|
37
lib/editor/lang/ja-sjis.js
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
// I18N constants -- Japanese Shift-JIS
|
||||||
|
// by Manabu Onoue -- tmocsys@tmocsys.com
|
||||||
|
|
||||||
|
HTMLArea.I18N = {
|
||||||
|
|
||||||
|
// the following should be the filename without .js extension
|
||||||
|
// it will be used for automatically load plugin language.
|
||||||
|
lang: "ja-sjis",
|
||||||
|
|
||||||
|
tooltips: {
|
||||||
|
bold: "太字",
|
||||||
|
italic: "斜体",
|
||||||
|
underline: "下線",
|
||||||
|
strikethrough: "打ち消し線",
|
||||||
|
subscript: "下付き添え字",
|
||||||
|
superscript: "上付き添え字",
|
||||||
|
justifyleft: "左寄せ",
|
||||||
|
justifycenter: "中央寄せ",
|
||||||
|
justifyright: "右寄せ",
|
||||||
|
justifyfull: "均等割付",
|
||||||
|
orderedlist: "番号付き箇条書き",
|
||||||
|
unorderedlist: "記号付き箇条書き",
|
||||||
|
outdent: "インデント解除",
|
||||||
|
indent: "インデント設定",
|
||||||
|
forecolor: "文字色",
|
||||||
|
backcolor: "背景色",
|
||||||
|
horizontalrule: "水平線",
|
||||||
|
createlink: "リンク作成",
|
||||||
|
insertimage: "画像挿入",
|
||||||
|
inserttable: "テーブル挿入",
|
||||||
|
htmlmode: "HTML表示切替",
|
||||||
|
popupeditor: "エディタ拡大",
|
||||||
|
about: "バージョン情報",
|
||||||
|
help: "ヘルプ",
|
||||||
|
textindicator: "現在のスタイル"
|
||||||
|
}
|
||||||
|
};
|
37
lib/editor/lang/ja-utf8.js
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
// I18N constants -- Japanese UTF-8
|
||||||
|
// by Manabu Onoue -- tmocsys@tmocsys.com
|
||||||
|
|
||||||
|
HTMLArea.I18N = {
|
||||||
|
|
||||||
|
// the following should be the filename without .js extension
|
||||||
|
// it will be used for automatically load plugin language.
|
||||||
|
lang: "ja-utf8",
|
||||||
|
|
||||||
|
tooltips: {
|
||||||
|
bold: "太字",
|
||||||
|
italic: "斜体",
|
||||||
|
underline: "下線",
|
||||||
|
strikethrough: "打ち消し線",
|
||||||
|
subscript: "下付き添え字",
|
||||||
|
superscript: "上付き添え字",
|
||||||
|
justifyleft: "左寄せ",
|
||||||
|
justifycenter: "中央寄せ",
|
||||||
|
justifyright: "右寄せ",
|
||||||
|
justifyfull: "均等割付",
|
||||||
|
orderedlist: "番号付き箇条書き",
|
||||||
|
unorderedlist: "記号付き箇条書き",
|
||||||
|
outdent: "インデント解除",
|
||||||
|
indent: "インデント設定",
|
||||||
|
forecolor: "文字色",
|
||||||
|
backcolor: "背景色",
|
||||||
|
horizontalrule: "水平線",
|
||||||
|
createlink: "リンク作成",
|
||||||
|
insertimage: "画像挿入",
|
||||||
|
inserttable: "テーブル挿入",
|
||||||
|
htmlmode: "HTML表示切替",
|
||||||
|
popupeditor: "エディタ拡大",
|
||||||
|
about: "バージョン情報",
|
||||||
|
help: "ヘルプ",
|
||||||
|
textindicator: "現在のスタイル"
|
||||||
|
}
|
||||||
|
};
|
36
lib/editor/lang/nb.js
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
// I18N constants
|
||||||
|
|
||||||
|
HTMLArea.I18N = {
|
||||||
|
|
||||||
|
// the following should be the filename without .js extension
|
||||||
|
// it will be used for automatically load plugin language.
|
||||||
|
lang: "nb",
|
||||||
|
|
||||||
|
tooltips: {
|
||||||
|
bold: "Fet",
|
||||||
|
italic: "Kursiv",
|
||||||
|
underline: "Understreket",
|
||||||
|
strikethrough: "Gjennomstreket",
|
||||||
|
subscript: "Senket",
|
||||||
|
superscript: "Hevet",
|
||||||
|
justifyleft: "Venstrejuster",
|
||||||
|
justifycenter: "Midtjuster",
|
||||||
|
justifyright: "Høyrejuster",
|
||||||
|
justifyfull: "Blokkjuster",
|
||||||
|
orderedlist: "Nummerert liste",
|
||||||
|
unorderedlist: "Punktmerket liste",
|
||||||
|
outdent: "Øke innrykk",
|
||||||
|
indent: "Reduser innrykk",
|
||||||
|
forecolor: "Skriftfarge",
|
||||||
|
backcolor: "Bakgrunnsfarge",
|
||||||
|
horizontalrule: "Horisontal linje",
|
||||||
|
createlink: "Sett inn lenke",
|
||||||
|
insertimage: "Sett inn bilde",
|
||||||
|
inserttable: "Sett inn tabell",
|
||||||
|
htmlmode: "Vis HTML kode",
|
||||||
|
popupeditor: "Forstørr redigeringsvindu",
|
||||||
|
about: "Om..",
|
||||||
|
help: "Hjelp",
|
||||||
|
textindicator: "Gjeldende stil"
|
||||||
|
}
|
||||||
|
};
|
37
lib/editor/lang/nl.js
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
// Dutch version
|
||||||
|
// Author: Wouter Meeus alias Redspider <webmaster@tielt.be>
|
||||||
|
|
||||||
|
HTMLArea.I18N = {
|
||||||
|
|
||||||
|
// the following should be the filename without .js extension
|
||||||
|
// it will be used for automatically load plugin language.
|
||||||
|
lang: "nl",
|
||||||
|
|
||||||
|
tooltips: {
|
||||||
|
bold: "Vet",
|
||||||
|
italic: "Cursief",
|
||||||
|
underline: "Onderlijnen",
|
||||||
|
strikethrough: "Doorstrepen",
|
||||||
|
subscript: "Subscript",
|
||||||
|
superscript: "Superscript",
|
||||||
|
justifyleft: "Links Uitlijnen",
|
||||||
|
justifycenter: "Centreren",
|
||||||
|
justifyright: "Rechts Uitlijnen",
|
||||||
|
justifyfull: "Uitvullen",
|
||||||
|
orderedlist: "Nummering",
|
||||||
|
unorderedlist: "Opsomming",
|
||||||
|
outdent: "Verklein insprong",
|
||||||
|
indent: "Vergroot insprong",
|
||||||
|
forecolor: "Tekst Kleur",
|
||||||
|
backcolor: "Achtergrond Kleur",
|
||||||
|
horizontalrule: "Horizontale lijn",
|
||||||
|
createlink: "Hyperlink invoegen",
|
||||||
|
insertimage: "Afbeelding invoegen",
|
||||||
|
inserttable: "Tabel invoegen",
|
||||||
|
htmlmode: "HTML broncode",
|
||||||
|
popupeditor: "Vergroot Editor",
|
||||||
|
about: "Over deze editor",
|
||||||
|
help: "Help",
|
||||||
|
textindicator: "Huidige stijl"
|
||||||
|
}
|
||||||
|
};
|
51
lib/editor/lang/old_fi.js
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
// I18N constants
|
||||||
|
|
||||||
|
HTMLArea.I18N = {
|
||||||
|
|
||||||
|
// the following should be the filename without .js extension
|
||||||
|
// it will be used for automatically load plugin language.
|
||||||
|
lang: "fi",
|
||||||
|
|
||||||
|
tooltips: {
|
||||||
|
bold: "Lihavoitu",
|
||||||
|
italic: "Kursivoitu",
|
||||||
|
underline: "Alleviivattu",
|
||||||
|
strikethrough: "Yliviivattu",
|
||||||
|
subscript: "Alaindeksi",
|
||||||
|
superscript: "Yläindeksi",
|
||||||
|
justifyleft: "Tasaa vasemmat reunat",
|
||||||
|
justifycenter: "Keskitä",
|
||||||
|
justifyright: "Tasaa oikeat reunat",
|
||||||
|
justifyfull: "Tasaa molemmat reunat",
|
||||||
|
insertorderedlist: "Numerointi",
|
||||||
|
insertunorderedlist: "Luettelomerkit",
|
||||||
|
outdent: "Lisää sisennystä",
|
||||||
|
indent: "Pienennä sisennystä",
|
||||||
|
forecolor: "Fontin väri",
|
||||||
|
hilitecolor: "Taustaväri",
|
||||||
|
inserthorizontalrule: "Vaakaviiva",
|
||||||
|
createlink: "Lisää Linkki",
|
||||||
|
insertimage: "Lisää Kuva",
|
||||||
|
inserttable: "Lisää Taulu",
|
||||||
|
htmlmode: "HTML Lähdekoodi vs WYSIWYG",
|
||||||
|
popupeditor: "Suurenna Editori",
|
||||||
|
about: "Tietoja Editorista",
|
||||||
|
showhelp: "Näytä Ohje",
|
||||||
|
textindicator: "Nykyinen tyyli",
|
||||||
|
undo: "Peruuta viimeinen toiminto",
|
||||||
|
redo: "Palauta viimeinen toiminto",
|
||||||
|
cut: "Leikkaa maalattu",
|
||||||
|
copy: "Kopioi maalattu",
|
||||||
|
paste: "Liitä leikepyödältä"
|
||||||
|
},
|
||||||
|
|
||||||
|
buttons: {
|
||||||
|
"ok": "Hyväksy",
|
||||||
|
"cancel": "Peruuta"
|
||||||
|
},
|
||||||
|
|
||||||
|
msg: {
|
||||||
|
"Path": "Polku",
|
||||||
|
"TEXT_MODE": "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWIG."
|
||||||
|
}
|
||||||
|
};
|
36
lib/editor/lang/pl.js
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
// I18N constants
|
||||||
|
|
||||||
|
HTMLArea.I18N = {
|
||||||
|
|
||||||
|
// the following should be the filename without .js extension
|
||||||
|
// it will be used for automatically load plugin language.
|
||||||
|
lang: "pl",
|
||||||
|
|
||||||
|
tooltips: {
|
||||||
|
bold: "Pogrubienie",
|
||||||
|
italic: "Pochylenie",
|
||||||
|
underline: "Podkreślenie",
|
||||||
|
strikethrough: "Przekreślenie",
|
||||||
|
subscript: "Indeks dolny",
|
||||||
|
superscript: "Indeks górny",
|
||||||
|
justifyleft: "Wyrównaj do lewej",
|
||||||
|
justifycenter: "Wyśrodkuj",
|
||||||
|
justifyright: "Wyrównaj do prawej",
|
||||||
|
justifyfull: "Wyjustuj",
|
||||||
|
orderedlist: "Numerowanie",
|
||||||
|
unorderedlist: "Wypunktowanie",
|
||||||
|
outdent: "Zmniejsz wcięcie",
|
||||||
|
indent: "Zwiększ wcięcie",
|
||||||
|
forecolor: "Kolor czcionki",
|
||||||
|
backcolor: "Kolor tła",
|
||||||
|
horizontalrule: "Linia pozioma",
|
||||||
|
createlink: "Wstaw adres sieci Web",
|
||||||
|
insertimage: "Wstaw obraz",
|
||||||
|
inserttable: "Wstaw tabelę",
|
||||||
|
htmlmode: "Edycja WYSIWYG/w źródle strony",
|
||||||
|
popupeditor: "Pełny ekran",
|
||||||
|
about: "Informacje o tym edytorze",
|
||||||
|
help: "Pomoc",
|
||||||
|
textindicator: "Obecny styl"
|
||||||
|
}
|
||||||
|
};
|
37
lib/editor/lang/pt_br.js
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
// I18N constants
|
||||||
|
// Brazilian Portuguese Translation by Alex Piaz <webmaster@globalmap.com>
|
||||||
|
|
||||||
|
HTMLArea.I18N = {
|
||||||
|
|
||||||
|
// the following should be the filename without .js extension
|
||||||
|
// it will be used for automatically load plugin language.
|
||||||
|
lang: "pt_br",
|
||||||
|
|
||||||
|
tooltips: {
|
||||||
|
bold: "Negrito",
|
||||||
|
italic: "Itálico",
|
||||||
|
underline: "Sublinhado",
|
||||||
|
strikethrough: "Tachado",
|
||||||
|
subscript: "Subescrito",
|
||||||
|
superscript: "Sobrescrito",
|
||||||
|
justifyleft: "Alinhar à Esquerda",
|
||||||
|
justifycenter: "Centralizar",
|
||||||
|
justifyright: "Alinhar à Direita",
|
||||||
|
justifyfull: "Justificar",
|
||||||
|
orderedlist: "Lista Numerada",
|
||||||
|
unorderedlist: "Lista Marcadores",
|
||||||
|
outdent: "Diminuir Indentação",
|
||||||
|
indent: "Aumentar Indentação",
|
||||||
|
forecolor: "Cor da Fonte",
|
||||||
|
backcolor: "Cor do Fundo",
|
||||||
|
horizontalrule: "Linha Horizontal",
|
||||||
|
createlink: "Inserir Link",
|
||||||
|
insertimage: "Inserir Imagem",
|
||||||
|
inserttable: "Inserir Tabela",
|
||||||
|
htmlmode: "Ver Código-Fonte",
|
||||||
|
popupeditor: "Expandir Editor",
|
||||||
|
about: "Sobre",
|
||||||
|
help: "Ajuda",
|
||||||
|
textindicator: "Estilo Atual"
|
||||||
|
}
|
||||||
|
};
|
63
lib/editor/lang/ro.js
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
// 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.)
|
||||||
|
|
||||||
|
HTMLArea.I18N = {
|
||||||
|
|
||||||
|
// the following should be the filename without .js extension
|
||||||
|
// it will be used for automatically load plugin language.
|
||||||
|
lang: "ro",
|
||||||
|
|
||||||
|
tooltips: {
|
||||||
|
bold: "Îngroşat",
|
||||||
|
italic: "Italic",
|
||||||
|
underline: "Subliniat",
|
||||||
|
strikethrough: "Tăiat",
|
||||||
|
subscript: "Subscript",
|
||||||
|
superscript: "Superscript",
|
||||||
|
justifyleft: "Aliniere la stânga",
|
||||||
|
justifycenter: "Aliniere pe centru",
|
||||||
|
justifyright: "Aliniere la dreapta",
|
||||||
|
justifyfull: "Aliniere în ambele părţi",
|
||||||
|
orderedlist: "Listă ordonată",
|
||||||
|
unorderedlist: "Listă marcată",
|
||||||
|
outdent: "Micşorează alineatul",
|
||||||
|
indent: "Măreşte alineatul",
|
||||||
|
forecolor: "Culoarea textului",
|
||||||
|
hilitecolor: "Culoare de fundal",
|
||||||
|
horizontalrule: "Linie orizontală",
|
||||||
|
createlink: "Inserează link",
|
||||||
|
insertimage: "Inserează o imagine",
|
||||||
|
inserttable: "Inserează un tabel",
|
||||||
|
htmlmode: "Sursa HTML / WYSIWYG",
|
||||||
|
popupeditor: "Maximizează editorul",
|
||||||
|
about: "Despre editor",
|
||||||
|
showhelp: "Documentaţie (devel)",
|
||||||
|
textindicator: "Stilul curent",
|
||||||
|
undo: "Anulează ultima acţiune",
|
||||||
|
redo: "Reface ultima acţiune anulată",
|
||||||
|
cut: "Taie în clipboard",
|
||||||
|
copy: "Copie în clipboard",
|
||||||
|
paste: "Aduce din clipboard"
|
||||||
|
},
|
||||||
|
|
||||||
|
buttons: {
|
||||||
|
"ok": "OK",
|
||||||
|
"cancel": "Anulează"
|
||||||
|
},
|
||||||
|
|
||||||
|
msg: {
|
||||||
|
"Path": "Calea",
|
||||||
|
"TEXT_MODE": "Eşti în modul TEXT. Apasă butonul [<>] pentru a te întoarce în modul WYSIWYG."
|
||||||
|
}
|
||||||
|
};
|
36
lib/editor/lang/ru.js
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
// I18N constants
|
||||||
|
|
||||||
|
HTMLArea.I18N = {
|
||||||
|
|
||||||
|
// the following should be the filename without .js extension
|
||||||
|
// it will be used for automatically load plugin language.
|
||||||
|
lang: "ru",
|
||||||
|
|
||||||
|
tooltips: {
|
||||||
|
bold: "Жирный",
|
||||||
|
italic: "Наклонный",
|
||||||
|
underline: "Подчеркнутый",
|
||||||
|
strikethrough: "Перечеркнутый",
|
||||||
|
subscript: "Нижний индекс",
|
||||||
|
superscript: "Верхний индекс",
|
||||||
|
justifyleft: "Выравнивание по левому краю",
|
||||||
|
justifycenter: "Выравнивание по центру",
|
||||||
|
justifyright: "Выравнивание по правому краю",
|
||||||
|
justifyfull: "Растянутый текст",
|
||||||
|
orderedlist: "Нумерованный список",
|
||||||
|
unorderedlist: "Маркированный список",
|
||||||
|
outdent: "Сдвиг в лево",
|
||||||
|
indent: "Сдвиг в право",
|
||||||
|
forecolor: "Цвет шрифта",
|
||||||
|
backcolor: "Цвет фона",
|
||||||
|
horizontalrule: "Горизонтальная линия",
|
||||||
|
createlink: "Вставить ссылку",
|
||||||
|
insertimage: "Вставить картинку",
|
||||||
|
inserttable: "Вставить таблицу",
|
||||||
|
htmlmode: "Видеть HTML код",
|
||||||
|
popupeditor: "Увеличить редактор",
|
||||||
|
about: "О редакторе",
|
||||||
|
help: "Помощь в использовании",
|
||||||
|
textindicator: "Данный стиль"
|
||||||
|
}
|
||||||
|
};
|
38
lib/editor/lang/se.js
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
// Swedish version for htmlArea v3.0 - Alpha Release
|
||||||
|
// - translated by pat<pat@engvall.nu>
|
||||||
|
// term´s and licenses are equal to htmlarea!
|
||||||
|
|
||||||
|
HTMLArea.I18N = {
|
||||||
|
|
||||||
|
// the following should be the filename without .js extension
|
||||||
|
// it will be used for automatically load plugin language.
|
||||||
|
lang: "se",
|
||||||
|
|
||||||
|
tooltips: {
|
||||||
|
bold: "Fet",
|
||||||
|
italic: "Kursiv",
|
||||||
|
underline: "Understruken",
|
||||||
|
strikethrough: "Genomstruken",
|
||||||
|
subscript: "Nedsänkt",
|
||||||
|
superscript: "Upphöjd",
|
||||||
|
justifyleft: "Vänsterjustera",
|
||||||
|
justifycenter: "Centrera",
|
||||||
|
justifyright: "Högerjustera",
|
||||||
|
justifyfull: "Marginaljustera",
|
||||||
|
orderedlist: "Numrerad lista",
|
||||||
|
unorderedlist: "Punktlista",
|
||||||
|
outdent: "Minska indrag",
|
||||||
|
indent: "Öka indrag",
|
||||||
|
forecolor: "Textfärg",
|
||||||
|
backcolor: "Bakgrundsfärg",
|
||||||
|
horizontalrule: "Vågrät linje",
|
||||||
|
createlink: "Infoga länk",
|
||||||
|
insertimage: "Infoga bild",
|
||||||
|
inserttable: "Infoga tabell",
|
||||||
|
htmlmode: "Visa källkod",
|
||||||
|
popupeditor: "Visa i eget fönster",
|
||||||
|
about: "Om denna editor",
|
||||||
|
help: "Hjälp",
|
||||||
|
textindicator: "Nuvarande stil"
|
||||||
|
}
|
||||||
|
};
|
38
lib/editor/lang/vn.js
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
// I18N constants : Vietnamese
|
||||||
|
// mviet: download the free Vietnamese script addon for htmlArea at: www.mviet.org
|
||||||
|
// email: mviet@socal.rr.com
|
||||||
|
|
||||||
|
HTMLArea.I18N = {
|
||||||
|
|
||||||
|
// the following should be the filename without .js extension
|
||||||
|
// it will be used for automatically load plugin language.
|
||||||
|
lang: "vn",
|
||||||
|
|
||||||
|
tooltips: {
|
||||||
|
bold: "Đậm",
|
||||||
|
italic: "Nghiêng",
|
||||||
|
underline: "Gạch Đít",
|
||||||
|
strikethrough: "Gạch Xóa",
|
||||||
|
subscript: "Viết Xuống Dưới",
|
||||||
|
superscript: "Viết Lên Trên ",
|
||||||
|
justifyleft: "Ngay Hàng Bên Trái ",
|
||||||
|
justifycenter: "Ngay Hàng Giữa",
|
||||||
|
justifyright: "Ngay Hàng Lên Phải",
|
||||||
|
justifyfull: "Ngay Hàng Trái & Phải",
|
||||||
|
orderedlist: "Chuỗi Thứ Tự 123",
|
||||||
|
unorderedlist: "Chuỗi Nút",
|
||||||
|
outdent: "Giảm Vào Hàng",
|
||||||
|
indent: "Tăng Vào Hàng",
|
||||||
|
forecolor: "Màu Chữ",
|
||||||
|
backcolor: "Màu Nền",
|
||||||
|
horizontalrule: "Thước Ngang",
|
||||||
|
createlink: "Tạo Nối",
|
||||||
|
insertimage: "Mang Hình Vô",
|
||||||
|
inserttable: "Mang Khuôn Vô",
|
||||||
|
htmlmode: "Bật / Tắt Nguồn HTML",
|
||||||
|
popupeditor: "Póp Lớn Khung Viết",
|
||||||
|
about: "Nói Về Chương Trình",
|
||||||
|
help: "Giúp Đỡ",
|
||||||
|
textindicator: "Loại Kiểu Viết"
|
||||||
|
}
|
||||||
|
};
|
13
lib/editor/license.txt
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
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.
|
72
lib/editor/old_dialog.js
Normal file
|
@ -0,0 +1,72 @@
|
||||||
|
// 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
|
||||||
|
}
|
||||||
|
if (document.all) { // here we hope that Mozilla will never support document.all
|
||||||
|
var value =
|
||||||
|
showModalDialog(url, init,
|
||||||
|
//window.open(url, '_blank',
|
||||||
|
"resizable: no; help: no; status: no; scroll: no");
|
||||||
|
if (action) {
|
||||||
|
action(value);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return Dialog._geckoOpenModal(url, action, init);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Dialog._parentEvent = function(ev) {
|
||||||
|
if (Dialog._modal && !Dialog._modal.closed) {
|
||||||
|
//Dialog._modal.focus();
|
||||||
|
// we get here in Mozilla only, anyway, so we can safely use
|
||||||
|
// the DOM version.
|
||||||
|
ev.preventDefault();
|
||||||
|
ev.stopPropagation();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 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 dlg = window.open(url, "ha_dialog",
|
||||||
|
"toolbar=no,menubar=no,personalbar=no,width=10,height=10," +
|
||||||
|
"scrollbars=no,resizable=no");
|
||||||
|
Dialog._modal = dlg;
|
||||||
|
Dialog._arguments = init;
|
||||||
|
|
||||||
|
// capture some window's events
|
||||||
|
function capwin(w) {
|
||||||
|
w.addEventListener("click", Dialog._parentEvent, true);
|
||||||
|
w.addEventListener("mousedown", Dialog._parentEvent, true);
|
||||||
|
w.addEventListener("focus", Dialog._parentEvent, true);
|
||||||
|
};
|
||||||
|
// release the captured events
|
||||||
|
function relwin(w) {
|
||||||
|
w.removeEventListener("focus", Dialog._parentEvent, true);
|
||||||
|
w.removeEventListener("mousedown", Dialog._parentEvent, true);
|
||||||
|
w.removeEventListener("click", Dialog._parentEvent, true);
|
||||||
|
};
|
||||||
|
capwin(window);
|
||||||
|
// capture other frames
|
||||||
|
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) {
|
||||||
|
if (val && action) {
|
||||||
|
action(val);
|
||||||
|
}
|
||||||
|
relwin(window);
|
||||||
|
// capture other frames
|
||||||
|
for (var i = 0; i < window.frames.length; relwin(window.frames[i++]));
|
||||||
|
Dialog._modal = null;
|
||||||
|
};
|
||||||
|
};
|
1839
lib/editor/old_htmlarea.js
Normal file
1697
lib/editor/old_htmlarea.php
Normal file
BIN
lib/editor/plugins/SpellChecker/img/spell-check.gif
Normal file
After Width: | Height: | Size: 107 B |
37
lib/editor/plugins/SpellChecker/lang/en.js
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
// 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 ;-)"
|
||||||
|
};
|
37
lib/editor/plugins/SpellChecker/lang/ro.js
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
// 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 ;-)"
|
||||||
|
};
|
115
lib/editor/plugins/SpellChecker/readme-tech.html
Normal file
|
@ -0,0 +1,115 @@
|
||||||
|
<!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 — the spell checker plugin interface for
|
||||||
|
HTMLArea</li>
|
||||||
|
|
||||||
|
<li>spell-checker-ui.html — the HTML code for the user
|
||||||
|
interface</li>
|
||||||
|
|
||||||
|
<li>spell-checker-ui.js — functionality of the user
|
||||||
|
interface</li>
|
||||||
|
|
||||||
|
<li>spell-checker-logic.cgi — Perl CGI script that checks a text
|
||||||
|
given through POST for spelling errors</li>
|
||||||
|
|
||||||
|
<li>spell-checker-style.css — style for mispelled words</li>
|
||||||
|
|
||||||
|
<li>lang/en.js — 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> — 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>
|
155
lib/editor/plugins/SpellChecker/spell-check-logic.cgi
Normal file
|
@ -0,0 +1,155 @@
|
||||||
|
#! /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;
|
||||||
|
}
|
10
lib/editor/plugins/SpellChecker/spell-check-style.css
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
.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; }
|
119
lib/editor/plugins/SpellChecker/spell-check-ui.html
Normal file
|
@ -0,0 +1,119 @@
|
||||||
|
<!--
|
||||||
|
|
||||||
|
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>
|
334
lib/editor/plugins/SpellChecker/spell-check-ui.js
Normal file
|
@ -0,0 +1,334 @@
|
||||||
|
// 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 fucks 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
72
lib/editor/plugins/SpellChecker/spell-checker.js
Normal file
|
@ -0,0 +1,72 @@
|
||||||
|
// 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;
|
BIN
lib/editor/plugins/TableOperations/img/cell-delete.gif
Normal file
After Width: | Height: | Size: 101 B |
BIN
lib/editor/plugins/TableOperations/img/cell-insert-after.gif
Normal file
After Width: | Height: | Size: 118 B |
BIN
lib/editor/plugins/TableOperations/img/cell-insert-before.gif
Normal file
After Width: | Height: | Size: 118 B |
BIN
lib/editor/plugins/TableOperations/img/cell-merge.gif
Normal file
After Width: | Height: | Size: 896 B |
BIN
lib/editor/plugins/TableOperations/img/cell-prop.gif
Normal file
After Width: | Height: | Size: 155 B |
BIN
lib/editor/plugins/TableOperations/img/cell-split.gif
Normal file
After Width: | Height: | Size: 907 B |
BIN
lib/editor/plugins/TableOperations/img/col-delete.gif
Normal file
After Width: | Height: | Size: 100 B |
BIN
lib/editor/plugins/TableOperations/img/col-insert-after.gif
Normal file
After Width: | Height: | Size: 111 B |
BIN
lib/editor/plugins/TableOperations/img/col-insert-before.gif
Normal file
After Width: | Height: | Size: 110 B |
BIN
lib/editor/plugins/TableOperations/img/col-split.gif
Normal file
After Width: | Height: | Size: 908 B |
BIN
lib/editor/plugins/TableOperations/img/row-delete.gif
Normal file
After Width: | Height: | Size: 104 B |
BIN
lib/editor/plugins/TableOperations/img/row-insert-above.gif
Normal file
After Width: | Height: | Size: 116 B |
BIN
lib/editor/plugins/TableOperations/img/row-insert-under.gif
Normal file
After Width: | Height: | Size: 115 B |
BIN
lib/editor/plugins/TableOperations/img/row-prop.gif
Normal file
After Width: | Height: | Size: 149 B |
BIN
lib/editor/plugins/TableOperations/img/row-split.gif
Normal file
After Width: | Height: | Size: 895 B |
BIN
lib/editor/plugins/TableOperations/img/table-prop.gif
Normal file
After Width: | Height: | Size: 145 B |
90
lib/editor/plugins/TableOperations/lang/en.js
Normal file
|
@ -0,0 +1,90 @@
|
||||||
|
// 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"
|
||||||
|
};
|
66
lib/editor/plugins/TableOperations/lang/fi.js
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
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ä"
|
||||||
|
};
|
90
lib/editor/plugins/TableOperations/lang/ro.js
Normal file
|
@ -0,0 +1,90 @@
|
||||||
|
// 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"
|
||||||
|
};
|