Fixes in htmlarea... reverting to previous version by now

This commit is contained in:
viniciuscb 2005-06-19 13:37:50 +00:00
parent d4760bb15c
commit 70e7091322
38 changed files with 2278 additions and 4528 deletions

View File

@ -12,7 +12,6 @@
_editor_lang = "en"; _editor_lang = "en";
</script> </script>
<script type="text/javascript" src="../htmlarea.js"></script> <script type="text/javascript" src="../htmlarea.js"></script>
<script type="text/javascript" src="../htmlarea_css.js"></script>
<style type="text/css"> <style type="text/css">
html, body { html, body {

View File

@ -18,13 +18,11 @@
editor.registerPlugin(FullPage); editor.registerPlugin(FullPage);
editor.generate(); editor.generate();
} }
HTMLArea.onload = initDocument;
</script> </script>
</head> </head>
<body onload="HTMLArea.init()"> <body onload="initDocument()">
<h1>Test of FullPage plugin</h1> <h1>Test of FullPage plugin</h1>
<textarea id="editor" style="height: 30em; width: 100%;"> <textarea id="editor" style="height: 30em; width: 100%;">
@ -71,7 +69,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: Wed Oct 1 19:55:37 EEST 2003 --> <!-- Created: Wed Oct 1 19:55:37 EEST 2003 -->
<!-- hhmts start --> Last modified: Wed Aug 11 13:59:07 CEST 2004 <!-- hhmts end --> <!-- hhmts start --> Last modified: Wed Jan 28 11:10:07 EET 2004 <!-- hhmts end -->
<!-- doc-lang: English --> <!-- doc-lang: English -->
</body> </body>
</html> </html>

View File

