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

View File

@ -15,7 +15,7 @@ if (typeof _editor_url == "string") {
// Leave exactly one backslash at the end of _editor_url // Leave exactly one backslash at the end of _editor_url
_editor_url = _editor_url.replace(/\x2f*$/, '/'); _editor_url = _editor_url.replace(/\x2f*$/, '/');
} else { } 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 = ''; _editor_url = '';
} }
@ -127,7 +127,7 @@ HTMLArea.Config = function () {
[ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator", [ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator",
"lefttoright", "righttoleft", "separator", "lefttoright", "righttoleft", "separator",
"insertorderedlist", "insertunorderedlist", "outdent", "indent", "separator", "orderedlist", "unorderedlist", "outdent", "indent", "separator",
"forecolor", "hilitecolor", "separator", "forecolor", "hilitecolor", "separator",
"inserthorizontalrule", "createlink", "insertimage", "inserttable", "htmlmode", "separator", "inserthorizontalrule", "createlink", "insertimage", "inserttable", "htmlmode", "separator",
"popupeditor", "separator", "showhelp", "about" ] "popupeditor", "separator", "showhelp", "about" ]
@ -197,8 +197,8 @@ HTMLArea.Config = function () {
justifycenter: [ "Justify Center", "ed_align_center.gif", false, function(e) {e.execCommand("justifycenter");} ], 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");} ], 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");} ], 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");} ], orderedlist: [ "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");} ], 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");} ], 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");} ], 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");} ], 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 cmd = null;
var customSelects = editor.config.customSelects; var customSelects = editor.config.customSelects;
var context = null; var context = null;
var tooltip = "";
switch (txt) { switch (txt) {
case "fontsize": case "fontsize":
case "fontname": case "fontname":
@ -436,6 +437,9 @@ HTMLArea.prototype._createToolbar = function () {
if (typeof dropdown != "undefined") { if (typeof dropdown != "undefined") {
options = dropdown.options; options = dropdown.options;
context = dropdown.context; context = dropdown.context;
if (typeof dropdown.tooltip != "undefined") {
tooltip = dropdown.tooltip;
}
} else { } else {
alert("ERROR [createSelect]:\nCan't find the requested dropdown definition"); alert("ERROR [createSelect]:\nCan't find the requested dropdown definition");
} }
@ -443,6 +447,7 @@ HTMLArea.prototype._createToolbar = function () {
} }
if (options) { if (options) {
el = document.createElement("select"); el = document.createElement("select");
el.title = tooltip;
var obj = { var obj = {
name : txt, // field name name : txt, // field name
element : el, // the UI element (SELECT) 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 // add a handler for the "back/forward" case -- on body.unload we save
// the HTML content into the original textarea. // the HTML content into the original textarea.
window.onunload = function() { try {
editor._textArea.value = editor.getHTML(); window.onunload = function() {
}; editor._textArea.value = editor.getHTML();
};
} catch(e) {};
// creates & appends the toolbar // creates & appends the toolbar
this._createToolbar(); this._createToolbar();
// create the IFRAME // create the IFRAME
var iframe = document.createElement("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); htmlarea.appendChild(iframe);
this._iframe = iframe; this._iframe = iframe;
@ -741,8 +753,8 @@ HTMLArea.prototype.generate = function () {
html += "<head>\n"; html += "<head>\n";
if (editor.config.baseURL) if (editor.config.baseURL)
html += '<base href="' + editor.config.baseURL + '" />'; html += '<base href="' + editor.config.baseURL + '" />';
html += "<style> html,body { border: 0px; } " + html += "<style>" + editor.config.pageStyle +
editor.config.pageStyle + "</style>\n"; " html,body { border: 0px; }</style>\n";
html += "</head>\n"; html += "</head>\n";
html += "<body>\n"; html += "<body>\n";
html += editor._textArea.value; html += editor._textArea.value;
@ -781,6 +793,10 @@ HTMLArea.prototype.generate = function () {
var plugin = editor.plugins[i].instance; var plugin = editor.plugins[i].instance;
if (typeof plugin.onGenerate == "function") if (typeof plugin.onGenerate == "function")
plugin.onGenerate(); plugin.onGenerate();
if (typeof plugin.onGenerateOnce == "function") {
plugin.onGenerateOnce();
plugin.onGenerateOnce = null;
}
} }
setTimeout(function() { setTimeout(function() {
@ -839,6 +855,11 @@ HTMLArea.prototype.setMode = function(mode) {
} }
this._editMode = mode; this._editMode = mode;
this.focusEditor(); 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) { HTMLArea.prototype.setFullHTML = function(html) {
@ -876,6 +897,10 @@ HTMLArea.prototype.setFullHTML = function(html) {
HTMLArea.prototype.registerPlugin2 = function(plugin, args) { HTMLArea.prototype.registerPlugin2 = function(plugin, args) {
if (typeof plugin == "string") if (typeof plugin == "string")
plugin = eval(plugin); 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); var obj = new plugin(this, args);
if (obj) { if (obj) {
var clone = {}; var clone = {};
@ -1003,8 +1028,11 @@ HTMLArea.prototype.forceRedraw = function() {
// focuses the iframe window. returns a reference to the editor document. // focuses the iframe window. returns a reference to the editor document.
HTMLArea.prototype.focusEditor = function() { HTMLArea.prototype.focusEditor = function() {
switch (this._editMode) { switch (this._editMode) {
case "wysiwyg" : this._iframe.contentWindow.focus(); break; // notice the try { ... } catch block to avoid some rare exceptions in FireFox
case "textmode": this._textArea.focus(); break; // (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"); default : alert("ERROR: mode " + this._editMode + " is not defined");
} }
return this._doc; return this._doc;
@ -1098,6 +1126,7 @@ HTMLArea.prototype.updateToolbar = function(noStatus) {
} }
} }
} }
for (var i in this._toolbarObjects) { for (var i in this._toolbarObjects) {
var btn = this._toolbarObjects[i]; var btn = this._toolbarObjects[i];
var cmd = i; var cmd = i;
@ -1197,6 +1226,7 @@ HTMLArea.prototype.updateToolbar = function(noStatus) {
btn.state("active", (el.style.direction == ((cmd == "righttoleft") ? "rtl" : "ltr"))); btn.state("active", (el.style.direction == ((cmd == "righttoleft") ? "rtl" : "ltr")));
break; break;
default: default:
cmd = cmd.replace(/(un)?orderedlist/i, "insert$1orderedlist");
try { try {
btn.state("active", (!text && doc.queryCommandState(cmd))); btn.state("active", (!text && doc.queryCommandState(cmd)));
} catch (e) {} } catch (e) {}
@ -1210,6 +1240,7 @@ HTMLArea.prototype.updateToolbar = function(noStatus) {
editor._timerUndo = null; editor._timerUndo = null;
}, this.config.undoTimeout); }, this.config.undoTimeout);
} }
// check if any plugins have registered refresh handlers // check if any plugins have registered refresh handlers
for (var i in this.plugins) { for (var i in this.plugins) {
var plugin = this.plugins[i].instance; var plugin = this.plugins[i].instance;
@ -1404,18 +1435,33 @@ HTMLArea.prototype._createLink = function(link) {
if (!param) if (!param)
return false; return false;
var a = link; var a = link;
if (!a) { if (!a) try {
editor._doc.execCommand("createlink", false, param.f_href); editor._doc.execCommand("createlink", false, param.f_href);
a = editor.getParentElement(); a = editor.getParentElement();
var sel = editor._getSelection(); var sel = editor._getSelection();
var range = editor._createRange(sel); var range = editor._createRange(sel);
if (!HTMLArea.is_ie) { if (!HTMLArea.is_ie) {
a = range.startContainer; a = range.startContainer;
if (!/^a$/i.test(a.tagName)) if (!/^a$/i.test(a.tagName)) {
a = a.nextSibling; a = a.nextSibling;
if (a == null)
a = range.startContainer.parentNode;
}
} }
} else a.href = param.f_href.trim(); } catch(e) {}
if (!/^a$/i.test(a.tagName)) 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; return false;
a.target = param.f_target.trim(); a.target = param.f_target.trim();
a.title = param.f_title.trim(); a.title = param.f_title.trim();
@ -1463,6 +1509,7 @@ HTMLArea.prototype._insertImage = function(image) {
} else { } else {
img.src = param.f_url; img.src = param.f_url;
} }
for (field in param) { for (field in param) {
var value = param[field]; var value = param[field];
switch (field) { switch (field) {
@ -1489,6 +1536,7 @@ HTMLArea.prototype._insertTable = function() {
// create the table element // create the table element
var table = doc.createElement("table"); var table = doc.createElement("table");
// assign the given arguments // assign the given arguments
for (var field in param) { for (var field in param) {
var value = param[field]; var value = param[field];
if (!value) { if (!value) {
@ -1498,8 +1546,8 @@ HTMLArea.prototype._insertTable = function() {
case "f_width" : table.style.width = value + param["f_unit"]; break; case "f_width" : table.style.width = value + param["f_unit"]; break;
case "f_align" : table.align = value; break; case "f_align" : table.align = value; break;
case "f_border" : table.border = parseInt(value); break; case "f_border" : table.border = parseInt(value); break;
case "f_spacing" : table.cellspacing = parseInt(value); break; case "f_spacing" : table.cellSpacing = parseInt(value); break;
case "f_padding" : table.cellpadding = parseInt(value); break; case "f_padding" : table.cellPadding = parseInt(value); break;
} }
} }
var tbody = doc.createElement("tbody"); var tbody = doc.createElement("tbody");
@ -1572,6 +1620,8 @@ HTMLArea.prototype.execCommand = function(cmdID, UI, param) {
this._createLink(); this._createLink();
break; break;
case "popupeditor": case "popupeditor":
// this object will be passed to the newly opened window
HTMLArea._object = this;
if (HTMLArea.is_ie) { if (HTMLArea.is_ie) {
//if (confirm(HTMLArea.I18N.msg["IE-sucks-full-screen"])) //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," + "toolbar=no,menubar=no,personalbar=no,width=640,height=480," +
"scrollbars=no,resizable=yes"); "scrollbars=no,resizable=yes");
} }
// pass this object to the newly opened window
HTMLArea._object = this;
break; break;
case "undo": case "undo":
case "redo": case "redo":
@ -1610,9 +1658,14 @@ HTMLArea.prototype.execCommand = function(cmdID, UI, param) {
this._doc.execCommand(cmdID, UI, param); this._doc.execCommand(cmdID, UI, param);
} catch (e) { } catch (e) {
if (HTMLArea.is_gecko) { if (HTMLArea.is_gecko) {
if (confirm("Unprivileged scripts cannot access Cut/Copy/Paste programatically " + if (typeof HTMLArea.I18N.msg["Moz-Clipboard"] == "undefined") {
"for security reasons. Click OK to see a technical note at mozilla.org " + HTMLArea.I18N.msg["Moz-Clipboard"] =
"which shows you how to allow a script to access the 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"); 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) { HTMLArea.prototype._editorEvent = function(ev) {
var editor = this; var editor = this;
var keyEvent = (HTMLArea.is_ie && ev.type == "keydown") || (ev.type == "keypress"); 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 sel = null;
var range = null; var range = null;
var key = String.fromCharCode(HTMLArea.is_ie ? ev.keyCode : ev.charCode).toLowerCase(); var key = String.fromCharCode(HTMLArea.is_ie ? ev.keyCode : ev.charCode).toLowerCase();
@ -1982,7 +2042,11 @@ HTMLArea.getHTML = function(root, outputRoot, editor) {
continue; continue;
} }
var name = a.nodeName.toLowerCase(); 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 // avoid certain attributes
continue; continue;
} }
@ -2020,7 +2084,9 @@ HTMLArea.getHTML = function(root, outputRoot, editor) {
} }
html += " " + name + '="' + value + '"'; html += " " + name + '="' + value + '"';
} }
html += closed ? " />" : ">"; if (html != "") {
html += closed ? " />" : ">";
}
} }
for (i = root.firstChild; i; i = i.nextSibling) { for (i = root.firstChild; i; i = i.nextSibling) {
html += HTMLArea.getHTML(i, true, editor); html += HTMLArea.getHTML(i, true, editor);
@ -2030,7 +2096,16 @@ HTMLArea.getHTML = function(root, outputRoot, editor) {
} }
break; break;
case 3: // Node.TEXT_NODE 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; break;
case 8: // Node.COMMENT_NODE case 8: // Node.COMMENT_NODE
html = "<!--" + root.data + "-->"; 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 // I18N constants
// - translated by AtK<atk@chello.at>
// term´s and licenses are equal to htmlarea! // LANG: "de", ENCODING: ISO-8859-1 for the german umlaut!
// translation improved by broxx<broxx@broxx.com>
HTMLArea.I18N = { HTMLArea.I18N = {
@ -16,30 +15,35 @@ HTMLArea.I18N = {
strikethrough: "Durchgestrichen", strikethrough: "Durchgestrichen",
subscript: "Hochgestellt", subscript: "Hochgestellt",
superscript: "Tiefgestellt", superscript: "Tiefgestellt",
justifyleft: "Links ausrichten", justifyleft: "Linksbündig",
justifycenter: "Zentrieren", justifycenter: "Zentriert",
justifyright: "Rechts ausrichten", justifyright: "Rechtsbündig",
justifyfull: "Blocksatz", justifyfull: "Blocksatz",
orderedlist: "Nummerierung", orderedlist: "Nummerierung",
unorderedlist: "Aufzaehlungszeichen", unorderedlist: "Aufzählungszeichen",
outdent: "Einzug verkleinern", outdent: "Einzug verkleinern",
indent: "Einzug vergrössern", indent: "Einzug vergrößern",
forecolor: "Text Farbe", forecolor: "Schriftfarbe",
hilitecolor: "Hintergrund Farbe", backcolor: "Hindergrundfarbe",
hilitecolor: "Hintergrundfarbe",
horizontalrule: "Horizontale Linie", horizontalrule: "Horizontale Linie",
createlink: "Hyperlink einfuegen", inserthorizontalrule: "Horizontale Linie",
insertimage: "Bild einfuegen", createlink: "Hyperlink einfügen",
inserttable: "Tabelle einfuegen", insertimage: "Bild einfügen",
inserttable: "Tabelle einfügen",
htmlmode: "HTML Modus", htmlmode: "HTML Modus",
popupeditor: "Editor im Popup öffnen", popupeditor: "Editor im Popup öffnen",
about: "Ueber HtmlArea", about: "Über htmlarea",
help: "Hilfe",
showhelp: "Hilfe", showhelp: "Hilfe",
textindicator: "derzeitiger Stil", textindicator: "Derzeitiger Stil",
undo: "Rueckgaengig", undo: "Rückgängig",
redo: "Wiederholen", redo: "Wiederholen",
cut: "Ausschneiden", cut: "Ausschneiden",
copy: "Kopieren", copy: "Kopieren",
paste: "Einfuegen" paste: "Einfügen aus der Zwischenablage",
lefttoright: "Textrichtung von Links nach Rechts",
righttoleft: "Textrichtung von Rechts nach Links"
}, },
buttons: { buttons: {
@ -49,6 +53,27 @@ HTMLArea.I18N = {
msg: { msg: {
"Path": "Pfad", "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", justifycenter: "Joonda keskele",
justifyright: "Joonda paremale", justifyright: "Joonda paremale",
justifyfull: "Rööpjoonda", justifyfull: "Rööpjoonda",
insertorderedlist: "Nummerdus", orderedlist: "Nummerdus",
insertunorderedlist: "Täpploend", unorderedlist: "Täpploend",
outdent: "Vähenda taanet", outdent: "Vähenda taanet",
indent: "Suurenda taanet", indent: "Suurenda taanet",
forecolor: "Fondi värv", forecolor: "Fondi värv",

View File

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

View File

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

View File

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

View File

@ -1,5 +1,7 @@
// I18N constants // 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: // FOR TRANSLATORS:
// //
@ -10,6 +12,12 @@
// (if this is not possible, please include a comment // (if this is not possible, please include a comment
// that states what encoding is necessary.) // 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 = { HTMLArea.I18N = {
// the following should be the filename without .js extension // the following should be the filename without .js extension
@ -21,32 +29,34 @@ HTMLArea.I18N = {
italic: "Italique", italic: "Italique",
underline: "Souligné", underline: "Souligné",
strikethrough: "Barré", strikethrough: "Barré",
subscript: "Subscript", subscript: "Indice",
superscript: "Superscript", superscript: "Exposant",
justifyleft: "Aligné à gauche", justifyleft: "Aligné à gauche",
justifycenter: "Centré", justifycenter: "Centré",
justifyright: "Aligné à droite", justifyright: "Aligné à droite",
justifyfull: "Justifié", justifyfull: "Justifier",
orderedlist: "Numérotation", orderedlist: "Numérotation",
unorderedlist: "Puces", unorderedlist: "Puces",
outdent: "Augmenter le retrait", outdent: "Diminuer le retrait",
indent: "Diminuer le retrait", indent: "Augmenter le retrait",
forecolor: "Couleur du texte", forecolor: "Couleur de police",
hilitecolor: "Couleur du fond", hilitecolor: "Surlignage",
horizontalrule: "Ligne horizontale", horizontalrule: "Ligne horizontale",
createlink: "Insérer un lien", createlink: "Insérer un hyperlien",
insertimage: "Insérer une image", insertimage: "Insérer/Modifier une image",
inserttable: "Insérer un tableau", inserttable: "Insérer un tableau",
htmlmode: "Passer au code source HTML", htmlmode: "Passer au code source",
popupeditor: "Agrandir l'éditeur", popupeditor: "Agrandir l'éditeur",
about: "A propos de cet éditeur", about: "À propos de cet éditeur",
showhelp: "Aide sur l'éditeur", showhelp: "Aide sur l'éditeur",
textindicator: "Style courant", textindicator: "Style courant",
undo: "Annule la dernière action", undo: "Annuler la dernière action",
redo: "Refait la dernière action", redo: "Répéter la dernière action",
cut: "Coupe la sélection", cut: "Couper la sélection",
copy: "Copie la sélection", copy: "Copier la sélection",
paste: "Colle depuis le presse papiers" paste: "Coller depuis le presse-papier",
lefttoright: "Direction de gauche à droite",
righttoleft: "Direction de droite à gauche"
}, },
buttons: { buttons: {
@ -56,6 +66,32 @@ HTMLArea.I18N = {
msg: { msg: {
"Path": "Chemin", "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 // I18N constants
// LANG: "he", ENCODING: UTF-8 // 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: // FOR TRANSLATORS:
// //
@ -28,7 +28,7 @@ HTMLArea.I18N = {
justifyleft: " ישור לשמאל", justifyleft: " ישור לשמאל",
justifycenter: "ישור למרכז", justifycenter: "ישור למרכז",
justifyright: "ישור לימין", justifyright: "ישור לימין",
justifyfull: "יישור לשורה מלאה", justifyfull: "ישור לשורה מלאה",
orderedlist: "רשימה ממוספרת", orderedlist: "רשימה ממוספרת",
unorderedlist: "רשימה לא ממוספרת", unorderedlist: "רשימה לא ממוספרת",
outdent: "הקטן כניסה", outdent: "הקטן כניסה",
@ -37,7 +37,7 @@ HTMLArea.I18N = {
hilitecolor: "צבע רקע", hilitecolor: "צבע רקע",
horizontalrule: "קו אנכי", horizontalrule: "קו אנכי",
createlink: "הכנס היפר-קישור", createlink: "הכנס היפר-קישור",
insertimage: "הכנס תמונה", insertimage: "הכנס/שנה תמונה",
inserttable: "הכנס טבלה", inserttable: "הכנס טבלה",
htmlmode: "שנה מצב קוד HTML", htmlmode: "שנה מצב קוד HTML",
popupeditor: "הגדל את העורך", popupeditor: "הגדל את העורך",
@ -48,16 +48,42 @@ HTMLArea.I18N = {
redo: "מבצע מחדש את הפעולה האחרונה שביטלת", redo: "מבצע מחדש את הפעולה האחרונה שביטלת",
cut: "גזור בחירה", cut: "גזור בחירה",
copy: "העתק בחירה", copy: "העתק בחירה",
paste: "הדבק מהלוח" paste: "הדבק מהלוח",
lefttoright: "כיוון משמאל לימין",
righttoleft: "כיוון מימין לשמאל"
}, },
buttons: { buttons: {
"ok": "OK", "ok": "אישור",
"cancel": "ביטול" "cancel": "ביטול"
}, },
msg: { msg: {
"Path": "נתיב עיצוב", "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", redo: "Újra végrehajtás",
cut: "Kivágás", cut: "Kivágás",
copy: "Másolás", copy: "Másolás",
paste: "Beillesztés" paste: "Beillesztés",
lefttoright: "Irány balról jobbra",
righttoleft: "Irány jobbról balra"
}, },
buttons: { buttons: {
@ -58,6 +60,31 @@ HTMLArea.I18N = {
msg: { msg: {
"Path": "Hierarchia", "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 // LANG: "it", ENCODING: UTF-8 | ISO-8859-1
// Author: Fabio Rotondo <fabio@rotondo.it> // Author: Fabio Rotondo <fabio@rotondo.it>
// Update for 3.0 rc1: Giovanni Premuda <gpremuda@softwerk.it>
HTMLArea.I18N = { HTMLArea.I18N = {
// the following should be the filename without .js extension // the following should be the filename without .js extension
// it will be used for automatically load plugin language. // it will be used for automatically load plugin language.
lang: "it", lang: "it",
tooltips: { tooltips: {
bold: "Grassetto", bold: "Grassetto",
italic: "Italico", italic: "Corsivo",
underline: "Sottolineato", underline: "Sottolineato",
strikethrough: "Barrato", strikethrough: "Barrato",
subscript: "Pedice", subscript: "Pedice",
superscript: "Apice", superscript: "Apice",
justifyleft: "Giustifica a Sinistra", justifyleft: "Allinea a sinistra",
justifycenter: "Giustifica in Centro", justifycenter: "Allinea in centro",
justifyright: "Giustifica a Destra", justifyright: "Allinea a destra",
justifyfull: "Giustifica Completamente", justifyfull: "Giustifica",
orderedlist: "Lista Ordinata", insertorderedlist: "Lista ordinata",
unorderedlist: "Lista Puntata", insertunorderedlist: "Lista puntata",
outdent: "Decrementa Indentazione", outdent: "Decrementa indentazione",
indent: "Incrementa Indentazione", indent: "Incrementa indentazione",
forecolor: "Colore del Carattere", forecolor: "Colore del carattere",
hilitecolor: "Colore di Sfondo", hilitecolor: "Colore di sfondo",
horizontalrule: "Linea Orizzontale", inserthorizontalrule: "Linea orizzontale",
createlink: "Inserisci un Link", createlink: "Inserisci un link",
insertimage: "Inserisci un'Immagine", insertimage: "Inserisci un'immagine",
inserttable: "Inserisci una Tabella", inserttable: "Inserisci una tabella",
htmlmode: "Attiva il codice HTML", htmlmode: "Visualizzazione HTML",
popupeditor: "Allarga l'editor", popupeditor: "Editor a pieno schermo",
about: "Info sull'editor", about: "Info sull'editor",
showhelp: "Aiuto sull'editor", showhelp: "Aiuto sull'editor",
textindicator: "Stile Attuale", textindicator: "Stile corrente",
undo: "Elimina l'ultima modifica", undo: "Annulla",
redo: "Ripristina l'ultima modifica", redo: "Ripristina",
cut: "Taglia l'area selezionata", cut: "Taglia",
copy: "Copia l'area selezionata", copy: "Copia",
paste: "Incolla dalla memoria" paste: "Incolla",
}, lefttoright: "Scrivi da sinistra a destra",
righttoleft: "Scrivi da destra a sinistra"
},
buttons: { buttons: {
"ok": "OK", "ok": "OK",
"cancel": "Annulla" "cancel": "Annulla"
}, },
msg: { msg: {
"Path": "Percorso", "Path": "Percorso",
"TEXT_MODE": "Sei in MODALITA' TESTO. Usa il bottone [<>] per tornare alla modalità WYSIWYG." "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 // LANG: "lt", ENCODING: UTF-8
// Author: Jaroslav Šatkevič, <jaro@akl.lt> // Author: Jaroslav Šatkevič, <jaro@akl.lt>
HTMLArea.I18N = { HTMLArea.I18N = {
// the following should be the filename without .js extension // the following should be the filename without .js extension
// it will be used for automatically load plugin language. // it will be used for automatically load plugin language.
lang: "lt", lang: "en",
tooltips: { tooltips: {
bold: "Paryškinti", bold: "Paryškinti",
@ -41,7 +40,7 @@ HTMLArea.I18N = {
cut: "Iškirpti", cut: "Iškirpti",
copy: "Kopijuoti", copy: "Kopijuoti",
paste: "Įterpti" paste: "Įterpti"
}, },
buttons: { buttons: {
"ok": "OK", "ok": "OK",
@ -50,6 +49,29 @@ HTMLArea.I18N = {
msg: { msg: {
"Path": "Kelias", "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", justifycenter: "Centreren",
justifyright: "Rechts uitlijnen", justifyright: "Rechts uitlijnen",
justifyfull: "Uitvullen", justifyfull: "Uitvullen",
insertorderedlist: "Nummering", orderedlist: "Nummering",
insertunorderedlist: "Opsommingstekens", unorderedlist: "Opsommingstekens",
outdent: "Inspringing verkleinen", outdent: "Inspringing verkleinen",
indent: "Inspringing vergroten", indent: "Inspringing vergroten",
forecolor: "Tekstkleur", 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> // - translated by ses<ses@online.no>
// Additional translations by Håvard Wigtil <havardw@extend.no>
// term´s and licenses are equal to htmlarea! // term´s and licenses are equal to htmlarea!
HTMLArea.I18N = { HTMLArea.I18N = {
@ -9,31 +10,38 @@ HTMLArea.I18N = {
lang: "no", lang: "no",
tooltips: { tooltips: {
bold: "Fet", bold: "Fet",
italic: "Kursiv", italic: "Kursiv",
underline: "Understreket", underline: "Understreket",
strikethrough: "Gjennomstreket", strikethrough: "Gjennomstreket",
subscript: "Nedsenket", subscript: "Nedsenket",
superscript: "Opphøyet", superscript: "Opphøyet",
justifyleft: "Venstrejuster", justifyleft: "Venstrejuster",
justifycenter: "Midtjuster", justifycenter: "Midtjuster",
justifyright: "Høyrejuster", justifyright: "Høyrejuster",
justifyfull: "Blokkjuster", justifyfull: "Blokkjuster",
orderedlist: "Nummerert liste", orderedlist: "Nummerert liste",
unorderedlist: "Punktliste", unorderedlist: "Punktliste",
outdent: "Reduser innrykk", outdent: "Reduser innrykk",
indent: "Øke innrykk", indent: "Øke innrykk",
forecolor: "Tekstfarge", forecolor: "Tekstfarge",
backcolor: "Bakgrundsfarge", hilitecolor: "Bakgrundsfarge",
horizontalrule: "Vannrett linje", inserthorizontalrule: "Vannrett linje",
createlink: "Lag lenke", createlink: "Lag lenke",
insertimage: "Sett inn bilde", insertimage: "Sett inn bilde",
inserttable: "Sett inn tabell", inserttable: "Sett inn tabell",
htmlmode: "Vis kildekode", htmlmode: "Vis kildekode",
popupeditor: "Vis i eget vindu", popupeditor: "Vis i eget vindu",
about: "Om denne editor", about: "Om denne editor",
help: "Hjelp", showhelp: "Hjelp",
textindicator: "Nåværende stil" 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: { buttons: {
@ -43,6 +51,29 @@ HTMLArea.I18N = {
msg: { msg: {
"Path": "Tekstvelger", "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: "По центру", justifycenter: "По центру",
justifyright: "По правому краю", justifyright: "По правому краю",
justifyfull: "По ширине", justifyfull: "По ширине",
insertorderedlist: "Нумерованный лист", orderedlist: "Нумерованный лист",
insertunorderedlist: "Маркированный лист", unorderedlist: "Маркированный лист",
outdent: "Уменьшить отступ", outdent: "Уменьшить отступ",
indent: "Увеличить отступ", indent: "Увеличить отступ",
forecolor: "Цвет шрифта", 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 all" : "Replace all",
"Replace with" : "Replace with", "Replace with" : "Replace with",
"Replace" : "Replace", "Replace" : "Replace",
"Revert" : "Revert",
"SC-spell-check" : "Spell-check", "SC-spell-check" : "Spell-check",
"Suggestions" : "Suggestions", "Suggestions" : "Suggestions",
"pliz weit ;-)" : "pliz weit ;-)" "pliz weit ;-)" : "pliz weit ;-)"

View File

@ -59,20 +59,22 @@
Unicode safe. HTML entities are expanded into their corresponding Unicode safe. HTML entities are expanded into their corresponding
Unicode characters. These characters will be matched as part of the Unicode characters. These characters will be matched as part of the
word passed to Aspell. All texts passed to Aspell are in Unicode 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 yet (<a
href="http://mail.gnu.org/archive/html/aspell-user/2000-11/msg00007.html">thread concerning Aspell and Unicode</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 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>
<p> <p>
I digged the Net for a couple of hours today and I can't seem to find <strong style="font-variant: small-caps; color:
any open-source spell checker that has Unicode support. For this red;">Update:</strong> though I've never seen it mentioned
reason we keep using Aspell, because it also seems to have the anywhere, it looks that Aspell <em>does</em>, in fact, speak
best suggestions engine. Unicode support will eventually be Unicode. Or else, maybe <code>Text::Aspell</code> does
implemented in Aspell. <a href="mailto:kevin@atkinson.dhs.org">Email transparent conversion; anyway, this new version of our
Kevin Atkinson</a> (Aspell author and maintainer) about this ;-) 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>
<p> <p>
@ -96,8 +98,7 @@
<ul> <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=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=XML%3A%3ADOM&mode=all" target="_blank">XML::DOM</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> <li><a href="http://search.cpan.org/search?query=CGI&mode=all" target="_blank">CGI</a></li>
</ul> </ul>
@ -107,7 +108,7 @@
<hr /> <hr />
<address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address> <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
<!-- Created: Thu Jul 17 13:22:27 EEST 2003 --> <!-- 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 --> <!-- doc-lang: English -->
</body> </body>
</html> </html>

View File

@ -1,109 +1,87 @@
#! /usr/bin/perl -w #! /usr/bin/perl -w
# Spell Checker Plugin for HTMLArea-3.0 # 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). # 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$ # $Id$
use strict; use strict;
use utf8; use utf8;
use Encode; use Encode;
use Text::Aspell; use Text::Aspell;
use HTML::Parser; use XML::DOM;
use HTML::Entities;
use CGI; 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; 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 $speller = new Text::Aspell;
my $cgi = new CGI; 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... # FIXME: report a nice error...
die "Can't create speller!" unless $speller; die "Can't create speller!" unless $speller;
my $dict = $cgi->param('dictionary') || $cgi->cookie('dictionary') || 'en';
# add configurable option for this # add configurable option for this
my $dict = $cgi->param('dictionary') || 'en_US';
$speller->set_option('lang', $dict); $speller->set_option('lang', $dict);
$speller->set_option('encoding', 'UTF-8');
#setlocale(LC_CTYPE, $dict);
# ultra, fast, normal, bad-spellers # ultra, fast, normal, bad-spellers
# bad-spellers seems to cause segmentation fault # 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 $file_content = decode('UTF-8', $cgi->param('content'));
my ($offset, $length, $text, $is_cdata) = @_; $file_content = parse_with_dom($file_content);
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 my $ck_dictionary = $cgi->cookie(-name => 'dictionary',
(api_version => 3, -value => $dict,
handlers => { start => [ sub { -expires => '+30d');
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) { print $cgi->header(-type => 'text/html; charset: utf-8',
open (FOO, '>:encoding(UTF-8)', '/tmp/spell-check-before'); -cookie => $ck_dictionary);
print FOO $file_content, "\n";
close(FOO);
}
$p->parse($file_content); my $js_suggested_words = make_js_hash(\%suggested_words);
$p->eof(); 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) { print qq^<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
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> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" media="all" href="spell-check-style.css" /> <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> </head>
<body onload="window.parent.finishedSpellChecking();">^; <body onload="window.parent.finishedSpellChecking();">^;
@ -112,44 +90,121 @@ if ($cgi->param('init') eq '1') {
my @dicts = $speller->dictionary_info(); my @dicts = $speller->dictionary_info();
my $dictionaries = ''; my $dictionaries = '';
foreach my $i (@dicts) { 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/^,//; $dictionaries =~ s/^,//;
print qq^ print qq^<div id="HA-spellcheck-dictionaries">$dictionaries</div>^;
<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>'; print '</body></html>';
# Perl is beautiful. # Perl is beautiful.
sub spellcheck { sub spellcheck {
my $text = shift; my $node = shift;
sub check { # called for each word in the text my $doc = $node->getOwnerDocument;
my $check = sub { # called for each word in the text
# input is in UTF-8 # input is in UTF-8
my $U_word = shift; my $word = shift;
my $word = encode($speller->get_option('encoding'), $U_word); my $already_suggested = defined $suggested_words{$word};
print DEBUG "*$U_word* ----> |$word|\n" if $debug; ++$total_words;
if ($speller->check($word)) { if (!$already_suggested && $speller->check($word)) {
return $U_word; # we return the word in UTF-8 return undef;
} else { } else {
# we should have suggestions; give them back to browser in UTF-8 # we should have suggestions; give them back to browser in UTF-8
my $suggestions = decode($speller->get_option('encoding'), join(',', $speller->suggest($word))); ++$total_mispelled;
my $ret = '<span class="HA-spellcheck-error">'.$U_word.'</span><span class="HA-spellcheck-suggestions">'.$suggestions.'</span>'; if (!$already_suggested) {
return $ret; # 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. sub check_inner_text {
# $text =~ s/(\p{IsWord}+)/check($1)/egs; my $node = shift;
return $text; 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-error { border-bottom: 1px dashed #f00; cursor: default; }
.HA-spellcheck-same { background-color: #ff8; color: #000; } .HA-spellcheck-same { background-color: #cef; color: #000; }
.HA-spellcheck-hover { background-color: #433; color: white; } .HA-spellcheck-hover { background-color: #433; color: white; }
.HA-spellcheck-fixed { border-bottom: 1px dotted #0b8; } .HA-spellcheck-fixed { border-bottom: 1px dashed #0b8; }
.HA-spellcheck-current { background-color: #7be; color: #000; } .HA-spellcheck-current { background-color: #9be; color: #000; }
.HA-spellcheck-suggestions { display: none; } .HA-spellcheck-suggestions { display: none; }
#HA-spellcheck-dictionaries { display: none; } #HA-spellcheck-dictionaries { display: none; }

View File

@ -7,17 +7,13 @@
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
Spell Checker Plugin for HTMLArea-3.0 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). 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$ $Id$
--> -->
@ -37,7 +33,7 @@
table { background-color: ButtonFace; color: ButtonText; table { background-color: ButtonFace; color: ButtonText;
font-family: tahoma,verdana,sans-serif; font-size: 11px; } 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 { width: 13em; }
.controls .sectitle { /* background-color: #736c6c; color: #fff; .controls .sectitle { /* background-color: #736c6c; color: #fff;
@ -51,7 +47,7 @@
input, select { font-family: fixed,"andale mono",monospace; } 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; } #statusbar { padding: 7px 0px 0px 5px; }
#status { font-weight: bold; } #status { font-weight: bold; }
</style> </style>
@ -61,12 +57,12 @@
<body onload="initDocument()"> <body onload="initDocument()">
<form style="display: none;" action="spell-check-logic.cgi" <form style="display: none;" action="spell-check-logic.cgi"
method="post" target="framecontent" method="post" target="framecontent"
accept-charset="utf-8" accept-charset="UTF-8"
><input type="hidden" name="content" id="f_content" ><input type="hidden" name="content" id="f_content"
/><input type="hidden" name="dictionary" id="f_dictionary" /><input type="hidden" name="dictionary" id="f_dictionary"
/><input type="hidden" name="init" id="f_init" value="1" /><input type="hidden" name="init" id="f_init" value="1"
/></form> /></form>
<table style="height: 100%; width: 100%; border-collapse: collapse;" cellspacing="0" cellpadding="0"> <table style="height: 100%; width: 100%; border-collapse: collapse;" cellspacing="0" cellpadding="0">
<tr> <tr>
@ -80,8 +76,15 @@
</tr> </tr>
<tr> <tr>
<td valign="top" class="controls"> <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="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="sectitle">Replace with</div>
<div class="secbody"> <div class="secbody">
<input type="text" id="v_replacement" style="width: 94%; margin-left: 3%;" /><br /> <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 SpellChecker = window.opener.SpellChecker;
var i18n = SpellChecker.I18N; 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 editor = SpellChecker.editor;
var frame = null; var frame = null;
var currentElement = null; var currentElement = null;
var wrongWords = null; var wrongWords = null;
var modified = false; var modified = false;
var allWords = {}; var allWords = {};
var fixedWords = [];
var suggested_words = {};
function makeCleanDoc(leaveFixed) { function makeCleanDoc(leaveFixed) {
// document.getElementById("status").innerHTML = 'Please wait: rendering valid HTML'; // document.getElementById("status").innerHTML = 'Please wait: rendering valid HTML';
for (var i in wrongWords) { var words = wrongWords.concat(fixedWords);
var el = wrongWords[i]; for (var i = words.length; --i >= 0;) {
var el = words[i];
if (!(leaveFixed && /HA-spellcheck-fixed/.test(el.className))) { if (!(leaveFixed && /HA-spellcheck-fixed/.test(el.className))) {
el.parentNode.insertBefore(el.firstChild, el); el.parentNode.insertBefore(el.firstChild, el);
el.parentNode.removeChild(el.nextSibling);
el.parentNode.removeChild(el); el.parentNode.removeChild(el);
} else { } else
el.className = "HA-spellcheck-fixed"; el.className = "HA-spellcheck-fixed";
el.parentNode.removeChild(el.nextSibling);
}
} }
// we should use innerHTML here, but IE6's implementation fucks up the // 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 // HTML to such extent that our poor Perl parser doesn't understand it
// anymore. // anymore.
return window.opener.HTMLArea.getHTML(frame.contentWindow.document.body, leaveFixed); return window.opener.HTMLArea.getHTML(frame.contentWindow.document.body, false, editor);
}; };
function recheckClicked() { function recheckClicked() {
@ -95,7 +96,14 @@ function replaceClicked() {
index = 0; index = 0;
alert(i18n["Finished list of mispelled words"]); 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; return false;
}; };
@ -168,7 +176,7 @@ function initDocument() {
modified = false; modified = false;
frame = document.getElementById("i_framecontent"); frame = document.getElementById("i_framecontent");
var field = document.getElementById("f_content"); var field = document.getElementById("f_content");
field.value = editor.getHTML(); field.value = HTMLArea.getHTML(editor._doc.body, false, editor);
field.form.submit(); field.form.submit();
document.getElementById("f_init").value = "0"; document.getElementById("f_init").value = "0";
@ -190,6 +198,8 @@ function initDocument() {
document.getElementById("b_ignore").onclick = ignoreClicked; document.getElementById("b_ignore").onclick = ignoreClicked;
document.getElementById("b_ignall").onclick = ignoreAllClicked; document.getElementById("b_ignall").onclick = ignoreAllClicked;
document.getElementById("b_recheck").onclick = recheckClicked; 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_ok").onclick = saveClicked;
document.getElementById("b_cancel").onclick = cancelClicked; 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) { if (currentElement) {
var a = allWords[currentElement.__msh_origWord]; var a = allWords[currentElement.__msh_origWord];
currentElement.className = currentElement.className.replace(/\s*HA-spellcheck-current\s*/g, " "); currentElement.className = currentElement.className.replace(/\s*HA-spellcheck-current\s*/g, " ");
@ -220,8 +253,8 @@ function wordClicked() {
el.className += " HA-spellcheck-same"; el.className += " HA-spellcheck-same";
} }
} }
document.getElementById("b_replall").disabled = (a.length <= 1); // document.getElementById("b_replall").disabled = (a.length <= 1);
document.getElementById("b_ignall").disabled = (a.length <= 1); // document.getElementById("b_ignall").disabled = (a.length <= 1);
var txt; var txt;
if (a.length == 1) { if (a.length == 1) {
txt = "one occurrence"; txt = "one occurrence";
@ -230,14 +263,17 @@ function wordClicked() {
} else { } else {
txt = a.length + " occurrences"; 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 + document.getElementById("statusbar").innerHTML = "Found " + txt +
' for word "<b>' + currentElement.__msh_origWord + '</b>"'; ' for word "<b>' + currentElement.__msh_origWord + '</b>"';
var select = document.getElementById("v_suggestions");
for (var i = select.length; --i >= 0;) { for (var i = select.length; --i >= 0;) {
select.remove(i); select.remove(i);
} }
var suggestions;
suggestions = this.nextSibling.firstChild.data.split(/,/);
for (var i = 0; i < suggestions.length; ++i) { for (var i = 0; i < suggestions.length; ++i) {
var txt = suggestions[i]; var txt = suggestions[i];
var option = document.createElement("option"); var option = document.createElement("option");
@ -252,6 +288,8 @@ function wordClicked() {
} else { } else {
document.getElementById("v_replacement").value = this.innerHTML; document.getElementById("v_replacement").value = this.innerHTML;
} }
select.style.display = "none";
select.style.display = "block";
return false; return false;
}; };
@ -263,11 +301,27 @@ function wordMouseOut() {
this.className = this.className.replace(/\s*HA-spellcheck-hover\s*/g, " "); 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() { function finishedSpellChecking() {
// initialization of global variables // initialization of global variables
currentElement = null; currentElement = null;
wrongWords = null; wrongWords = null;
allWords = {}; 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>)"; 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 doc = frame.contentWindow.document;
@ -278,7 +332,12 @@ function finishedSpellChecking() {
var el = spans[i]; var el = spans[i];
if (/HA-spellcheck-error/.test(el.className)) { if (/HA-spellcheck-error/.test(el.className)) {
sps.push(el); 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.onmouseover = wordMouseOver;
el.onmouseout = wordMouseOut; el.onmouseout = wordMouseOut;
el.__msh_id = id++; el.__msh_id = id++;
@ -289,7 +348,9 @@ function finishedSpellChecking() {
} else { } else {
allWords[txt].push(el); allWords[txt].push(el);
} }
} } else if (/HA-spellcheck-fixed/.test(el.className)) {
fixedWords.push(el);
}
} }
wrongWords = sps; wrongWords = sps;
if (sps.length == 0) { if (sps.length == 0) {
@ -301,7 +362,7 @@ function finishedSpellChecking() {
} }
return false; return false;
} }
(currentElement = sps[0]).onclick(); (currentElement = sps[0]).__msh_wordClicked(true);
var as = doc.getElementsByTagName("a"); var as = doc.getElementsByTagName("a");
for (var i = as.length; --i >= 0;) { for (var i = as.length; --i >= 0;) {
var a = as[i]; var a = as[i];
@ -324,6 +385,10 @@ function finishedSpellChecking() {
for (var i = 0; i < dicts.length; ++i) { for (var i = 0; i < dicts.length; ++i) {
var txt = dicts[i]; var txt = dicts[i];
var option = document.createElement("option"); var option = document.createElement("option");
if (/^@(.*)$/.test(txt)) {
txt = RegExp.$1;
option.selected = true;
}
option.value = txt; option.value = txt;
option.appendChild(document.createTextNode(txt)); option.appendChild(document.createTextNode(txt));
select.appendChild(option); select.appendChild(option);

View File

@ -1,15 +1,11 @@
// Spell Checker Plugin for HTMLArea-3.0 // 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). // 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$ // $Id$
function SpellChecker(editor) { function SpellChecker(editor) {
@ -68,10 +64,10 @@ SpellChecker.prototype.buttonPress = function(editor, id) {
if (HTMLArea.is_ie) { if (HTMLArea.is_ie) {
win = window.open(uiurl, "SC_spell_checker", win = window.open(uiurl, "SC_spell_checker",
"toolbar=no,location=no,directories=no,status=no,menubar=no," + "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 { } else {
win = window.open(uiurl, "SC_spell_checker", 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"); "scrollbars=no,resizable=yes");
} }
win.focus(); 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 // I18N constants
// LANG: "el", ENCODING: UTF-8 | ISO-8859-7 // LANG: "el", ENCODING: UTF-8 | ISO-8859-7
// Author: Dimitris Glezos <dimitris@glezos.com> // Author: Dimitris Glezos, dimitris@glezos.com
TableOperations.I18N = { TableOperations.I18N = {
"Align": "Στοίχηση", "Align": "Στοίχηση",

View File

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

View File

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

View File

@ -285,9 +285,10 @@ href="http://dynarch.com" title="http://dynarch.com/" target="_blank">dynarch.co
</p> </p>
<ul> <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.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> </ul>
<p>Also many thanks to all people at InteractiveTools.com <p>Also many thanks to all people at InteractiveTools.com

View File

@ -6,10 +6,10 @@
<script type="text/javascript"> <script type="text/javascript">
window.resizeTo(400, 200); window.resizeTo(400, 200);
//I18N = window.opener.HTMLArea.I18N.dialogs; I18N = window.opener.HTMLArea.I18N.dialogs;
function i18n(str) { function i18n(str) {
// return (I18N[str] || str); return (I18N[str] || str);
}; };
function onTargetChanged() { function onTargetChanged() {
@ -49,7 +49,9 @@ function Init() {
function onOK() { function onOK() {
var required = { 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) { for (var i in required) {
var el = document.getElementById(i); var el = document.getElementById(i);

View File

@ -1,7 +1,11 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN"> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><% $basename %> release notes</title> <title><% $basename %> release notes</title>
<style>
.fixme { color: red; }
</style>
</head> </head>
<body> <body>
@ -16,48 +20,105 @@
<ul> <ul>
<li> <li>
ContextMenu plugin (provides a nice context menu with common <b>New plugins</b>
operations, including table ops, link ops, etc.) <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>
<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>
<li> <li>
FullPage plugin (allows HTMLArea to edit a whole HTML file, <b>Changes in the core editor</b>
not only the content within &lt;body&gt;.) <ul>
</li> <li>
<li> Easier to setup: you only need to load
Better plugin support (they register information about <tt>htmlarea.js</tt>; other scripts will be loaded
themselves with the editor; can register event handlers for automatically. <a href="reference.html">Documentation</a>
the editor, etc.) and <a href="examples/">examples</a> updated.
</li> </li>
<li> <li>
New about box ;-) Better plugin support (they register information about
</li> themselves with the editor; can register event handlers for
<li> the editor, etc.)
Word cleaner (can be enabled to automatically kill Word crap </li>
on paste (see Config.killWordOnPaste); otherwise accessible by <li>
pressing CTRL-0 in the editor; a toolbar button will come up New about box; check it out, it's cool ;-)
soon) </li>
</li> <li>
<li> Word cleaner (can be enabled to automatically kill Word crap
Image preview in "insert image" dialog. Also allows on paste (see Config.killWordOnPaste); otherwise accessible by
modification of current image, if selected. pressing CTRL-0 in the editor; a toolbar button will come up
</li> soon)
<li> </li>
New "insert link" dialog, allows target and title <li>
specification, allows editing links. Image preview in "insert image" dialog. Also allows
</li> modification of current image, if selected.
<li> </li>
Implemented support for text direction (left-to-right or <li>
right-to-left). New "insert link" dialog, allows target and title
</li> specification, allows editing links.
<li> </li>
<a href="ChangeLog">Full CVS ChangeLog</a> is now <li>
automatically generated from the CVS logs. Implemented support for text direction (left-to-right or
</li> right-to-left).
<li> </li>
Lots of bug fixes! <li>
Lots of bug fixes! ... and more, I guess ;-) an
automatically generated <a href="ChangeLog">change log</a>
is now available.
</li>
</ul>
</li> </li>
</ul> </ul>
@ -130,7 +191,7 @@ system</a> at SourceForge
<hr /> <hr />
<address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address> <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
<!-- Created: Sun Aug 3 16:55:08 EEST 2003 --> <!-- 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 --> <!-- doc-lang: English -->
</body> </body>
</html> </html>