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);";
editor.generate(); setTimeout(function() {
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

@ -2,50 +2,50 @@
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: "es", lang: "es",
tooltips: { tooltips: {
bold: "Negrita", bold: "Negrita",
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",
htmlmode: "Ver Documento en HTML", htmlmode: "Ver Documento en HTML",
popupeditor: "Ampliar Editor", popupeditor: "Ampliar Editor",
about: "Acerca del Editor", about: "Acerca del Editor",
showhelp: "Ayuda", showhelp: "Ayuda",
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"
}, },
buttons: { buttons: {
"ok": "Aceptar", "ok": "Aceptar",
"cancel": "Cancelar" "cancel": "Cancelar"
}, },
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"
@ -61,7 +61,7 @@ HTMLArea.I18N = {
msg: { msg: {
"Path": "Pad", "Path": "Pad",
"TEXT_MODE": "Je bent in TEKST-mode. Gebruik de [<>] knop om terug te keren naar WYSIWYG-mode.", "TEXT_MODE": "Je bent in TEKST-mode. Gebruik de [<>] knop om terug te keren naar WYSIWYG-mode.",
"IE-sucks-full-screen" : "IE-sucks-full-screen" :
// translate here // translate here
"Fullscreen-mode veroorzaakt problemen met Internet Explorer door bugs in de webbrowser " + "Fullscreen-mode veroorzaakt problemen met Internet Explorer door bugs in de webbrowser " +
@ -86,4 +86,5 @@ HTMLArea.I18N = {
"URL:" : "URL:", "URL:" : "URL:",
"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,77 +1,51 @@
// 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 = {
// 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: "vn", lang: "vn",
tooltips: { tooltips: {
bold: "Đậm", bold: "Đậm",
italic: "Nghiêng", italic: "Nghiêng",
underline: "Gạch Chân", underline: "Gạch Chân",
strikethrough: "Gạch Xóa", strikethrough: "Gạch Xóa",
subscript: "Viết Xuống Dưới", subscript: "Viết Xuống Dưới",
superscript: "Viết Lên Trên", superscript: "Viết Lên Trên",
justifyleft: "Căn Trái", justifyleft: "Căn Trái",
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",
htmlmode: "Chế Độ Mã HTML", htmlmode: "Chế Độ Mã HTML",
popupeditor: "Phóng To Ô Soạn Thảo", popupeditor: "Phóng To Ô Soạn Thảo",
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: {
}, "ok": "OK",
buttons: { "cancel": "Hủy"
"ok": "Đồng ý", },
"cancel": "Hủy", msg: {
"Path": "Đường Dẫn",
"IE-sucks-full-screen" : "TEXT_MODE": "Bạn đang ở chế độ text. Sử dụng nút [<>] để chuyển lại chế độ WYSIWIG."
// 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: {
"Path": "Đường Dẫn",
"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,41 +189,32 @@ 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:"] + " " + currentTarget.tagName)) {
if (confirm(i18n["Please confirm that you want to remove this element:"] + " " + var el = currentTarget;
currentTarget.tagName)) { var p = el.parentNode;
var el = currentTarget; p.removeChild(el);
var p = el.parentNode; if (HTMLArea.is_gecko) {
p.removeChild(el); if (p.tagName.toLowerCase() == "td" && !p.hasChildNodes())
if (HTMLArea.is_gecko) { p.appendChild(editor._doc.createElement("br"));
if (p.tagName.toLowerCase() == "td" && !p.hasChildNodes()) editor.forceRedraw();
p.appendChild(editor._doc.createElement("br")); editor.focusEditor();
editor.forceRedraw(); editor.updateToolbar();
editor.focusEditor(); if (table) {
editor.updateToolbar(); var save_collapse = table.style.borderCollapse;
if (table) { table.style.borderCollapse = "collapse";
var save_collapse = table.style.borderCollapse; table.style.borderCollapse = "separate";
table.style.borderCollapse = "collapse"; table.style.borderCollapse = save_collapse;
table.style.borderCollapse = "separate";
table.style.borderCollapse = save_collapse;
}
} }
} }
}, }
i18n["Remove this node from the document"] ], },
[ i18n["Insert paragraph before"], i18n["Remove this node from the document"] ]);
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

@ -6,20 +6,20 @@
// This notice MUST stay intact for use (see license.txt). // This notice MUST stay intact for use (see license.txt).
function EnterParagraphs(editor, params) { function EnterParagraphs(editor, params) {
this.editor = editor; this.editor = editor;
// activate only if we're talking to Gecko // activate only if we're talking to Gecko
if (HTMLArea.is_gecko) if (HTMLArea.is_gecko)
this.onKeyPress = this.__onKeyPress; this.onKeyPress = this.__onKeyPress;
}; };
EnterParagraphs._pluginInfo = { EnterParagraphs._pluginInfo = {
name : "EnterParagraphs", name : "EnterParagraphs",
version : "1.0", version : "1.0",
developer : "Adam Wright", developer : "Adam Wright",
developer_url : "http://blog.hipikat.org/", developer_url : "http://blog.hipikat.org/",
sponsor : "The University of Western Australia", sponsor : "The University of Western Australia",
sponsor_url : "http://www.uwa.edu.au/", sponsor_url : "http://www.uwa.edu.au/",
license : "htmlArea" license : "htmlArea"
}; };
// An array of elements who, in html4, by default, have an inline display and can have children // An array of elements who, in html4, by default, have an inline display and can have children
@ -28,177 +28,177 @@ EnterParagraphs.prototype._html4_inlines_re = /^(a|abbr|acronym|b|bdo|big|cite|c
// Finds the first parent element of a given node whose display is probably not inline // Finds the first parent element of a given node whose display is probably not inline
EnterParagraphs.prototype.parentBlock = function(node) { EnterParagraphs.prototype.parentBlock = function(node) {
while (node.parentNode && (node.nodeType != 1 || this._html4_inlines_re.test(node.tagName))) while (node.parentNode && (node.nodeType != 1 || this._html4_inlines_re.test(node.tagName)))
node = node.parentNode; node = node.parentNode;
return node; return node;
}; };
// Internal function for recursively itterating over a all nodes in a fragment // Internal function for recursively itterating over a all nodes in a fragment
// If a callback function returns a non-null value, that is returned and the crawl is therefore broken // If a callback function returns a non-null value, that is returned and the crawl is therefore broken
EnterParagraphs.prototype.walkNodeChildren = function(me, callback) { EnterParagraphs.prototype.walkNodeChildren = function(me, callback) {
if (me.firstChild) { if (me.firstChild) {
var myChild = me.firstChild; var myChild = me.firstChild;
var retVal; var retVal;
while (myChild) { while (myChild) {
if ((retVal = callback(this, myChild)) != null) if ((retVal = callback(this, myChild)) != null)
return retVal; return retVal;
if ((retVal = this.walkNodeChildren(myChild, callback)) != null) if ((retVal = this.walkNodeChildren(myChild, callback)) != null)
return retVal; return retVal;
myChild = myChild.nextSibling; myChild = myChild.nextSibling;
} }
} }
}; };
// Callback function to be performed on each node in the hierarchy // Callback function to be performed on each node in the hierarchy
// Sets flag to true if we find actual text or an element that's not usually displayed inline // Sets flag to true if we find actual text or an element that's not usually displayed inline
EnterParagraphs.prototype._isFilling = function(self, node) { EnterParagraphs.prototype._isFilling = function(self, node) {
if (node.nodeType == 1 && !self._html4_inlines_re.test(node.nodeName)) if (node.nodeType == 1 && !self._html4_inlines_re.test(node.nodeName))
return true; return true;
else if (node.nodeType == 3 && node.nodeValue != '') else if (node.nodeType == 3 && node.nodeValue != '')
return true; return true;
return null; return null;
//alert(node.nodeName); //alert(node.nodeName);
}; };
// Inserts a node deeply on the left of a hierarchy of nodes // Inserts a node deeply on the left of a hierarchy of nodes
EnterParagraphs.prototype.insertDeepLeftText = function(target, toInsert) { EnterParagraphs.prototype.insertDeepLeftText = function(target, toInsert) {
var falling = target; var falling = target;
while (falling.firstChild && falling.firstChild.nodeType == 1) while (falling.firstChild && falling.firstChild.nodeType == 1)
falling = falling.firstChild; falling = falling.firstChild;
//var refNode = falling.firstChild ? falling.firstChild : null; //var refNode = falling.firstChild ? falling.firstChild : null;
//falling.insertBefore(toInsert, refNode); //falling.insertBefore(toInsert, refNode);
falling.innerHTML = toInsert; falling.innerHTML = toInsert;
}; };
// Kind of like a macros, for a frequent query... // Kind of like a macros, for a frequent query...
EnterParagraphs.prototype.isElem = function(node, type) { EnterParagraphs.prototype.isElem = function(node, type) {
return node.nodeName.toLowerCase() == type.toLowerCase(); return node.nodeName.toLowerCase() == type.toLowerCase();
}; };
// The onKeyPress even that does all the work - nicely breaks the line into paragraphs // The onKeyPress even that does all the work - nicely breaks the line into paragraphs
EnterParagraphs.prototype.__onKeyPress = function(ev) { EnterParagraphs.prototype.__onKeyPress = function(ev) {
if (ev.keyCode == 13 && !ev.shiftKey && this.editor._iframe.contentWindow.getSelection) { if (ev.keyCode == 13 && !ev.shiftKey && this.editor._iframe.contentWindow.getSelection) {
var editor = this.editor; var editor = this.editor;
// Get the selection and solid references to what we're dealing with chopping // Get the selection and solid references to what we're dealing with chopping
var sel = editor._iframe.contentWindow.getSelection(); var sel = editor._iframe.contentWindow.getSelection();
// Set the start and end points such that they're going /forward/ through the document // Set the start and end points such that they're going /forward/ through the document
var rngLeft = editor._doc.createRange(); var rngRight = editor._doc.createRange(); var rngLeft = editor._doc.createRange(); var rngRight = editor._doc.createRange();
rngLeft.setStart(sel.anchorNode, sel.anchorOffset); rngRight.setStart(sel.focusNode, sel.focusOffset); rngLeft.setStart(sel.anchorNode, sel.anchorOffset); rngRight.setStart(sel.focusNode, sel.focusOffset);
rngLeft.collapse(true); rngRight.collapse(true); rngLeft.collapse(true); rngRight.collapse(true);
var direct = rngLeft.compareBoundaryPoints(rngLeft.START_TO_END, rngRight) < 0; var direct = rngLeft.compareBoundaryPoints(rngLeft.START_TO_END, rngRight) < 0;
var startNode = direct ? sel.anchorNode : sel.focusNode; var startNode = direct ? sel.anchorNode : sel.focusNode;
var startOffset = direct ? sel.anchorOffset : sel.focusOffset; var startOffset = direct ? sel.anchorOffset : sel.focusOffset;
var endNode = direct ? sel.focusNode : sel.anchorNode; var endNode = direct ? sel.focusNode : sel.anchorNode;
var endOffset = direct ? sel.focusOffset : sel.anchorOffset; var endOffset = direct ? sel.focusOffset : sel.anchorOffset;
// Find the parent blocks of nodes at either end, and their attributes if they're paragraphs // Find the parent blocks of nodes at either end, and their attributes if they're paragraphs
var startBlock = this.parentBlock(startNode); var endBlock = this.parentBlock(endNode); var startBlock = this.parentBlock(startNode); var endBlock = this.parentBlock(endNode);
var attrsLeft = new Array(); var attrsRight = new Array(); var attrsLeft = new Array(); var attrsRight = new Array();
// If a list, let the browser take over, if we're in a paragraph, gather it's attributes // If a list, let the browser take over, if we're in a paragraph, gather it's attributes
if (this.isElem(startBlock, 'li') || this.isElem(endBlock, 'li')) if (this.isElem(startBlock, 'li') || this.isElem(endBlock, 'li'))
return; return;
if (this.isElem(startBlock, 'p')) { if (this.isElem(startBlock, 'p')) {
for (var i = 0; i < startBlock.attributes.length; i++) { for (var i = 0; i < startBlock.attributes.length; i++) {
attrsLeft[startBlock.attributes[i].nodeName] = startBlock.attributes[i].nodeValue; attrsLeft[startBlock.attributes[i].nodeName] = startBlock.attributes[i].nodeValue;
} }
} }
if (this.isElem(endBlock, 'p')) { if (this.isElem(endBlock, 'p')) {
for (var i = 0; i < endBlock.attributes.length; i++) { for (var i = 0; i < endBlock.attributes.length; i++) {
// If we start and end within one paragraph, don't duplicate the 'id' // If we start and end within one paragraph, don't duplicate the 'id'
if (endBlock != startBlock || endBlock.attributes[i].nodeName.toLowerCase() != 'id') if (endBlock != startBlock || endBlock.attributes[i].nodeName.toLowerCase() != 'id')
attrsRight[endBlock.attributes[i].nodeName] = endBlock.attributes[i].nodeValue; attrsRight[endBlock.attributes[i].nodeName] = endBlock.attributes[i].nodeValue;
} }
} }
// Look for where to start and end our chopping - within surrounding paragraphs // Look for where to start and end our chopping - within surrounding paragraphs
// if they exist, or at the edges of the containing block, otherwise // if they exist, or at the edges of the containing block, otherwise
var startChop = startNode; var endChop = endNode; var startChop = startNode; var endChop = endNode;
while ((startChop.previousSibling && !this.isElem(startChop.previousSibling, 'p')) while ((startChop.previousSibling && !this.isElem(startChop.previousSibling, 'p'))
|| (startChop.parentNode && startChop.parentNode != startBlock && startChop.parentNode.nodeType != 9)) || (startChop.parentNode && startChop.parentNode != startBlock && startChop.parentNode.nodeType != 9))
startChop = startChop.previousSibling ? startChop.previousSibling : startChop.parentNode; startChop = startChop.previousSibling ? startChop.previousSibling : startChop.parentNode;
while ((endChop.nextSibling && !this.isElem(endChop.nextSibling, 'p')) while ((endChop.nextSibling && !this.isElem(endChop.nextSibling, 'p'))
|| (endChop.parentNode && endChop.parentNode != endBlock && endChop.parentNode.nodeType != 9)) || (endChop.parentNode && endChop.parentNode != endBlock && endChop.parentNode.nodeType != 9))
endChop = endChop.nextSibling ? endChop.nextSibling : endChop.parentNode; endChop = endChop.nextSibling ? endChop.nextSibling : endChop.parentNode;
// Set up new paragraphs // Set up new paragraphs
var pLeft = editor._doc.createElement('p'); var pRight = editor._doc.createElement('p'); var pLeft = editor._doc.createElement('p'); var pRight = editor._doc.createElement('p');
for (var attrName in attrsLeft) { for (var attrName in attrsLeft) {
var thisAttr = editor._doc.createAttribute(attrName); var thisAttr = editor._doc.createAttribute(attrName);
thisAttr.value = attrsLeft[attrName]; thisAttr.value = attrsLeft[attrName];
pLeft.setAttributeNode(thisAttr); pLeft.setAttributeNode(thisAttr);
} }
for (var attrName in attrsRight) { for (var attrName in attrsRight) {
var thisAttr = editor._doc.createAttribute(attrName); var thisAttr = editor._doc.createAttribute(attrName);
thisAttr.value = attrsRight[attrName]; thisAttr.value = attrsRight[attrName];
pRight.setAttributeNode(thisAttr); pRight.setAttributeNode(thisAttr);
} }
// Get the ranges destined to be stuffed into new paragraphs // Get the ranges destined to be stuffed into new paragraphs
rngLeft.setStartBefore(startChop); rngLeft.setStartBefore(startChop);
rngLeft.setEnd(startNode,startOffset); rngLeft.setEnd(startNode,startOffset);
pLeft.appendChild(rngLeft.cloneContents()); // Copy into pLeft pLeft.appendChild(rngLeft.cloneContents()); // Copy into pLeft
rngRight.setEndAfter(endChop); rngRight.setEndAfter(endChop);
rngRight.setStart(endNode,endOffset); rngRight.setStart(endNode,endOffset);
pRight.appendChild(rngRight.cloneContents()); // Copy into pRight pRight.appendChild(rngRight.cloneContents()); // Copy into pRight
// If either paragraph is empty, fill it with a nonbreakable space // If either paragraph is empty, fill it with a nonbreakable space
var foundBlock = false; var foundBlock = false;
foundBlock = this.walkNodeChildren(pLeft, this._isFilling); foundBlock = this.walkNodeChildren(pLeft, this._isFilling);
if (foundBlock != true) if (foundBlock != true)
this.insertDeepLeftText(pLeft, '&nbsp;'); this.insertDeepLeftText(pLeft, '&nbsp;');
foundBlock = false; foundBlock = false;
foundBlock = this.walkNodeChildren(pRight, this._isFilling); foundBlock = this.walkNodeChildren(pRight, this._isFilling);
if (foundBlock != true) if (foundBlock != true)
this.insertDeepLeftText(pRight, '&nbsp;'); this.insertDeepLeftText(pRight, '&nbsp;');
// Get a range for everything to be replaced and replace it // Get a range for everything to be replaced and replace it
var rngAround = editor._doc.createRange(); var rngAround = editor._doc.createRange();
if (!startChop.previousSibling && this.isElem(startChop.parentNode, 'p')) if (!startChop.previousSibling && this.isElem(startChop.parentNode, 'p'))
rngAround.setStartBefore(startChop.parentNode); rngAround.setStartBefore(startChop.parentNode);
else else
rngAround.setStart(rngLeft.startContainer, rngLeft.startOffset); rngAround.setStart(rngLeft.startContainer, rngLeft.startOffset);
if (!endChop.nextSibling && this.isElem(endChop.parentNode, 'p')) if (!endChop.nextSibling && this.isElem(endChop.parentNode, 'p'))
rngAround.setEndAfter(endChop.parentNode); rngAround.setEndAfter(endChop.parentNode);
else else
rngAround.setEnd(rngRight.endContainer, rngRight.endOffset); rngAround.setEnd(rngRight.endContainer, rngRight.endOffset);
rngAround.deleteContents(); rngAround.deleteContents();
rngAround.insertNode(pRight); rngAround.insertNode(pRight);
rngAround.insertNode(pLeft); rngAround.insertNode(pLeft);
// Set the selection to the start of the (second) new paragraph // Set the selection to the start of the (second) new paragraph
if (pRight.firstChild) { if (pRight.firstChild) {
while (pRight.firstChild && this._html4_inlines_re.test(pRight.firstChild.nodeName)) while (pRight.firstChild && this._html4_inlines_re.test(pRight.firstChild.nodeName))
pRight = pRight.firstChild; pRight = pRight.firstChild;
// Slip into any inline tags // Slip into any inline tags
if (pRight.firstChild && pRight.firstChild.nodeType == 3) if (pRight.firstChild && pRight.firstChild.nodeType == 3)
pRight = pRight.firstChild; // and text, if they've got it pRight = pRight.firstChild; // and text, if they've got it
var rngCaret = editor._doc.createRange(); var rngCaret = editor._doc.createRange();
rngCaret.setStart(pRight, 0); rngCaret.setStart(pRight, 0);
rngCaret.collapse(true); rngCaret.collapse(true);
sel = editor._iframe.contentWindow.getSelection(); sel = editor._iframe.contentWindow.getSelection();
sel.removeAllRanges(); sel.removeAllRanges();
sel.addRange(rngCaret); sel.addRange(rngCaret);
} }
// Stop the bubbling // Stop the bubbling
HTMLArea._stopEvent(ev); HTMLArea._stopEvent(ev);
} }
}; };

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,14 +114,7 @@ FullPage.prototype.setDocProp = function(params) {
else if (style2) else if (style2)
head.removeChild(style2); head.removeChild(style2);
if (charset_meta) { for (var i in params) {
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) {
var val = params[i]; var val = params[i];
switch (i) { switch (i) {
case "f_title": case "f_title":

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

@ -1 +1 @@
Options +ExecCGI Options +ExecCGI

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

@ -1,87 +1,111 @@
<?php <?php
/**************************************************************************\ /**************************************************************************\
* eGroupWare - UploadImage-plugin for htmlArea * * eGroupWare - UploadImage-plugin for htmlArea *
* http://www.eGroupWare.org * * http://www.eGroupWare.org *
* Written and (c) by Xiang Wei ZHUO <wei@zhuo.org> * * Written and (c) by Xiang Wei ZHUO <wei@zhuo.org> *
* Modified for eGW by and (c) by Pim Snel <pim@lingewoud.nl> * * Modified for eGW by and (c) by Pim Snel <pim@lingewoud.nl> *
* -------------------------------------------- * * -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it * * This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the * * under the terms of the GNU General Public License as published by the *
* Free Software Foundation; version 2 of the License. * * Free Software Foundation; version 2 of the License. *
\**************************************************************************/ \**************************************************************************/
/* $id$ */ /* $id$ */
// 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' => 'home',
'currentapp' => 'jinn', 'noheader' => True,
'noheader' => True, 'nonavbar' => True,
'nonavbar' => True, 'noappheader' => True,
'noappheader' => True, 'noappfooter' => True,
'noappfooter' => True, 'nofooter' => True
'nofooter' => True );
);
$GLOBALS['phpgw_info']['flags'] = $phpgw_flags;
$GLOBALS['phpgw_info']['flags'] = $phpgw_flags;
if(@include('../../../../../../header.inc.php'))
if(@include('../../../../../../header.inc.php')) {
{ // I know this is very ugly
// I know this is very ugly }
} else
else {
{ @include('../../../../../../../header.inc.php');
@include('../../../../../../../header.inc.php'); }
}
$sessdata = $GLOBALS['phpgw']->session->appsession('UploadImage','phpgwapi');
define('IMAGE_CLASS', 'GD'); $phpgw_flags['currentapp'] = $sessdata['app'] ? $sessdata['app'] : 'jinn';
//In safe mode, directory creation is not permitted. define('IMAGE_CLASS', 'GD');
$SAFE_MODE = false;
//In safe mode, directory creation is not permitted.
$sessdata = $GLOBALS['phpgw']->session->appsession('UploadImage','phpgwapi'); $SAFE_MODE = false;
$BASE_DIR = $sessdata[UploadImageBaseDir]; switch ($phpgw_flags['currentapp'])
$BASE_URL = $sessdata[UploadImageBaseURL]; {
$MAX_HEIGHT = $sessdata[UploadImageMaxHeight]; case 'jinn' :
$MAX_WIDTH = $sessdata[UploadImageMaxWidth]; $BASE_DIR = $sessdata[UploadImageBaseDir];
$BASE_URL = $sessdata[UploadImageBaseURL];
if(!$MAX_HEIGHT) $MAX_HEIGHT = 10000; $MAX_HEIGHT = $sessdata[UploadImageMaxHeight];
if(!$MAX_WIDTH) $MAX_WIDTH = 10000; $MAX_WIDTH = $sessdata[UploadImageMaxWidth];
// _debug_array($sessdata); // _debug_array($sessdata);
//die(); //die();
break;
case 'sitemgr' :
//After defining which library to use, if it is NetPBM or IM, you need to if(is_writeable($sessdata['upload_dir']))
//specify where the binary for the selected library are. And of course {
//your server and PHP must be able to execute them (i.e. safe mode is OFF). $BASE_DIR = $sessdata['upload_dir'];
//If you have safe mode ON, or don't have the binaries, your choice is $BASE_URL = str_replace($GLOBALS['_SERVER']['DOCUMENT_ROOT'],'',$sessdata['upload_dir']);
//GD only. GD does not require the following definition. }
//define('IMAGE_TRANSFORM_LIB_PATH', '/usr/bin/netpbm/'); else
//define('IMAGE_TRANSFORM_LIB_PATH', '"D:\\Program Files\\ImageMagick\\'); {
echo '<p><b>Error</b></p>';
$BASE_ROOT = ''; echo '<p>Upload directory does not exist, or is not writeable by webserver</p>';
$IMG_ROOT = $BASE_ROOT; echo $GLOBALS['egw_info']['user']['apps']['admin'] ?
'<a href="'. $GLOBALS['phpgw']->link('/index.php',
if(strrpos($BASE_DIR, '/')!= strlen($BASE_DIR)-1) 'menuaction=sitemgr.Common_UI.DisplayPrefs').'">Choose an other directory</a><br>
$BASE_DIR .= '/'; or make "'. $sessdata['upload_dir']. '" writeable by webserver' :
'Notify your Administrator to correct this Situation';
if(strrpos($BASE_URL, '/')!= strlen($BASE_URL)-1) die();
$BASE_URL .= '/'; }
default :
//Built in function of dirname is faulty break;
//It assumes that the directory nane can not contain a . (period) }
function dir_name($dir)
{ if(!$MAX_HEIGHT) $MAX_HEIGHT = 10000;
$lastSlash = intval(strrpos($dir, '/')); if(!$MAX_WIDTH) $MAX_WIDTH = 10000;
if($lastSlash == strlen($dir)-1){
return substr($dir, 0, $lastSlash);
} //After defining which library to use, if it is NetPBM or IM, you need to
else //specify where the binary for the selected library are. And of course
return dirname($dir); //your server and PHP must be able to execute them (i.e. safe mode is OFF).
} //If you have safe mode ON, or don't have the binaries, your choice is
//GD only. GD does not require the following definition.
//define('IMAGE_TRANSFORM_LIB_PATH', '/usr/bin/netpbm/');
//define('IMAGE_TRANSFORM_LIB_PATH', '"D:\\Program Files\\ImageMagick\\');
$BASE_ROOT = '';
$IMG_ROOT = $BASE_ROOT;
if(strrpos($BASE_DIR, '/')!= strlen($BASE_DIR)-1)
$BASE_DIR .= '/';
if(strrpos($BASE_URL, '/')!= strlen($BASE_URL)-1)
$BASE_URL .= '/';
//Built in function of dirname is faulty
//It assumes that the directory nane can not contain a . (period)
function dir_name($dir)
{
$lastSlash = intval(strrpos($dir, '/'));
if($lastSlash == strlen($dir)-1){
return substr($dir, 0, $lastSlash);
}
else
return dirname($dir);
}
?> ?>

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 { editor.registerPlugin2(plugin.name, plugin.args);
eval(plugin.name);
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"]);
@ -42,12 +37,6 @@ function Init() {
target_select.appendChild(opt); target_select.appendChild(opt);
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";
@ -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) {