@ -28,17 +28,15 @@
// in our case "lang/en.js" loaded above). // in our case "lang/en.js" loaded above).
// If this lang file is not found the plugin will fail to // If this lang file is not found the plugin will fail to
// load correctly and NOTHING WILL WORK. // load correctly and nothing will work.
HTMLArea.loadPlugin("TableOperations"); HTMLArea.loadPlugin("TableOperations");
HTMLArea.loadPlugin("SpellChecker"); HTMLArea.loadPlugin("SpellChecker");
HTMLArea.loadPlugin("FullPage"); HTMLArea.loadPlugin("FullPage");
HTMLArea.loadPlugin("CSS"); HTMLArea.loadPlugin("CSS");
HTMLArea.loadPlugin("ContextMenu"); HTMLArea.loadPlugin("ContextMenu");
//HTMLArea.loadPlugin("HtmlTidy"); HTMLArea.loadPlugin("HtmlTidy");
HTMLArea.loadPlugin("ListType"); HTMLArea.loadPlugin("ListType");
HTMLArea.loadPlugin("CharacterMap");
HTMLArea.loadPlugin("DynamicCSS");
</script> </script>
<style type="text/css"> <style type="text/css">
@ -56,7 +54,6 @@ textarea { background-color: #fff; border: 1px solid 00f; }
<script type="text/javascript"> <script type="text/javascript">
var editor = null; var editor = null;
function initEditor() { function initEditor() {
// create an editor for the "ta" textbox // create an editor for the "ta" textbox
@ -72,14 +69,11 @@ function initEditor() {
editor.registerPlugin(SpellChecker); editor.registerPlugin(SpellChecker);
// register the HtmlTidy plugin // register the HtmlTidy plugin
//editor.registerPlugin(HtmlTidy); editor.registerPlugin(HtmlTidy);
// register the ListType plugin // register the ListType plugin
editor.registerPlugin(ListType); editor.registerPlugin(ListType);
editor.registerPlugin(CharacterMap);
editor.registerPlugin(DynamicCSS);
// register the CSS plugin // register the CSS plugin
editor.registerPlugin(CSS, { editor.registerPlugin(CSS, {
combos : [ combos : [
@ -118,12 +112,12 @@ editor.registerPlugin(DynamicCSS);
// load the stylesheet used by our CSS plugin configuration // load the stylesheet used by our CSS plugin configuration
editor.config.pageStyle = "@import url(custom.css);"; editor.config.pageStyle = "@import url(custom.css);";
setTimeout(function() {
editor.generate(); editor.generate();
}, 500);
return false; return false;
} }
HTMLArea.onload = initEditor;
function insertHTML() { function insertHTML() {
var html = prompt("Enter some HTML code here"); var html = prompt("Enter some HTML code here");
if (html) { if (html) {
@ -139,7 +133,7 @@ function highlight() {
<!-- use <body onload="HTMLArea.replaceAll()" if you don't care about <!-- use <body onload="HTMLArea.replaceAll()" if you don't care about
customizing the editor. It's the easiest way! :) --> customizing the editor. It's the easiest way! :) -->
<body onload="HTMLArea.init();"> <body onload="initEditor()">
<h1>HTMLArea 3.0</h1> <h1>HTMLArea 3.0</h1>

View File

@ -16,7 +16,7 @@
</ul> </ul>
<hr /> <hr />
<address>mihai_bazon@yahoo.com</address> <address>mishoo@infoiasi.ro</address>
<!-- hhmts start --> Last modified: Sun Feb 1 13:30:39 EET 2004 <!-- hhmts end --> <!-- hhmts start --> Last modified: Sun Feb 1 13:30:39 EET 2004 <!-- hhmts end -->
</body> </html> </body> </html>

View File

@ -3,7 +3,7 @@
.htmlarea .toolbar { .htmlarea .toolbar {
cursor: default; cursor: default;
background: ButtonFace; background: ButtonFace;
padding: 3px; padding: 1px 1px 2px 1px;
border: 1px solid; border: 1px solid;
border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
} }
@ -20,16 +20,11 @@
width: 18px; width: 18px;
height: 18px; height: 18px;
} }
.htmlarea .toolbar a.button:hover { .htmlarea .toolbar .buttonHover {
border: 1px solid; border: 1px solid;
border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
} }
.htmlarea .toolbar a.buttonDisabled:hover { .htmlarea .toolbar .buttonActive, .htmlarea .toolbar .buttonPressed {
border-color: ButtonFace;
}
.htmlarea .toolbar .buttonActive,
.htmlarea .toolbar .buttonPressed
{
padding: 2px 0px 0px 2px; padding: 2px 0px 0px 2px;
border: 1px solid; border: 1px solid;
border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow; border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
@ -47,12 +42,12 @@
} }
.htmlarea .toolbar .buttonDisabled img { .htmlarea .toolbar .buttonDisabled img {
filter: gray() alpha(opacity = 25); filter: alpha(opacity = 25);
-moz-opacity: 0.25; -moz-opacity: 0.25;
} }
.htmlarea .toolbar .separator { .htmlarea .toolbar .separator {
/*position: relative;*/ position: relative;
margin: 3px; margin: 3px;
border-left: 1px solid ButtonShadow; border-left: 1px solid ButtonShadow;
border-right: 1px solid ButtonHighlight; border-right: 1px solid ButtonHighlight;
@ -69,11 +64,6 @@
.htmlarea .toolbar select:hover, .htmlarea .toolbar select:hover,
.htmlarea .toolbar select:active { background: FieldFace; color: ButtonText; } .htmlarea .toolbar select:active { background: FieldFace; color: ButtonText; }
.htmlarea iframe
{
border: none;
}
.htmlarea .statusBar { .htmlarea .statusBar {
border: 1px solid; border: 1px solid;
border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow; border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
@ -112,8 +102,7 @@
.dialog table { border-collapse: collapse; } .dialog table { border-collapse: collapse; }
.dialog .title, .dialog h1 .dialog .title {
{
background: #008; background: #008;
color: #ff8; color: #ff8;
border-bottom: 1px solid #000; border-bottom: 1px solid #000;
@ -122,7 +111,7 @@
font-weight: bold; font-weight: bold;
cursor: default; cursor: default;
} }
.dialog h1 { margin:0px;}
.dialog .title .button { .dialog .title .button {
float: right; float: right;
border: 1px solid #66a; border: 1px solid #66a;
@ -189,46 +178,3 @@
} }
form { margin: 0px; border: none; } form { margin: 0px; border: none; }
/** Panels **/
.htmlarea .panels.top
{
border-bottom : 1px solid;
border-color: ButtonShadow;
}
.htmlarea .panels.right
{
border-left : 1px solid;
border-color: ButtonShadow;
}
.htmlarea .panels.left
{
border-right : 1px solid;
border-color: ButtonShadow;
}
.htmlarea .panels.bottom
{
border-top : 1px solid;
border-color: ButtonShadow;
}
.htmlarea .panel h1 {
background: ButtonFace;
border: 1px solid;
border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
margin: 0px;
padding: 0px;
font-size:100%;
font-weight:bold;
padding: 2px;
}
.htmlarea .panels.left .panel { border-right:none; border-left:none; }
.htmlarea .panels.left h1 { border-right:none; }
.htmlarea .panels.right .panel { border-right:none; border-left:none; }
.htmlarea .panels.left h1 { border-left:none; }
div.htmlarea { border: 1px solid black; }

File diff suppressed because it is too large Load Diff

View File

@ -46,7 +46,7 @@
Please see our About Box for details about who sponsored what plugins. Please see our About Box for details about who sponsored what plugins.
</p> </p>
<h2><a href="examples/">Online demos</a></h2> <h2>Online demos</h2>
<ul> <ul>
@ -184,7 +184,7 @@ find htmlarea/ -name "*.cgi" -exec chmod 755 {} \;</pre>
</ul> </ul>
<p>You can <a href="mailto:mihai_bazon@yahoo.com">contact me directly</a> <p>You can <a href="mailto:mishoo@infoiasi.ro">contact me directly</a>
<em>only</em> if you want to pay me for implementing custom features to <em>only</em> if you want to pay me for implementing custom features to
HTMLArea. If you want to sponsor these features (that is, allow them to HTMLArea. If you want to sponsor these features (that is, allow them to
get back into the public HTMLArea distribution) I'll be cheaper. ;-)</p> get back into the public HTMLArea distribution) I'll be cheaper. ;-)</p>
@ -192,7 +192,7 @@ find htmlarea/ -name "*.cgi" -exec chmod 755 {} \;</pre>
<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 14:11:26 EEST 2003 --> <!-- Created: Sun Aug 3 14:11:26 EEST 2003 -->
<!-- hhmts start --> Last modified: Wed Jul 14 13:20:53 CEST 2004 <!-- hhmts end --> <!-- hhmts start --> Last modified: Wed Jan 28 11:54:47 EET 2004 <!-- hhmts end -->
<!-- doc-lang: English --> <!-- doc-lang: English -->
</body> </body>
</html> </html>

View File

@ -43,8 +43,7 @@ HTMLArea.I18N = {
copy: "Kopieren", copy: "Kopieren",
paste: "Einfügen aus der Zwischenablage", paste: "Einfügen aus der Zwischenablage",
lefttoright: "Textrichtung von Links nach Rechts", lefttoright: "Textrichtung von Links nach Rechts",
righttoleft: "Textrichtung von Rechts nach Links", righttoleft: "Textrichtung von Rechts nach Links"
removeformat: "Formatierung entfernen"
}, },
buttons: { buttons: {

View File

@ -50,10 +50,7 @@ HTMLArea.I18N = {
copy: "Copy selection", copy: "Copy selection",
paste: "Paste from clipboard", paste: "Paste from clipboard",
lefttoright: "Direction left to right", lefttoright: "Direction left to right",
righttoleft: "Direction right to left", righttoleft: "Direction right to left"
removeformat: "Remove formatting",
print: "Print document",
killword: "Clear MSOffice tags"
}, },
buttons: { buttons: {
@ -73,74 +70,24 @@ HTMLArea.I18N = {
"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-security-clipboard" : "Moz-Clipboard" :
// Translate Here "Unprivileged scripts cannot access Cut/Copy/Paste programatically " +
"The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly." "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: {
// Common
"OK" : "OK",
"Cancel" : "Cancel", "Cancel" : "Cancel",
"Alignment:" : "Alignment:",
"Not set" : "Not set",
"Left" : "Left",
"Right" : "Right",
"Texttop" : "Texttop",
"Absmiddle" : "Absmiddle",
"Baseline" : "Baseline",
"Absbottom" : "Absbottom",
"Bottom" : "Bottom",
"Middle" : "Middle",
"Top" : "Top",
"Layout" : "Layout",
"Spacing" : "Spacing",
"Horizontal:" : "Horizontal:",
"Horizontal padding" : "Horizontal padding",
"Vertical:" : "Vertical:",
"Vertical padding" : "Vertical padding",
"Border thickness:" : "Border thickness:",
"Leave empty for no border" : "Leave empty for no border",
// Insert Link
"Insert/Modify Link" : "Insert/Modify Link", "Insert/Modify Link" : "Insert/Modify Link",
"None (use implicit)" : "None (use implicit)",
"New window (_blank)" : "New window (_blank)", "New window (_blank)" : "New window (_blank)",
"Same frame (_self)" : "Same frame (_self)", "None (use implicit)" : "None (use implicit)",
"Top frame (_top)" : "Top frame (_top)", "OK" : "OK",
"Other" : "Other", "Other" : "Other",
"Same frame (_self)" : "Same frame (_self)",
"Target:" : "Target:", "Target:" : "Target:",
"Title (tooltip):" : "Title (tooltip):", "Title (tooltip):" : "Title (tooltip):",
"Top frame (_top)" : "Top frame (_top)",
"URL:" : "URL:", "URL:" : "URL:",
"You must enter the URL where this link points to" : "You must enter the URL where this link points to", "You must enter the URL where this link points to" : "You must enter the URL where this link points to"
// Insert Table
"Insert Table" : "Insert Table",
"Rows:" : "Rows:",
"Number of rows" : "Number of rows",
"Cols:" : "Cols:",
"Number of columns" : "Number of columns",
"Width:" : "Width:",
"Width of the table" : "Width of the table",
"Percent" : "Percent",
"Pixels" : "Pixels",
"Em" : "Em",
"Width unit" : "Width unit",
"Positioning of this table" : "Positioning of this table",
"Cell spacing:" : "Cell spacing:",
"Space between adjacent cells" : "Space between adjacent cells",
"Cell padding:" : "Cell padding:",
"Space between content and border in cell" : "Space between content and border in cell",
// Insert Image
"Insert Image" : "Insert Image",
"Image URL:" : "Image URL:",
"Enter the image URL here" : "Enter the image URL here",
"Preview" : "Preview",
"Preview the image in a new window" : "Preview the image in a new window",
"Alternate text:" : "Alternate text:",
"For browsers that don't support images" : "For browsers that don't support images",
"Positioning of this image" : "Positioning of this image",
"Image Preview:" : "Image Preview:"
} }
}; };

View File

@ -11,19 +11,19 @@ HTMLArea.I18N = {
italic: "Cursiva", italic: "Cursiva",
underline: "Subrayado", underline: "Subrayado",
strikethrough: "Tachado", strikethrough: "Tachado",
subscript: "Sub?ndice", subscript: "Subíndice",
superscript: "Super?ndice", superscript: "Superíndice",
justifyleft: "Alinear a la Izquierda", justifyleft: "Alinear a la Izquierda",
justifycenter: "Centrar", justifycenter: "Centrar",
justifyright: "Alinear a la Derecha", justifyright: "Alinear a la Derecha",
justifyfull: "Justificar", justifyfull: "Justificar",
orderedlist: "Lista Ordenada", orderedlist: "Lista Ordenada",
unorderedlist: "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",
hilitecolor: "Color del Fondo", hilitecolor: "Color del Fondo",
inserthorizontalrule: "L?nea Horizontal", inserthorizontalrule: "Línea Horizontal",
createlink: "Insertar Enlace", createlink: "Insertar Enlace",
insertimage: "Insertar Imagen", insertimage: "Insertar Imagen",
inserttable: "Insertar Tabla", inserttable: "Insertar Tabla",
@ -34,8 +34,8 @@ HTMLArea.I18N = {
textindicator: "Estilo Actual", textindicator: "Estilo Actual",
undo: "Deshacer", undo: "Deshacer",
redo: "Rehacer", redo: "Rehacer",
cut: "Cortar selecci?n", cut: "Cortar selección",
copy: "Copiar selecci?n", copy: "Copiar selección",
paste: "Pegar desde el portapapeles" paste: "Pegar desde el portapapeles"
}, },
@ -46,6 +46,6 @@ HTMLArea.I18N = {
msg: { msg: {
"Path": "Ruta", "Path": "Ruta",
"TEXT_MODE": "Esta en modo TEXTO. Use el boton [<>] para cambiar a WYSIWIG" "TEXT_MODE": "Esta en modo TEXTO. Use el boton [<>] para cambiar a WYSIWIG",
} }
}; };

View File

@ -47,7 +47,7 @@ HTMLArea.I18N = {
undo: "Ongedaan maken", undo: "Ongedaan maken",
redo: "Herhalen", redo: "Herhalen",
cut: "Knippen", cut: "Knippen",
copy: "Kopi?ren", copy: "Kopiëren",
paste: "Plakken", paste: "Plakken",
lefttoright: "Tekstrichting links naar rechts", lefttoright: "Tekstrichting links naar rechts",
righttoleft: "Tekstrichting rechts naar links" righttoleft: "Tekstrichting rechts naar links"
@ -87,3 +87,4 @@ HTMLArea.I18N = {
"You must enter the URL where this link points to" : "Geef de URL in waar de link naar verwijst" "You must enter the URL where this link points to" : "Geef de URL in waar de link naar verwijst"
} }
}; };

View File

@ -1,7 +1,6 @@
// I18N constants : Vietnamese // I18N constants : Vietnamese
// LANG: "en", ENCODING: UTF-8 // LANG: "en", ENCODING: UTF-8
// Author: Nguyễn Đình Nam, <hncryptologist@yahoo.com> // Author: Nguyễn Đình Nam, <hncryptologist@yahoo.com>
// Modified 21/07/2004 by Phạm Mai Quân <pmquan@4vn.org>
HTMLArea.I18N = { HTMLArea.I18N = {
@ -20,13 +19,13 @@ HTMLArea.I18N = {
justifycenter: "Căn Giữa", justifycenter: "Căn Giữa",
justifyright: "Căn Phải", justifyright: "Căn Phải",
justifyfull: "Căn Đều", justifyfull: "Căn Đều",
insertorderedlist: "Danh Sách Có Thứ Tự (1, 2, 3)", orderedlist: "Danh Sách Có Thứ Tự",
insertunorderedlist: "Danh Sách Phi Thứ Tự (Chấm đầu dòng)", unorderedlist: "Danh Sách Phi Thứ Tự",
outdent: "Lùi Ra Ngoài", outdent: "Lùi Ra Ngoài",
indent: "Thụt Vào Trong", indent: "Thụt Vào Trong",
forecolor: "Màu Chữ", forecolor: "Màu Chữ",
hilitecolor: "Màu Nền", backcolor: "Màu Nền",
inserthorizontalrule: "Dòng Kẻ Ngang", horizontalrule: "Dòng Kẻ Ngang",
createlink: "Tạo Liên Kết", createlink: "Tạo Liên Kết",
insertimage: "Chèn Ảnh", insertimage: "Chèn Ảnh",
inserttable: "Chèn Bảng", inserttable: "Chèn Bảng",
@ -35,43 +34,18 @@ HTMLArea.I18N = {
about: "Tự Giới Thiệu", about: "Tự Giới Thiệu",
showhelp: "Giúp Đỡ", showhelp: "Giúp Đỡ",
textindicator: "Định Dạng Hiện Thời", textindicator: "Định Dạng Hiện Thời",
undo: "Hủy thao tác trước", undo: "Undo",
redo: "Lấy lại thao tác vừa bỏ", redo: "Redo",
cut: "Cắt", cut: "Cắt",
copy: "Sao chép", copy: "Copy",
paste: "Dán", paste: "Dán"
lefttoright: "Viết từ trái sang phải",
righttoleft: "Viết từ phải sang trái"
}, },
buttons: { buttons: {
"ok": "Đồng ý", "ok": "OK",
"cancel": "Hủy", "cancel": "Hủy"
"IE-sucks-full-screen" :
// translate here
"Chế độ phóng to ô soạn thảo có thể gây lỗi với Internet Explorer vì một số lỗi của trình duyệt này," +
" vì thế chế độ này có thể sẽ không chạy. Hiển thị không đúng, lộn xộn, không có đầy đủ chức năng," +
" và cũng có thể làm trình duyệt của bạn bị tắt ngang. Nếu bạn đang sử dụng Windows 9x " +
"bạn có thể bị báo lỗi 'General Protection Fault' và máy tính của bạn buộc phải khởi động lại.\n\n" +
"Chúng tôi đã cảnh báo bạn. Nhấn nút 'Đồng ý' nếu bạn vẫn muốn sử dụng tính năng này."
}, },
msg: { msg: {
"Path": "Đường Dẫn", "Path": "Đường Dẫn",
"TEXT_MODE": "Bạn đang ở chế độ text. Sử dụng nút [<>] để chuyển lại chế độ WYSIWIG." "TEXT_MODE": "Bạn đang ở chế độ text. Sử dụng nút [<>] để chuyển lại chế độ WYSIWIG."
},
dialogs: {
"Cancel" : "Hủy",
"Insert/Modify Link" : "Thêm/Chỉnh sửa đường dẫn",
"New window (_blank)" : "Cửa sổ mới (_blank)",
"None (use implicit)" : "Không (sử dụng implicit)",
"OK" : "Đồng ý",
"Other" : "Khác",
"Same frame (_self)" : "Trên cùng khung (_self)",
"Target:" : "Nơi hiện thị:",
"Title (tooltip):" : "Tiêu đề (của hướng dẫn):",
"Top frame (_top)" : "Khung trên cùng (_top)",
"URL:" : "URL:",
"You must enter the URL where this link points to" : "Bạn phải điền địa chỉ (URL) mà đường dẫn sẽ liên kết tới"
} }
}; };

View File

@ -63,26 +63,6 @@ ContextMenu.prototype.getContextMenu = function(target) {
tbo.buttonPress(editor, opcode); tbo.buttonPress(editor, opcode);
}; };
function insertPara(after) {
var el = currentTarget;
var par = el.parentNode;
var p = editor._doc.createElement("p");
p.appendChild(editor._doc.createElement("br"));
par.insertBefore(p, after ? el.nextSibling : el);
var sel = editor._getSelection();
var range = editor._createRange(sel);
if (!HTMLArea.is_ie) {
sel.removeAllRanges();
range.selectNodeContents(p);
range.collapse(true);
sel.addRange(range);
} else {
range.moveToElementText(p);
range.collapse(true);
range.select();
}
};
for (; target; target = target.parentNode) { for (; target; target = target.parentNode) {
var tag = target.tagName; var tag = target.tagName;
if (!tag) if (!tag)
@ -209,15 +189,13 @@ ContextMenu.prototype.getContextMenu = function(target) {
i18n["Create a link"], i18n["Create a link"],
config.btnList["createlink"][1] ]); config.btnList["createlink"][1] ]);
for (var i = 0; i < elmenus.length; ++i) for (var i in elmenus)
menu.push(elmenus[i]); menu.push(elmenus[i]);
if (!/html|body/i.test(currentTarget.tagName))
menu.push(null, menu.push(null,
[ i18n["Remove the"] + " &lt;" + currentTarget.tagName + "&gt; " + i18n["Element"], [ i18n["Remove the"] + " &lt;" + currentTarget.tagName + "&gt; " + i18n["Element"],
function() { function() {
if (confirm(i18n["Please confirm that you want to remove this element:"] + " " + if (confirm(i18n["Please confirm that you want to remove this element:"] + " " + currentTarget.tagName)) {
currentTarget.tagName)) {
var el = currentTarget; var el = currentTarget;
var p = el.parentNode; var p = el.parentNode;
p.removeChild(el); p.removeChild(el);
@ -236,14 +214,7 @@ ContextMenu.prototype.getContextMenu = function(target) {
} }
} }
}, },
i18n["Remove this node from the document"] ], i18n["Remove this node from the document"] ]);
[ i18n["Insert paragraph before"],
function() { insertPara(false); },
i18n["Insert a paragraph before the current node"] ],
[ i18n["Insert paragraph after"],
function() { insertPara(true); },
i18n["Insert a paragraph after the current node"] ]
);
return menu; return menu;
}; };
@ -414,8 +385,12 @@ ContextMenu.prototype.popupMenu = function(ev) {
} }
if (!HTMLArea.is_ie) { if (!HTMLArea.is_ie) {
var dx = x + div.offsetWidth - window.innerWidth + 4; // var dx = x + div.offsetWidth - window.innerWidth + 4;
var dy = y + div.offsetHeight - window.innerHeight + 4; // var dy = y + div.offsetHeight - window.innerHeight + 4;
var dx = x + div.offsetWidth - window.innerWidth - window.pageXOffset + 4;
var dy = y + div.offsetHeight - window.innerHeight - window.pageYOffset + 4;
if (dx > 0) x -= dx; if (dx > 0) x -= dx;
if (dy > 0) y -= dy; if (dy > 0) y -= dy;
div.style.left = x + "px"; div.style.left = x + "px";

View File

@ -40,8 +40,6 @@ ContextMenu.I18N = {
"Make link" : "Make lin_k...", "Make link" : "Make lin_k...",
"Remove the" : "Remove the", "Remove the" : "Remove the",
"Element" : "Element...", "Element" : "Element...",
"Insert paragraph before" : "Insert paragraph before",
"Insert paragraph after" : "Insert paragraph after",
// Other labels (tooltips and alert/confirm box messages) // Other labels (tooltips and alert/confirm box messages)
@ -64,7 +62,5 @@ ContextMenu.I18N = {
"Insert a new column before the current one" : "Insert a new column before the current one", "Insert a new column before the current one" : "Insert a new column before the current one",
"Insert a new column after the current one" : "Insert a new column after the current one", "Insert a new column after the current one" : "Insert a new column after the current one",
"Delete the current column" : "Delete the current column", "Delete the current column" : "Delete the current column",
"Create a link" : "Create a link", "Create a link" : "Create a link"
"Insert a paragraph before the current node" : "Insert a paragraph before the current node",
"Insert a paragraph after the current node" : "Insert a paragraph after the current node"
}; };

View File

@ -24,6 +24,7 @@ $GLOBALS['phpgw_info']['flags'] = Array(
); );
include('../../../../../../header.inc.php'); include('../../../../../../header.inc.php');
header('Content-type: text/javascript; charset='.$GLOBALS['phpgw']->translation->charset());
$GLOBALS['phpgw']->translation->add_app('htmlarea-ContextMenu'); $GLOBALS['phpgw']->translation->add_app('htmlarea-ContextMenu');
// I18N constants // I18N constants

View File

@ -7,7 +7,6 @@ div.htmlarea-context-menu {
border: 1px solid #aca899; border: 1px solid #aca899;
padding: 2px; padding: 2px;
background-color: #fff; background-color: #fff;
color: #000;
cursor: default; cursor: default;
z-index: 1000; z-index: 1000;
} }

View File

@ -49,7 +49,6 @@ FullPage.prototype.buttonPress = function(editor, id) {
var links = doc.getElementsByTagName("link"); var links = doc.getElementsByTagName("link");
var style1 = ''; var style1 = '';
var style2 = ''; var style2 = '';
var charset = '';
for (var i = links.length; --i >= 0;) { for (var i = links.length; --i >= 0;) {
var link = links[i]; var link = links[i];
if (/stylesheet/i.test(link.rel)) { if (/stylesheet/i.test(link.rel)) {
@ -59,14 +58,6 @@ FullPage.prototype.buttonPress = function(editor, id) {
style1 = link.href; style1 = link.href;
} }
} }
var metas = doc.getElementsByTagName("meta");
for (var i = metas.length; --i >= 0;) {
var meta = metas[i];
if (/content-type/i.test(meta.httpEquiv)) {
r = /^text\/html; *charset=(.*)$/i.exec(meta.content);
charset = r[1];
}
}
var title = doc.getElementsByTagName("title")[0]; var title = doc.getElementsByTagName("title")[0];
title = title ? title.innerHTML : ''; title = title ? title.innerHTML : '';
var init = { var init = {
@ -76,7 +67,7 @@ FullPage.prototype.buttonPress = function(editor, id) {
f_body_fgcolor : HTMLArea._colorToRgb(doc.body.style.color), f_body_fgcolor : HTMLArea._colorToRgb(doc.body.style.color),
f_base_style : style1, f_base_style : style1,
f_alt_style : style2, f_alt_style : style2,
f_charset : charset,
editor : editor editor : editor
}; };
editor._popupDialog("plugin://FullPage/docprop", function(params) { editor._popupDialog("plugin://FullPage/docprop", function(params) {
@ -91,11 +82,8 @@ FullPage.prototype.setDocProp = function(params) {
var doc = this.editor._doc; var doc = this.editor._doc;
var head = doc.getElementsByTagName("head")[0]; var head = doc.getElementsByTagName("head")[0];
var links = doc.getElementsByTagName("link"); var links = doc.getElementsByTagName("link");
var metas = doc.getElementsByTagName("meta");
var style1 = null; var style1 = null;
var style2 = null; var style2 = null;
var charset = null;
var charset_meta = null;
for (var i = links.length; --i >= 0;) { for (var i = links.length; --i >= 0;) {
var link = links[i]; var link = links[i];
if (/stylesheet/i.test(link.rel)) { if (/stylesheet/i.test(link.rel)) {
@ -105,27 +93,12 @@ FullPage.prototype.setDocProp = function(params) {
style1 = link; style1 = link;
} }
} }
for (var i = metas.length; --i >= 0;) {
var meta = metas[i];
if (/content-type/i.test(meta.httpEquiv)) {
r = /^text\/html; *charset=(.*)$/i.exec(meta.content);
charset = r[1];
charset_meta = meta;
}
}
function createLink(alt) { function createLink(alt) {
var link = doc.createElement("link"); var link = doc.createElement("link");
link.rel = alt ? "alternate stylesheet" : "stylesheet"; link.rel = alt ? "alternate stylesheet" : "stylesheet";
head.appendChild(link); head.appendChild(link);
return link; return link;
}; };
function createMeta(name, content) {
var meta = doc.createElement("meta");
meta.httpEquiv = name;
meta.content = content;
head.appendChild(meta);
return meta;
};
if (!style1 && params.f_base_style) if (!style1 && params.f_base_style)
style1 = createLink(false); style1 = createLink(false);
@ -141,13 +114,6 @@ FullPage.prototype.setDocProp = function(params) {
else if (style2) else if (style2)
head.removeChild(style2); head.removeChild(style2);
if (charset_meta) {
head.removeChild(charset_meta);
charset_meta = null;
}
if (!charset_meta && params.f_charset)
charset_meta = createMeta("Content-Type", "text/html; charset="+params.f_charset);
for (var i in params) { for (var i in params) {
var val = params[i]; var val = params[i];
switch (i) { switch (i) {

View File

@ -24,6 +24,7 @@ $GLOBALS['phpgw_info']['flags'] = Array(
); );
include('../../../../../../header.inc.php'); include('../../../../../../header.inc.php');
header('Content-type: text/javascript; charset='.$GLOBALS['phpgw']->translation->charset());
$GLOBALS['phpgw']->translation->add_app('htmlarea-FullPage'); $GLOBALS['phpgw']->translation->add_app('htmlarea-FullPage');
// I18N for the FullPage plugin // I18N for the FullPage plugin

View File

@ -16,8 +16,7 @@ window.resizeTo(400, 100);
f_body_bgcolor : true, f_body_bgcolor : true,
f_body_fgcolor : true, f_body_fgcolor : true,
f_base_style : true, f_base_style : true,
f_alt_style : true, f_alt_style : true
f_charset : true
}; };
var editor = null; var editor = null;
@ -121,17 +120,6 @@ border-bottom: 1px solid black; letter-spacing: 2px;
<td class="label"><span>Text color:</span></td> <td class="label"><span>Text color:</span></td>
<td><input type="text" id="f_body_fgcolor" size="7" /></td> <td><input type="text" id="f_body_fgcolor" size="7" /></td>
</tr> </tr>
<tr>
<td class="label"><span>Character set:</span></td>
<td><select id="f_charset">
<option value=""></option>
<option value="utf-8">UTF-8 (recommended)</option>
<option value="windows-1251">cyrillic (WINDOWS-1251)</option>
<option value="koi8-r">cyrillic (KOI8-R)</option>
<option value="iso-8859-5">cyrillic (ISO-8859-5)</option>
<option value="iso-8859-1">western (ISO-8859-1)</option>
</select></td>
</tr>
</table> </table>
<div id="buttons"> <div id="buttons">

View File

@ -16,7 +16,7 @@ function HtmlTidy(editor) {
// register the toolbar buttons provided by this plugin // register the toolbar buttons provided by this plugin
var toolbar = []; var toolbar = [];
for (var i = 0; i < bl.length; ++i) { for (var i in bl) {
var btn = bl[i]; var btn = bl[i];
if (btn == "html-tidy") { if (btn == "html-tidy") {
var id = "HT-html-tidy"; var id = "HT-html-tidy";

View File

@ -24,6 +24,7 @@ $GLOBALS['phpgw_info']['flags'] = Array(
); );
include('../../../../../../header.inc.php'); include('../../../../../../header.inc.php');
header('Content-type: text/javascript; charset='.$GLOBALS['phpgw']->translation->charset());
$GLOBALS['phpgw']->translation->add_app('htmlarea-HtmlTidy'); $GLOBALS['phpgw']->translation->add_app('htmlarea-HtmlTidy');
// I18N constants // I18N constants

View File

@ -24,6 +24,7 @@ $GLOBALS['phpgw_info']['flags'] = Array(
); );
include('../../../../../../header.inc.php'); include('../../../../../../header.inc.php');
header('Content-type: text/javascript; charset='.$GLOBALS['phpgw']->translation->charset());
$GLOBALS['phpgw']->translation->add_app('htmlarea-ListType'); $GLOBALS['phpgw']->translation->add_app('htmlarea-ListType');
// I18N constants // I18N constants

View File

@ -24,6 +24,7 @@ $GLOBALS['phpgw_info']['flags'] = Array(
); );
include('../../../../../../header.inc.php'); include('../../../../../../header.inc.php');
header('Content-type: text/javascript; charset='.$GLOBALS['phpgw']->translation->charset());
$GLOBALS['phpgw']->translation->add_app('htmlarea-SpellChecker'); $GLOBALS['phpgw']->translation->add_app('htmlarea-SpellChecker');
// I18N constants // I18N constants

View File

@ -126,7 +126,7 @@ function replaceAllClicked() {
} }
*/ */
if (ok) { if (ok) {
for (var i = 0; i < spans.length; ++i) { for (var i in spans) {
if (spans[i] != currentElement) { if (spans[i] != currentElement) {
replaceWord(spans[i]); replaceWord(spans[i]);
} }
@ -156,7 +156,7 @@ function learnClicked() {
function internationalizeWindow() { function internationalizeWindow() {
var types = ["div", "span", "button"]; var types = ["div", "span", "button"];
for (var i = 0; i < types.length; ++i) { for (var i in types) {
var tag = types[i]; var tag = types[i];
var els = document.getElementsByTagName(tag); var els = document.getElementsByTagName(tag);
for (var j = els.length; --j >= 0;) { for (var j = els.length; --j >= 0;) {
@ -237,7 +237,7 @@ function wordClicked(scroll) {
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, " ");
for (var i = 0; i < a.length; ++i) { for (var i in a) {
var el = a[i]; var el = a[i];
if (el != currentElement) { if (el != currentElement) {
el.className = el.className.replace(/\s*HA-spellcheck-same\s*/g, " "); el.className = el.className.replace(/\s*HA-spellcheck-same\s*/g, " ");
@ -247,7 +247,7 @@ function wordClicked(scroll) {
currentElement = this; currentElement = this;
this.className += " HA-spellcheck-current"; this.className += " HA-spellcheck-current";
var a = allWords[currentElement.__msh_origWord]; var a = allWords[currentElement.__msh_origWord];
for (var i = 0; i < a.length; ++i) { for (var i in a) {
var el = a[i]; var el = a[i];
if (el != currentElement) { if (el != currentElement) {
el.className += " HA-spellcheck-same"; el.className += " HA-spellcheck-same";

View File

@ -18,7 +18,7 @@ function SpellChecker(editor) {
// register the toolbar buttons provided by this plugin // register the toolbar buttons provided by this plugin
var toolbar = []; var toolbar = [];
for (var i = 0; i < bl.length; ++i) { for (var i in bl) {
var btn = bl[i]; var btn = bl[i];
if (!btn) { if (!btn) {
toolbar.push("separator"); toolbar.push("separator");
@ -33,7 +33,7 @@ function SpellChecker(editor) {
} }
} }
for (var i = 0; i < toolbar.length; ++i) { for (var i in toolbar) {
cfg.toolbar[0].push(toolbar[i]); cfg.toolbar[0].push(toolbar[i]);
} }
}; };

View File

@ -24,6 +24,7 @@ $GLOBALS['phpgw_info']['flags'] = Array(
); );
include('../../../../../../header.inc.php'); include('../../../../../../header.inc.php');
header('Content-type: text/javascript; charset='.$GLOBALS['phpgw']->translation->charset());
$GLOBALS['phpgw']->translation->add_app('htmlarea-TableOperations'); $GLOBALS['phpgw']->translation->add_app('htmlarea-TableOperations');
// I18N constants // I18N constants

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, <mihai_bazon@yahoo.com> // Author: Mihai Bazon, <mishoo@infoiasi.ro>
// translated into Norwegia: ses@online.no 11.11.03 // translated into Norwegia: ses@online.no 11.11.03
// FOR TRANSLATORS: // FOR TRANSLATORS:

View File

@ -24,7 +24,7 @@ function TableOperations(editor) {
// register the toolbar buttons provided by this plugin // register the toolbar buttons provided by this plugin
var toolbar = ["linebreak"]; var toolbar = ["linebreak"];
for (var i = 0; i < bl.length; ++i) { for (var i in bl) {
var btn = bl[i]; var btn = bl[i];
if (!btn) { if (!btn) {
toolbar.push("separator"); toolbar.push("separator");
@ -65,7 +65,7 @@ TableOperations.prototype.getClosest = function(tagName) {
var ancestors = editor.getAllAncestors(); var ancestors = editor.getAllAncestors();
var ret = null; var ret = null;
tagName = ("" + tagName).toLowerCase(); tagName = ("" + tagName).toLowerCase();
for (var i = 0; i < ancestors.length; ++i) { for (var i in ancestors) {
var el = ancestors[i]; var el = ancestors[i];
if (el.tagName.toLowerCase() == tagName) { if (el.tagName.toLowerCase() == tagName) {
ret = el; ret = el;
@ -502,17 +502,11 @@ TableOperations.prototype.buttonPress = function(editor, button_id) {
var rows = td.parentNode.parentNode.rows; var rows = td.parentNode.parentNode.rows;
var index = td.cellIndex; var index = td.cellIndex;
for (var i = rows.length; --i >= 0;) { for (var i = rows.length; --i >= 0;) {
/*
var tr = rows;
var otd = tr.insertCell(index + (/after/.test(button_id) ? 1 : 0));
otd.innerHTML = mozbr;
*/
var tr = rows[i]; var tr = rows[i];
var ref = tr.cells[index + (/after/.test(button_id) ? 1 : 0)]; var ref = tr.cells[index + (/after/.test(button_id) ? 1 : 0)];
var otd = editor._doc.createElement("td"); var otd = editor._doc.createElement("td");
otd.innerHTML = mozbr; otd.innerHTML = mozbr;
tr.insertBefore(otd, ref); tr.insertBefore(otd, ref);
} }
editor.focusEditor(); editor.focusEditor();
break; break;
@ -874,7 +868,7 @@ TableOperations.createStyleLayoutFieldset = function(doc, editor, el) {
td.appendChild(select); td.appendChild(select);
select.name = "f_st_float"; select.name = "f_st_float";
options = ["None", "Left", "Right"]; options = ["None", "Left", "Right"];
for (var i = 0; i < options.length; ++i) { for (i in options) {
var Val = options[i]; var Val = options[i];
var val = options[i].toLowerCase(); var val = options[i].toLowerCase();
option = doc.createElement("option"); option = doc.createElement("option");
@ -929,7 +923,7 @@ TableOperations.createStyleLayoutFieldset = function(doc, editor, el) {
input.size = "1"; input.size = "1";
input.style.fontFamily = "monospace"; input.style.fontFamily = "monospace";
td.appendChild(input); td.appendChild(input);
for (var i = 0; i < options.length; ++i) { for (i in options) {
var Val = options[i]; var Val = options[i];
var val = Val.toLowerCase(); var val = Val.toLowerCase();
option = doc.createElement("option"); option = doc.createElement("option");
@ -984,7 +978,7 @@ TableOperations.createStyleLayoutFieldset = function(doc, editor, el) {
select.style.marginLeft = "0.5em"; select.style.marginLeft = "0.5em";
td.appendChild(select); td.appendChild(select);
options = ["Top", "Middle", "Bottom", "Baseline"]; options = ["Top", "Middle", "Bottom", "Baseline"];
for (var i = 0; i < options.length; ++i) { for (i in options) {
var Val = options[i]; var Val = options[i];
var val = Val.toLowerCase(); var val = Val.toLowerCase();
option = doc.createElement("option"); option = doc.createElement("option");
@ -1076,7 +1070,7 @@ TableOperations.createStyleFieldset = function(doc, editor, el) {
// That is, "top right bottom left" -- we only consider the first // That is, "top right bottom left" -- we only consider the first
// value. // value.
(currentBorderStyle.match(/([^\s]*)\s/)) && (currentBorderStyle = RegExp.$1); (currentBorderStyle.match(/([^\s]*)\s/)) && (currentBorderStyle = RegExp.$1);
for (var i in options) { for (i in options) {
var val = options[i]; var val = options[i];
option = doc.createElement("option"); option = doc.createElement("option");
option.value = val; option.value = val;
@ -1086,7 +1080,7 @@ TableOperations.createStyleFieldset = function(doc, editor, el) {
} }
select.style.marginRight = "0.5em"; select.style.marginRight = "0.5em";
function setBorderFieldsStatus(value) { function setBorderFieldsStatus(value) {
for (var i = 0; i < borderFields.length; ++i) { for (i in borderFields) {
var el = borderFields[i]; var el = borderFields[i];
el.style.visibility = value ? "hidden" : "visible"; el.style.visibility = value ? "hidden" : "visible";
if (!value && (el.tagName.toLowerCase() == "input")) { if (!value && (el.tagName.toLowerCase() == "input")) {

View File

@ -24,6 +24,7 @@ $GLOBALS['phpgw_info']['flags'] = Array(
); );
include('../../../../../../header.inc.php'); include('../../../../../../header.inc.php');
header('Content-type: text/javascript; charset='.$GLOBALS['phpgw']->translation->charset());
$GLOBALS['phpgw']->translation->add_app('htmlarea-SpellChecker'); $GLOBALS['phpgw']->translation->add_app('htmlarea-SpellChecker');
// I18N for the FullPage plugin // I18N for the FullPage plugin

View File

@ -14,11 +14,10 @@
// FIXME: remove imageMagick shit, we only use gdlib // FIXME: remove imageMagick shit, we only use gdlib
// FIXME: autodetect safe_mode // FIXME: autodetect safe_mode
// FIXME set current app to the calling app
// FIXME include header nicer // FIXME include header nicer
$phpgw_flags = Array( $phpgw_flags = Array(
'currentapp' => 'jinn', 'currentapp' => 'home',
'noheader' => True, 'noheader' => True,
'nonavbar' => True, 'nonavbar' => True,
'noappheader' => True, 'noappheader' => True,
@ -37,22 +36,47 @@
@include('../../../../../../../header.inc.php'); @include('../../../../../../../header.inc.php');
} }
$sessdata = $GLOBALS['phpgw']->session->appsession('UploadImage','phpgwapi');
$phpgw_flags['currentapp'] = $sessdata['app'] ? $sessdata['app'] : 'jinn';
define('IMAGE_CLASS', 'GD'); define('IMAGE_CLASS', 'GD');
//In safe mode, directory creation is not permitted. //In safe mode, directory creation is not permitted.
$SAFE_MODE = false; $SAFE_MODE = false;
$sessdata = $GLOBALS['phpgw']->session->appsession('UploadImage','phpgwapi'); switch ($phpgw_flags['currentapp'])
{
case 'jinn' :
$BASE_DIR = $sessdata[UploadImageBaseDir]; $BASE_DIR = $sessdata[UploadImageBaseDir];
$BASE_URL = $sessdata[UploadImageBaseURL]; $BASE_URL = $sessdata[UploadImageBaseURL];
$MAX_HEIGHT = $sessdata[UploadImageMaxHeight]; $MAX_HEIGHT = $sessdata[UploadImageMaxHeight];
$MAX_WIDTH = $sessdata[UploadImageMaxWidth]; $MAX_WIDTH = $sessdata[UploadImageMaxWidth];
// _debug_array($sessdata);
//die();
break;
case 'sitemgr' :
if(is_writeable($sessdata['upload_dir']))
{
$BASE_DIR = $sessdata['upload_dir'];
$BASE_URL = str_replace($GLOBALS['_SERVER']['DOCUMENT_ROOT'],'',$sessdata['upload_dir']);
}
else
{
echo '<p><b>Error</b></p>';
echo '<p>Upload directory does not exist, or is not writeable by webserver</p>';
echo $GLOBALS['egw_info']['user']['apps']['admin'] ?
'<a href="'. $GLOBALS['phpgw']->link('/index.php',
'menuaction=sitemgr.Common_UI.DisplayPrefs').'">Choose an other directory</a><br>
or make "'. $sessdata['upload_dir']. '" writeable by webserver' :
'Notify your Administrator to correct this Situation';
die();
}
default :
break;
}
if(!$MAX_HEIGHT) $MAX_HEIGHT = 10000; if(!$MAX_HEIGHT) $MAX_HEIGHT = 10000;
if(!$MAX_WIDTH) $MAX_WIDTH = 10000; if(!$MAX_WIDTH) $MAX_WIDTH = 10000;
// _debug_array($sessdata);
//die();
//After defining which library to use, if it is NetPBM or IM, you need to //After defining which library to use, if it is NetPBM or IM, you need to

View File

@ -191,7 +191,7 @@ PopupDiv.prototype.getForm = function() {
PopupDiv.prototype.callHandler = function() { PopupDiv.prototype.callHandler = function() {
var tags = ["input", "textarea", "select"]; var tags = ["input", "textarea", "select"];
var params = new Object(); var params = new Object();
for (var ti = tags.length; --ti >= 0;) { for (var ti in tags) {
var tag = tags[ti]; var tag = tags[ti];
var els = this.content.getElementsByTagName(tag); var els = this.content.getElementsByTagName(tag);
for (var j = 0; j < els.length; ++j) { for (var j = 0; j < els.length; ++j) {

View File

@ -3,9 +3,8 @@
<head> <head>
<title>Fullscreen HTMLArea</title> <title>Fullscreen HTMLArea</title>
<script type="text/javascript"> <script type="text/javascript">
_editor_url = window.opener._editor_url || '../'; _editor_url = window.opener._editor_url;
_editor_lang = window.opener._editor_lang; _editor_lang = window.opener._editor_lang;
_editor_css = window.opener._editor_css;
var BASE = window.opener.document.baseURI || window.opener.document.URL; var BASE = window.opener.document.baseURI || window.opener.document.URL;
var head = document.getElementsByTagName("head")[0]; var head = document.getElementsByTagName("head")[0];
var base = document.createElement("base"); var base = document.createElement("base");
@ -13,15 +12,13 @@
head.appendChild(base); head.appendChild(base);
</script> </script>
<script type="text/javascript"> <script type="text/javascript" src="../htmlarea.js"></script>
document.write('<scr' + 'ipt type="text/javascript" src="' + _editor_url + 'htmlarea.js"></scr' + 'ipt>');
</script>
<script type="text/javascript"> <script type="text/javascript">
// load HTMLArea scripts that are present in the opener frame // load HTMLArea scripts that are present in the opener frame
var scripts = window.opener.HTMLArea._scripts; var scripts = window.opener.HTMLArea._scripts;
for (var i = 3; i < scripts.length; ++i) { for (var i = 4; i < scripts.length; ++i) {
//document.write("<scr" + "ipt type='text/javascript' src='" + scripts[i] + "'></scr" + "ipt>"); document.write("<scr" + "ipt type='text/javascript' src='" + scripts[i] + "'></scr" + "ipt>");
HTMLArea.loadScript(scripts[i]);
} }
</script> </script>
@ -36,7 +33,7 @@ var editor = null; // to be initialized later [ function init() ]
\* ---------------------------------------------------------------------- */ \* ---------------------------------------------------------------------- */
function _CloseOnEsc(ev) { function _CloseOnEsc(ev) {
ev || (ev = window.event) || (ev = editor._iframe.contentWindow.event); ev || (ev = window.event);
if (ev.keyCode == 27) { if (ev.keyCode == 27) {
// update_parent(); // update_parent();
window.close(); window.close();
@ -62,7 +59,7 @@ function resize_editor() { // resize editor to fix window
if (editor.config.statusBar) { if (editor.config.statusBar) {
newHeight -= editor._statusBar.offsetHeight; newHeight -= editor._statusBar.offsetHeight;
} }
editor._textArea.style.height = editor._iframe.style.height = newHeight - (HTMLArea.is_gecko ? 8 : 0) + "px"; editor._textArea.style.height = editor._iframe.style.height = newHeight + "px";
} }
/* ---------------------------------------------------------------------- *\ /* ---------------------------------------------------------------------- *\
@ -86,10 +83,7 @@ function init() {
// register the plugins, if any // register the plugins, if any
for (var i in parent_object.plugins) { for (var i in parent_object.plugins) {
var plugin = parent_object.plugins[i]; var plugin = parent_object.plugins[i];
try {
eval(plugin.name);
editor.registerPlugin2(plugin.name, plugin.args); editor.registerPlugin2(plugin.name, plugin.args);
} catch(e) {};
} }
// and restore the original toolbar // and restore the original toolbar
config.toolbar = parent_object.config.toolbar; config.toolbar = parent_object.config.toolbar;
@ -131,7 +125,7 @@ function update_parent() {
</script> </script>
<style type="text/css"> html, body { height: 100%; margin: 0px; border: 0px; background-color: buttonface; } </style> <style type="text/css"> html, body { height: 100%; margin: 0px; border: 0px; background-color: buttonface; } </style>
</head> </head>
<body scroll="no" onload="HTMLArea.onload = init; HTMLArea.init();" onunload="update_parent()"> <body scroll="no" onload="setTimeout(function(){init();}, 500)" onunload="update_parent()">
<form style="margin: 0px; border: 1px solid; border-color: threedshadow threedhighlight threedhighlight threedshadow;"> <form style="margin: 0px; border: 1px solid; border-color: threedshadow threedhighlight threedhighlight threedshadow;">
<textarea name="editor" id="editor" style="width:100%; height:300px">&nbsp;</textarea> <textarea name="editor" id="editor" style="width:100%; height:300px">&nbsp;</textarea>
</form> </form>

View File

@ -10,8 +10,6 @@
window.resizeTo(400, 100); window.resizeTo(400, 100);
function Init() { function Init() {
i18n = window.opener.HTMLArea.I18N.dialogs; // load the HTMLArea plugin and lang file
__dlg_translate(i18n);
__dlg_init(); __dlg_init();
document.getElementById("f_rows").focus(); document.getElementById("f_rows").focus();
}; };
@ -29,13 +27,13 @@ function onOK() {
return false; return false;
} }
} }
var fields = ["f_rows", "f_cols", "f_width", "f_unit", "f_fixed", var fields = ["f_rows", "f_cols", "f_width", "f_unit",
"f_align", "f_border", "f_spacing", "f_padding"]; "f_align", "f_border", "f_spacing", "f_padding"];
var param = new Object(); var param = new Object();
for (var i in fields) { for (var i in fields) {
var id = fields[i]; var id = fields[i];
var el = document.getElementById(id); var el = document.getElementById(id);
param[id] = (el.type == "checkbox") ? el.checked : el.value; param[id] = el.value;
} }
__dlg_close(param); __dlg_close(param);
return false; return false;
@ -90,6 +88,13 @@ form { padding: 0px; margin: 0px; }
<tr> <tr>
<td style="width: 4em; text-align: right">Rows:</td> <td style="width: 4em; text-align: right">Rows:</td>
<td><input type="text" name="rows" id="f_rows" size="5" title="Number of rows" value="2" /></td> <td><input type="text" name="rows" id="f_rows" size="5" title="Number of rows" value="2" /></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td style="width: 4em; text-align: right">Cols:</td>
<td><input type="text" name="cols" id="f_cols" size="5" title="Number of columns" value="4" /></td>
<td style="width: 4em; text-align: right">Width:</td> <td style="width: 4em; text-align: right">Width:</td>
<td><input type="text" name="width" id="f_width" size="5" title="Width of the table" value="100" /></td> <td><input type="text" name="width" id="f_width" size="5" title="Width of the table" value="100" /></td>
<td><select size="1" name="unit" id="f_unit" title="Width unit"> <td><select size="1" name="unit" id="f_unit" title="Width unit">
@ -98,13 +103,7 @@ form { padding: 0px; margin: 0px; }
<option value="em" >Em</option> <option value="em" >Em</option>
</select></td> </select></td>
</tr> </tr>
<tr>
<td style="width: 4em; text-align: right">Cols:</td>
<td><input type="text" name="cols" id="f_cols" size="5" title="Number of columns" value="4" /></td>
<td style="text-align: right"><input type="checkbox" checked="checked" name="fixed" id="f_fixed" /></td>
<td colspan="2"><label for="f_fixed"
>Fixed width columns</label></td>
</tr>
</tbody> </tbody>
</table> </table>
@ -117,7 +116,7 @@ form { padding: 0px; margin: 0px; }
<div class="fl">Alignment:</div> <div class="fl">Alignment:</div>
<select size="1" name="align" id="f_align" <select size="1" name="align" id="f_align"
title="Positioning of this table"> title="Positioning of this image">
<option value="" selected="1" >Not set</option> <option value="" selected="1" >Not set</option>
<option value="left" >Left</option> <option value="left" >Left</option>
<option value="right" >Right</option> <option value="right" >Right</option>

View File

@ -26,12 +26,7 @@ function Init() {
__dlg_init(); __dlg_init();
var param = window.dialogArguments; var param = window.dialogArguments;
var target_select = document.getElementById("f_target"); var target_select = document.getElementById("f_target");
var use_target = true;
if (param) { if (param) {
if ( typeof param["f_usetarget"] != "undefined" ) {
use_target = param["f_usetarget"];
}
if ( typeof param["f_href"] != "undefined" ) {
document.getElementById("f_href").value = param["f_href"]; document.getElementById("f_href").value = param["f_href"];
document.getElementById("f_title").value = param["f_title"]; document.getElementById("f_title").value = param["f_title"];
comboSelectValue(target_select, param["f_target"]); comboSelectValue(target_select, param["f_target"]);
@ -43,12 +38,6 @@ function Init() {
opt.selected = true; opt.selected = true;
} }
} }
}
if (! use_target) {
document.getElementById("f_target_label").style.visibility = "hidden";
document.getElementById("f_target").style.visibility = "hidden";
document.getElementById("f_target_other").style.visibility = "hidden";
}
var opt = document.createElement("option"); var opt = document.createElement("option");
opt.value = "_other"; opt.value = "_other";
opt.innerHTML = i18n("Other"); opt.innerHTML = i18n("Other");
@ -123,7 +112,7 @@ border-bottom: 1px solid black; letter-spacing: 2px;
<body onload="Init()"> <body onload="Init()">
<div class="title">Insert/Modify Link</div> <div class="title">Insert/Modify Link</div>
<form>
<table border="0" style="width: 100%;"> <table border="0" style="width: 100%;">
<tr> <tr>
<td class="label">URL:</td> <td class="label">URL:</td>
@ -134,7 +123,7 @@ border-bottom: 1px solid black; letter-spacing: 2px;
<td><input type="text" id="f_title" style="width: 100%" /></td> <td><input type="text" id="f_title" style="width: 100%" /></td>
</tr> </tr>
<tr> <tr>
<td class="label"><span id="f_target_label">Target:</span></td> <td class="label">Target:</td>
<td><select id="f_target"> <td><select id="f_target">
<option value="">None (use implicit)</option> <option value="">None (use implicit)</option>
<option value="_blank">New window (_blank)</option> <option value="_blank">New window (_blank)</option>
@ -147,9 +136,9 @@ border-bottom: 1px solid black; letter-spacing: 2px;
</table> </table>
<div id="buttons"> <div id="buttons">
<button type="submit" name="ok" onclick="return onOK();">OK</button> <button type="button" name="ok" onclick="return onOK();">OK</button>
<button type="button" name="cancel" onclick="return onCancel();">Cancel</button> <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
</div> </div>
</form>
</body> </body>
</html> </html>

View File

@ -53,12 +53,12 @@ function __dlg_init(bottom) {
// only if we call it twice we get the // only if we call it twice we get the
// correct size. // correct size.
window.addEventListener("unload", __dlg_onclose, true); window.addEventListener("unload", __dlg_onclose, true);
window.innerWidth = body.offsetWidth + 5;
window.innerHeight = body_height + 2;
// center on parent // center on parent
var x = opener.screenX + (opener.outerWidth - window.outerWidth) / 2; var x = opener.screenX + (opener.outerWidth - window.outerWidth) / 2;
var y = opener.screenY + (opener.outerHeight - window.outerHeight) / 2; var y = opener.screenY + (opener.outerHeight - window.outerHeight) / 2;
window.moveTo(x, y); window.moveTo(x, y);
window.innerWidth = body.offsetWidth + 5;
window.innerHeight = body_height + 2;
} else { } else {
// window.dialogHeight = body.offsetHeight + 50 + "px"; // window.dialogHeight = body.offsetHeight + 50 + "px";
// window.dialogWidth = body.offsetWidth + "px"; // window.dialogWidth = body.offsetWidth + "px";
@ -76,8 +76,8 @@ function __dlg_init(bottom) {
}; };
function __dlg_translate(i18n) { function __dlg_translate(i18n) {
var types = ["input", "select", "legend", "span", "option", "td", "button", "div"]; var types = ["span", "option", "td", "button", "div"];
for (var type = 0; type < types.length; ++type) { for (var type in types) {
var spans = document.getElementsByTagName(types[type]); var spans = document.getElementsByTagName(types[type]);
for (var i = spans.length; --i >= 0;) { for (var i = spans.length; --i >= 0;) {
var span = spans[i]; var span = spans[i];
@ -86,11 +86,6 @@ function __dlg_translate(i18n) {
if (txt) if (txt)
span.firstChild.data = txt; span.firstChild.data = txt;
} }
if (span.title) {
var txt = i18n[span.title];
if (txt)
span.title = txt;
}
} }
} }
var txt = i18n[document.title]; var txt = i18n[document.title];

View File

@ -16,7 +16,7 @@ function PopupWin(editor, title, handler, initFunction) {
if (base && base.match(/(.*)\/([^\/]+)/)) { if (base && base.match(/(.*)\/([^\/]+)/)) {
base = RegExp.$1 + "/"; base = RegExp.$1 + "/";
} }
if (typeof _editor_url != "undefined" && !/^\//.test(_editor_url) && !/http:\/\//.test(_editor_url)) { if (typeof _editor_url != "undefined" && !/^\//.test(_editor_url)) {
// _editor_url doesn't start with '/' which means it's relative // _editor_url doesn't start with '/' which means it's relative
// FIXME: there's a problem here, it could be http:// which // FIXME: there's a problem here, it could be http:// which
// doesn't start with slash but it's not relative either. // doesn't start with slash but it's not relative either.
@ -61,7 +61,7 @@ function PopupWin(editor, title, handler, initFunction) {
PopupWin.prototype.callHandler = function() { PopupWin.prototype.callHandler = function() {
var tags = ["input", "textarea", "select"]; var tags = ["input", "textarea", "select"];
var params = new Object(); var params = new Object();
for (var ti = tags.length; --ti >= 0;) { for (var ti in tags) {
var tag = tags[ti]; var tag = tags[ti];
var els = this.content.getElementsByTagName(tag); var els = this.content.getElementsByTagName(tag);
for (var j = 0; j < els.length; ++j) { for (var j = 0; j < els.length; ++j) {