mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-13 09:28:29 +01:00
Fixes in htmlarea... reverting to previous version by now
This commit is contained in:
parent
d4760bb15c
commit
70e7091322
@ -12,7 +12,6 @@
|
||||
_editor_lang = "en";
|
||||
</script>
|
||||
<script type="text/javascript" src="../htmlarea.js"></script>
|
||||
<script type="text/javascript" src="../htmlarea_css.js"></script>
|
||||
|
||||
<style type="text/css">
|
||||
html, body {
|
||||
|
@ -18,13 +18,11 @@
|
||||
editor.registerPlugin(FullPage);
|
||||
editor.generate();
|
||||
}
|
||||
|
||||
HTMLArea.onload = initDocument;
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body onload="HTMLArea.init()">
|
||||
<body onload="initDocument()">
|
||||
<h1>Test of FullPage plugin</h1>
|
||||
|
||||
<textarea id="editor" style="height: 30em; width: 100%;">
|
||||
@ -71,7 +69,7 @@
|
||||
<hr />
|
||||
<address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
|
||||
<!-- 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 -->
|
||||
</body>
|
||||
</html>
|
||||
|
@ -28,17 +28,15 @@
|
||||
// in our case "lang/en.js" loaded above).
|
||||
|
||||
// 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("SpellChecker");
|
||||
HTMLArea.loadPlugin("FullPage");
|
||||
HTMLArea.loadPlugin("CSS");
|
||||
HTMLArea.loadPlugin("ContextMenu");
|
||||
//HTMLArea.loadPlugin("HtmlTidy");
|
||||
HTMLArea.loadPlugin("HtmlTidy");
|
||||
HTMLArea.loadPlugin("ListType");
|
||||
HTMLArea.loadPlugin("CharacterMap");
|
||||
HTMLArea.loadPlugin("DynamicCSS");
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
@ -56,7 +54,6 @@ textarea { background-color: #fff; border: 1px solid 00f; }
|
||||
|
||||
<script type="text/javascript">
|
||||
var editor = null;
|
||||
|
||||
function initEditor() {
|
||||
|
||||
// create an editor for the "ta" textbox
|
||||
@ -72,14 +69,11 @@ function initEditor() {
|
||||
editor.registerPlugin(SpellChecker);
|
||||
|
||||
// register the HtmlTidy plugin
|
||||
//editor.registerPlugin(HtmlTidy);
|
||||
editor.registerPlugin(HtmlTidy);
|
||||
|
||||
// register the ListType plugin
|
||||
editor.registerPlugin(ListType);
|
||||
|
||||
editor.registerPlugin(CharacterMap);
|
||||
editor.registerPlugin(DynamicCSS);
|
||||
|
||||
// register the CSS plugin
|
||||
editor.registerPlugin(CSS, {
|
||||
combos : [
|
||||
@ -118,12 +112,12 @@ editor.registerPlugin(DynamicCSS);
|
||||
// load the stylesheet used by our CSS plugin configuration
|
||||
editor.config.pageStyle = "@import url(custom.css);";
|
||||
|
||||
editor.generate();
|
||||
setTimeout(function() {
|
||||
editor.generate();
|
||||
}, 500);
|
||||
return false;
|
||||
}
|
||||
|
||||
HTMLArea.onload = initEditor;
|
||||
|
||||
function insertHTML() {
|
||||
var html = prompt("Enter some HTML code here");
|
||||
if (html) {
|
||||
@ -139,7 +133,7 @@ function highlight() {
|
||||
|
||||
<!-- use <body onload="HTMLArea.replaceAll()" if you don't care about
|
||||
customizing the editor. It's the easiest way! :) -->
|
||||
<body onload="HTMLArea.init();">
|
||||
<body onload="initEditor()">
|
||||
|
||||
<h1>HTMLArea 3.0</h1>
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
</ul>
|
||||
|
||||
<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 -->
|
||||
</body> </html>
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
.htmlarea .toolbar {
|
||||
cursor: default;
|
||||
background: ButtonFace;
|
||||
padding: 3px;
|
||||
padding: 1px 1px 2px 1px;
|
||||
border: 1px solid;
|
||||
border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
|
||||
}
|
||||
@ -20,16 +20,11 @@
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
}
|
||||
.htmlarea .toolbar a.button:hover {
|
||||
.htmlarea .toolbar .buttonHover {
|
||||
border: 1px solid;
|
||||
border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
|
||||
}
|
||||
.htmlarea .toolbar a.buttonDisabled:hover {
|
||||
border-color: ButtonFace;
|
||||
}
|
||||
.htmlarea .toolbar .buttonActive,
|
||||
.htmlarea .toolbar .buttonPressed
|
||||
{
|
||||
.htmlarea .toolbar .buttonActive, .htmlarea .toolbar .buttonPressed {
|
||||
padding: 2px 0px 0px 2px;
|
||||
border: 1px solid;
|
||||
border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
|
||||
@ -47,12 +42,12 @@
|
||||
}
|
||||
|
||||
.htmlarea .toolbar .buttonDisabled img {
|
||||
filter: gray() alpha(opacity = 25);
|
||||
filter: alpha(opacity = 25);
|
||||
-moz-opacity: 0.25;
|
||||
}
|
||||
|
||||
.htmlarea .toolbar .separator {
|
||||
/*position: relative;*/
|
||||
position: relative;
|
||||
margin: 3px;
|
||||
border-left: 1px solid ButtonShadow;
|
||||
border-right: 1px solid ButtonHighlight;
|
||||
@ -69,11 +64,6 @@
|
||||
.htmlarea .toolbar select:hover,
|
||||
.htmlarea .toolbar select:active { background: FieldFace; color: ButtonText; }
|
||||
|
||||
.htmlarea iframe
|
||||
{
|
||||
border: none;
|
||||
}
|
||||
|
||||
.htmlarea .statusBar {
|
||||
border: 1px solid;
|
||||
border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
|
||||
@ -112,8 +102,7 @@
|
||||
|
||||
.dialog table { border-collapse: collapse; }
|
||||
|
||||
.dialog .title, .dialog h1
|
||||
{
|
||||
.dialog .title {
|
||||
background: #008;
|
||||
color: #ff8;
|
||||
border-bottom: 1px solid #000;
|
||||
@ -122,7 +111,7 @@
|
||||
font-weight: bold;
|
||||
cursor: default;
|
||||
}
|
||||
.dialog h1 { margin:0px;}
|
||||
|
||||
.dialog .title .button {
|
||||
float: right;
|
||||
border: 1px solid #66a;
|
||||
@ -189,46 +178,3 @@
|
||||
}
|
||||
|
||||
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
@ -46,7 +46,7 @@
|
||||
Please see our About Box for details about who sponsored what plugins.
|
||||
</p>
|
||||
|
||||
<h2><a href="examples/">Online demos</a></h2>
|
||||
<h2>Online demos</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
@ -184,7 +184,7 @@ find htmlarea/ -name "*.cgi" -exec chmod 755 {} \;</pre>
|
||||
|
||||
</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
|
||||
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>
|
||||
@ -192,7 +192,7 @@ find htmlarea/ -name "*.cgi" -exec chmod 755 {} \;</pre>
|
||||
<hr />
|
||||
<address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
|
||||
<!-- 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 -->
|
||||
</body>
|
||||
</html>
|
||||
|
@ -43,8 +43,7 @@ HTMLArea.I18N = {
|
||||
copy: "Kopieren",
|
||||
paste: "Einfügen aus der Zwischenablage",
|
||||
lefttoright: "Textrichtung von Links nach Rechts",
|
||||
righttoleft: "Textrichtung von Rechts nach Links",
|
||||
removeformat: "Formatierung entfernen"
|
||||
righttoleft: "Textrichtung von Rechts nach Links"
|
||||
},
|
||||
|
||||
buttons: {
|
||||
|
@ -50,10 +50,7 @@ HTMLArea.I18N = {
|
||||
copy: "Copy selection",
|
||||
paste: "Paste from clipboard",
|
||||
lefttoright: "Direction left to right",
|
||||
righttoleft: "Direction right to left",
|
||||
removeformat: "Remove formatting",
|
||||
print: "Print document",
|
||||
killword: "Clear MSOffice tags"
|
||||
righttoleft: "Direction right to left"
|
||||
},
|
||||
|
||||
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" +
|
||||
"You have been warned. Please press OK if you still want to try the full screen editor.",
|
||||
|
||||
"MOZ-security-clipboard" :
|
||||
// Translate Here
|
||||
"The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly."
|
||||
"Moz-Clipboard" :
|
||||
"Unprivileged scripts cannot access Cut/Copy/Paste programatically " +
|
||||
"for security reasons. Click OK to see a technical note at mozilla.org " +
|
||||
"which shows you how to allow a script to access the clipboard."
|
||||
},
|
||||
|
||||
dialogs: {
|
||||
// Common
|
||||
"OK" : "OK",
|
||||
"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",
|
||||
"None (use implicit)" : "None (use implicit)",
|
||||
"New window (_blank)" : "New window (_blank)",
|
||||
"Same frame (_self)" : "Same frame (_self)",
|
||||
"Top frame (_top)" : "Top frame (_top)",
|
||||
"None (use implicit)" : "None (use implicit)",
|
||||
"OK" : "OK",
|
||||
"Other" : "Other",
|
||||
"Same frame (_self)" : "Same frame (_self)",
|
||||
"Target:" : "Target:",
|
||||
"Title (tooltip):" : "Title (tooltip):",
|
||||
"Top frame (_top)" : "Top frame (_top)",
|
||||
"URL:" : "URL:",
|
||||
"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:"
|
||||
"You must enter the URL where this link points to" : "You must enter the URL where this link points to"
|
||||
}
|
||||
};
|
||||
|
@ -2,50 +2,50 @@
|
||||
|
||||
HTMLArea.I18N = {
|
||||
|
||||
// the following should be the filename without .js extension
|
||||
// it will be used for automatically load plugin language.
|
||||
lang: "es",
|
||||
// the following should be the filename without .js extension
|
||||
// it will be used for automatically load plugin language.
|
||||
lang: "es",
|
||||
|
||||
tooltips: {
|
||||
bold: "Negrita",
|
||||
italic: "Cursiva",
|
||||
underline: "Subrayado",
|
||||
strikethrough: "Tachado",
|
||||
subscript: "Sub?ndice",
|
||||
superscript: "Super?ndice",
|
||||
justifyleft: "Alinear a la Izquierda",
|
||||
justifycenter: "Centrar",
|
||||
justifyright: "Alinear a la Derecha",
|
||||
justifyfull: "Justificar",
|
||||
orderedlist: "Lista Ordenada",
|
||||
unorderedlist: "Lista No Ordenada",
|
||||
outdent: "Aumentar Sangr?a",
|
||||
indent: "Disminuir Sangr?a",
|
||||
forecolor: "Color del Texto",
|
||||
hilitecolor: "Color del Fondo",
|
||||
inserthorizontalrule: "L?nea Horizontal",
|
||||
createlink: "Insertar Enlace",
|
||||
insertimage: "Insertar Imagen",
|
||||
inserttable: "Insertar Tabla",
|
||||
htmlmode: "Ver Documento en HTML",
|
||||
popupeditor: "Ampliar Editor",
|
||||
about: "Acerca del Editor",
|
||||
showhelp: "Ayuda",
|
||||
textindicator: "Estilo Actual",
|
||||
undo: "Deshacer",
|
||||
redo: "Rehacer",
|
||||
cut: "Cortar selecci?n",
|
||||
copy: "Copiar selecci?n",
|
||||
paste: "Pegar desde el portapapeles"
|
||||
},
|
||||
tooltips: {
|
||||
bold: "Negrita",
|
||||
italic: "Cursiva",
|
||||
underline: "Subrayado",
|
||||
strikethrough: "Tachado",
|
||||
subscript: "Subíndice",
|
||||
superscript: "Superíndice",
|
||||
justifyleft: "Alinear a la Izquierda",
|
||||
justifycenter: "Centrar",
|
||||
justifyright: "Alinear a la Derecha",
|
||||
justifyfull: "Justificar",
|
||||
orderedlist: "Lista Ordenada",
|
||||
unorderedlist: "Lista No Ordenada",
|
||||
outdent: "Aumentar Sangría",
|
||||
indent: "Disminuir Sangría",
|
||||
forecolor: "Color del Texto",
|
||||
hilitecolor: "Color del Fondo",
|
||||
inserthorizontalrule: "Línea Horizontal",
|
||||
createlink: "Insertar Enlace",
|
||||
insertimage: "Insertar Imagen",
|
||||
inserttable: "Insertar Tabla",
|
||||
htmlmode: "Ver Documento en HTML",
|
||||
popupeditor: "Ampliar Editor",
|
||||
about: "Acerca del Editor",
|
||||
showhelp: "Ayuda",
|
||||
textindicator: "Estilo Actual",
|
||||
undo: "Deshacer",
|
||||
redo: "Rehacer",
|
||||
cut: "Cortar selección",
|
||||
copy: "Copiar selección",
|
||||
paste: "Pegar desde el portapapeles"
|
||||
},
|
||||
|
||||
buttons: {
|
||||
"ok": "Aceptar",
|
||||
"cancel": "Cancelar"
|
||||
},
|
||||
buttons: {
|
||||
"ok": "Aceptar",
|
||||
"cancel": "Cancelar"
|
||||
},
|
||||
|
||||
msg: {
|
||||
"Path": "Ruta",
|
||||
"TEXT_MODE": "Esta en modo TEXTO. Use el boton [<>] para cambiar a WYSIWIG"
|
||||
}
|
||||
msg: {
|
||||
"Path": "Ruta",
|
||||
"TEXT_MODE": "Esta en modo TEXTO. Use el boton [<>] para cambiar a WYSIWIG",
|
||||
}
|
||||
};
|
||||
|
@ -47,7 +47,7 @@ HTMLArea.I18N = {
|
||||
undo: "Ongedaan maken",
|
||||
redo: "Herhalen",
|
||||
cut: "Knippen",
|
||||
copy: "Kopi?ren",
|
||||
copy: "Kopiëren",
|
||||
paste: "Plakken",
|
||||
lefttoright: "Tekstrichting links naar rechts",
|
||||
righttoleft: "Tekstrichting rechts naar links"
|
||||
@ -61,7 +61,7 @@ HTMLArea.I18N = {
|
||||
msg: {
|
||||
"Path": "Pad",
|
||||
"TEXT_MODE": "Je bent in TEKST-mode. Gebruik de [<>] knop om terug te keren naar WYSIWYG-mode.",
|
||||
|
||||
|
||||
"IE-sucks-full-screen" :
|
||||
// translate here
|
||||
"Fullscreen-mode veroorzaakt problemen met Internet Explorer door bugs in de webbrowser " +
|
||||
@ -86,4 +86,5 @@ HTMLArea.I18N = {
|
||||
"URL:" : "URL:",
|
||||
"You must enter the URL where this link points to" : "Geef de URL in waar de link naar verwijst"
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -1,77 +1,51 @@
|
||||
// I18N constants : Vietnamese
|
||||
// LANG: "en", ENCODING: UTF-8
|
||||
// Author: Nguyễn Đình Nam, <hncryptologist@yahoo.com>
|
||||
// Modified 21/07/2004 by Phạm Mai Quân <pmquan@4vn.org>
|
||||
|
||||
HTMLArea.I18N = {
|
||||
|
||||
// the following should be the filename without .js extension
|
||||
// it will be used for automatically load plugin language.
|
||||
lang: "vn",
|
||||
// the following should be the filename without .js extension
|
||||
// it will be used for automatically load plugin language.
|
||||
lang: "vn",
|
||||
|
||||
tooltips: {
|
||||
bold: "Đậm",
|
||||
italic: "Nghiêng",
|
||||
underline: "Gạch Chân",
|
||||
strikethrough: "Gạch Xóa",
|
||||
subscript: "Viết Xuống Dưới",
|
||||
superscript: "Viết Lên Trên",
|
||||
justifyleft: "Căn Trái",
|
||||
justifycenter: "Căn Giữa",
|
||||
justifyright: "Căn Phải",
|
||||
justifyfull: "Căn Đều",
|
||||
insertorderedlist: "Danh Sách Có Thứ Tự (1, 2, 3)",
|
||||
insertunorderedlist: "Danh Sách Phi Thứ Tự (Chấm đầu dòng)",
|
||||
outdent: "Lùi Ra Ngoài",
|
||||
indent: "Thụt Vào Trong",
|
||||
forecolor: "Màu Chữ",
|
||||
hilitecolor: "Màu Nền",
|
||||
inserthorizontalrule: "Dòng Kẻ Ngang",
|
||||
createlink: "Tạo Liên Kết",
|
||||
insertimage: "Chèn Ảnh",
|
||||
inserttable: "Chèn Bảng",
|
||||
htmlmode: "Chế Độ Mã HTML",
|
||||
popupeditor: "Phóng To Ô Soạn Thảo",
|
||||
about: "Tự Giới Thiệu",
|
||||
showhelp: "Giúp Đỡ",
|
||||
textindicator: "Định Dạng Hiện Thời",
|
||||
undo: "Hủy thao tác trước",
|
||||
redo: "Lấy lại thao tác vừa bỏ",
|
||||
cut: "Cắt",
|
||||
copy: "Sao chép",
|
||||
paste: "Dán",
|
||||
lefttoright: "Viết từ trái sang phải",
|
||||
righttoleft: "Viết từ phải sang trái"
|
||||
},
|
||||
buttons: {
|
||||
"ok": "Đồng ý",
|
||||
"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: {
|
||||
"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"
|
||||
}
|
||||
tooltips: {
|
||||
bold: "Đậm",
|
||||
italic: "Nghiêng",
|
||||
underline: "Gạch Chân",
|
||||
strikethrough: "Gạch Xóa",
|
||||
subscript: "Viết Xuống Dưới",
|
||||
superscript: "Viết Lên Trên",
|
||||
justifyleft: "Căn Trái",
|
||||
justifycenter: "Căn Giữa",
|
||||
justifyright: "Căn Phải",
|
||||
justifyfull: "Căn Đều",
|
||||
orderedlist: "Danh Sách Có Thứ Tự",
|
||||
unorderedlist: "Danh Sách Phi Thứ Tự",
|
||||
outdent: "Lùi Ra Ngoài",
|
||||
indent: "Thụt Vào Trong",
|
||||
forecolor: "Màu Chữ",
|
||||
backcolor: "Màu Nền",
|
||||
horizontalrule: "Dòng Kẻ Ngang",
|
||||
createlink: "Tạo Liên Kết",
|
||||
insertimage: "Chèn Ảnh",
|
||||
inserttable: "Chèn Bảng",
|
||||
htmlmode: "Chế Độ Mã HTML",
|
||||
popupeditor: "Phóng To Ô Soạn Thảo",
|
||||
about: "Tự Giới Thiệu",
|
||||
showhelp: "Giúp Đỡ",
|
||||
textindicator: "Định Dạng Hiện Thời",
|
||||
undo: "Undo",
|
||||
redo: "Redo",
|
||||
cut: "Cắt",
|
||||
copy: "Copy",
|
||||
paste: "Dán"
|
||||
},
|
||||
buttons: {
|
||||
"ok": "OK",
|
||||
"cancel": "Hủy"
|
||||
},
|
||||
msg: {
|
||||
"Path": "Đường Dẫn",
|
||||
"TEXT_MODE": "Bạn đang ở chế độ text. Sử dụng nút [<>] để chuyển lại chế độ WYSIWIG."
|
||||
}
|
||||
};
|
||||
|
@ -63,26 +63,6 @@ ContextMenu.prototype.getContextMenu = function(target) {
|
||||
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) {
|
||||
var tag = target.tagName;
|
||||
if (!tag)
|
||||
@ -209,41 +189,32 @@ ContextMenu.prototype.getContextMenu = function(target) {
|
||||
i18n["Create a link"],
|
||||
config.btnList["createlink"][1] ]);
|
||||
|
||||
for (var i = 0; i < elmenus.length; ++i)
|
||||
for (var i in elmenus)
|
||||
menu.push(elmenus[i]);
|
||||
|
||||
if (!/html|body/i.test(currentTarget.tagName))
|
||||
menu.push(null,
|
||||
[ i18n["Remove the"] + " <" + currentTarget.tagName + "> " + i18n["Element"],
|
||||
function() {
|
||||
if (confirm(i18n["Please confirm that you want to remove this element:"] + " " +
|
||||
currentTarget.tagName)) {
|
||||
var el = currentTarget;
|
||||
var p = el.parentNode;
|
||||
p.removeChild(el);
|
||||
if (HTMLArea.is_gecko) {
|
||||
if (p.tagName.toLowerCase() == "td" && !p.hasChildNodes())
|
||||
p.appendChild(editor._doc.createElement("br"));
|
||||
editor.forceRedraw();
|
||||
editor.focusEditor();
|
||||
editor.updateToolbar();
|
||||
if (table) {
|
||||
var save_collapse = table.style.borderCollapse;
|
||||
table.style.borderCollapse = "collapse";
|
||||
table.style.borderCollapse = "separate";
|
||||
table.style.borderCollapse = save_collapse;
|
||||
}
|
||||
menu.push(null,
|
||||
[ i18n["Remove the"] + " <" + currentTarget.tagName + "> " + i18n["Element"],
|
||||
function() {
|
||||
if (confirm(i18n["Please confirm that you want to remove this element:"] + " " + currentTarget.tagName)) {
|
||||
var el = currentTarget;
|
||||
var p = el.parentNode;
|
||||
p.removeChild(el);
|
||||
if (HTMLArea.is_gecko) {
|
||||
if (p.tagName.toLowerCase() == "td" && !p.hasChildNodes())
|
||||
p.appendChild(editor._doc.createElement("br"));
|
||||
editor.forceRedraw();
|
||||
editor.focusEditor();
|
||||
editor.updateToolbar();
|
||||
if (table) {
|
||||
var save_collapse = table.style.borderCollapse;
|
||||
table.style.borderCollapse = "collapse";
|
||||
table.style.borderCollapse = "separate";
|
||||
table.style.borderCollapse = save_collapse;
|
||||
}
|
||||
}
|
||||
},
|
||||
i18n["Remove this node from the document"] ],
|
||||
[ 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"] ]
|
||||
);
|
||||
}
|
||||
},
|
||||
i18n["Remove this node from the document"] ]);
|
||||
return menu;
|
||||
};
|
||||
|
||||
@ -414,8 +385,12 @@ ContextMenu.prototype.popupMenu = function(ev) {
|
||||
}
|
||||
|
||||
if (!HTMLArea.is_ie) {
|
||||
var dx = x + div.offsetWidth - window.innerWidth + 4;
|
||||
var dy = y + div.offsetHeight - window.innerHeight + 4;
|
||||
// var dx = x + div.offsetWidth - window.innerWidth + 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 (dy > 0) y -= dy;
|
||||
div.style.left = x + "px";
|
||||
|
@ -40,8 +40,6 @@ ContextMenu.I18N = {
|
||||
"Make link" : "Make lin_k...",
|
||||
"Remove the" : "Remove the",
|
||||
"Element" : "Element...",
|
||||
"Insert paragraph before" : "Insert paragraph before",
|
||||
"Insert paragraph after" : "Insert paragraph after",
|
||||
|
||||
// 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 after the current one" : "Insert a new column after the current one",
|
||||
"Delete the current column" : "Delete the current column",
|
||||
"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"
|
||||
"Create a link" : "Create a link"
|
||||
};
|
||||
|
@ -24,6 +24,7 @@ $GLOBALS['phpgw_info']['flags'] = Array(
|
||||
);
|
||||
|
||||
include('../../../../../../header.inc.php');
|
||||
header('Content-type: text/javascript; charset='.$GLOBALS['phpgw']->translation->charset());
|
||||
$GLOBALS['phpgw']->translation->add_app('htmlarea-ContextMenu');
|
||||
|
||||
// I18N constants
|
||||
|
@ -7,7 +7,6 @@ div.htmlarea-context-menu {
|
||||
border: 1px solid #aca899;
|
||||
padding: 2px;
|
||||
background-color: #fff;
|
||||
color: #000;
|
||||
cursor: default;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
@ -6,20 +6,20 @@
|
||||
// This notice MUST stay intact for use (see license.txt).
|
||||
|
||||
function EnterParagraphs(editor, params) {
|
||||
this.editor = editor;
|
||||
// activate only if we're talking to Gecko
|
||||
if (HTMLArea.is_gecko)
|
||||
this.onKeyPress = this.__onKeyPress;
|
||||
this.editor = editor;
|
||||
// activate only if we're talking to Gecko
|
||||
if (HTMLArea.is_gecko)
|
||||
this.onKeyPress = this.__onKeyPress;
|
||||
};
|
||||
|
||||
EnterParagraphs._pluginInfo = {
|
||||
name : "EnterParagraphs",
|
||||
version : "1.0",
|
||||
developer : "Adam Wright",
|
||||
developer_url : "http://blog.hipikat.org/",
|
||||
sponsor : "The University of Western Australia",
|
||||
sponsor_url : "http://www.uwa.edu.au/",
|
||||
license : "htmlArea"
|
||||
name : "EnterParagraphs",
|
||||
version : "1.0",
|
||||
developer : "Adam Wright",
|
||||
developer_url : "http://blog.hipikat.org/",
|
||||
sponsor : "The University of Western Australia",
|
||||
sponsor_url : "http://www.uwa.edu.au/",
|
||||
license : "htmlArea"
|
||||
};
|
||||
|
||||
// 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
|
||||
EnterParagraphs.prototype.parentBlock = function(node) {
|
||||
while (node.parentNode && (node.nodeType != 1 || this._html4_inlines_re.test(node.tagName)))
|
||||
node = node.parentNode;
|
||||
return node;
|
||||
while (node.parentNode && (node.nodeType != 1 || this._html4_inlines_re.test(node.tagName)))
|
||||
node = node.parentNode;
|
||||
return node;
|
||||
};
|
||||
|
||||
// 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
|
||||
EnterParagraphs.prototype.walkNodeChildren = function(me, callback) {
|
||||
if (me.firstChild) {
|
||||
var myChild = me.firstChild;
|
||||
var retVal;
|
||||
while (myChild) {
|
||||
if ((retVal = callback(this, myChild)) != null)
|
||||
return retVal;
|
||||
if ((retVal = this.walkNodeChildren(myChild, callback)) != null)
|
||||
return retVal;
|
||||
myChild = myChild.nextSibling;
|
||||
}
|
||||
}
|
||||
if (me.firstChild) {
|
||||
var myChild = me.firstChild;
|
||||
var retVal;
|
||||
while (myChild) {
|
||||
if ((retVal = callback(this, myChild)) != null)
|
||||
return retVal;
|
||||
if ((retVal = this.walkNodeChildren(myChild, callback)) != null)
|
||||
return retVal;
|
||||
myChild = myChild.nextSibling;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 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
|
||||
EnterParagraphs.prototype._isFilling = function(self, node) {
|
||||
if (node.nodeType == 1 && !self._html4_inlines_re.test(node.nodeName))
|
||||
return true;
|
||||
else if (node.nodeType == 3 && node.nodeValue != '')
|
||||
return true;
|
||||
return null;
|
||||
//alert(node.nodeName);
|
||||
if (node.nodeType == 1 && !self._html4_inlines_re.test(node.nodeName))
|
||||
return true;
|
||||
else if (node.nodeType == 3 && node.nodeValue != '')
|
||||
return true;
|
||||
return null;
|
||||
//alert(node.nodeName);
|
||||
};
|
||||
|
||||
// Inserts a node deeply on the left of a hierarchy of nodes
|
||||
EnterParagraphs.prototype.insertDeepLeftText = function(target, toInsert) {
|
||||
var falling = target;
|
||||
while (falling.firstChild && falling.firstChild.nodeType == 1)
|
||||
falling = falling.firstChild;
|
||||
//var refNode = falling.firstChild ? falling.firstChild : null;
|
||||
//falling.insertBefore(toInsert, refNode);
|
||||
falling.innerHTML = toInsert;
|
||||
var falling = target;
|
||||
while (falling.firstChild && falling.firstChild.nodeType == 1)
|
||||
falling = falling.firstChild;
|
||||
//var refNode = falling.firstChild ? falling.firstChild : null;
|
||||
//falling.insertBefore(toInsert, refNode);
|
||||
falling.innerHTML = toInsert;
|
||||
};
|
||||
|
||||
// Kind of like a macros, for a frequent query...
|
||||
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
|
||||
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
|
||||
var sel = editor._iframe.contentWindow.getSelection();
|
||||
// Get the selection and solid references to what we're dealing with chopping
|
||||
var sel = editor._iframe.contentWindow.getSelection();
|
||||
|
||||
// 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();
|
||||
rngLeft.setStart(sel.anchorNode, sel.anchorOffset); rngRight.setStart(sel.focusNode, sel.focusOffset);
|
||||
rngLeft.collapse(true); rngRight.collapse(true);
|
||||
// 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();
|
||||
rngLeft.setStart(sel.anchorNode, sel.anchorOffset); rngRight.setStart(sel.focusNode, sel.focusOffset);
|
||||
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 startOffset = direct ? sel.anchorOffset : sel.focusOffset;
|
||||
var endNode = direct ? sel.focusNode : sel.anchorNode;
|
||||
var endOffset = direct ? sel.focusOffset : sel.anchorOffset;
|
||||
var startNode = direct ? sel.anchorNode : sel.focusNode;
|
||||
var startOffset = direct ? sel.anchorOffset : sel.focusOffset;
|
||||
var endNode = direct ? sel.focusNode : sel.anchorNode;
|
||||
var endOffset = direct ? sel.focusOffset : sel.anchorOffset;
|
||||
|
||||
// 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 attrsLeft = new Array(); var attrsRight = new Array();
|
||||
// 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 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 (this.isElem(startBlock, 'li') || this.isElem(endBlock, 'li'))
|
||||
return;
|
||||
// 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'))
|
||||
return;
|
||||
|
||||
if (this.isElem(startBlock, 'p')) {
|
||||
for (var i = 0; i < startBlock.attributes.length; i++) {
|
||||
attrsLeft[startBlock.attributes[i].nodeName] = startBlock.attributes[i].nodeValue;
|
||||
}
|
||||
}
|
||||
if (this.isElem(endBlock, 'p')) {
|
||||
for (var i = 0; i < endBlock.attributes.length; i++) {
|
||||
// If we start and end within one paragraph, don't duplicate the 'id'
|
||||
if (endBlock != startBlock || endBlock.attributes[i].nodeName.toLowerCase() != 'id')
|
||||
attrsRight[endBlock.attributes[i].nodeName] = endBlock.attributes[i].nodeValue;
|
||||
}
|
||||
}
|
||||
if (this.isElem(startBlock, 'p')) {
|
||||
for (var i = 0; i < startBlock.attributes.length; i++) {
|
||||
attrsLeft[startBlock.attributes[i].nodeName] = startBlock.attributes[i].nodeValue;
|
||||
}
|
||||
}
|
||||
if (this.isElem(endBlock, 'p')) {
|
||||
for (var i = 0; i < endBlock.attributes.length; i++) {
|
||||
// If we start and end within one paragraph, don't duplicate the 'id'
|
||||
if (endBlock != startBlock || endBlock.attributes[i].nodeName.toLowerCase() != 'id')
|
||||
attrsRight[endBlock.attributes[i].nodeName] = endBlock.attributes[i].nodeValue;
|
||||
}
|
||||
}
|
||||
|
||||
// Look for where to start and end our chopping - within surrounding paragraphs
|
||||
// if they exist, or at the edges of the containing block, otherwise
|
||||
var startChop = startNode; var endChop = endNode;
|
||||
// Look for where to start and end our chopping - within surrounding paragraphs
|
||||
// if they exist, or at the edges of the containing block, otherwise
|
||||
var startChop = startNode; var endChop = endNode;
|
||||
|
||||
while ((startChop.previousSibling && !this.isElem(startChop.previousSibling, 'p'))
|
||||
|| (startChop.parentNode && startChop.parentNode != startBlock && startChop.parentNode.nodeType != 9))
|
||||
startChop = startChop.previousSibling ? startChop.previousSibling : startChop.parentNode;
|
||||
while ((startChop.previousSibling && !this.isElem(startChop.previousSibling, 'p'))
|
||||
|| (startChop.parentNode && startChop.parentNode != startBlock && startChop.parentNode.nodeType != 9))
|
||||
startChop = startChop.previousSibling ? startChop.previousSibling : startChop.parentNode;
|
||||
|
||||
while ((endChop.nextSibling && !this.isElem(endChop.nextSibling, 'p'))
|
||||
|| (endChop.parentNode && endChop.parentNode != endBlock && endChop.parentNode.nodeType != 9))
|
||||
endChop = endChop.nextSibling ? endChop.nextSibling : endChop.parentNode;
|
||||
while ((endChop.nextSibling && !this.isElem(endChop.nextSibling, 'p'))
|
||||
|| (endChop.parentNode && endChop.parentNode != endBlock && endChop.parentNode.nodeType != 9))
|
||||
endChop = endChop.nextSibling ? endChop.nextSibling : endChop.parentNode;
|
||||
|
||||
// Set up new paragraphs
|
||||
var pLeft = editor._doc.createElement('p'); var pRight = editor._doc.createElement('p');
|
||||
// Set up new paragraphs
|
||||
var pLeft = editor._doc.createElement('p'); var pRight = editor._doc.createElement('p');
|
||||
|
||||
for (var attrName in attrsLeft) {
|
||||
var thisAttr = editor._doc.createAttribute(attrName);
|
||||
thisAttr.value = attrsLeft[attrName];
|
||||
pLeft.setAttributeNode(thisAttr);
|
||||
}
|
||||
for (var attrName in attrsRight) {
|
||||
var thisAttr = editor._doc.createAttribute(attrName);
|
||||
thisAttr.value = attrsRight[attrName];
|
||||
pRight.setAttributeNode(thisAttr);
|
||||
}
|
||||
for (var attrName in attrsLeft) {
|
||||
var thisAttr = editor._doc.createAttribute(attrName);
|
||||
thisAttr.value = attrsLeft[attrName];
|
||||
pLeft.setAttributeNode(thisAttr);
|
||||
}
|
||||
for (var attrName in attrsRight) {
|
||||
var thisAttr = editor._doc.createAttribute(attrName);
|
||||
thisAttr.value = attrsRight[attrName];
|
||||
pRight.setAttributeNode(thisAttr);
|
||||
}
|
||||
|
||||
// Get the ranges destined to be stuffed into new paragraphs
|
||||
rngLeft.setStartBefore(startChop);
|
||||
rngLeft.setEnd(startNode,startOffset);
|
||||
pLeft.appendChild(rngLeft.cloneContents()); // Copy into pLeft
|
||||
// Get the ranges destined to be stuffed into new paragraphs
|
||||
rngLeft.setStartBefore(startChop);
|
||||
rngLeft.setEnd(startNode,startOffset);
|
||||
pLeft.appendChild(rngLeft.cloneContents()); // Copy into pLeft
|
||||
|
||||
rngRight.setEndAfter(endChop);
|
||||
rngRight.setStart(endNode,endOffset);
|
||||
pRight.appendChild(rngRight.cloneContents()); // Copy into pRight
|
||||
rngRight.setEndAfter(endChop);
|
||||
rngRight.setStart(endNode,endOffset);
|
||||
pRight.appendChild(rngRight.cloneContents()); // Copy into pRight
|
||||
|
||||
// If either paragraph is empty, fill it with a nonbreakable space
|
||||
var foundBlock = false;
|
||||
foundBlock = this.walkNodeChildren(pLeft, this._isFilling);
|
||||
if (foundBlock != true)
|
||||
this.insertDeepLeftText(pLeft, ' ');
|
||||
// If either paragraph is empty, fill it with a nonbreakable space
|
||||
var foundBlock = false;
|
||||
foundBlock = this.walkNodeChildren(pLeft, this._isFilling);
|
||||
if (foundBlock != true)
|
||||
this.insertDeepLeftText(pLeft, ' ');
|
||||
|
||||
foundBlock = false;
|
||||
foundBlock = this.walkNodeChildren(pRight, this._isFilling);
|
||||
if (foundBlock != true)
|
||||
this.insertDeepLeftText(pRight, ' ');
|
||||
foundBlock = false;
|
||||
foundBlock = this.walkNodeChildren(pRight, this._isFilling);
|
||||
if (foundBlock != true)
|
||||
this.insertDeepLeftText(pRight, ' ');
|
||||
|
||||
// Get a range for everything to be replaced and replace it
|
||||
var rngAround = editor._doc.createRange();
|
||||
// Get a range for everything to be replaced and replace it
|
||||
var rngAround = editor._doc.createRange();
|
||||
|
||||
if (!startChop.previousSibling && this.isElem(startChop.parentNode, 'p'))
|
||||
rngAround.setStartBefore(startChop.parentNode);
|
||||
else
|
||||
rngAround.setStart(rngLeft.startContainer, rngLeft.startOffset);
|
||||
if (!startChop.previousSibling && this.isElem(startChop.parentNode, 'p'))
|
||||
rngAround.setStartBefore(startChop.parentNode);
|
||||
else
|
||||
rngAround.setStart(rngLeft.startContainer, rngLeft.startOffset);
|
||||
|
||||
if (!endChop.nextSibling && this.isElem(endChop.parentNode, 'p'))
|
||||
rngAround.setEndAfter(endChop.parentNode);
|
||||
else
|
||||
rngAround.setEnd(rngRight.endContainer, rngRight.endOffset);
|
||||
if (!endChop.nextSibling && this.isElem(endChop.parentNode, 'p'))
|
||||
rngAround.setEndAfter(endChop.parentNode);
|
||||
else
|
||||
rngAround.setEnd(rngRight.endContainer, rngRight.endOffset);
|
||||
|
||||
rngAround.deleteContents();
|
||||
rngAround.insertNode(pRight);
|
||||
rngAround.insertNode(pLeft);
|
||||
rngAround.deleteContents();
|
||||
rngAround.insertNode(pRight);
|
||||
rngAround.insertNode(pLeft);
|
||||
|
||||
// Set the selection to the start of the (second) new paragraph
|
||||
if (pRight.firstChild) {
|
||||
while (pRight.firstChild && this._html4_inlines_re.test(pRight.firstChild.nodeName))
|
||||
pRight = pRight.firstChild;
|
||||
// Slip into any inline tags
|
||||
if (pRight.firstChild && pRight.firstChild.nodeType == 3)
|
||||
pRight = pRight.firstChild; // and text, if they've got it
|
||||
// Set the selection to the start of the (second) new paragraph
|
||||
if (pRight.firstChild) {
|
||||
while (pRight.firstChild && this._html4_inlines_re.test(pRight.firstChild.nodeName))
|
||||
pRight = pRight.firstChild;
|
||||
// Slip into any inline tags
|
||||
if (pRight.firstChild && pRight.firstChild.nodeType == 3)
|
||||
pRight = pRight.firstChild; // and text, if they've got it
|
||||
|
||||
var rngCaret = editor._doc.createRange();
|
||||
rngCaret.setStart(pRight, 0);
|
||||
rngCaret.collapse(true);
|
||||
var rngCaret = editor._doc.createRange();
|
||||
rngCaret.setStart(pRight, 0);
|
||||
rngCaret.collapse(true);
|
||||
|
||||
sel = editor._iframe.contentWindow.getSelection();
|
||||
sel.removeAllRanges();
|
||||
sel.addRange(rngCaret);
|
||||
}
|
||||
sel = editor._iframe.contentWindow.getSelection();
|
||||
sel.removeAllRanges();
|
||||
sel.addRange(rngCaret);
|
||||
}
|
||||
|
||||
// Stop the bubbling
|
||||
HTMLArea._stopEvent(ev);
|
||||
}
|
||||
// Stop the bubbling
|
||||
HTMLArea._stopEvent(ev);
|
||||
}
|
||||
};
|
||||
|
@ -49,7 +49,6 @@ FullPage.prototype.buttonPress = function(editor, id) {
|
||||
var links = doc.getElementsByTagName("link");
|
||||
var style1 = '';
|
||||
var style2 = '';
|
||||
var charset = '';
|
||||
for (var i = links.length; --i >= 0;) {
|
||||
var link = links[i];
|
||||
if (/stylesheet/i.test(link.rel)) {
|
||||
@ -59,14 +58,6 @@ FullPage.prototype.buttonPress = function(editor, id) {
|
||||
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];
|
||||
title = title ? title.innerHTML : '';
|
||||
var init = {
|
||||
@ -76,7 +67,7 @@ FullPage.prototype.buttonPress = function(editor, id) {
|
||||
f_body_fgcolor : HTMLArea._colorToRgb(doc.body.style.color),
|
||||
f_base_style : style1,
|
||||
f_alt_style : style2,
|
||||
f_charset : charset,
|
||||
|
||||
editor : editor
|
||||
};
|
||||
editor._popupDialog("plugin://FullPage/docprop", function(params) {
|
||||
@ -91,11 +82,8 @@ FullPage.prototype.setDocProp = function(params) {
|
||||
var doc = this.editor._doc;
|
||||
var head = doc.getElementsByTagName("head")[0];
|
||||
var links = doc.getElementsByTagName("link");
|
||||
var metas = doc.getElementsByTagName("meta");
|
||||
var style1 = null;
|
||||
var style2 = null;
|
||||
var charset = null;
|
||||
var charset_meta = null;
|
||||
for (var i = links.length; --i >= 0;) {
|
||||
var link = links[i];
|
||||
if (/stylesheet/i.test(link.rel)) {
|
||||
@ -105,27 +93,12 @@ FullPage.prototype.setDocProp = function(params) {
|
||||
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) {
|
||||
var link = doc.createElement("link");
|
||||
link.rel = alt ? "alternate stylesheet" : "stylesheet";
|
||||
head.appendChild(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)
|
||||
style1 = createLink(false);
|
||||
@ -141,14 +114,7 @@ FullPage.prototype.setDocProp = function(params) {
|
||||
else if (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];
|
||||
switch (i) {
|
||||
case "f_title":
|
||||
|
@ -24,6 +24,7 @@ $GLOBALS['phpgw_info']['flags'] = Array(
|
||||
);
|
||||
|
||||
include('../../../../../../header.inc.php');
|
||||
header('Content-type: text/javascript; charset='.$GLOBALS['phpgw']->translation->charset());
|
||||
$GLOBALS['phpgw']->translation->add_app('htmlarea-FullPage');
|
||||
|
||||
// I18N for the FullPage plugin
|
||||
|
@ -16,8 +16,7 @@ window.resizeTo(400, 100);
|
||||
f_body_bgcolor : true,
|
||||
f_body_fgcolor : true,
|
||||
f_base_style : true,
|
||||
f_alt_style : true,
|
||||
f_charset : true
|
||||
f_alt_style : true
|
||||
};
|
||||
|
||||
var editor = null;
|
||||
@ -121,17 +120,6 @@ border-bottom: 1px solid black; letter-spacing: 2px;
|
||||
<td class="label"><span>Text color:</span></td>
|
||||
<td><input type="text" id="f_body_fgcolor" size="7" /></td>
|
||||
</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>
|
||||
|
||||
<div id="buttons">
|
||||
|
@ -16,7 +16,7 @@ function HtmlTidy(editor) {
|
||||
|
||||
// register the toolbar buttons provided by this plugin
|
||||
var toolbar = [];
|
||||
for (var i = 0; i < bl.length; ++i) {
|
||||
for (var i in bl) {
|
||||
var btn = bl[i];
|
||||
if (btn == "html-tidy") {
|
||||
var id = "HT-html-tidy";
|
||||
|
@ -24,6 +24,7 @@ $GLOBALS['phpgw_info']['flags'] = Array(
|
||||
);
|
||||
|
||||
include('../../../../../../header.inc.php');
|
||||
header('Content-type: text/javascript; charset='.$GLOBALS['phpgw']->translation->charset());
|
||||
$GLOBALS['phpgw']->translation->add_app('htmlarea-HtmlTidy');
|
||||
|
||||
// I18N constants
|
||||
|
@ -24,6 +24,7 @@ $GLOBALS['phpgw_info']['flags'] = Array(
|
||||
);
|
||||
|
||||
include('../../../../../../header.inc.php');
|
||||
header('Content-type: text/javascript; charset='.$GLOBALS['phpgw']->translation->charset());
|
||||
$GLOBALS['phpgw']->translation->add_app('htmlarea-ListType');
|
||||
|
||||
// I18N constants
|
||||
|
@ -1 +1 @@
|
||||
Options +ExecCGI
|
||||
Options +ExecCGI
|
||||
|
@ -24,6 +24,7 @@ $GLOBALS['phpgw_info']['flags'] = Array(
|
||||
);
|
||||
|
||||
include('../../../../../../header.inc.php');
|
||||
header('Content-type: text/javascript; charset='.$GLOBALS['phpgw']->translation->charset());
|
||||
$GLOBALS['phpgw']->translation->add_app('htmlarea-SpellChecker');
|
||||
|
||||
// I18N constants
|
||||
|
@ -126,7 +126,7 @@ function replaceAllClicked() {
|
||||
}
|
||||
*/
|
||||
if (ok) {
|
||||
for (var i = 0; i < spans.length; ++i) {
|
||||
for (var i in spans) {
|
||||
if (spans[i] != currentElement) {
|
||||
replaceWord(spans[i]);
|
||||
}
|
||||
@ -156,7 +156,7 @@ function learnClicked() {
|
||||
|
||||
function internationalizeWindow() {
|
||||
var types = ["div", "span", "button"];
|
||||
for (var i = 0; i < types.length; ++i) {
|
||||
for (var i in types) {
|
||||
var tag = types[i];
|
||||
var els = document.getElementsByTagName(tag);
|
||||
for (var j = els.length; --j >= 0;) {
|
||||
@ -237,7 +237,7 @@ function wordClicked(scroll) {
|
||||
if (currentElement) {
|
||||
var a = allWords[currentElement.__msh_origWord];
|
||||
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];
|
||||
if (el != currentElement) {
|
||||
el.className = el.className.replace(/\s*HA-spellcheck-same\s*/g, " ");
|
||||
@ -247,7 +247,7 @@ function wordClicked(scroll) {
|
||||
currentElement = this;
|
||||
this.className += " HA-spellcheck-current";
|
||||
var a = allWords[currentElement.__msh_origWord];
|
||||
for (var i = 0; i < a.length; ++i) {
|
||||
for (var i in a) {
|
||||
var el = a[i];
|
||||
if (el != currentElement) {
|
||||
el.className += " HA-spellcheck-same";
|
||||
|
@ -18,7 +18,7 @@ function SpellChecker(editor) {
|
||||
|
||||
// register the toolbar buttons provided by this plugin
|
||||
var toolbar = [];
|
||||
for (var i = 0; i < bl.length; ++i) {
|
||||
for (var i in bl) {
|
||||
var btn = bl[i];
|
||||
if (!btn) {
|
||||
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]);
|
||||
}
|
||||
};
|
||||
|
@ -24,6 +24,7 @@ $GLOBALS['phpgw_info']['flags'] = Array(
|
||||
);
|
||||
|
||||
include('../../../../../../header.inc.php');
|
||||
header('Content-type: text/javascript; charset='.$GLOBALS['phpgw']->translation->charset());
|
||||
$GLOBALS['phpgw']->translation->add_app('htmlarea-TableOperations');
|
||||
|
||||
// I18N constants
|
||||
|
@ -1,7 +1,7 @@
|
||||
// I18N constants
|
||||
|
||||
// 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
|
||||
|
||||
// FOR TRANSLATORS:
|
||||
|
@ -24,7 +24,7 @@ function TableOperations(editor) {
|
||||
|
||||
// register the toolbar buttons provided by this plugin
|
||||
var toolbar = ["linebreak"];
|
||||
for (var i = 0; i < bl.length; ++i) {
|
||||
for (var i in bl) {
|
||||
var btn = bl[i];
|
||||
if (!btn) {
|
||||
toolbar.push("separator");
|
||||
@ -65,7 +65,7 @@ TableOperations.prototype.getClosest = function(tagName) {
|
||||
var ancestors = editor.getAllAncestors();
|
||||
var ret = null;
|
||||
tagName = ("" + tagName).toLowerCase();
|
||||
for (var i = 0; i < ancestors.length; ++i) {
|
||||
for (var i in ancestors) {
|
||||
var el = ancestors[i];
|
||||
if (el.tagName.toLowerCase() == tagName) {
|
||||
ret = el;
|
||||
@ -502,17 +502,11 @@ TableOperations.prototype.buttonPress = function(editor, button_id) {
|
||||
var rows = td.parentNode.parentNode.rows;
|
||||
var index = td.cellIndex;
|
||||
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 ref = tr.cells[index + (/after/.test(button_id) ? 1 : 0)];
|
||||
var otd = editor._doc.createElement("td");
|
||||
otd.innerHTML = mozbr;
|
||||
tr.insertBefore(otd, ref);
|
||||
|
||||
}
|
||||
editor.focusEditor();
|
||||
break;
|
||||
@ -874,7 +868,7 @@ TableOperations.createStyleLayoutFieldset = function(doc, editor, el) {
|
||||
td.appendChild(select);
|
||||
select.name = "f_st_float";
|
||||
options = ["None", "Left", "Right"];
|
||||
for (var i = 0; i < options.length; ++i) {
|
||||
for (i in options) {
|
||||
var Val = options[i];
|
||||
var val = options[i].toLowerCase();
|
||||
option = doc.createElement("option");
|
||||
@ -929,7 +923,7 @@ TableOperations.createStyleLayoutFieldset = function(doc, editor, el) {
|
||||
input.size = "1";
|
||||
input.style.fontFamily = "monospace";
|
||||
td.appendChild(input);
|
||||
for (var i = 0; i < options.length; ++i) {
|
||||
for (i in options) {
|
||||
var Val = options[i];
|
||||
var val = Val.toLowerCase();
|
||||
option = doc.createElement("option");
|
||||
@ -984,7 +978,7 @@ TableOperations.createStyleLayoutFieldset = function(doc, editor, el) {
|
||||
select.style.marginLeft = "0.5em";
|
||||
td.appendChild(select);
|
||||
options = ["Top", "Middle", "Bottom", "Baseline"];
|
||||
for (var i = 0; i < options.length; ++i) {
|
||||
for (i in options) {
|
||||
var Val = options[i];
|
||||
var val = Val.toLowerCase();
|
||||
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
|
||||
// value.
|
||||
(currentBorderStyle.match(/([^\s]*)\s/)) && (currentBorderStyle = RegExp.$1);
|
||||
for (var i in options) {
|
||||
for (i in options) {
|
||||
var val = options[i];
|
||||
option = doc.createElement("option");
|
||||
option.value = val;
|
||||
@ -1086,7 +1080,7 @@ TableOperations.createStyleFieldset = function(doc, editor, el) {
|
||||
}
|
||||
select.style.marginRight = "0.5em";
|
||||
function setBorderFieldsStatus(value) {
|
||||
for (var i = 0; i < borderFields.length; ++i) {
|
||||
for (i in borderFields) {
|
||||
var el = borderFields[i];
|
||||
el.style.visibility = value ? "hidden" : "visible";
|
||||
if (!value && (el.tagName.toLowerCase() == "input")) {
|
||||
|
@ -24,6 +24,7 @@ $GLOBALS['phpgw_info']['flags'] = Array(
|
||||
);
|
||||
|
||||
include('../../../../../../header.inc.php');
|
||||
header('Content-type: text/javascript; charset='.$GLOBALS['phpgw']->translation->charset());
|
||||
$GLOBALS['phpgw']->translation->add_app('htmlarea-SpellChecker');
|
||||
|
||||
// I18N for the FullPage plugin
|
||||
|
@ -1,87 +1,111 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* eGroupWare - UploadImage-plugin for htmlArea *
|
||||
* http://www.eGroupWare.org *
|
||||
* Written and (c) by Xiang Wei ZHUO <wei@zhuo.org> *
|
||||
* 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 *
|
||||
* under the terms of the GNU General Public License as published by the *
|
||||
* Free Software Foundation; version 2 of the License. *
|
||||
\**************************************************************************/
|
||||
|
||||
/* $id$ */
|
||||
|
||||
// FIXME: remove imageMagick shit, we only use gdlib
|
||||
// FIXME: autodetect safe_mode
|
||||
// FIXME set current app to the calling app
|
||||
// FIXME include header nicer
|
||||
|
||||
$phpgw_flags = Array(
|
||||
'currentapp' => 'jinn',
|
||||
'noheader' => True,
|
||||
'nonavbar' => True,
|
||||
'noappheader' => True,
|
||||
'noappfooter' => True,
|
||||
'nofooter' => True
|
||||
);
|
||||
|
||||
$GLOBALS['phpgw_info']['flags'] = $phpgw_flags;
|
||||
|
||||
if(@include('../../../../../../header.inc.php'))
|
||||
{
|
||||
// I know this is very ugly
|
||||
}
|
||||
else
|
||||
{
|
||||
@include('../../../../../../../header.inc.php');
|
||||
}
|
||||
|
||||
define('IMAGE_CLASS', 'GD');
|
||||
|
||||
//In safe mode, directory creation is not permitted.
|
||||
$SAFE_MODE = false;
|
||||
|
||||
$sessdata = $GLOBALS['phpgw']->session->appsession('UploadImage','phpgwapi');
|
||||
|
||||
$BASE_DIR = $sessdata[UploadImageBaseDir];
|
||||
$BASE_URL = $sessdata[UploadImageBaseURL];
|
||||
$MAX_HEIGHT = $sessdata[UploadImageMaxHeight];
|
||||
$MAX_WIDTH = $sessdata[UploadImageMaxWidth];
|
||||
|
||||
if(!$MAX_HEIGHT) $MAX_HEIGHT = 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
|
||||
//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).
|
||||
//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);
|
||||
}
|
||||
/**************************************************************************\
|
||||
* eGroupWare - UploadImage-plugin for htmlArea *
|
||||
* http://www.eGroupWare.org *
|
||||
* Written and (c) by Xiang Wei ZHUO <wei@zhuo.org> *
|
||||
* 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 *
|
||||
* under the terms of the GNU General Public License as published by the *
|
||||
* Free Software Foundation; version 2 of the License. *
|
||||
\**************************************************************************/
|
||||
|
||||
/* $id$ */
|
||||
|
||||
// FIXME: remove imageMagick shit, we only use gdlib
|
||||
// FIXME: autodetect safe_mode
|
||||
// FIXME include header nicer
|
||||
|
||||
$phpgw_flags = Array(
|
||||
'currentapp' => 'home',
|
||||
'noheader' => True,
|
||||
'nonavbar' => True,
|
||||
'noappheader' => True,
|
||||
'noappfooter' => True,
|
||||
'nofooter' => True
|
||||
);
|
||||
|
||||
$GLOBALS['phpgw_info']['flags'] = $phpgw_flags;
|
||||
|
||||
if(@include('../../../../../../header.inc.php'))
|
||||
{
|
||||
// I know this is very ugly
|
||||
}
|
||||
else
|
||||
{
|
||||
@include('../../../../../../../header.inc.php');
|
||||
}
|
||||
|
||||
$sessdata = $GLOBALS['phpgw']->session->appsession('UploadImage','phpgwapi');
|
||||
$phpgw_flags['currentapp'] = $sessdata['app'] ? $sessdata['app'] : 'jinn';
|
||||
|
||||
define('IMAGE_CLASS', 'GD');
|
||||
|
||||
//In safe mode, directory creation is not permitted.
|
||||
$SAFE_MODE = false;
|
||||
|
||||
switch ($phpgw_flags['currentapp'])
|
||||
{
|
||||
case 'jinn' :
|
||||
$BASE_DIR = $sessdata[UploadImageBaseDir];
|
||||
$BASE_URL = $sessdata[UploadImageBaseURL];
|
||||
$MAX_HEIGHT = $sessdata[UploadImageMaxHeight];
|
||||
$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_WIDTH) $MAX_WIDTH = 10000;
|
||||
|
||||
|
||||
//After defining which library to use, if it is NetPBM or IM, you need to
|
||||
//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).
|
||||
//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);
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -191,7 +191,7 @@ PopupDiv.prototype.getForm = function() {
|
||||
PopupDiv.prototype.callHandler = function() {
|
||||
var tags = ["input", "textarea", "select"];
|
||||
var params = new Object();
|
||||
for (var ti = tags.length; --ti >= 0;) {
|
||||
for (var ti in tags) {
|
||||
var tag = tags[ti];
|
||||
var els = this.content.getElementsByTagName(tag);
|
||||
for (var j = 0; j < els.length; ++j) {
|
||||
|
@ -3,9 +3,8 @@
|
||||
<head>
|
||||
<title>Fullscreen HTMLArea</title>
|
||||
<script type="text/javascript">
|
||||
_editor_url = window.opener._editor_url || '../';
|
||||
_editor_url = window.opener._editor_url;
|
||||
_editor_lang = window.opener._editor_lang;
|
||||
_editor_css = window.opener._editor_css;
|
||||
var BASE = window.opener.document.baseURI || window.opener.document.URL;
|
||||
var head = document.getElementsByTagName("head")[0];
|
||||
var base = document.createElement("base");
|
||||
@ -13,15 +12,13 @@
|
||||
head.appendChild(base);
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
document.write('<scr' + 'ipt type="text/javascript" src="' + _editor_url + 'htmlarea.js"></scr' + 'ipt>');
|
||||
</script>
|
||||
<script type="text/javascript" src="../htmlarea.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
// load HTMLArea scripts that are present in the opener frame
|
||||
var scripts = window.opener.HTMLArea._scripts;
|
||||
for (var i = 3; i < scripts.length; ++i) {
|
||||
//document.write("<scr" + "ipt type='text/javascript' src='" + scripts[i] + "'></scr" + "ipt>");
|
||||
HTMLArea.loadScript(scripts[i]);
|
||||
for (var i = 4; i < scripts.length; ++i) {
|
||||
document.write("<scr" + "ipt type='text/javascript' src='" + scripts[i] + "'></scr" + "ipt>");
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -36,7 +33,7 @@ var editor = null; // to be initialized later [ function init() ]
|
||||
\* ---------------------------------------------------------------------- */
|
||||
|
||||
function _CloseOnEsc(ev) {
|
||||
ev || (ev = window.event) || (ev = editor._iframe.contentWindow.event);
|
||||
ev || (ev = window.event);
|
||||
if (ev.keyCode == 27) {
|
||||
// update_parent();
|
||||
window.close();
|
||||
@ -62,7 +59,7 @@ function resize_editor() { // resize editor to fix window
|
||||
if (editor.config.statusBar) {
|
||||
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
|
||||
for (var i in parent_object.plugins) {
|
||||
var plugin = parent_object.plugins[i];
|
||||
try {
|
||||
eval(plugin.name);
|
||||
editor.registerPlugin2(plugin.name, plugin.args);
|
||||
} catch(e) {};
|
||||
editor.registerPlugin2(plugin.name, plugin.args);
|
||||
}
|
||||
// and restore the original toolbar
|
||||
config.toolbar = parent_object.config.toolbar;
|
||||
@ -131,7 +125,7 @@ function update_parent() {
|
||||
</script>
|
||||
<style type="text/css"> html, body { height: 100%; margin: 0px; border: 0px; background-color: buttonface; } </style>
|
||||
</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;">
|
||||
<textarea name="editor" id="editor" style="width:100%; height:300px"> </textarea>
|
||||
</form>
|
||||
|
@ -10,8 +10,6 @@
|
||||
window.resizeTo(400, 100);
|
||||
|
||||
function Init() {
|
||||
i18n = window.opener.HTMLArea.I18N.dialogs; // load the HTMLArea plugin and lang file
|
||||
__dlg_translate(i18n);
|
||||
__dlg_init();
|
||||
document.getElementById("f_rows").focus();
|
||||
};
|
||||
@ -29,13 +27,13 @@ function onOK() {
|
||||
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"];
|
||||
var param = new Object();
|
||||
for (var i in fields) {
|
||||
var id = fields[i];
|
||||
var el = document.getElementById(id);
|
||||
param[id] = (el.type == "checkbox") ? el.checked : el.value;
|
||||
param[id] = el.value;
|
||||
}
|
||||
__dlg_close(param);
|
||||
return false;
|
||||
@ -90,6 +88,13 @@ form { padding: 0px; margin: 0px; }
|
||||
<tr>
|
||||
<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></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><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">
|
||||
@ -98,13 +103,7 @@ form { padding: 0px; margin: 0px; }
|
||||
<option value="em" >Em</option>
|
||||
</select></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="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>
|
||||
</table>
|
||||
|
||||
@ -117,7 +116,7 @@ form { padding: 0px; margin: 0px; }
|
||||
|
||||
<div class="fl">Alignment:</div>
|
||||
<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="left" >Left</option>
|
||||
<option value="right" >Right</option>
|
||||
|
@ -26,12 +26,7 @@ function Init() {
|
||||
__dlg_init();
|
||||
var param = window.dialogArguments;
|
||||
var target_select = document.getElementById("f_target");
|
||||
var use_target = true;
|
||||
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_title").value = param["f_title"];
|
||||
comboSelectValue(target_select, param["f_target"]);
|
||||
@ -42,12 +37,6 @@ function Init() {
|
||||
target_select.appendChild(opt);
|
||||
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");
|
||||
opt.value = "_other";
|
||||
@ -123,7 +112,7 @@ border-bottom: 1px solid black; letter-spacing: 2px;
|
||||
|
||||
<body onload="Init()">
|
||||
<div class="title">Insert/Modify Link</div>
|
||||
<form>
|
||||
|
||||
<table border="0" style="width: 100%;">
|
||||
<tr>
|
||||
<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>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><span id="f_target_label">Target:</span></td>
|
||||
<td class="label">Target:</td>
|
||||
<td><select id="f_target">
|
||||
<option value="">None (use implicit)</option>
|
||||
<option value="_blank">New window (_blank)</option>
|
||||
@ -147,9 +136,9 @@ border-bottom: 1px solid black; letter-spacing: 2px;
|
||||
</table>
|
||||
|
||||
<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>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -53,12 +53,12 @@ function __dlg_init(bottom) {
|
||||
// only if we call it twice we get the
|
||||
// correct size.
|
||||
window.addEventListener("unload", __dlg_onclose, true);
|
||||
window.innerWidth = body.offsetWidth + 5;
|
||||
window.innerHeight = body_height + 2;
|
||||
// center on parent
|
||||
var x = opener.screenX + (opener.outerWidth - window.outerWidth) / 2;
|
||||
var y = opener.screenY + (opener.outerHeight - window.outerHeight) / 2;
|
||||
window.moveTo(x, y);
|
||||
window.innerWidth = body.offsetWidth + 5;
|
||||
window.innerHeight = body_height + 2;
|
||||
} else {
|
||||
// window.dialogHeight = body.offsetHeight + 50 + "px";
|
||||
// window.dialogWidth = body.offsetWidth + "px";
|
||||
@ -76,8 +76,8 @@ function __dlg_init(bottom) {
|
||||
};
|
||||
|
||||
function __dlg_translate(i18n) {
|
||||
var types = ["input", "select", "legend", "span", "option", "td", "button", "div"];
|
||||
for (var type = 0; type < types.length; ++type) {
|
||||
var types = ["span", "option", "td", "button", "div"];
|
||||
for (var type in types) {
|
||||
var spans = document.getElementsByTagName(types[type]);
|
||||
for (var i = spans.length; --i >= 0;) {
|
||||
var span = spans[i];
|
||||
@ -86,11 +86,6 @@ function __dlg_translate(i18n) {
|
||||
if (txt)
|
||||
span.firstChild.data = txt;
|
||||
}
|
||||
if (span.title) {
|
||||
var txt = i18n[span.title];
|
||||
if (txt)
|
||||
span.title = txt;
|
||||
}
|
||||
}
|
||||
}
|
||||
var txt = i18n[document.title];
|
||||
|
@ -16,7 +16,7 @@ function PopupWin(editor, title, handler, initFunction) {
|
||||
if (base && base.match(/(.*)\/([^\/]+)/)) {
|
||||
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
|
||||
// FIXME: there's a problem here, it could be http:// which
|
||||
// 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() {
|
||||
var tags = ["input", "textarea", "select"];
|
||||
var params = new Object();
|
||||
for (var ti = tags.length; --ti >= 0;) {
|
||||
for (var ti in tags) {
|
||||
var tag = tags[ti];
|
||||
var els = this.content.getElementsByTagName(tag);
|
||||
for (var j = 0; j < els.length; ++j) {
|
||||
|
Loading…
Reference in New Issue
Block a user