updating to HTMLAREA RC1/CVS

This commit is contained in:
Pim Snel 2004-04-20 22:17:46 +00:00
parent cc11712210
commit 627bf9d53d
73 changed files with 1276 additions and 374 deletions

View File

@ -22,12 +22,13 @@ function Dialog(url, action, init) {
};
Dialog._parentEvent = function(ev) {
setTimeout( function() { if (Dialog._modal && !Dialog._modal.closed) { Dialog._modal.focus() } }, 50);
if (Dialog._modal && !Dialog._modal.closed) {
Dialog._modal.focus();
HTMLArea._stopEvent(ev);
}
};
// should be a function, the return handler of the currently opened dialog.
Dialog._return = null;
@ -40,7 +41,7 @@ Dialog._arguments = null;
Dialog._geckoOpenModal = function(url, action, init) {
var dlg = window.open(url, "hadialog",
"toolbar=no,menubar=no,personalbar=no,width=10,height=10," +
"scrollbars=no,resizable=yes");
"scrollbars=no,resizable=yes,modal=yes,dependable=yes");
Dialog._modal = dlg;
Dialog._arguments = init;

View File

@ -15,7 +15,7 @@ if (typeof _editor_url == "string") {
// Leave exactly one backslash at the end of _editor_url
_editor_url = _editor_url.replace(/\x2f*$/, '/');
} else {
alert("WARNING: _editor_url is not set! You should set this variable to the editor files path; it should preferably be an absolute path, like in '/htmlarea', but it can be relative if you prefer. Further we will try to load the editor files correctly but we'll probably fail.");
alert("WARNING: _editor_url is not set! You should set this variable to the editor files path; it should preferably be an absolute path, like in '/htmlarea/', but it can be relative if you prefer. Further we will try to load the editor files correctly but we'll probably fail.");
_editor_url = '';
}
@ -127,7 +127,7 @@ HTMLArea.Config = function () {
[ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator",
"lefttoright", "righttoleft", "separator",
"insertorderedlist", "insertunorderedlist", "outdent", "indent", "separator",
"orderedlist", "unorderedlist", "outdent", "indent", "separator",
"forecolor", "hilitecolor", "separator",
"inserthorizontalrule", "createlink", "insertimage", "inserttable", "htmlmode", "separator",
"popupeditor", "separator", "showhelp", "about" ]
@ -197,8 +197,8 @@ HTMLArea.Config = function () {
justifycenter: [ "Justify Center", "ed_align_center.gif", false, function(e) {e.execCommand("justifycenter");} ],
justifyright: [ "Justify Right", "ed_align_right.gif", false, function(e) {e.execCommand("justifyright");} ],
justifyfull: [ "Justify Full", "ed_align_justify.gif", false, function(e) {e.execCommand("justifyfull");} ],
insertorderedlist: [ "Ordered List", "ed_list_num.gif", false, function(e) {e.execCommand("insertorderedlist");} ],
insertunorderedlist: [ "Bulleted List", "ed_list_bullet.gif", false, function(e) {e.execCommand("insertunorderedlist");} ],
orderedlist: [ "Ordered List", "ed_list_num.gif", false, function(e) {e.execCommand("insertorderedlist");} ],
unorderedlist: [ "Bulleted List", "ed_list_bullet.gif", false, function(e) {e.execCommand("insertunorderedlist");} ],
outdent: [ "Decrease Indent", "ed_indent_less.gif", false, function(e) {e.execCommand("outdent");} ],
indent: [ "Increase Indent", "ed_indent_more.gif", false, function(e) {e.execCommand("indent");} ],
forecolor: [ "Font Color", "ed_color_fg.gif", false, function(e) {e.execCommand("forecolor");} ],
@ -415,6 +415,7 @@ HTMLArea.prototype._createToolbar = function () {
var cmd = null;
var customSelects = editor.config.customSelects;
var context = null;
var tooltip = "";
switch (txt) {
case "fontsize":
case "fontname":
@ -436,6 +437,9 @@ HTMLArea.prototype._createToolbar = function () {
if (typeof dropdown != "undefined") {
options = dropdown.options;
context = dropdown.context;
if (typeof dropdown.tooltip != "undefined") {
tooltip = dropdown.tooltip;
}
} else {
alert("ERROR [createSelect]:\nCan't find the requested dropdown definition");
}
@ -443,6 +447,7 @@ HTMLArea.prototype._createToolbar = function () {
}
if (options) {
el = document.createElement("select");
el.title = tooltip;
var obj = {
name : txt, // field name
element : el, // the UI element (SELECT)
@ -662,15 +667,22 @@ HTMLArea.prototype.generate = function () {
// add a handler for the "back/forward" case -- on body.unload we save
// the HTML content into the original textarea.
window.onunload = function() {
editor._textArea.value = editor.getHTML();
};
try {
window.onunload = function() {
editor._textArea.value = editor.getHTML();
};
} catch(e) {};
// creates & appends the toolbar
this._createToolbar();
// create the IFRAME
var iframe = document.createElement("iframe");
// workaround for the HTTPS problem
// iframe.setAttribute("src", "javascript:void(0);");
iframe.src = _editor_url + "popups/blank.html";
htmlarea.appendChild(iframe);
this._iframe = iframe;
@ -741,8 +753,8 @@ HTMLArea.prototype.generate = function () {
html += "<head>\n";
if (editor.config.baseURL)
html += '<base href="' + editor.config.baseURL + '" />';
html += "<style> html,body { border: 0px; } " +
editor.config.pageStyle + "</style>\n";
html += "<style>" + editor.config.pageStyle +
" html,body { border: 0px; }</style>\n";
html += "</head>\n";
html += "<body>\n";
html += editor._textArea.value;
@ -781,6 +793,10 @@ HTMLArea.prototype.generate = function () {
var plugin = editor.plugins[i].instance;
if (typeof plugin.onGenerate == "function")
plugin.onGenerate();
if (typeof plugin.onGenerateOnce == "function") {
plugin.onGenerateOnce();
plugin.onGenerateOnce = null;
}
}
setTimeout(function() {
@ -839,6 +855,11 @@ HTMLArea.prototype.setMode = function(mode) {
}
this._editMode = mode;
this.focusEditor();
for (var i in this.plugins) {
var plugin = this.plugins[i].instance;
if (typeof plugin.onMode == "function") plugin.onMode(mode);
}
};
HTMLArea.prototype.setFullHTML = function(html) {
@ -876,6 +897,10 @@ HTMLArea.prototype.setFullHTML = function(html) {
HTMLArea.prototype.registerPlugin2 = function(plugin, args) {
if (typeof plugin == "string")
plugin = eval(plugin);
if (typeof plugin == "undefined") {
/* FIXME: This should never happen. But why does it do? */
return false;
}
var obj = new plugin(this, args);
if (obj) {
var clone = {};
@ -1003,8 +1028,11 @@ HTMLArea.prototype.forceRedraw = function() {
// focuses the iframe window. returns a reference to the editor document.
HTMLArea.prototype.focusEditor = function() {
switch (this._editMode) {
case "wysiwyg" : this._iframe.contentWindow.focus(); break;
case "textmode": this._textArea.focus(); break;
// notice the try { ... } catch block to avoid some rare exceptions in FireFox
// (perhaps also in other Gecko browsers). Manual focus by user is required in
// case of an error. Somebody has an idea?
case "wysiwyg" : try { this._iframe.contentWindow.focus() } catch (e) {} break;
case "textmode": try { this._textArea.focus() } catch (e) {} break;
default : alert("ERROR: mode " + this._editMode + " is not defined");
}
return this._doc;
@ -1098,6 +1126,7 @@ HTMLArea.prototype.updateToolbar = function(noStatus) {
}
}
}
for (var i in this._toolbarObjects) {
var btn = this._toolbarObjects[i];
var cmd = i;
@ -1197,6 +1226,7 @@ HTMLArea.prototype.updateToolbar = function(noStatus) {
btn.state("active", (el.style.direction == ((cmd == "righttoleft") ? "rtl" : "ltr")));
break;
default:
cmd = cmd.replace(/(un)?orderedlist/i, "insert$1orderedlist");
try {
btn.state("active", (!text && doc.queryCommandState(cmd)));
} catch (e) {}
@ -1210,6 +1240,7 @@ HTMLArea.prototype.updateToolbar = function(noStatus) {
editor._timerUndo = null;
}, this.config.undoTimeout);
}
// check if any plugins have registered refresh handlers
for (var i in this.plugins) {
var plugin = this.plugins[i].instance;
@ -1404,18 +1435,33 @@ HTMLArea.prototype._createLink = function(link) {
if (!param)
return false;
var a = link;
if (!a) {
if (!a) try {
editor._doc.execCommand("createlink", false, param.f_href);
a = editor.getParentElement();
var sel = editor._getSelection();
var range = editor._createRange(sel);
if (!HTMLArea.is_ie) {
a = range.startContainer;
if (!/^a$/i.test(a.tagName))
if (!/^a$/i.test(a.tagName)) {
a = a.nextSibling;
if (a == null)
a = range.startContainer.parentNode;
}
}
} else a.href = param.f_href.trim();
if (!/^a$/i.test(a.tagName))
} catch(e) {}
else {
var href = param.f_href.trim();
editor.selectNodeContents(a);
if (href == "") {
editor._doc.execCommand("unlink", false, null);
editor.updateToolbar();
return false;
}
else {
a.href = href;
}
}
if (!(a && /^a$/i.test(a.tagName)))
return false;
a.target = param.f_target.trim();
a.title = param.f_title.trim();
@ -1463,6 +1509,7 @@ HTMLArea.prototype._insertImage = function(image) {
} else {
img.src = param.f_url;
}
for (field in param) {
var value = param[field];
switch (field) {
@ -1489,6 +1536,7 @@ HTMLArea.prototype._insertTable = function() {
// create the table element
var table = doc.createElement("table");
// assign the given arguments
for (var field in param) {
var value = param[field];
if (!value) {
@ -1498,8 +1546,8 @@ HTMLArea.prototype._insertTable = function() {
case "f_width" : table.style.width = value + param["f_unit"]; break;
case "f_align" : table.align = value; break;
case "f_border" : table.border = parseInt(value); break;
case "f_spacing" : table.cellspacing = parseInt(value); break;
case "f_padding" : table.cellpadding = parseInt(value); break;
case "f_spacing" : table.cellSpacing = parseInt(value); break;
case "f_padding" : table.cellPadding = parseInt(value); break;
}
}
var tbody = doc.createElement("tbody");
@ -1572,6 +1620,8 @@ HTMLArea.prototype.execCommand = function(cmdID, UI, param) {
this._createLink();
break;
case "popupeditor":
// this object will be passed to the newly opened window
HTMLArea._object = this;
if (HTMLArea.is_ie) {
//if (confirm(HTMLArea.I18N.msg["IE-sucks-full-screen"]))
{
@ -1584,8 +1634,6 @@ HTMLArea.prototype.execCommand = function(cmdID, UI, param) {
"toolbar=no,menubar=no,personalbar=no,width=640,height=480," +
"scrollbars=no,resizable=yes");
}
// pass this object to the newly opened window
HTMLArea._object = this;
break;
case "undo":
case "redo":
@ -1610,9 +1658,14 @@ HTMLArea.prototype.execCommand = function(cmdID, UI, param) {
this._doc.execCommand(cmdID, UI, param);
} catch (e) {
if (HTMLArea.is_gecko) {
if (confirm("Unprivileged scripts cannot access Cut/Copy/Paste programatically " +
"for security reasons. Click OK to see a technical note at mozilla.org " +
"which shows you how to allow a script to access the clipboard."))
if (typeof HTMLArea.I18N.msg["Moz-Clipboard"] == "undefined") {
HTMLArea.I18N.msg["Moz-Clipboard"] =
"Unprivileged scripts cannot access Cut/Copy/Paste programatically " +
"for security reasons. Click OK to see a technical note at mozilla.org " +
"which shows you how to allow a script to access the clipboard.\n\n" +
"[FIXME: please translate this message in your language definition file.]";
}
if (confirm(HTMLArea.I18N.msg["Moz-Clipboard"]))
window.open("http://mozilla.org/editor/midasdemo/securityprefs.html");
}
}
@ -1641,7 +1694,14 @@ HTMLArea.prototype.execCommand = function(cmdID, UI, param) {
HTMLArea.prototype._editorEvent = function(ev) {
var editor = this;
var keyEvent = (HTMLArea.is_ie && ev.type == "keydown") || (ev.type == "keypress");
if (keyEvent && ev.ctrlKey) {
if (keyEvent) {
for (var i in editor.plugins) {
var plugin = editor.plugins[i].instance;
if (typeof plugin.onKeyPress == "function") plugin.onKeyPress(ev);
}
}
if (keyEvent && ev.ctrlKey && !ev.altKey) {
var sel = null;
var range = null;
var key = String.fromCharCode(HTMLArea.is_ie ? ev.keyCode : ev.charCode).toLowerCase();
@ -1982,7 +2042,11 @@ HTMLArea.getHTML = function(root, outputRoot, editor) {
continue;
}
var name = a.nodeName.toLowerCase();
if (/_moz|contenteditable/.test(name)) {
if (/_moz_editor_bogus_node/.test(name)) {
html = "";
break;
}
if (/_moz|contenteditable|_msh/.test(name)) {
// avoid certain attributes
continue;
}
@ -2020,7 +2084,9 @@ HTMLArea.getHTML = function(root, outputRoot, editor) {
}
html += " " + name + '="' + value + '"';
}
html += closed ? " />" : ">";
if (html != "") {
html += closed ? " />" : ">";
}
}
for (i = root.firstChild; i; i = i.nextSibling) {
html += HTMLArea.getHTML(i, true, editor);
@ -2030,7 +2096,16 @@ HTMLArea.getHTML = function(root, outputRoot, editor) {
}
break;
case 3: // Node.TEXT_NODE
html = HTMLArea.htmlEncode(root.data);
// If a text node is alone in an element and all spaces, replace it with an non breaking one
// This partially undoes the damage done by moz, which translates '&nbsp;'s into spaces in the data element
if ( !root.previousSibling && !root.nextSibling && root.data.match(/^\s*$/i) ) html = '&nbsp;';
else html = /^script|style$/i.test(root.parentNode.tagName) ? root.data : HTMLArea.htmlEncode(root.data);
break;
case 4: // Node.CDATA_SECTION_NODE
// FIXME: it seems we never get here, but I believe we should..
// maybe a browser problem?--CDATA sections are converted to plain text nodes and normalized
// CDATA sections should go "as is" without further encoding
html = "<![CDATA[" + root.data + "]]>";
break;
case 8: // Node.COMMENT_NODE
html = "<!--" + root.data + "-->";

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 B

After

Width:  |  Height:  |  Size: 87 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 B

After

Width:  |  Height:  |  Size: 69 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 B

After

Width:  |  Height:  |  Size: 69 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 B

After

Width:  |  Height:  |  Size: 69 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 B

After

Width:  |  Height:  |  Size: 68 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 B

After

Width:  |  Height:  |  Size: 56 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 B

After

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 181 B

After

Width:  |  Height:  |  Size: 181 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 B

After

Width:  |  Height:  |  Size: 171 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 B

After

Width:  |  Height:  |  Size: 110 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 B

After

Width:  |  Height:  |  Size: 67 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 B

After

Width:  |  Height:  |  Size: 91 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 B

After

Width:  |  Height:  |  Size: 90 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 B

After

Width:  |  Height:  |  Size: 74 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 B

After

Width:  |  Height:  |  Size: 77 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 B

After

Width:  |  Height:  |  Size: 78 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 B

After

Width:  |  Height:  |  Size: 78 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 B

After

Width:  |  Height:  |  Size: 77 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 B

After

Width:  |  Height:  |  Size: 85 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 B

After

Width:  |  Height:  |  Size: 70 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 B

After

Width:  |  Height:  |  Size: 70 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 B

After

Width:  |  Height:  |  Size: 75 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 B

After

Width:  |  Height:  |  Size: 148 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 B

After

Width:  |  Height:  |  Size: 87 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 B

After

Width:  |  Height:  |  Size: 87 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 B

After

Width:  |  Height:  |  Size: 89 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 B

After

Width:  |  Height:  |  Size: 97 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 B

After

Width:  |  Height:  |  Size: 80 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 B

After

Width:  |  Height:  |  Size: 82 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 B

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 B

After

Width:  |  Height:  |  Size: 80 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 B

After

Width:  |  Height:  |  Size: 88 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 B

After

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 B

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 925 B

After

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 B

After

Width:  |  Height:  |  Size: 81 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 B

After

Width:  |  Height:  |  Size: 97 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 B

After

Width:  |  Height:  |  Size: 97 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 B

After

Width:  |  Height:  |  Size: 121 B

View File

@ -1,7 +1,6 @@
// german version for htmlArea v3.0 - Alpha Release
// - translated by AtK<atk@chello.at>
// term´s and licenses are equal to htmlarea!
// translation improved by broxx<broxx@broxx.com>
// I18N constants
// LANG: "de", ENCODING: ISO-8859-1 for the german umlaut!
HTMLArea.I18N = {
@ -16,30 +15,35 @@ HTMLArea.I18N = {
strikethrough: "Durchgestrichen",
subscript: "Hochgestellt",
superscript: "Tiefgestellt",
justifyleft: "Links ausrichten",
justifycenter: "Zentrieren",
justifyright: "Rechts ausrichten",
justifyleft: "Linksbündig",
justifycenter: "Zentriert",
justifyright: "Rechtsbündig",
justifyfull: "Blocksatz",
orderedlist: "Nummerierung",
unorderedlist: "Aufzaehlungszeichen",
orderedlist: "Nummerierung",
unorderedlist: "Aufzählungszeichen",
outdent: "Einzug verkleinern",
indent: "Einzug vergrössern",
forecolor: "Text Farbe",
hilitecolor: "Hintergrund Farbe",
indent: "Einzug vergrößern",
forecolor: "Schriftfarbe",
backcolor: "Hindergrundfarbe",
hilitecolor: "Hintergrundfarbe",
horizontalrule: "Horizontale Linie",
createlink: "Hyperlink einfuegen",
insertimage: "Bild einfuegen",
inserttable: "Tabelle einfuegen",
inserthorizontalrule: "Horizontale Linie",
createlink: "Hyperlink einfügen",
insertimage: "Bild einfügen",
inserttable: "Tabelle einfügen",
htmlmode: "HTML Modus",
popupeditor: "Editor im Popup öffnen",
about: "Ueber HtmlArea",
about: "Über htmlarea",
help: "Hilfe",
showhelp: "Hilfe",
textindicator: "derzeitiger Stil",
undo: "Rueckgaengig",
textindicator: "Derzeitiger Stil",
undo: "Rückgängig",
redo: "Wiederholen",
cut: "Ausschneiden",
copy: "Kopieren",
paste: "Einfuegen"
paste: "Einfügen aus der Zwischenablage",
lefttoright: "Textrichtung von Links nach Rechts",
righttoleft: "Textrichtung von Rechts nach Links"
},
buttons: {
@ -49,6 +53,27 @@ HTMLArea.I18N = {
msg: {
"Path": "Pfad",
"TEXT_MODE": "Du befindest dich im HTML Modus. Benuetze die [<>] Schaltflaeche um in den WYSIWIG-Modus zu wechseln."
"TEXT_MODE": "Sie sind im Text-Modus. Benutzen Sie den [<>] Knopf um in den visuellen Modus (WYSIWIG) zu gelangen.",
"Moz-Clipboard" :
"Aus Sicherheitsgründen dürfen Skripte normalerweise nicht programmtechnisch auf " +
"Ausschneiden/Kopieren/Einfügen zugreifen. Bitte klicken Sie OK um die technische " +
"Erläuterung auf mozilla.org zu öffnen, in der erklärt wird, wie einem Skript Zugriff " +
"gewährt werden kann."
},
dialogs: {
"OK": "OK",
"Cancel": "Abbrechen",
"Insert/Modify Link": "Verknüpfung hinzufügen/ändern",
"None (use implicit)": "k.A. (implizit)",
"New window (_blank)": "Neues Fenster (_blank)",
"Same frame (_self)": "Selber Rahmen (_self)",
"Top frame (_top)": "Oberster Rahmen (_top)",
"Other": "Anderes",
"Target:": "Ziel:",
"Title (tooltip):": "Titel (Tooltip):",
"URL:": "URL:",
"You must enter the URL where this link points to": "Sie müssen eine Ziel-URL angeben für die Verknüpfung angeben"
}
};

View File

@ -29,8 +29,8 @@ HTMLArea.I18N = {
justifycenter: "Joonda keskele",
justifyright: "Joonda paremale",
justifyfull: "Rööpjoonda",
insertorderedlist: "Nummerdus",
insertunorderedlist: "Täpploend",
orderedlist: "Nummerdus",
unorderedlist: "Täpploend",
outdent: "Vähenda taanet",
indent: "Suurenda taanet",
forecolor: "Fondi värv",

View File

@ -1,16 +1,7 @@
// I18N constants
// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
// Author: Mihai Bazon, http://dynarch.com/mishoo
// 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.)
// LANG: "el", ENCODING: UTF-8 | ISO-8859-7
// Author: Dimitris Glezos, dimitris@glezos.com
HTMLArea.I18N = {

View File

@ -68,7 +68,12 @@ HTMLArea.I18N = {
"due to browser bugs that we weren't able to workaround. You might experience garbage " +
"display, lack of editor functions and/or random browser crashes. If your system is Windows 9x " +
"it's very likely that you'll get a 'General Protection Fault' and need to reboot.\n\n" +
"You have been warned. Please press OK if you still want to try the full screen editor."
"You have been warned. Please press OK if you still want to try the full screen editor.",
"Moz-Clipboard" :
"Unprivileged scripts cannot access Cut/Copy/Paste programatically " +
"for security reasons. Click OK to see a technical note at mozilla.org " +
"which shows you how to allow a script to access the clipboard."
},
dialogs: {

View File

@ -17,8 +17,8 @@ HTMLArea.I18N = {
justifycenter: "Centrar",
justifyright: "Alinear a la Derecha",
justifyfull: "Justificar",
insertorderedlist: "Lista Ordenada",
insertunorderedlist: "Lista No Ordenada",
orderedlist: "Lista Ordenada",
unorderedlist: "Lista No Ordenada",
outdent: "Aumentar Sangría",
indent: "Disminuir Sangría",
forecolor: "Color del Texto",

View File

@ -17,8 +17,8 @@ HTMLArea.I18N = {
justifycenter: "Keskitä",
justifyright: "Tasaa oikeat reunat",
justifyfull: "Tasaa molemmat reunat",
insertorderedlist: "Numerointi",
insertunorderedlist: "Luettelomerkit",
orderedlist: "Numerointi",
unorderedlist: "Luettelomerkit",
outdent: "Lisää sisennystä",
indent: "Pienennä sisennystä",
forecolor: "Fontin väri",

View File

@ -1,5 +1,7 @@
// I18N constants
// Author: Jonathan Ernst, <Jonathan.Ernst@NetOxygen.ch>
// LANG: "fr", ENCODING: UTF-8 | ISO-8859-1
// Author: Simon Richard, s.rich@sympatico.ca
// FOR TRANSLATORS:
//
@ -10,6 +12,12 @@
// (if this is not possible, please include a comment
// that states what encoding is necessary.)
// All technical terms used in this document are the ones approved
// by the Office québécois de la langue française.
// Tous les termes techniques utilisés dans ce document sont ceux
// approuvés par l'Office québécois de la langue française.
// http://www.oqlf.gouv.qc.ca/
HTMLArea.I18N = {
// the following should be the filename without .js extension
@ -21,32 +29,34 @@ HTMLArea.I18N = {
italic: "Italique",
underline: "Souligné",
strikethrough: "Barré",
subscript: "Subscript",
superscript: "Superscript",
subscript: "Indice",
superscript: "Exposant",
justifyleft: "Aligné à gauche",
justifycenter: "Centré",
justifyright: "Aligné à droite",
justifyfull: "Justifié",
justifyfull: "Justifier",
orderedlist: "Numérotation",
unorderedlist: "Puces",
outdent: "Augmenter le retrait",
indent: "Diminuer le retrait",
forecolor: "Couleur du texte",
hilitecolor: "Couleur du fond",
outdent: "Diminuer le retrait",
indent: "Augmenter le retrait",
forecolor: "Couleur de police",
hilitecolor: "Surlignage",
horizontalrule: "Ligne horizontale",
createlink: "Insérer un lien",
insertimage: "Insérer une image",
createlink: "Insérer un hyperlien",
insertimage: "Insérer/Modifier une image",
inserttable: "Insérer un tableau",
htmlmode: "Passer au code source HTML",
htmlmode: "Passer au code source",
popupeditor: "Agrandir l'éditeur",
about: "A propos de cet éditeur",
about: "À propos de cet éditeur",
showhelp: "Aide sur l'éditeur",
textindicator: "Style courant",
undo: "Annule la dernière action",
redo: "Refait la dernière action",
cut: "Coupe la sélection",
copy: "Copie la sélection",
paste: "Colle depuis le presse papiers"
undo: "Annuler la dernière action",
redo: "Répéter la dernière action",
cut: "Couper la sélection",
copy: "Copier la sélection",
paste: "Coller depuis le presse-papier",
lefttoright: "Direction de gauche à droite",
righttoleft: "Direction de droite à gauche"
},
buttons: {
@ -56,6 +66,32 @@ HTMLArea.I18N = {
msg: {
"Path": "Chemin",
"TEXT_MODE": "Vous êtes en mode texte. Utilisez le bouton [<>] pour revenir au mode WYSIWIG."
"TEXT_MODE": "Vous êtes en MODE TEXTE. Appuyez sur le bouton [<>] pour retourner au mode tel-tel.",
"IE-sucks-full-screen" :
// translate here
"Le mode plein écran peut causer des problèmes sous Internet Explorer, " +
"ceci dû à des bogues du navigateur qui ont été impossible à contourner. " +
"Les différents symptômes peuvent être un affichage déficient, le manque de " +
"fonctions dans l'éditeur et/ou pannes aléatoires du navigateur. Si votre " +
"système est Windows 9x, il est possible que vous subissiez une erreur de type " +
"«General Protection Fault» et que vous ayez à redémarrer votre ordinateur." +
"\n\nConsidérez-vous comme ayant été avisé. Appuyez sur OK si vous désirez tout " +
"de même essayer le mode plein écran de l'éditeur."
},
dialogs: {
"Cancel" : "Annuler",
"Insert/Modify Link" : "Insérer/Modifier Lien",
"New window (_blank)" : "Nouvelle fenêtre (_blank)",
"None (use implicit)" : "Aucun (par défaut)",
"OK" : "OK",
"Other" : "Autre",
"Same frame (_self)" : "Même cadre (_self)",
"Target:" : "Cible:",
"Title (tooltip):" : "Titre (infobulle):",
"Top frame (_top)" : "Cadre du haut (_top)",
"URL:" : "Adresse Web:",
"You must enter the URL where this link points to" : "Vous devez entrer l'adresse Web du lien"
}
};

View File

@ -1,7 +1,7 @@
// I18N constants
// LANG: "he", ENCODING: UTF-8
// Author: Liron Newman, <plastish@ultinet.org>
// Author: Liron Newman, http://www.eesh.net, <plastish at ultinet dot org>
// FOR TRANSLATORS:
//
@ -28,7 +28,7 @@ HTMLArea.I18N = {
justifyleft: " ישור לשמאל",
justifycenter: "ישור למרכז",
justifyright: "ישור לימין",
justifyfull: "יישור לשורה מלאה",
justifyfull: "ישור לשורה מלאה",
orderedlist: "רשימה ממוספרת",
unorderedlist: "רשימה לא ממוספרת",
outdent: "הקטן כניסה",
@ -37,7 +37,7 @@ HTMLArea.I18N = {
hilitecolor: "צבע רקע",
horizontalrule: "קו אנכי",
createlink: "הכנס היפר-קישור",
insertimage: "הכנס תמונה",
insertimage: "הכנס/שנה תמונה",
inserttable: "הכנס טבלה",
htmlmode: "שנה מצב קוד HTML",
popupeditor: "הגדל את העורך",
@ -48,16 +48,42 @@ HTMLArea.I18N = {
redo: "מבצע מחדש את הפעולה האחרונה שביטלת",
cut: "גזור בחירה",
copy: "העתק בחירה",
paste: "הדבק מהלוח"
paste: "הדבק מהלוח",
lefttoright: "כיוון משמאל לימין",
righttoleft: "כיוון מימין לשמאל"
},
buttons: {
"ok": "OK",
"ok": "אישור",
"cancel": "ביטול"
},
msg: {
"Path": "נתיב עיצוב",
"TEXT_MODE": "אתה במצב טקסט נקי (קוד). השתמש בכפתור [<>] כדי לחזור למצב WYSIWYG (תצוגת עיצוב)."
"TEXT_MODE": "אתה במצב טקסט נקי (קוד). השתמש בכפתור [<>] כדי לחזור למצב WYSIWYG (תצוגת עיצוב).",
"IE-sucks-full-screen" :
// translate here
"מצב מסך מלא יוצר בעיות בדפדפן Internet Explorer, " +
"עקב באגים בדפדפן לא יכולנו לפתור את זה. את/ה עלול/ה לחוות תצוגת זבל, " +
"בעיות בתפקוד העורך ו/או קריסה של הדפדפן. אם המערכת שלך היא Windows 9x " +
"סביר להניח שתקבל/י 'General Protection Fault' ותאלצ/י לאתחל את המחשב.\n\n" +
"ראה/י הוזהרת. אנא לחץ/י אישור אם את/ה עדיין רוצה לנסות את העורך במסך מלא."
},
dialogs: {
"Cancel" : "ביטול",
"Insert/Modify Link" : "הוסף/שנה קישור",
"New window (_blank)" : "חלון חדש (_blank)",
"None (use implicit)" : "ללא (השתמש ב-frame הקיים)",
"OK" : "OK",
"Other" : "אחר",
"Same frame (_self)" : "אותו frame (_self)",
"Target:" : "יעד:",
"Title (tooltip):" : "כותרת (tooltip):",
"Top frame (_top)" : "Frame עליון (_top)",
"URL:" : "URL:",
"You must enter the URL where this link points to" : "חובה לכתוב URL שאליו קישור זה מצביע"
}
};

View File

@ -48,7 +48,9 @@ HTMLArea.I18N = {
redo: "Újra végrehajtás",
cut: "Kivágás",
copy: "Másolás",
paste: "Beillesztés"
paste: "Beillesztés",
lefttoright: "Irány balról jobbra",
righttoleft: "Irány jobbról balra"
},
buttons: {
@ -58,6 +60,31 @@ HTMLArea.I18N = {
msg: {
"Path": "Hierarchia",
"TEXT_MODE": "Forrás mód. Visszaváltás [<>] gomb"
"TEXT_MODE": "Forrás mód. Visszaváltás [<>] gomb",
"IE-sucks-full-screen" :
// translate here
"A teljesképrenyős szerkesztés hibát okozhat Internet Explorer használata esetén, " +
"ez a böngésző a hibája, amit nem tudunk kikerülni. Szemetet észlelhet a képrenyőn, " +
"illetve néhány funkció hiányozhat és/vagy véletlenszerűen lefagyhat a böngésző. " +
"Windows 9x operaciós futtatása esetén elég valószínű, hogy 'General Protection Fault' " +
"hibát okoz és újra kell indítania a számítógépet.\n\n" +
"Figyelmeztettük. Kérjük nyomja meg a Rendben gombot, ha mégis szeretné megnyitni a " +
"szerkesztőt külön ablakban."
},
dialogs: {
"Cancel" : "Mégsem",
"Insert/Modify Link" : "Hivatkozás Beszúrása/Módosítása",
"New window (_blank)" : "Új ablak (_blank)",
"None (use implicit)" : "Nincs (use implicit)",
"OK" : "OK",
"Other" : "Más",
"Same frame (_self)" : "Ugyanabba a keretbe (_self)",
"Target:" : "Cél:",
"Title (tooltip):" : "Cím (tooltip):",
"Top frame (_top)" : "Felső keret (_top)",
"URL:" : "URL:",
"You must enter the URL where this link points to" : "Be kell írnia az URL-t, ahova a hivatkozás mutasson"
}
};

View File

@ -2,53 +2,78 @@
// LANG: "it", ENCODING: UTF-8 | ISO-8859-1
// Author: Fabio Rotondo <fabio@rotondo.it>
// Update for 3.0 rc1: Giovanni Premuda <gpremuda@softwerk.it>
HTMLArea.I18N = {
// the following should be the filename without .js extension
// it will be used for automatically load plugin language.
lang: "it",
// the following should be the filename without .js extension
// it will be used for automatically load plugin language.
lang: "it",
tooltips: {
bold: "Grassetto",
italic: "Italico",
underline: "Sottolineato",
strikethrough: "Barrato",
subscript: "Pedice",
superscript: "Apice",
justifyleft: "Giustifica a Sinistra",
justifycenter: "Giustifica in Centro",
justifyright: "Giustifica a Destra",
justifyfull: "Giustifica Completamente",
orderedlist: "Lista Ordinata",
unorderedlist: "Lista Puntata",
outdent: "Decrementa Indentazione",
indent: "Incrementa Indentazione",
forecolor: "Colore del Carattere",
hilitecolor: "Colore di Sfondo",
horizontalrule: "Linea Orizzontale",
createlink: "Inserisci un Link",
insertimage: "Inserisci un'Immagine",
inserttable: "Inserisci una Tabella",
htmlmode: "Attiva il codice HTML",
popupeditor: "Allarga l'editor",
about: "Info sull'editor",
showhelp: "Aiuto sull'editor",
textindicator: "Stile Attuale",
undo: "Elimina l'ultima modifica",
redo: "Ripristina l'ultima modifica",
cut: "Taglia l'area selezionata",
copy: "Copia l'area selezionata",
paste: "Incolla dalla memoria"
},
tooltips: {
bold: "Grassetto",
italic: "Corsivo",
underline: "Sottolineato",
strikethrough: "Barrato",
subscript: "Pedice",
superscript: "Apice",
justifyleft: "Allinea a sinistra",
justifycenter: "Allinea in centro",
justifyright: "Allinea a destra",
justifyfull: "Giustifica",
insertorderedlist: "Lista ordinata",
insertunorderedlist: "Lista puntata",
outdent: "Decrementa indentazione",
indent: "Incrementa indentazione",
forecolor: "Colore del carattere",
hilitecolor: "Colore di sfondo",
inserthorizontalrule: "Linea orizzontale",
createlink: "Inserisci un link",
insertimage: "Inserisci un'immagine",
inserttable: "Inserisci una tabella",
htmlmode: "Visualizzazione HTML",
popupeditor: "Editor a pieno schermo",
about: "Info sull'editor",
showhelp: "Aiuto sull'editor",
textindicator: "Stile corrente",
undo: "Annulla",
redo: "Ripristina",
cut: "Taglia",
copy: "Copia",
paste: "Incolla",
lefttoright: "Scrivi da sinistra a destra",
righttoleft: "Scrivi da destra a sinistra"
},
buttons: {
"ok": "OK",
"cancel": "Annulla"
},
buttons: {
"ok": "OK",
"cancel": "Annulla"
},
msg: {
"Path": "Percorso",
"TEXT_MODE": "Sei in MODALITA' TESTO. Usa il bottone [<>] per tornare alla modalità WYSIWYG."
}
msg: {
"Path": "Percorso",
"TEXT_MODE": "Sei in MODALITA' TESTO. Usa il bottone [<>] per tornare alla modalità WYSIWYG.",
"IE-sucks-full-screen" :
// translate here
"The full screen mode is known to cause problems with Internet Explorer, " +
"due to browser bugs that we weren't able to workaround. You might experience garbage " +
"display, lack of editor functions and/or random browser crashes. If your system is Windows 9x " +
"it's very likely that you'll get a 'General Protection Fault' and need to reboot.\n\n" +
"You have been warned. Please press OK if you still want to try the full screen editor."
},
dialogs: {
"Annulla" : "Cancel",
"Inserisci/modifica Link" : "Insert/Modify Link",
"Nuova finestra (_blank)" : "New window (_blank)",
"Nessuno (usa predefinito)" : "None (use implicit)",
"OK" : "OK",
"Altro" : "Other",
"Stessa finestra (_self)" : "Same frame (_self)",
"Target:" : "Target:",
"Title (suggerimento):" : "Title (tooltip):",
"Frame principale (_top)" : "Top frame (_top)",
"URL:" : "URL:",
"You must enter the URL where this link points to" : "Devi inserire un indirizzo per questo link"
}
};

View File

@ -3,12 +3,11 @@
// LANG: "lt", ENCODING: UTF-8
// Author: Jaroslav Šatkevič, <jaro@akl.lt>
HTMLArea.I18N = {
// the following should be the filename without .js extension
// it will be used for automatically load plugin language.
lang: "lt",
lang: "en",
tooltips: {
bold: "Paryškinti",
@ -41,7 +40,7 @@ HTMLArea.I18N = {
cut: "Iškirpti",
copy: "Kopijuoti",
paste: "Įterpti"
},
},
buttons: {
"ok": "OK",
@ -50,6 +49,29 @@ HTMLArea.I18N = {
msg: {
"Path": "Kelias",
"TEXT_MODE": "Jūs esete teksto režime. Naudokite [<>] mygtuką grįžimui į WYSIWYG."
"TEXT_MODE": "Jūs esete teksto režime. Naudokite [<>] mygtuką grįžimui į WYSIWYG.",
"IE-sucks-full-screen" :
// translate here
"The full screen mode is known to cause problems with Internet Explorer, " +
"due to browser bugs that we weren't able to workaround. You might experience garbage " +
"display, lack of editor functions and/or random browser crashes. If your system is Windows 9x " +
"it's very likely that you'll get a 'General Protection Fault' and need to reboot.\n\n" +
"You have been warned. Please press OK if you still want to try the full screen editor."
},
dialogs: {
"Cancel" : "Atšaukti",
"Insert/Modify Link" : "Idėti/Modifikuoti",
"New window (_blank)" : "Naujas langas (_blank)",
"None (use implicit)" : "None (use implicit)",
"OK" : "OK",
"Other" : "Kitas",
"Same frame (_self)" : "Same frame (_self)",
"Target:" : "Target:",
"Title (tooltip):" : "Pavadinimas (tooltip):",
"Top frame (_top)" : "Top frame (_top)",
"URL:" : "URL:",
"You must enter the URL where this link points to" : "Jus privalote nurodyti URL į kuri rodo šitą nuoroda"
}
};

View File

@ -29,8 +29,8 @@ HTMLArea.I18N = {
justifycenter: "Centreren",
justifyright: "Rechts uitlijnen",
justifyfull: "Uitvullen",
insertorderedlist: "Nummering",
insertunorderedlist: "Opsommingstekens",
orderedlist: "Nummering",
unorderedlist: "Opsommingstekens",
outdent: "Inspringing verkleinen",
indent: "Inspringing vergroten",
forecolor: "Tekstkleur",

View File

@ -1,5 +1,6 @@
// Norwegian version for htmlArea v3.0 - Alpha Release
// Norwegian version for htmlArea v3.0 - pre1
// - translated by ses<ses@online.no>
// Additional translations by Håvard Wigtil <havardw@extend.no>
// term´s and licenses are equal to htmlarea!
HTMLArea.I18N = {
@ -9,31 +10,38 @@ HTMLArea.I18N = {
lang: "no",
tooltips: {
bold: "Fet",
italic: "Kursiv",
underline: "Understreket",
strikethrough: "Gjennomstreket",
subscript: "Nedsenket",
superscript: "Opphøyet",
justifyleft: "Venstrejuster",
justifycenter: "Midtjuster",
justifyright: "Høyrejuster",
justifyfull: "Blokkjuster",
bold: "Fet",
italic: "Kursiv",
underline: "Understreket",
strikethrough: "Gjennomstreket",
subscript: "Nedsenket",
superscript: "Opphøyet",
justifyleft: "Venstrejuster",
justifycenter: "Midtjuster",
justifyright: "Høyrejuster",
justifyfull: "Blokkjuster",
orderedlist: "Nummerert liste",
unorderedlist: "Punktliste",
outdent: "Reduser innrykk",
indent: "Øke innrykk",
forecolor: "Tekstfarge",
backcolor: "Bakgrundsfarge",
horizontalrule: "Vannrett linje",
createlink: "Lag lenke",
insertimage: "Sett inn bilde",
inserttable: "Sett inn tabell",
htmlmode: "Vis kildekode",
popupeditor: "Vis i eget vindu",
about: "Om denne editor",
help: "Hjelp",
textindicator: "Nåværende stil"
outdent: "Reduser innrykk",
indent: "Øke innrykk",
forecolor: "Tekstfarge",
hilitecolor: "Bakgrundsfarge",
inserthorizontalrule: "Vannrett linje",
createlink: "Lag lenke",
insertimage: "Sett inn bilde",
inserttable: "Sett inn tabell",
htmlmode: "Vis kildekode",
popupeditor: "Vis i eget vindu",
about: "Om denne editor",
showhelp: "Hjelp",
textindicator: "Nåværende stil",
undo: "Angrer siste redigering",
redo: "Gjør om siste angring",
cut: "Klipp ut område",
copy: "Kopier område",
paste: "Lim inn",
lefttoright: "Fra venstre mot høyre",
righttoleft: "Fra høyre mot venstre"
},
buttons: {
@ -43,6 +51,29 @@ HTMLArea.I18N = {
msg: {
"Path": "Tekstvelger",
"TEXT_MODE": "Du er i tekstmodus Klikk på [<>] for å gå tilbake til WYSIWIG."
"TEXT_MODE": "Du er i tekstmodus Klikk på [<>] for å gå tilbake til WYSIWIG.",
"IE-sucks-full-screen" :
// translate here
"Visning i eget vindu har kjente problemer med Internet Explorer, " +
"på grunn av problemer med denne nettleseren. Mulige problemer er et uryddig " +
"skjermbilde, manglende editorfunksjoner og/eller at nettleseren crasher. Hvis du bruker Windows 95 eller Windows 98 " +
"er det også muligheter for at Windows will crashe.\n\n" +
"Trykk 'OK' hvis du vil bruke visning i eget vindu på tross av denne advarselen."
},
dialogs: {
"Cancel" : "Avbryt",
"Insert/Modify Link" : "Rediger lenke",
"New window (_blank)" : "Eget vindu (_blank)",
"None (use implicit)" : "Ingen (bruk standardinnstilling)",
"OK" : "OK",
"Other" : "Annen",
"Same frame (_self)" : "Samme ramme (_self)",
"Target:" : "Mål:",
"Title (tooltip):" : "Tittel (tooltip):",
"Top frame (_top)" : "Toppramme (_top)",
"URL:" : "Adresse:",
"You must enter the URL where this link points to" : "Du må skrive inn en adresse som denne lenken skal peke til"
}
};

View File

@ -29,8 +29,8 @@ HTMLArea.I18N = {
justifycenter: "По центру",
justifyright: "По правому краю",
justifyfull: "По ширине",
insertorderedlist: "Нумерованный лист",
insertunorderedlist: "Маркированный лист",
orderedlist: "Нумерованный лист",
unorderedlist: "Маркированный лист",
outdent: "Уменьшить отступ",
indent: "Увеличить отступ",
forecolor: "Цвет шрифта",

View File

@ -0,0 +1,38 @@
#! /usr/bin/perl -w
use strict;
my $file = 'context-menu.js';
my $outfile = $file.'-i18n';
my $langfile = 'en.js';
open FILE, "<$file";
#open OUTFILE, ">$outfile";
#open LANGFILE, ">$langfile";
my %texts = ();
while (<FILE>) {
if (/"(.*?)"/) {
my $inline = $_;
chomp $inline;
my $key = $1;
my $val = $1;
print "Key: [$key]: ";
my $line = <STDIN>;
if (defined $line) {
chomp $line;
if ($line =~ /(\S+)/) {
$key = $1;
print "-- using $key\n";
}
$texts{$val} = $key;
} else {
print " -- skipped...\n";
}
}
}
#close LANGFILE;
#close OUTFILE;
close FILE;
print "\n\n\n";
print '"', join("\"\n\"", sort keys %texts), '"', "\n";

View File

@ -0,0 +1,416 @@
// Context Menu Plugin for HTMLArea-3.0
// Sponsored by www.americanbible.org
// Implementation by Mihai Bazon, http://dynarch.com/mishoo/
//
// (c) dynarch.com 2003.
// Distributed under the same terms as HTMLArea itself.
// This notice MUST stay intact for use (see license.txt).
//
// $Id$
HTMLArea.loadStyle("menu.css", "ContextMenu");
function ContextMenu(editor) {
this.editor = editor;
};
ContextMenu._pluginInfo = {
name : "ContextMenu",
version : "1.0",
developer : "Mihai Bazon",
developer_url : "http://dynarch.com/mishoo/",
c_owner : "dynarch.com",
sponsor : "American Bible Society",
sponsor_url : "http://www.americanbible.org",
license : "htmlArea"
};
ContextMenu.prototype.onGenerate = function() {
var self = this;
var doc = this.editordoc = this.editor._iframe.contentWindow.document;
HTMLArea._addEvents(doc, ["contextmenu"],
function (event) {
return self.popupMenu(HTMLArea.is_ie ? self.editor._iframe.contentWindow.event : event);
});
this.currentMenu = null;
};
ContextMenu.prototype.getContextMenu = function(target) {
var self = this;
var editor = this.editor;
var config = editor.config;
var menu = [];
var tbo = this.editor.plugins.TableOperations;
if (tbo) tbo = tbo.instance;
var i18n = ContextMenu.I18N;
var selection = editor.hasSelectedText();
if (selection)
menu.push([ i18n["Cut"], function() { editor.execCommand("cut"); }, null, config.btnList["cut"][1] ],
[ i18n["Copy"], function() { editor.execCommand("copy"); }, null, config.btnList["copy"][1] ]);
menu.push([ i18n["Paste"], function() { editor.execCommand("paste"); }, null, config.btnList["paste"][1] ]);
var currentTarget = target;
var elmenus = [];
var link = null;
var table = null;
var tr = null;
var td = null;
var img = null;
function tableOperation(opcode) {
tbo.buttonPress(editor, opcode);
};
for (; target; target = target.parentNode) {
var tag = target.tagName;
if (!tag)
continue;
tag = tag.toLowerCase();
switch (tag) {
case "img":
img = target;
elmenus.push(null,
[ i18n["Image Properties"],
function() {
editor._insertImage(img);
},
i18n["Show the image properties dialog"],
config.btnList["insertimage"][1] ]
);
break;
case "a":
link = target;
elmenus.push(null,
[ i18n["Modify Link"],
function() { editor.execCommand("createlink", true); },
i18n["Current URL is"] + ': ' + link.href,
config.btnList["createlink"][1] ],
[ i18n["Check Link"],
function() { window.open(link.href); },
i18n["Opens this link in a new window"] ],
[ i18n["Remove Link"],
function() {
if (confirm(i18n["Please confirm that you want to unlink this element."] + "\n" +
i18n["Link points to:"] + " " + link.href)) {
while (link.firstChild)
link.parentNode.insertBefore(link.firstChild, link);
link.parentNode.removeChild(link);
}
},
i18n["Unlink the current element"] ]
);
break;
case "td":
td = target;
if (!tbo) break;
elmenus.push(null,
[ i18n["Cell Properties"],
function() { tableOperation("TO-cell-prop"); },
i18n["Show the Table Cell Properties dialog"],
config.btnList["TO-cell-prop"][1] ]
);
break;
case "tr":
tr = target;
if (!tbo) break;
elmenus.push(null,
[ i18n["Row Properties"],
function() { tableOperation("TO-row-prop"); },
i18n["Show the Table Row Properties dialog"],
config.btnList["TO-row-prop"][1] ],
[ i18n["Insert Row Before"],
function() { tableOperation("TO-row-insert-above"); },
i18n["Insert a new row before the current one"],
config.btnList["TO-row-insert-above"][1] ],
[ i18n["Insert Row After"],
function() { tableOperation("TO-row-insert-under"); },
i18n["Insert a new row after the current one"],
config.btnList["TO-row-insert-under"][1] ],
[ i18n["Delete Row"],
function() { tableOperation("TO-row-delete"); },
i18n["Delete the current row"],
config.btnList["TO-row-delete"][1] ]
);
break;
case "table":
table = target;
if (!tbo) break;
elmenus.push(null,
[ i18n["Table Properties"],
function() { tableOperation("TO-table-prop"); },
i18n["Show the Table Properties dialog"],
config.btnList["TO-table-prop"][1] ],
[ i18n["Insert Column Before"],
function() { tableOperation("TO-col-insert-before"); },
i18n["Insert a new column before the current one"],
config.btnList["TO-col-insert-before"][1] ],
[ i18n["Insert Column After"],
function() { tableOperation("TO-col-insert-after"); },
i18n["Insert a new column after the current one"],
config.btnList["TO-col-insert-after"][1] ],
[ i18n["Delete Column"],
function() { tableOperation("TO-col-delete"); },
i18n["Delete the current column"],
config.btnList["TO-col-delete"][1] ]
);
break;
case "body":
elmenus.push(null,
[ i18n["Justify Left"],
function() { editor.execCommand("justifyleft"); }, null,
config.btnList["justifyleft"][1] ],
[ i18n["Justify Center"],
function() { editor.execCommand("justifycenter"); }, null,
config.btnList["justifycenter"][1] ],
[ i18n["Justify Right"],
function() { editor.execCommand("justifyright"); }, null,
config.btnList["justifyright"][1] ],
[ i18n["Justify Full"],
function() { editor.execCommand("justifyfull"); }, null,
config.btnList["justifyfull"][1] ]
);
break;
}
}
if (selection && !link)
menu.push(null, [ i18n["Make link"],
function() { editor.execCommand("createlink", true); },
i18n["Create a link"],
config.btnList["createlink"][1] ]);
for (var i in elmenus)
menu.push(elmenus[i]);
menu.push(null,
[ i18n["Remove the"] + " &lt;" + currentTarget.tagName + "&gt; " + i18n["Element"],
function() {
if (confirm(i18n["Please confirm that you want to remove this element:"] + " " + currentTarget.tagName)) {
var el = currentTarget;
var p = el.parentNode;
p.removeChild(el);
if (HTMLArea.is_gecko) {
if (p.tagName.toLowerCase() == "td" && !p.hasChildNodes())
p.appendChild(editor._doc.createElement("br"));
editor.forceRedraw();
editor.focusEditor();
editor.updateToolbar();
if (table) {
var save_collapse = table.style.borderCollapse;
table.style.borderCollapse = "collapse";
table.style.borderCollapse = "separate";
table.style.borderCollapse = save_collapse;
}
}
}
},
i18n["Remove this node from the document"] ]);
return menu;
};
ContextMenu.prototype.popupMenu = function(ev) {
var self = this;
var i18n = ContextMenu.I18N;
if (this.currentMenu)
this.currentMenu.parentNode.removeChild(this.currentMenu);
function getPos(el) {
var r = { x: el.offsetLeft, y: el.offsetTop };
if (el.offsetParent) {
var tmp = getPos(el.offsetParent);
r.x += tmp.x;
r.y += tmp.y;
}
return r;
};
function documentClick(ev) {
ev || (ev = window.event);
if (!self.currentMenu) {
alert(i18n["How did you get here? (Please report!)"]);
return false;
}
var el = HTMLArea.is_ie ? ev.srcElement : ev.target;
for (; el != null && el != self.currentMenu; el = el.parentNode);
if (el == null)
self.closeMenu();
//HTMLArea._stopEvent(ev);
//return false;
};
var keys = [];
function keyPress(ev) {
ev || (ev = window.event);
HTMLArea._stopEvent(ev);
if (ev.keyCode == 27) {
self.closeMenu();
return false;
}
var key = String.fromCharCode(HTMLArea.is_ie ? ev.keyCode : ev.charCode).toLowerCase();
for (var i = keys.length; --i >= 0;) {
var k = keys[i];
if (k[0].toLowerCase() == key)
k[1].__msh.activate();
}
};
self.closeMenu = function() {
self.currentMenu.parentNode.removeChild(self.currentMenu);
self.currentMenu = null;
HTMLArea._removeEvent(document, "mousedown", documentClick);
HTMLArea._removeEvent(self.editordoc, "mousedown", documentClick);
if (keys.length > 0)
HTMLArea._removeEvent(self.editordoc, "keypress", keyPress);
if (HTMLArea.is_ie)
self.iePopup.hide();
};
var target = HTMLArea.is_ie ? ev.srcElement : ev.target;
var ifpos = getPos(self.editor._iframe);
var x = ev.clientX + ifpos.x;
var y = ev.clientY + ifpos.y;
var div;
var doc;
if (!HTMLArea.is_ie) {
doc = document;
} else {
// IE stinks
var popup = this.iePopup = window.createPopup();
doc = popup.document;
doc.open();
doc.write("<html><head><style type='text/css'>@import url(" + _editor_url + "plugins/ContextMenu/menu.css); html, body { padding: 0px; margin: 0px; overflow: hidden; border: 0px; }</style></head><body unselectable='yes'></body></html>");
doc.close();
}
div = doc.createElement("div");
if (HTMLArea.is_ie)
div.unselectable = "on";
div.oncontextmenu = function() { return false; };
div.className = "htmlarea-context-menu";
if (!HTMLArea.is_ie)
div.style.left = div.style.top = "0px";
doc.body.appendChild(div);
var table = doc.createElement("table");
div.appendChild(table);
table.cellSpacing = 0;
table.cellPadding = 0;
var parent = doc.createElement("tbody");
table.appendChild(parent);
var options = this.getContextMenu(target);
for (var i = 0; i < options.length; ++i) {
var option = options[i];
var item = doc.createElement("tr");
parent.appendChild(item);
if (HTMLArea.is_ie)
item.unselectable = "on";
else item.onmousedown = function(ev) {
HTMLArea._stopEvent(ev);
return false;
};
if (!option) {
item.className = "separator";
var td = doc.createElement("td");
td.className = "icon";
var IE_IS_A_FUCKING_SHIT = '>';
if (HTMLArea.is_ie) {
td.unselectable = "on";
IE_IS_A_FUCKING_SHIT = " unselectable='on' style='height=1px'>&nbsp;";
}
td.innerHTML = "<div" + IE_IS_A_FUCKING_SHIT + "</div>";
var td1 = td.cloneNode(true);
td1.className = "label";
item.appendChild(td);
item.appendChild(td1);
} else {
var label = option[0];
item.className = "item";
item.__msh = {
item: item,
label: label,
action: option[1],
tooltip: option[2] || null,
icon: option[3] || null,
activate: function() {
self.closeMenu();
self.editor.focusEditor();
this.action();
}
};
label = label.replace(/_([a-zA-Z0-9])/, "<u>$1</u>");
if (label != option[0])
keys.push([ RegExp.$1, item ]);
label = label.replace(/__/, "_");
var td1 = doc.createElement("td");
if (HTMLArea.is_ie)
td1.unselectable = "on";
item.appendChild(td1);
td1.className = "icon";
if (item.__msh.icon)
td1.innerHTML = "<img align='middle' src='" + item.__msh.icon + "' />";
var td2 = doc.createElement("td");
if (HTMLArea.is_ie)
td2.unselectable = "on";
item.appendChild(td2);
td2.className = "label";
td2.innerHTML = label;
item.onmouseover = function() {
this.className += " hover";
self.editor._statusBarTree.innerHTML = this.__msh.tooltip || '&nbsp;';
};
item.onmouseout = function() { this.className = "item"; };
item.oncontextmenu = function(ev) {
this.__msh.activate();
if (!HTMLArea.is_ie)
HTMLArea._stopEvent(ev);
return false;
};
item.onmouseup = function(ev) {
var timeStamp = (new Date()).getTime();
if (timeStamp - self.timeStamp > 500)
this.__msh.activate();
if (!HTMLArea.is_ie)
HTMLArea._stopEvent(ev);
return false;
};
//if (typeof option[2] == "string")
//item.title = option[2];
}
}
if (!HTMLArea.is_ie) {
var dx = x + div.offsetWidth - window.innerWidth + 4;
var dy = y + div.offsetHeight - window.innerHeight + 4;
if (dx > 0) x -= dx;
if (dy > 0) y -= dy;
div.style.left = x + "px";
div.style.top = y + "px";
} else {
// determine the size (did I mention that IE stinks?)
var foobar = document.createElement("div");
foobar.className = "htmlarea-context-menu";
foobar.innerHTML = div.innerHTML;
document.body.appendChild(foobar);
var w = foobar.offsetWidth;
var h = foobar.offsetHeight;
document.body.removeChild(foobar);
this.iePopup.show(ev.screenX, ev.screenY, w, h);
}
this.currentMenu = div;
this.timeStamp = (new Date()).getTime();
HTMLArea._addEvent(document, "mousedown", documentClick);
HTMLArea._addEvent(this.editordoc, "mousedown", documentClick);
if (keys.length > 0)
HTMLArea._addEvent(this.editordoc, "keypress", keyPress);
HTMLArea._stopEvent(ev);
return false;
};

View File

@ -31,6 +31,7 @@ SpellChecker.I18N = {
"Replace all" : "Replace all",
"Replace with" : "Replace with",
"Replace" : "Replace",
"Revert" : "Revert",
"SC-spell-check" : "Spell-check",
"Suggestions" : "Suggestions",
"pliz weit ;-)" : "pliz weit ;-)"

View File

@ -59,20 +59,22 @@
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
(when appropriate). <strike>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.
characters that are not in 0..255 are likely to be reported as "mispelled" by Aspell.</strike>
</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 ;-)
<strong style="font-variant: small-caps; color:
red;">Update:</strong> though I've never seen it mentioned
anywhere, it looks that Aspell <em>does</em>, in fact, speak
Unicode. Or else, maybe <code>Text::Aspell</code> does
transparent conversion; anyway, this new version of our
SpellChecker plugin is, as tests show so far, fully
Unicode-safe... well, probably the <em>only</em> freeware
Web-based spell-checker which happens to have Unicode support.
</p>
<p>
@ -96,8 +98,7 @@
<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=XML%3A%3ADOM&mode=all" target="_blank">XML::DOM</a></li>
<li><a href="http://search.cpan.org/search?query=CGI&mode=all" target="_blank">CGI</a></li>
</ul>
@ -107,7 +108,7 @@
<hr />
<address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
<!-- Created: Thu Jul 17 13:22:27 EEST 2003 -->
<!-- hhmts start --> Last modified: Wed Jan 28 11:13:13 EET 2004 <!-- hhmts end -->
<!-- hhmts start --> Last modified: Fri Jan 30 19:14:11 EET 2004 <!-- hhmts end -->
<!-- doc-lang: English -->
</body>
</html>

View File

@ -1,109 +1,87 @@
#! /usr/bin/perl -w
# Spell Checker Plugin for HTMLArea-3.0
# Implementation by Mihai Bazon. Sponsored by www.americanbible.org
# Sponsored by www.americanbible.org
# Implementation by Mihai Bazon, http://dynarch.com/mishoo/
#
# htmlArea v3.0 - Copyright (c) 2002 interactivetools.com, inc.
# (c) dynarch.com 2003.
# Distributed under the same terms as HTMLArea itself.
# This notice MUST stay intact for use (see license.txt).
#
# A free WYSIWYG editor replacement for <textarea> fields.
# For full source code and docs, visit http://www.interactivetools.com/
#
# Version 3.0 developed by Mihai Bazon for InteractiveTools.
# http://dynarch.com/mishoo
#
# $Id$
use strict;
use utf8;
use Encode;
use Text::Aspell;
use HTML::Parser;
use HTML::Entities;
use XML::DOM;
use CGI;
my $TIMER_start = undef;
eval {
use Time::HiRes qw( gettimeofday tv_interval );
$TIMER_start = [gettimeofday()];
};
# use POSIX qw( locale_h );
binmode STDIN, ':utf8';
binmode STDOUT, ':utf8';
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;
my $total_words = 0;
my $total_mispelled = 0;
my $total_suggestions = 0;
my $total_words_suggested = 0;
# FIXME: report a nice error...
die "Can't create speller!" unless $speller;
my $dict = $cgi->param('dictionary') || $cgi->cookie('dictionary') || 'en';
# add configurable option for this
my $dict = $cgi->param('dictionary') || 'en_US';
$speller->set_option('lang', $dict);
$speller->set_option('encoding', 'UTF-8');
#setlocale(LC_CTYPE, $dict);
# ultra, fast, normal, bad-spellers
# bad-spellers seems to cause segmentation fault
$speller->set_option('sug-mode', 'ultra');
$speller->set_option('sug-mode', 'normal');
my @replacements = ();
my %suggested_words = ();
keys %suggested_words = 128;
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 $file_content = decode('UTF-8', $cgi->param('content'));
$file_content = parse_with_dom($file_content);
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');
my $ck_dictionary = $cgi->cookie(-name => 'dictionary',
-value => $dict,
-expires => '+30d');
if ($debug) {
open (FOO, '>:encoding(UTF-8)', '/tmp/spell-check-before');
print FOO $file_content, "\n";
close(FOO);
}
print $cgi->header(-type => 'text/html; charset: utf-8',
-cookie => $ck_dictionary);
$p->parse($file_content);
$p->eof();
my $js_suggested_words = make_js_hash(\%suggested_words);
my $js_spellcheck_info = make_js_hash_from_array
([
[ 'Total words' , $total_words ],
[ 'Mispelled words' , $total_mispelled . ' in dictionary \"'.$dict.'\"' ],
[ 'Total suggestions' , $total_suggestions ],
[ 'Total words suggested' , $total_words_suggested ],
[ 'Spell-checked in' , defined $TIMER_start ? (tv_interval($TIMER_start) . ' seconds') : 'n/a' ]
]);
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">
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" />
<script type="text/javascript">
var suggested_words = { $js_suggested_words };
var spellcheck_info = { $js_spellcheck_info }; </script>
</head>
<body onload="window.parent.finishedSpellChecking();">^;
@ -112,44 +90,121 @@ if ($cgi->param('init') eq '1') {
my @dicts = $speller->dictionary_info();
my $dictionaries = '';
foreach my $i (@dicts) {
$dictionaries .= ',' . $i->{name} unless $i->{jargon};
next if $i->{jargon};
my $name = $i->{name};
if ($name eq $dict) {
$name = '@'.$name;
}
$dictionaries .= ',' . $name;
}
$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 qq^<div id="HA-spellcheck-dictionaries">$dictionaries</div>^;
}
print '</body></html>';
# Perl is beautiful.
sub spellcheck {
my $text = shift;
sub check { # called for each word in the text
my $node = shift;
my $doc = $node->getOwnerDocument;
my $check = sub { # 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
my $word = shift;
my $already_suggested = defined $suggested_words{$word};
++$total_words;
if (!$already_suggested && $speller->check($word)) {
return undef;
} 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;
++$total_mispelled;
if (!$already_suggested) {
# compute suggestions for this word
my @suggestions = $speller->suggest($word);
my $suggestions = decode($speller->get_option('encoding'), join(',', @suggestions));
$suggested_words{$word} = $suggestions;
++$total_suggestions;
$total_words_suggested += scalar @suggestions;
}
# HA-spellcheck-error
my $err = $doc->createElement('span');
$err->setAttribute('class', 'HA-spellcheck-error');
my $tmp = $doc->createTextNode;
$tmp->setNodeValue($word);
$err->appendChild($tmp);
return $err;
}
};
while ($node->getNodeValue =~ /([\p{IsWord}']+)/) {
my $word = $1;
my $before = $`;
my $after = $';
my $df = &$check($word);
if (!$df) {
$before .= $word;
}
{
my $parent = $node->getParentNode;
my $n1 = $doc->createTextNode;
$n1->setNodeValue($before);
$parent->insertBefore($n1, $node);
$parent->insertBefore($df, $node) if $df;
$node->setNodeValue($after);
}
}
$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;
}
sub check_inner_text {
my $node = shift;
my $text = '';
for (my $i = $node->getFirstChild; defined $i; $i = $i->getNextSibling) {
if ($i->getNodeType == TEXT_NODE) {
spellcheck($i);
}
}
};
sub parse_with_dom {
my ($text) = @_;
$text = '<spellchecker>'.$text.'</spellchecker>';
my $parser = new XML::DOM::Parser;
if ($debug) {
open(FOO, '>:utf8', '/tmp/foo');
print FOO $text;
close FOO;
}
my $doc = $parser->parse($text);
my $nodes = $doc->getElementsByTagName('*');
my $n = $nodes->getLength;
for (my $i = 0; $i < $n; ++$i) {
my $node = $nodes->item($i);
if ($node->getNodeType == ELEMENT_NODE) {
check_inner_text($node);
}
}
my $ret = $doc->toString;
$ret =~ s{<spellchecker>(.*)</spellchecker>}{$1}sg;
return $ret;
};
sub make_js_hash {
my ($hash) = @_;
my $js_hash = '';
while (my ($key, $val) = each %$hash) {
$js_hash .= ',' if $js_hash;
$js_hash .= '"'.$key.'":"'.$val.'"';
}
return $js_hash;
};
sub make_js_hash_from_array {
my ($array) = @_;
my $js_hash = '';
foreach my $i (@$array) {
$js_hash .= ',' if $js_hash;
$js_hash .= '"'.$i->[0].'":"'.$i->[1].'"';
}
return $js_hash;
};

View File

@ -1,8 +1,8 @@
.HA-spellcheck-error { border-bottom: 2px dotted #f00; cursor: default; }
.HA-spellcheck-same { background-color: #ff8; color: #000; }
.HA-spellcheck-error { border-bottom: 1px dashed #f00; cursor: default; }
.HA-spellcheck-same { background-color: #cef; 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-fixed { border-bottom: 1px dashed #0b8; }
.HA-spellcheck-current { background-color: #9be; color: #000; }
.HA-spellcheck-suggestions { display: none; }
#HA-spellcheck-dictionaries { display: none; }

View File

@ -7,17 +7,13 @@
"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
Sponsored by www.americanbible.org
Implementation by Mihai Bazon, http://dynarch.com/mishoo/
htmlArea v3.0 - Copyright (c) 2003 interactivetools.com, inc.
(c) dynarch.com 2003.
Distributed under the same terms as HTMLArea itself.
This notice MUST stay intact for use (see license.txt).
A free WYSIWYG editor replacement for <textarea> fields.
For full source code and docs, visit http://www.interactivetools.com/
Version 3.0 developed by Mihai Bazon for InteractiveTools.
http://dynarch.com/mishoo
$Id$
-->
@ -37,7 +33,7 @@
table { background-color: ButtonFace; color: ButtonText;
font-family: tahoma,verdana,sans-serif; font-size: 11px; }
iframe { background-color: #fff; color: #000; }
iframe { background-color: #fff; color: #000; height: 100%; width: 100%; }
.controls { width: 13em; }
.controls .sectitle { /* background-color: #736c6c; color: #fff;
@ -51,7 +47,7 @@
input, select { font-family: fixed,"andale mono",monospace; }
#v_currentWord { color: #f00; font-weight: bold; font-size: 120%; }
#v_currentWord { color: #f00; font-weight: bold; }
#statusbar { padding: 7px 0px 0px 5px; }
#status { font-weight: bold; }
</style>
@ -61,12 +57,12 @@
<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>
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>
@ -80,8 +76,15 @@
</tr>
<tr>
<td valign="top" class="controls">
<div class="secbody" style="text-align: center">
<button id="b_info">Info</button>
</div>
<div class="sectitle">Original word</div>
<div class="secbody" id="v_currentWord" style="text-align: center">pliz weit ;-)</div>
<div class="secbody" id="v_currentWord" style="text-align:
center; margin-bottom: 0px;">pliz weit ;-)</div>
<div class="secbody" style="text-align: center">
<button id="b_revert">Revert</button>
</div>
<div class="sectitle">Replace with</div>
<div class="secbody">
<input type="text" id="v_replacement" style="width: 94%; margin-left: 3%;" /><br />

View File

@ -12,31 +12,32 @@
var SpellChecker = window.opener.SpellChecker;
var i18n = SpellChecker.I18N;
var is_ie = window.opener.HTMLArea.is_ie;
var HTMLArea = window.opener.HTMLArea;
var is_ie = HTMLArea.is_ie;
var editor = SpellChecker.editor;
var frame = null;
var currentElement = null;
var wrongWords = null;
var modified = false;
var allWords = {};
var fixedWords = [];
var suggested_words = {};
function makeCleanDoc(leaveFixed) {
// document.getElementById("status").innerHTML = 'Please wait: rendering valid HTML';
for (var i in wrongWords) {
var el = wrongWords[i];
var words = wrongWords.concat(fixedWords);
for (var i = words.length; --i >= 0;) {
var el = words[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 {
} 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);
return window.opener.HTMLArea.getHTML(frame.contentWindow.document.body, false, editor);
};
function recheckClicked() {
@ -95,7 +96,14 @@ function replaceClicked() {
index = 0;
alert(i18n["Finished list of mispelled words"]);
}
wrongWords[index].onclick();
wrongWords[index].__msh_wordClicked(true);
return false;
};
function revertClicked() {
document.getElementById("v_replacement").value = currentElement.__msh_origWord;
replaceWord(currentElement);
currentElement.className = "HA-spellcheck-error HA-spellcheck-current";
return false;
};
@ -168,7 +176,7 @@ function initDocument() {
modified = false;
frame = document.getElementById("i_framecontent");
var field = document.getElementById("f_content");
field.value = editor.getHTML();
field.value = HTMLArea.getHTML(editor._doc.body, false, editor);
field.form.submit();
document.getElementById("f_init").value = "0";
@ -190,6 +198,8 @@ function initDocument() {
document.getElementById("b_ignore").onclick = ignoreClicked;
document.getElementById("b_ignall").onclick = ignoreAllClicked;
document.getElementById("b_recheck").onclick = recheckClicked;
document.getElementById("b_revert").onclick = revertClicked;
document.getElementById("b_info").onclick = displayInfo;
document.getElementById("b_ok").onclick = saveClicked;
document.getElementById("b_cancel").onclick = cancelClicked;
@ -200,7 +210,30 @@ function initDocument() {
};
};
function wordClicked() {
function getAbsolutePos(el) {
var r = { x: el.offsetLeft, y: el.offsetTop };
if (el.offsetParent) {
var tmp = getAbsolutePos(el.offsetParent);
r.x += tmp.x;
r.y += tmp.y;
}
return r;
};
function wordClicked(scroll) {
var self = this;
if (scroll) (function() {
var pos = getAbsolutePos(self);
var ws = { x: frame.offsetWidth - 4,
y: frame.offsetHeight - 4 };
var wp = { x: frame.contentWindow.document.body.scrollLeft,
y: frame.contentWindow.document.body.scrollTop };
pos.x -= Math.round(ws.x/2);
if (pos.x < 0) pos.x = 0;
pos.y -= Math.round(ws.y/2);
if (pos.y < 0) pos.y = 0;
frame.contentWindow.scrollTo(pos.x, pos.y);
})();
if (currentElement) {
var a = allWords[currentElement.__msh_origWord];
currentElement.className = currentElement.className.replace(/\s*HA-spellcheck-current\s*/g, " ");
@ -220,8 +253,8 @@ function wordClicked() {
el.className += " HA-spellcheck-same";
}
}
document.getElementById("b_replall").disabled = (a.length <= 1);
document.getElementById("b_ignall").disabled = (a.length <= 1);
// 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";
@ -230,14 +263,17 @@ function wordClicked() {
} else {
txt = a.length + " occurrences";
}
var suggestions = suggested_words[this.__msh_origWord];
if (suggestions)
suggestions = suggestions.split(/,/);
else
suggestions = [];
var select = document.getElementById("v_suggestions");
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");
@ -252,6 +288,8 @@ function wordClicked() {
} else {
document.getElementById("v_replacement").value = this.innerHTML;
}
select.style.display = "none";
select.style.display = "block";
return false;
};
@ -263,11 +301,27 @@ function wordMouseOut() {
this.className = this.className.replace(/\s*HA-spellcheck-hover\s*/g, " ");
};
function displayInfo() {
var info = frame.contentWindow.spellcheck_info;
if (!info)
alert("No information available");
else {
var txt = "** Document information **";
for (var i in info) {
txt += "\n" + i + " : " + info[i];
}
alert(txt);
}
return false;
};
function finishedSpellChecking() {
// initialization of global variables
currentElement = null;
wrongWords = null;
allWords = {};
fixedWords = [];
suggested_words = frame.contentWindow.suggested_words;
document.getElementById("status").innerHTML = "HTMLArea Spell Checker (<a href='readme-tech.html' target='_blank' title='Technical information'>info</a>)";
var doc = frame.contentWindow.document;
@ -278,7 +332,12 @@ function finishedSpellChecking() {
var el = spans[i];
if (/HA-spellcheck-error/.test(el.className)) {
sps.push(el);
el.onclick = wordClicked;
el.__msh_wordClicked = wordClicked;
el.onclick = function(ev) {
ev || (ev = window.event);
ev && HTMLArea._stopEvent(ev);
return this.__msh_wordClicked(false);
};
el.onmouseover = wordMouseOver;
el.onmouseout = wordMouseOut;
el.__msh_id = id++;
@ -289,7 +348,9 @@ function finishedSpellChecking() {
} else {
allWords[txt].push(el);
}
}
} else if (/HA-spellcheck-fixed/.test(el.className)) {
fixedWords.push(el);
}
}
wrongWords = sps;
if (sps.length == 0) {
@ -301,7 +362,7 @@ function finishedSpellChecking() {
}
return false;
}
(currentElement = sps[0]).onclick();
(currentElement = sps[0]).__msh_wordClicked(true);
var as = doc.getElementsByTagName("a");
for (var i = as.length; --i >= 0;) {
var a = as[i];
@ -324,6 +385,10 @@ function finishedSpellChecking() {
for (var i = 0; i < dicts.length; ++i) {
var txt = dicts[i];
var option = document.createElement("option");
if (/^@(.*)$/.test(txt)) {
txt = RegExp.$1;
option.selected = true;
}
option.value = txt;
option.appendChild(document.createTextNode(txt));
select.appendChild(option);

View File

@ -1,15 +1,11 @@
// Spell Checker Plugin for HTMLArea-3.0
// Implementation by Mihai Bazon. Sponsored by www.americanbible.org
// Sponsored by www.americanbible.org
// Implementation by Mihai Bazon, http://dynarch.com/mishoo/
//
// htmlArea v3.0 - Copyright (c) 2002 interactivetools.com, inc.
// (c) dynarch.com 2003.
// Distributed under the same terms as HTMLArea itself.
// This notice MUST stay intact for use (see license.txt).
//
// A free WYSIWYG editor replacement for <textarea> fields.
// For full source code and docs, visit http://www.interactivetools.com/
//
// Version 3.0 developed by Mihai Bazon for InteractiveTools.
// http://dynarch.com/mishoo
//
// $Id$
function SpellChecker(editor) {
@ -68,10 +64,10 @@ SpellChecker.prototype.buttonPress = function(editor, id) {
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");
"scrollbars=no,resizable=yes,width=600,height=450");
} else {
win = window.open(uiurl, "SC_spell_checker",
"toolbar=no,menubar=no,personalbar=no,width=600,height=400," +
"toolbar=no,menubar=no,personalbar=no,width=600,height=450," +
"scrollbars=no,resizable=yes");
}
win.focus();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 0 B

After

Width:  |  Height:  |  Size: 101 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 0 B

After

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 0 B

After

Width:  |  Height:  |  Size: 111 B

View File

@ -1,8 +1,7 @@
// I18N constants
// LANG: "el", ENCODING: UTF-8 | ISO-8859-7
// Author: Dimitris Glezos <dimitris@glezos.com>
// Author: Dimitris Glezos, dimitris@glezos.com
TableOperations.I18N = {
"Align": "Στοίχηση",

View File

@ -1,7 +1,7 @@
// I18N constants
// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
// Author: Mihai Bazon, <mishoo@infoiasi.ro>
// Author: Mihai Bazon, http://dynarch.com/mishoo
// FOR TRANSLATORS:
//

View File

@ -1,7 +1,7 @@
// I18N constants
// LANG: "ro", ENCODING: UTF-8
// Author: Mihai Bazon, <mishoo@infoiasi.ro>
// Author: Mihai Bazon, http://dynarch.com/mishoo
// FOR TRANSLATORS:
//

View File

@ -285,9 +285,10 @@ href="http://dynarch.com" title="http://dynarch.com/" target="_blank">dynarch.co
</p>
<ul>
<li><a href="http://www.neomedia.ro">Neomedia</a> (Romania)</li>
<li><a href="http://www.computerlove.co.uk" target="_blank">Code Computer Love Ltd.</a> (UK)</li>
<li><a href="http://www.neomedia.ro" target="_blank">Neomedia</a> (Romania)</li>
<li><a href="http://www.os3.it" target="_blank">OS3</a> (Italy)</li>
<li><a href="http://www.softwerk.net">SoftWerk</a> (Italy)</li>
<li><a href="http://www.softwerk.net" target="_blank">SoftWerk</a> (Italy)</li>
</ul>
<p>Also many thanks to all people at InteractiveTools.com

View File

@ -6,10 +6,10 @@
<script type="text/javascript">
window.resizeTo(400, 200);
//I18N = window.opener.HTMLArea.I18N.dialogs;
I18N = window.opener.HTMLArea.I18N.dialogs;
function i18n(str) {
// return (I18N[str] || str);
return (I18N[str] || str);
};
function onTargetChanged() {
@ -49,7 +49,9 @@ function Init() {
function onOK() {
var required = {
"f_href": i18n("You must enter the URL where this link points to")
// f_href shouldn't be required or otherwise removing the link by entering an empty
// url isn't possible anymore.
// "f_href": i18n("You must enter the URL where this link points to")
};
for (var i in required) {
var el = document.getElementById(i);

View File

@ -1,7 +1,11 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><% $basename %> release notes</title>
<style>
.fixme { color: red; }
</style>
</head>
<body>
@ -16,48 +20,105 @@
<ul>
<li>
ContextMenu plugin (provides a nice context menu with common
operations, including table ops, link ops, etc.)
<b>New plugins</b>
<ul>
<li>
ContextMenu plugin (provides a nice context menu with common
operations, including table ops, link ops, etc.)
</li>
<li>
CSS plugin (provides an easy way to insert/change CSS classes)
</li>
<li>
FullPage plugin (allows HTMLArea to edit a whole HTML file,
not only the content within &lt;body&gt;.)
</li>
</ul>
</li>
<li>
CSS plugin (provides an easy way to insert/change CSS classes)
<b>Changes in the SpellChecker plugin</b>
<ul>
<li>
Many bugfixes: now it works ;-) Fully Unicode-safe.
</li>
<li>
Speed and bandwidth optimization: reports the list of
suggestions only once for each mispelled word; this helps
in cases where you have, for instance, the word “HTMLArea”
in 10 places all over the document; the list of
suggestions for it--which is kind of huge--will only be
included <em>once</em>.
</li>
<li>
User interface improvements: the highlighted word will
remain in view; in cases where it's normally outside, the
window will be scrolled to it.
</li>
<li>
Added a "Revert" button for those that change their minds ;-)
</li>
<li>
Added a "Info" button which reports information about the
document, retrieved by the server-side spell checker:
total number of words, total number of mispelled words,
number of suggestions made, spell check time, etc. More
can be easily added. <span class="fixme">FIXME: this part
is not yet internationalized.</span>
</li>
<li>
The server-side spell checker now uses XML::DOM instead of
HTML::Parser, which means that it will be unable to parse
“tag-soup” HTML. It needs valid code. Usually HTMLArea
generates valid code, but on rare occasions it might fail
and the spell checker will report a gross error message.
This gonna have to be fixed, but instead of making the
spell checker accept invalid HTML I prefer to make
HTMLArea generate valid code, so changes are to be done in
other places ;-)
</li>
</ul>
</li>
<li>
FullPage plugin (allows HTMLArea to edit a whole HTML file,
not only the content within &lt;body&gt;.)
</li>
<li>
Better plugin support (they register information about
themselves with the editor; can register event handlers for
the editor, etc.)
</li>
<li>
New about box ;-)
</li>
<li>
Word cleaner (can be enabled to automatically kill Word crap
on paste (see Config.killWordOnPaste); otherwise accessible by
pressing CTRL-0 in the editor; a toolbar button will come up
soon)
</li>
<li>
Image preview in "insert image" dialog. Also allows
modification of current image, if selected.
</li>
<li>
New "insert link" dialog, allows target and title
specification, allows editing links.
</li>
<li>
Implemented support for text direction (left-to-right or
right-to-left).
</li>
<li>
<a href="ChangeLog">Full CVS ChangeLog</a> is now
automatically generated from the CVS logs.
</li>
<li>
Lots of bug fixes!
<b>Changes in the core editor</b>
<ul>
<li>
Easier to setup: you only need to load
<tt>htmlarea.js</tt>; other scripts will be loaded
automatically. <a href="reference.html">Documentation</a>
and <a href="examples/">examples</a> updated.
</li>
<li>
Better plugin support (they register information about
themselves with the editor; can register event handlers for
the editor, etc.)
</li>
<li>
New about box; check it out, it's cool ;-)
</li>
<li>
Word cleaner (can be enabled to automatically kill Word crap
on paste (see Config.killWordOnPaste); otherwise accessible by
pressing CTRL-0 in the editor; a toolbar button will come up
soon)
</li>
<li>
Image preview in "insert image" dialog. Also allows
modification of current image, if selected.
</li>
<li>
New "insert link" dialog, allows target and title
specification, allows editing links.
</li>
<li>
Implemented support for text direction (left-to-right or
right-to-left).
</li>
<li>
Lots of bug fixes! ... and more, I guess ;-) an
automatically generated <a href="ChangeLog">change log</a>
is now available.
</li>
</ul>
</li>
</ul>
@ -130,7 +191,7 @@ system</a> at SourceForge
<hr />
<address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
<!-- Created: Sun Aug 3 16:55:08 EEST 2003 -->
<!-- hhmts start --> Last modified: Wed Jan 28 12:53:03 EET 2004 <!-- hhmts end -->
<!-- hhmts start --> Last modified: Wed Mar 31 19:18:26 EEST 2004 <!-- hhmts end -->
<!-- doc-lang: English -->
</body>
</html>