Update of /cvsroot/php-blog/serendipity/htmlarea/popups
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20038/popups
Modified Files:
about.html fullscreen.html insert_image.html insert_table.html
popup.js select_color.html
Added Files:
link.html
Log Message:
Upgrade to latest WYSIWYG manager
Index: popup.js
===================================================================
RCS file: /cvsroot/php-blog/serendipity/htmlarea/popups/popup.js,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- popup.js 28 Mar 2003 20:05:29 -0000 1.1.1.1
+++ popup.js 23 Mar 2004 15:41:10 -0000 1.2
@@ -1,42 +1,109 @@
-function __dlg_onclose() {
- if (!document.all) {
- opener.Dialog._return(null);
+// htmlArea v3.0 - Copyright (c) 2002, 2003 interactivetools.com, inc.
+// This copyright notice MUST stay intact for use (see license.txt).
+//
+// Portions (c) dynarch.com, 2003
+//
+// A free WYSIWYG editor replacement for <textarea> fields.
+// For full source code and docs, visit http://www.interactivetools.com/
+//
+// Version 3.0 developed by Mihai Bazon.
+// http://dynarch.com/mishoo
+//
+// $Id$
+
+function getAbsolutePos(el) {
+ var r = { x: el.offsetLeft, y: el.offsetTop };
+ if (el.offsetParent) {
+ var tmp = getAbsolutePos(el.offsetParent);
+ r.x += tmp.x;
+ r.y += tmp.y;
}
+ return r;
};
-function __dlg_init() {
+function comboSelectValue(c, val) {
+ var ops = c.getElementsByTagName("option");
+ for (var i = ops.length; --i >= 0;) {
+ var op = ops[i];
+ op.selected = (op.value == val);
+ }
+ c.value = val;
+};
+
+function __dlg_onclose() {
+ opener.Dialog._return(null);
+};
+
+function __dlg_init(bottom) {
+ var body = document.body;
+ var body_height = 0;
+ if (typeof bottom == "undefined") {
+ var div = document.createElement("div");
+ body.appendChild(div);
+ var pos = getAbsolutePos(div);
+ body_height = pos.y;
+ } else {
+ var pos = getAbsolutePos(bottom);
+ body_height = pos.y + bottom.offsetHeight;
+ }
+ window.dialogArguments = opener.Dialog._arguments;
if (!document.all) {
- // init dialogArguments, as IE gets it
- window.dialogArguments = opener.Dialog._arguments;
window.sizeToContent();
window.sizeToContent(); // for reasons beyond understanding,
// only if we call it twice we get the
// correct size.
window.addEventListener("unload", __dlg_onclose, true);
// center on parent
- var px1 = opener.screenX;
- var px2 = opener.screenX + opener.outerWidth;
- var py1 = opener.screenY;
- var py2 = opener.screenY + opener.outerHeight;
- var x = (px2 - px1 - window.outerWidth) / 2;
- var y = (py2 - py1 - window.outerHeight) / 2;
+ var x = opener.screenX + (opener.outerWidth - window.outerWidth) / 2;
+ var y = opener.screenY + (opener.outerHeight - window.outerHeight) / 2;
window.moveTo(x, y);
- var body = document.body;
- window.innerHeight = body.offsetHeight;
- window.innerWidth = body.offsetWidth;
+ window.innerWidth = body.offsetWidth + 5;
+ window.innerHeight = body_height + 2;
} else {
- var body = document.body;
- window.dialogHeight = body.offsetHeight + 50 + "px";
- window.dialogWidth = body.offsetWidth + "px";
+ // window.dialogHeight = body.offsetHeight + 50 + "px";
+ // window.dialogWidth = body.offsetWidth + "px";
+ window.resizeTo(body.offsetWidth, body_height);
+ var ch = body.clientHeight;
+ var cw = body.clientWidth;
+ window.resizeBy(body.offsetWidth - cw, body_height - ch);
+ var W = body.offsetWidth;
+ var H = 2 * body_height - ch;
+ var x = (screen.availWidth - W) / 2;
+ var y = (screen.availHeight - H) / 2;
+ window.moveTo(x, y);
+ }
+ document.body.onkeypress = __dlg_close_on_esc;
+};
+
+function __dlg_translate(i18n) {
+ 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];
+ if (span.firstChild && span.firstChild.data) {
+ var txt = i18n[span.firstChild.data];
+ if (txt)
+ span.firstChild.data = txt;
+ }
+ }
}
+ var txt = i18n[document.title];
+ if (txt)
+ document.title = txt;
};
// closes the dialog and passes the return info upper.
function __dlg_close(val) {
- if (document.all) { // IE
- window.returnValue = val;
- } else {
- opener.Dialog._return(val);
- }
+ opener.Dialog._return(val);
window.close();
};
+
+function __dlg_close_on_esc(ev) {
+ ev || (ev = window.event);
+ if (ev.keyCode == 27) {
+ window.close();
+ return false;
+ }
+ return true;
+};
--- NEW FILE: link.html ---
<html>
<head>
<title>Insert/Modify Link</title>
<script type="text/javascript" src="popup.js"></script>
<script type="text/javascript">
window.resizeTo(400, 200);
I18N = window.opener.HTMLArea.I18N.dialogs;
function i18n(str) {
return (I18N[str] || str);
};
function onTargetChanged() {
var f = document.getElementById("f_other_target");
if (this.value == "_other") {
f.style.visibility = "visible";
f.select();
f.focus();
} else f.style.visibility = "hidden";
};
function Init() {
__dlg_translate(I18N);
__dlg_init();
var param = window.dialogArguments;
var target_select = document.getElementById("f_target");
if (param) {
document.getElementById("f_href").value = param["f_href"];
document.getElementById("f_title").value = param["f_title"];
comboSelectValue(target_select, param["f_target"]);
if (target_select.value != param.f_target) {
var opt = document.createElement("option");
opt.value = param.f_target;
opt.innerHTML = opt.value;
target_select.appendChild(opt);
opt.selected = true;
}
}
var opt = document.createElement("option");
opt.value = "_other";
opt.innerHTML = i18n("Other");
target_select.appendChild(opt);
target_select.onchange = onTargetChanged;
document.getElementById("f_href").focus();
document.getElementById("f_href").select();
};
function onOK() {
var required = {
"f_href": i18n("You must enter the URL where this link points to")
};
for (var i in required) {
var el = document.getElementById(i);
if (!el.value) {
alert(required[i]);
el.focus();
return false;
}
}
// pass data back to the calling window
var fields = ["f_href", "f_title", "f_target" ];
var param = new Object();
for (var i in fields) {
var id = fields[i];
var el = document.getElementById(id);
param[id] = el.value;
}
if (param.f_target == "_other")
param.f_target = document.getElementById("f_other_target").value;
__dlg_close(param);
return false;
};
function onCancel() {
__dlg_close(null);
return false;
};
</script>
<style type="text/css">
html, body {
background: ButtonFace;
color: ButtonText;
font: 11px Tahoma,Verdana,sans-serif;
margin: 0px;
padding: 0px;
}
body { padding: 5px; }
table {
font: 11px Tahoma,Verdana,sans-serif;
}
select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
button { width: 70px; }
table .label { text-align: right; width: 8em; }
.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
border-bottom: 1px solid black; letter-spacing: 2px;
}
#buttons {
margin-top: 1em; border-top: 1px solid #999;
padding: 2px; text-align: right;
}
</style>
</head>
<body onload="Init()">
<div class="title">Insert/Modify Link</div>
<table border="0" style="width: 100%;">
<tr>
<td class="label">URL:</td>
<td><input type="text" id="f_href" style="width: 100%" /></td>
</tr>
<tr>
<td class="label">Title (tooltip):</td>
<td><input type="text" id="f_title" style="width: 100%" /></td>
</tr>
<tr>
<td class="label">Target:</td>
<td><select id="f_target">
<option value="">None (use implicit)</option>
<option value="_blank">New window (_blank)</option>
<option value="_self">Same frame (_self)</option>
<option value="_top">Top frame (_top)</option>
</select>
<input type="text" name="f_other_target" id="f_other_target" size="10" style="visibility: hidden" />
</td>
</tr>
</table>
<div id="buttons">
<button type="button" name="ok" onclick="return onOK();">OK</button>
<button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
</div>
</body>
</html>
Index: insert_table.html
===================================================================
RCS file: /cvsroot/php-blog/serendipity/htmlarea/popups/insert_table.html,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- insert_table.html 28 Mar 2003 20:05:29 -0000 1.1.1.1
+++ insert_table.html 23 Mar 2004 15:41:10 -0000 1.2
@@ -1,4 +1,4 @@
-<html style="width: 398; height: 218">
+<html>
<head>
<title>Insert Table</title>
@@ -7,6 +7,8 @@
<script type="text/javascript">
+window.resizeTo(400, 100);
+
function Init() {
__dlg_init();
document.getElementById("f_rows").focus();
@@ -161,8 +163,7 @@
</fieldset>
-<div style="margin-top: 85px; text-align: right;">
-<hr />
+<div style="margin-top: 85px; border-top: 1px solid #999; padding: 2px; text-align: right;">
<button type="button" name="ok" onclick="return onOK();">OK</button>
<button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
</div>
Index: insert_image.html
===================================================================
RCS file: /cvsroot/php-blog/serendipity/htmlarea/popups/insert_image.html,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- insert_image.html 28 Mar 2003 20:05:29 -0000 1.1.1.1
+++ insert_image.html 23 Mar 2004 15:41:10 -0000 1.2
@@ -1,216 +1,191 @@
-<html style="width: 398; height: 218">
-
-<head>
- <title>Insert Image</title>
-
-<script type="text/javascript" src="popup.js"></script>
-
-<script type="text/javascript">
-var preview_window = null;
-
-function Init() {
- __dlg_init();
- document.getElementById("f_url").focus();
-};
-
-function onOK() {
- var required = {
- "f_url": "You must enter the URL",
- "f_alt": "Please enter the alternate text"
- };
- for (var i in required) {
- var el = document.getElementById(i);
- if (!el.value) {
- alert(required[i]);
- el.focus();
- return false;
- }
- }
- // pass data back to the calling window
- var fields = ["f_url", "f_alt", "f_align", "f_border",
- "f_horiz", "f_vert"];
- var param = new Object();
- for (var i in fields) {
- var id = fields[i];
- var el = document.getElementById(id);
- param[id] = el.value;
- }
- if (preview_window) {
- preview_window.close();
- }
- __dlg_close(param);
- return false;
-};
-
-function onCancel() {
- if (preview_window) {
- preview_window.close();
- }
- __dlg_close(null);
- return false;
-};
-
-function onPreview() {
- alert("FIXME: preview needs rewritten:\n show the image inside this window instead of opening a new one.");
- var f_url = document.getElementById("f_url");
- var url = f_url.value;
- if (!url) {
- alert("You have to enter an URL first");
- f_url.focus();
- return false;
- }
- var img = new Image();
- img.src = url;
- var win = null;
- if (!document.all) {
- win = window.open("about:blank", "ha_imgpreview", "toolbar=no,menubar=no,personalbar=no,innerWidth=100,innerHeight=100,scrollbars=no,resizable=yes");
- } else {
- win = window.open("about:blank", "ha_imgpreview", "channelmode=no,directories=no,height=100,width=100,location=no,menubar=no,resizable=yes,scrollbars=no,toolbar=no");
- }
- preview_window = win;
- var doc = win.document;
- var body = doc.body;
- if (body) {
- body.innerHTML = "";
- body.style.padding = "0px";
- body.style.margin = "0px";
- var el = doc.createElement("img");
- el.src = url;
-
- var table = doc.createElement("table");
- body.appendChild(table);
- table.style.width = "100%";
- table.style.height = "100%";
- var tbody = doc.createElement("tbody");
- table.appendChild(tbody);
- var tr = doc.createElement("tr");
- tbody.appendChild(tr);
- var td = doc.createElement("td");
- tr.appendChild(td);
- td.style.textAlign = "center";
-
- td.appendChild(el);
- win.resizeTo(el.offsetWidth + 30, el.offsetHeight + 30);
- }
- win.focus();
- return false;
-};
-</script>
-
-<style type="text/css">
-html, body {
- background: ButtonFace;
- color: ButtonText;
- font: 11px Tahoma,Verdana,sans-serif;
- margin: 0px;
- padding: 0px;
-}
-body { padding: 5px; }
-table {
- font: 11px Tahoma,Verdana,sans-serif;
-}
-form p {
- margin-top: 5px;
- margin-bottom: 5px;
-}
-.fl { width: 9em; float: left; padding: 2px 5px; text-align: right; }
-.fr { width: 6em; float: left; padding: 2px 5px; text-align: right; }
-fieldset { padding: 0px 10px 5px 5px; }
-select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
-button { width: 70px; }
-.space { padding: 2px; }
-
-.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
-border-bottom: 1px solid black; letter-spacing: 2px;
-}
-form { padding: 0px; margin: 0px; }
-</style>
-
-</head>
-
-<body onload="Init()">
-
-<div class="title">Insert Image</div>
-
-<form action="" method="get">
-<table border="0" width="100%" style="padding: 0px; margin: 0px">
- <tbody>
-
- <tr>
- <td style="width: 7em; text-align: right">Image URL:</td>
- <td><input type="text" name="url" id="f_url" style="width:75%"
- title="Enter the image URL here" />
- <button name="preview" onclick="return onPreview();"
- title="Preview the image in a new window">Preview</button>
- </td>
- </tr>
- <tr>
- <td style="width: 7em; text-align: right">Alternate text:</td>
- <td><input type="text" name="alt" id="f_alt" style="width:100%"
- title="For browsers that don't support images" /></td>
- </tr>
-
- </tbody>
-</table>
-
-<p />
-
-<fieldset style="float: left; margin-left: 5px;">
-<legend>Layout</legend>
-
-<div class="space"></div>
-
-<div class="fl">Alignment:</div>
-<select size="1" name="align" id="f_align"
- title="Positioning of this image">
- <option value="" >Not set</option>
- <option value="left" >Left</option>
- <option value="right" >Right</option>
- <option value="texttop" >Texttop</option>
- <option value="absmiddle" >Absmiddle</option>
- <option value="baseline" selected="1" >Baseline</option>
- <option value="absbottom" >Absbottom</option>
- <option value="bottom" >Bottom</option>
- <option value="middle" >Middle</option>
- <option value="top" >Top</option>
-</select>
-
-<p />
-
-<div class="fl">Border thickness:</div>
-<input type="text" name="border" id="f_border" size="5"
-title="Leave empty for no border" />
-
-<div class="space"></div>
-
-</fieldset>
-
-<fieldset style="float:right; margin-right: 5px;">
-<legend>Spacing</legend>
-
-<div class="space"></div>
-
-<div class="fr">Horizontal:</div>
-<input type="text" name="horiz" id="f_horiz" size="5"
-title="Horizontal padding" />
-
-<p />
-
-<div class="fr">Vertical:</div>
-<input type="text" name="vert" id="f_vert" size="5"
-title="Vertical padding" />
-
-<div class="space"></div>
-
-</fieldset>
-
-<div style="margin-top: 85px; text-align: right;">
-<hr />
-<button type="button" name="ok" onclick="return onOK();">OK</button>
-<button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
-</div>
-
-</form>
-
-</body>
-</html>
+<html>
+
+<head>
+ <title>Insert Image</title>
+
+<script type="text/javascript" src="popup.js"></script>
+
+<script type="text/javascript">
+
+window.resizeTo(400, 100);
+
+function Init() {
+ __dlg_init();
+ var param = window.dialogArguments;
+ if (param) {
+ document.getElementById("f_url").value = param["f_url"];
+ document.getElementById("f_alt").value = param["f_alt"];
+ document.getElementById("f_border").value = param["f_border"];
+ document.getElementById("f_align").value = param["f_align"];
+ document.getElementById("f_vert").value = param["f_vert"];
+ document.getElementById("f_horiz").value = param["f_horiz"];
+ window.ipreview.location.replace(param.f_url);
+ }
+ document.getElementById("f_url").focus();
+};
+
+function onOK() {
+ var required = {
+ "f_url": "You must enter the URL"
+ };
+ for (var i in required) {
+ var el = document.getElementById(i);
+ if (!el.value) {
+ alert(required[i]);
+ el.focus();
+ return false;
+ }
+ }
+ // pass data back to the calling window
+ var fields = ["f_url", "f_alt", "f_align", "f_border",
+ "f_horiz", "f_vert"];
+ var param = new Object();
+ for (var i in fields) {
+ var id = fields[i];
+ var el = document.getElementById(id);
+ param[id] = el.value;
+ }
+ __dlg_close(param);
+ return false;
+};
+
+function onCancel() {
+ __dlg_close(null);
+ return false;
+};
+
+function onPreview() {
+ var f_url = document.getElementById("f_url");
+ var url = f_url.value;
+ if (!url) {
+ alert("You have to enter an URL first");
+ f_url.focus();
+ return false;
+ }
+ window.ipreview.location.replace(url);
+ return false;
+};
+</script>
+
+<style type="text/css">
+html, body {
+ background: ButtonFace;
+ color: ButtonText;
+ font: 11px Tahoma,Verdana,sans-serif;
+ margin: 0px;
+ padding: 0px;
+}
+body { padding: 5px; }
+table {
+ font: 11px Tahoma,Verdana,sans-serif;
+}
+form p {
+ margin-top: 5px;
+ margin-bottom: 5px;
+}
+.fl { width: 9em; float: left; padding: 2px 5px; text-align: right; }
+.fr { width: 6em; float: left; padding: 2px 5px; text-align: right; }
+fieldset { padding: 0px 10px 5px 5px; }
+select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
+button { width: 70px; }
+.space { padding: 2px; }
+
+.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
+border-bottom: 1px solid black; letter-spacing: 2px;
+}
+form { padding: 0px; margin: 0px; }
+</style>
+
+</head>
+
+<body onload="Init()">
+
+<div class="title">Insert Image</div>
+<!--- new stuff --->
+<form action="" method="get">
+<table border="0" width="100%" style="padding: 0px; margin: 0px">
+ <tbody>
+
+ <tr>
+ <td style="width: 7em; text-align: right">Image URL:</td>
+ <td><input type="text" name="url" id="f_url" style="width:75%"
+ title="Enter the image URL here" />
+ <button name="preview" onclick="return onPreview();"
+ title="Preview the image in a new window">Preview</button>
+ </td>
+ </tr>
+ <tr>
+ <td style="width: 7em; text-align: right">Alternate text:</td>
+ <td><input type="text" name="alt" id="f_alt" style="width:100%"
+ title="For browsers that don't support images" /></td>
+ </tr>
+
+ </tbody>
+</table>
+
+<p />
+
+<fieldset style="float: left; margin-left: 5px;">
+<legend>Layout</legend>
+
+<div class="space"></div>
+
+<div class="fl">Alignment:</div>
+<select size="1" name="align" id="f_align"
+ title="Positioning of this image">
+ <option value="" >Not set</option>
+ <option value="left" >Left</option>
+ <option value="right" >Right</option>
+ <option value="texttop" >Texttop</option>
+ <option value="absmiddle" >Absmiddle</option>
+ <option value="baseline" selected="1" >Baseline</option>
+ <option value="absbottom" >Absbottom</option>
+ <option value="bottom" >Bottom</option>
+ <option value="middle" >Middle</option>
+ <option value="top" >Top</option>
+</select>
+
+<p />
+
+<div class="fl">Border thickness:</div>
+<input type="text" name="border" id="f_border" size="5"
+title="Leave empty for no border" />
+
+<div class="space"></div>
+
+</fieldset>
+
+<fieldset style="float:right; margin-right: 5px;">
+<legend>Spacing</legend>
+
+<div class="space"></div>
+
+<div class="fr">Horizontal:</div>
+<input type="text" name="horiz" id="f_horiz" size="5"
+title="Horizontal padding" />
+
+<p />
+
+<div class="fr">Vertical:</div>
+<input type="text" name="vert" id="f_vert" size="5"
+title="Vertical padding" />
+
+<div class="space"></div>
+
+</fieldset>
+<br clear="all" />
+<table width="100%" style="margin-bottom: 0.2em">
+ <tr>
+ <td valign="bottom">
+ Image Preview:<br />
+ <iframe name="ipreview" id="ipreview" frameborder="0" style="border : 1px solid gray;" height="200" width="300" src=""></iframe>
+ </td>
+ <td valign="bottom" style="text-align: right">
+ <button type="button" name="ok" onclick="return onOK();">OK</button><br>
+ <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
+ </td>
+ </tr>
+</table>
+</form>
+</body>
+</html>
Index: about.html
===================================================================
RCS file: /cvsroot/php-blog/serendipity/htmlarea/popups/about.html,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- about.html 28 Mar 2003 20:05:29 -0000 1.1.1.1
+++ about.html 23 Mar 2004 15:41:10 -0000 1.2
@@ -1,29 +1,378 @@
-<html style="width: 380px; height: 185px;">
-<head><title>About HTMLArea</title>
-<script type="text/javascript" src="popup.js"></script>
-<script type="text/javascript">
-function closeAbout() {
- __dlg_close(null);
-}
-</script>
-<style>
- html,body,textarea { font-family: tahoma,verdana,arial; font-size: 11px;
-padding: 0px; margin: 0px; }
- tt { font-size: 120%; }
- body { padding: 5px; background: ButtonFace; color: ButtonText; }
-</style></head>
-<body onload="__dlg_init()">
-<div style="font-family: arial black, arial; font-size: 28px;
-letter-spacing: -2px;">HTMLArea 3.0</div>
-
-<p>A free WYSIWYG editor replacement for <tt><textarea></tt> fields.</p>
-
-<p>For full source code and docs, visit:<br />
-<a href="http://www.interactivetools.com/products/htmlarea/" target="_blank"
->http://www.interactivetools.com/products/htmlarea/</a></p>
-
-<button style="float: right" type="button" onclick="closeAbout()">Close</button>
-
-<p>© 2002, 2003 interactivetools.com, inc. All Rights Reserved.</p>
-
-</body></html>
+<!--
+
+(c) dynarch.com, 2003-2004
+Author: Mihai Bazon, http://dynarch.com/mishoo
+Distributed as part of HTMLArea 3.0
+
+"You are not expected to understand this... I don't neither."
+
+ (from The Linux Kernel Source Code,
+ ./arch/x86_64/ia32/ptrace.c:90)
+
+;-)
+
+-->
+
+<html style="height: 100%">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>About HTMLArea</title>
+<script type="text/javascript" src="popup.js"></script>
+<script type="text/javascript">
+window.resizeTo(450, 250);
+var TABS = [];
+var CURRENT_TAB = 0;
+var CONTENT_HEIGHT_DIFF = 0;
+var CONTENT_WIDTH_DIFF = 0;
+function selectTab(idx) {
+ var ct = TABS[CURRENT_TAB];
+ ct.className = ct.className.replace(/\s*tab-current\s*/, ' ');
+ ct = TABS[CURRENT_TAB = idx];
+ ct.className += ' tab-current';
+ for (var i = TABS.length; --i >= 0;) {
+ var area = document.getElementById("tab-area-" + i);
+ if (CURRENT_TAB == i) {
+ area.style.display = "block";
+ } else {
+ area.style.display = "none";
+ }
+ }
+ document.body.style.visibility = "hidden";
+ document.body.style.visibility = "visible";
+ document.cookie = "HTMLAREA-ABOUT-TAB=" + idx;
+}
+var editor = null;
+function initDocument() {
+ editor = window.dialogArguments;
+ HTMLArea = window.opener.HTMLArea;
+
+ var plugins = document.getElementById("plugins");
+ var j = 0;
+ var html = "<table width='99%' cellpadding='0' style='margin-top: 1em; collapse-borders: collapse; border: 1px solid #8b8;'>" +
+ "<thead><tr>" +
+ "<td>Name</td>" +
+ "<td>Developer</td>" +
+ "<td>Sponsored by</td>" +
+ "<td>License<sup>*</sup></td>" +
+ "</tr></thead><tbody>";
+ for (var i in editor.plugins) {
+ var info = editor.plugins[i];
+ html += "<tr><td>" + info.name + " v" + info.version + "</td>" +
+ "<td><a href='" + info.developer_url + "' target='_blank' title='Visit developer website'>" +
+ info.developer + "</a></td>" +
+ "<td><a href='" + info.sponsor_url + "' target='_blank' title='Visit sponsor website'>" +
+ info.sponsor + "</a></td>" +
+ "<td>" + info.license + "</td></tr>";
+ ++j;
+ }
+
+ if (j) {
+ html += "</tbody></table>" +
+ "<p><sup>*</sup> License \"htmlArea\" means that the plugin is distributed under the same terms " +
+ "as HTMLArea itself. Such plugins are likely to be those included in the official " +
+ "HTMLArea distribution</p>";
+ plugins.innerHTML = "<p>The following plugins have been loaded.</p>" + html;
+ } else {
+ plugins.innerHTML = "<p>No plugins have been loaded</p>";
+ }
+
+ plugins.innerHTML += "<p>User agent reports:<br/>" + navigator.userAgent + "</p>";
+
+ var content = document.getElementById("content");
+ if (window.innerHeight) {
+ CONTENT_HEIGHT_DIFF = window.innerHeight - 250;
+ CONTENT_WIDTH_DIFF = window.innerWidth - content.offsetWidth;
+ } else {
+ CONTENT_HEIGHT_DIFF = document.body.offsetHeight - 250;
+ CONTENT_WIDTH_DIFF = document.body.offsetWidth - 400;
+ }
+ window.onresize();
+ var bar = document.getElementById("tabbar");
+ j = 0;
+ for (var i = bar.firstChild; i; i = i.nextSibling) {
+ TABS.push(i);
+ i.__msh_tab = j;
+ i.onmousedown = function(ev) { selectTab(this.__msh_tab); HTMLArea._stopEvent(ev || window.event); };
+ var area = document.getElementById("tab-area-" + j);
+ if (/tab-current/.test(i.className)) {
+ CURRENT_TAB = j;
+ area.style.display = "block";
+ } else {
+ area.style.display = "none";
+ }
+ ++j;
+ }
+ if (document.cookie.match(/HTMLAREA-ABOUT-TAB=([0-9]+)/))
+ selectTab(RegExp.$1);
+}
+window.onresize = function() {
+ var content = document.getElementById("content");
+ if (window.innerHeight) {
+ content.style.height = (window.innerHeight - CONTENT_HEIGHT_DIFF) + "px";
+ content.style.width = (window.innerWidth - CONTENT_WIDTH_DIFF) + "px";
+ } else {
+ content.style.height = (document.body.offsetHeight - CONTENT_HEIGHT_DIFF) + "px";
+ //content.style.width = (document.body.offsetWidth - CONTENT_WIDTH_DIFF) + "px";
+ }
+}
+</script>
+<style>
+ html,body,textarea,table { font-family: tahoma,verdana,arial; font-size: 11px;
+padding: 0px; margin: 0px; }
+ tt { font-size: 120%; }
+ body { padding: 0px; background: #cea; color: 000; }
+ a:link, a:visited { color: #00f; }
+ a:hover { color: #f00; }
+ a:active { color: #f80; }
+ button { font: 11px tahoma,verdana,sans-serif; background-color: #cea;
+ border-width: 1px; }
+
+ p { margin: 0.5em 0px; }
+
+ h1 { font: bold 130% georgia,"times new roman",serif; margin: 0px; border-bottom: 1px solid #6a6; }
+ h2 { font: bold 110% georgia,"times new roman",serif; margin: 0.7em 0px; }
+
+ thead {
+ font-weight: bold;
+ background-color: #dfb;
+ }
+
+ .logo, .logo-hover {
+ white-space: nowrap;
+ background-color: #8f4; color: #040; padding: 3px; border-bottom: 1px solid #555;
+ height: 5em;
+ }
+ .logo .brand, .logo-hover .brand {
+ margin-left: 0.5em; margin-right: 0.5em; padding-bottom: 0.1em;
+ font-family: impact,'arial black',arial,sans-serif; font-size: 28px;
+ border-bottom: 1px solid #595; text-align: center;
+ cursor: pointer;
+ }
+ .logo-hover {
+ background-color: #fff;
+ }
+ .logo-hover .brand {
+ color: #800;
+ border-color: #04f;
+ }
+ .logo .letter, .logo-hover .letter { position: relative; font-family: monospace; }
+ .logo .letter1 { top: 0.1em; }
+ .logo .letter2 { top: 0.05em; }
+ .logo .letter3 { top: -0.05em; }
+ .logo .letter4 { top: -0.1em; }
+
+ .logo-hover .letter1 { top: -0.1em; }
+ .logo-hover .letter2 { top: -0.05em; }
+ .logo-hover .letter3 { top: 0.05em; }
+ .logo-hover .letter4 { top: 0.1em; }
+ .logo .version, .logo-hover .version { font-family: georgia,"times new roman",serif; }
+ .logo .release {
+ font-size: 90%; margin-bottom: 1em;
+ text-align: center; color: #484;
+ }
+ .logo .visit { display: none; }
+ .logo-hover .release { display: none; }
+ .logo-hover .visit {
+ font-size: 90%; margin-bottom: 1em;
+ text-align: center; color: #448;
+ }
+ .buttons {
+ text-align: right; padding: 3px; background-color: #8f4;
+ border-top: 1px solid #555;
+ }
+ #tabbar {
+ position: relative;
+ left: 10px;
+ }
+ .tab {
+ color: #454;
+ cursor: pointer;
+ margin-left: -5px;
+ float: left; position: relative;
+ border: 1px solid #555;
+ top: -3px; left: -2px;
+ padding: 2px 10px 3px 10px;
+ border-top: none; background-color: #9b7;
+ -moz-border-radius: 0px 0px 4px 4px;
+ z-index: 0;
+ }
+ .tab-current {
+ color: #000;
+ top: -4px;
+ background-color: #cea;
+ padding: 3px 10px 4px 10px;
+ z-index: 10;
+ }
+ table.sponsors { border-top: 1px solid #aca; }
+ table.sponsors td {
+ border-bottom: 1px solid #aca; vertical-align: top;
+ }
+ table.sponsors tr td { padding: 2px 0px; }
+ table.sponsors tr td.sponsor { text-align: right; padding-right: 0.3em; white-space: nowrap; }
+ li, ol, ul { margin-top: 0px; margin-bottom: 0px; }
+</style></head>
+<body onload="__dlg_init(); initDocument();"
+><table cellspacing="0" cellpadding="0" style="border-collapse: collapse;
+ width: 100%; height: 100%;">
+
+<tr style="height: 1em"><td id="tdheader">
+
+<div class="logo">
+<div class="brand"
+onmouseover="this.parentNode.className='logo-hover';"
+onmouseout="this.parentNode.className='logo';"
+onclick="window.open('http://dynarch.com/htmlarea/');">
+<span class="letter letter1"><H</span><span
+class="letter letter2">T</span><span
+class="letter letter3">M</span><span
+class="letter letter4">L</span>Area <span class="letter">/></span>
+<span class="version">3.0 <span style="position: relative; top: -0.6em; font-size: 50%; font-weight: normal">[ rev. rc1 ]</span></span></div>
+<div class="release">Compiled on Mar 1, 2004 19:37 GMT</div>
+<div class="visit">Go to http://dynarch.com/htmlarea/ [latest milestone release]</div>
+</div>
+
+</td></tr>
+<tr><td id="tdcontent" style="padding: 0.5em;">
+
+<div style="overflow: auto; height: 250px;" id="content">
+<div id="tab-areas">
+
+<div id="tab-area-0">
+
+ <h1>HTMLArea</h1>
+
+ <p>A free WYSIWYG editor replacement for <tt><textarea></tt> fields.<br />
+ For Mozilla 1.3+ (any platform) or Internet Explorer 5.5+ (Windows).
+ </p>
+
+ <p style="text-align: center"
+ >© 2002-2004 <a href="http://interactivetools.com" target="_blank">interactivetools.com</a>, inc.<br />
+ © 2003-2004 <a href="http://dynarch.com" target="_blank">dynarch.com</a> LLC.<br />
+ All Rights Reserved.</p>
+
+ <h2>Project resources</h2>
+
+ <ul>
+ <li><a href="http://sourceforge.net/projects/itools-htmlarea/" target="_blank"
+ >Project page</a> (@ sourceforge.net)</li>
+ <li><a href="http://sourceforge.net/cvs/?group_id=69750" target="_blank"
+ >Anonymous CVS access</a> (@ sourceforge.net)</li>
+ <li><a href="http://sourceforge.net/tracker/?atid=525656&group_id=69750&func=browse" target="_blank"
+ >Bug system</a> (@ sourceforge.net)</li>
+ <li><a href="http://www.interactivetools.com/forum/gforum.cgi?forum=14;" target="_blank"
+ >Forum</a> (@ interactivetools.com)</li>
+ <li><a href="http://www.dynarch.com/htmlarea/" target="_blank"
+ >Last public release</a> (@ dynarch.com)</li>
+ </ul>
+
+ <p>
+ For download section please see the <a href="http://sourceforge.net/projects/itools-htmlarea/" target="_blank"
+ >project page @ SourceForge</a>.
+ </p>
+
+<p style="margin-top: 1em; text-align: center;">Version 3.0 developed and maintained by <a
+href="http://dynarch.com/mishoo/" title="http://dynarch.com/mishoo/" target="_blank">Mihai Bazon</a> / <a
+href="http://dynarch.com" title="http://dynarch.com/" target="_blank">dynarch.com</a></p>
+
+</div>
+
+<div id="tab-area-1">
+<h1>Thank you</h1>
+
+ <p>
+ <a href="http://dynarch.com" target="_blank">dynarch.com</a> would like to thank the following
+ companies/persons for their <em>donations</em> to support development of HTMLArea (listed alphabetically):
+ </p>
+
+ <ul>
+ <li><a href="http://www.neomedia.ro">Neomedia</a> (Romania)</li>
+ <li><a href="http://www.os3.it" target="_blank">OS3</a> (Italy)</li>
+ <li><a href="http://www.softwerk.net">SoftWerk</a> (Italy)</li>
+ </ul>
+
+ <p>Also many thanks to all people at InteractiveTools.com
+ <a href="http://www.interactivetools.com/forum/gforum.cgi?forum=14;">HTMLArea forums</a> for
+ contributing translations, feedback, bug reports and fixes.</p>
+
+ <p>
+ Last but not least, this project wouldn't have existed without
+ <a href="http://interactivetools.com" target="_blank">InteractiveTools.com</a>.
+ </p>
+
+</div>
+
+<div id="tab-area-2">
+<h1>htmlArea License (based on BSD license)</h1>
+
+<p style="text-align: center">© 2002-2004, interactivetools.com, inc.<br />
+ © 2003-2004 dynarch.com LLC<br />
+ All rights reserved.</p>
+
+<p>
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+</p>
+
+<ol>
+<li>
+Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+</li>
+
+<li>
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions and the following disclaimer in the documentation
+and/or other materials provided with the distribution.
+</li>
+
+<li>
+Neither the name of interactivetools.com, inc. nor the names of its
+contributors may be used to endorse or promote products derived from this
+software without specific prior written permission.
+</li>
+</ol>
+
+<p>
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+</p>
+
+</div>
+
+<div id="tab-area-3">
+<h1>Plugins</h1>
+<div id="plugins">
+</div>
+</div>
+
+</div></div>
+
+
+</tr></td>
+<tr style="height: 1em"><td id="tdfooter">
+
+
+<div class="buttons">
+<div id="tabbar"
+><div class="tab tab-current"
+>About</div><div class="tab"
+>Thanks</div><div class="tab"
+>License</div><div class="tab"
+>Plugins</div></div>
+<button type="button" onclick="__dlg_close(null);">I agree it's cool</button>
+</div>
+
+</td></tr></table>
+
+</body></html>
+
+
Index: fullscreen.html
===================================================================
RCS file: /cvsroot/php-blog/serendipity/htmlarea/popups/fullscreen.html,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- fullscreen.html 28 Mar 2003 20:05:29 -0000 1.1.1.1
+++ fullscreen.html 23 Mar 2004 15:41:10 -0000 1.2
@@ -1,133 +1,133 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
-<head><title>Fullscreen Editor</title>
-<style type="text/css">
-@import url(../htmlarea.css);
-html, body { margin: 0px; border: 0px; background-color: buttonface; } </style>
+ <head>
+ <title>Fullscreen HTMLArea</title>
+ <script type="text/javascript">
+ _editor_url = window.opener._editor_url;
+ _editor_lang = window.opener._editor_lang;
+ var BASE = window.opener.document.baseURI || window.opener.document.URL;
+ var head = document.getElementsByTagName("head")[0];
+ var base = document.createElement("base");
+ base.href = BASE;
+ head.appendChild(base);
+ </script>
-<script type="text/javascript" src="../htmlarea.js"></script>
-<script type="text/javascript" src="../htmlarea-lang-en.js"></script>
-<script type="text/javascript" src="../dialog.js"></script>
+ <script type="text/javascript" src="../htmlarea.js"></script>
-<script type="text/javascript">
+ <script type="text/javascript">
+ // load HTMLArea scripts that are present in the opener frame
+ var scripts = window.opener.HTMLArea._scripts;
+ for (var i = 4; i < scripts.length; ++i) {
+ document.write("<scr" + "ipt type='text/javascript' src='" + scripts[i] + "'></scr" + "ipt>");
+ }
+ </script>
-var parent_object = opener.HTMLArea._object;
-var editor = null; // to be initialized later [ function init() ]
+ <!-- browser takes a coffee break here -->
+ <script type="text/javascript">
+var parent_object = null;
+var editor = null; // to be initialized later [ function init() ]
/* ---------------------------------------------------------------------- *\
- Function :
- Description :
+ Function :
+ Description :
\* ---------------------------------------------------------------------- */
function _CloseOnEsc(ev) {
- if (document.all) {
- // IE
- ev = window.event;
- }
- if (ev.keyCode == 27) {
- // update_parent();
- window.close();
- return;
- }
-}
-
-/* ---------------------------------------------------------------------- *\
- Function : cloneObject
- Description : copy an object by value instead of by reference
- Usage : var newObj = cloneObject(oldObj);
-\* ---------------------------------------------------------------------- */
-
-function cloneObject(obj) {
- var newObj = new Object;
-
- // check for array objects
- if (obj.constructor.toString().indexOf('function Array(') == 1) {
- newObj = obj.constructor();
- }
-
- for (var n in obj) {
- var node = obj[n];
- if (typeof node == 'object') { newObj[n] = cloneObject(node); }
- else { newObj[n] = node; }
- }
-
- return newObj;
+ ev || (ev = window.event);
+ if (ev.keyCode == 27) {
+ // update_parent();
+ window.close();
+ return;
+ }
}
/* ---------------------------------------------------------------------- *\
- Function : resize_editor
- Description : resize the editor when the user resizes the popup
+ Function : resize_editor
+ Description : resize the editor when the user resizes the popup
\* ---------------------------------------------------------------------- */
function resize_editor() { // resize editor to fix window
- var newHeight;
- if (document.all) {
- // IE
- newHeight = document.body.offsetHeight - editor._toolbar.offsetHeight;
- if (newHeight < 0) { newHeight = 0; }
- } else {
- // Gecko
- newHeight = window.innerHeight - editor._toolbar.offsetHeight;
- }
- editor._textArea2.style.height = editor._iframe.style.height = newHeight + "px";
+ var newHeight;
+ if (document.all) {
+ // IE
+ newHeight = document.body.offsetHeight - editor._toolbar.offsetHeight;
+ if (newHeight < 0) { newHeight = 0; }
+ } else {
+ // Gecko
+ newHeight = window.innerHeight - editor._toolbar.offsetHeight;
+ }
+ if (editor.config.statusBar) {
+ newHeight -= editor._statusBar.offsetHeight;
+ }
+ editor._textArea.style.height = editor._iframe.style.height = newHeight + "px";
}
/* ---------------------------------------------------------------------- *\
- Function : init
- Description : run this code on page load
+ Function : init
+ Description : run this code on page load
\* ---------------------------------------------------------------------- */
function init() {
- var config = cloneObject( parent_object.config );
- config.editorURL = "../";
- config.width = "100%";
- config.height = "auto";
+ parent_object = opener.HTMLArea._object;
+ var config = HTMLArea.cloneObject( parent_object.config );
+ config.width = "100%";
+ config.height = "auto";
- // change maximize button to minimize button
- config.btnList["popupeditor"] = [ function() { window.close(); },
- 'Minimize Editor', 'fullscreen_minimize.gif', true ];
+ // change maximize button to minimize button
+ config.btnList["popupeditor"] = [ 'Minimize Editor', _editor_url + 'images/fullscreen_minimize.gif', true,
+ function() { window.close(); } ];
- // generate editor and resize it
- editor = new HTMLArea("editor", config);
- editor.generate();
- resize_editor();
- editor._iframe.style.width = "100%";
- editor._textArea2.style.width = "100%";
+ // generate editor and resize it
+ editor = new HTMLArea("editor", config);
- // set child window contents and event handlers, after a small delay
- setTimeout(function() {
- editor.setHTML(parent_object.getInnerHTML());
+ // register the plugins, if any
+ for (var i in parent_object.plugins) {
+ var plugin = parent_object.plugins[i];
+ editor.registerPlugin2(plugin.name, plugin.args);
+ }
+ // and restore the original toolbar
+ config.toolbar = parent_object.config.toolbar;
+ editor.generate();
+ editor._iframe.style.width = "100%";
+ editor._textArea.style.width = "100%";
+ resize_editor();
- // switch mode if needed
- if (parent_object._mode == "textmode") { editor.setMode("textmode"); }
+ editor.doctype = parent_object.doctype;
- // continuously update parent editor window
- setInterval(update_parent, 500);
+ // set child window contents and event handlers, after a small delay
+ setTimeout(function() {
+ editor.setHTML(parent_object.getInnerHTML());
- // setup event handlers
- document.body.onkeypress = _CloseOnEsc;
- editor._doc.body.onkeypress = _CloseOnEsc;
- editor._textArea2.onkeypress = _CloseOnEsc;
- window.onresize = resize_editor;
- }, 333); // give it some time to meet the new frame
+ // switch mode if needed
+ if (parent_object._mode == "textmode") { editor.setMode("textmode"); }
+
+ // continuously update parent editor window
+ setInterval(update_parent, 500);
+
+ // setup event handlers
+ document.body.onkeypress = _CloseOnEsc;
+ editor._doc.body.onkeypress = _CloseOnEsc;
+ editor._textArea.onkeypress = _CloseOnEsc;
+ window.onresize = resize_editor;
+ }, 333); // give it some time to meet the new frame
}
/* ---------------------------------------------------------------------- *\
- Function : update_parent
- Description : update parent window editor field with contents from child window
-\* ---------------------------------------------------------------------- */
+ Function : update_parent
+ Description : update parent window editor field with contents from child window
+ \* ---------------------------------------------------------------------- */
function update_parent() {
- // use the fast version
- parent_object.setHTML(editor.getInnerHTML());
+ // use the fast version
+ parent_object.setHTML(editor.getInnerHTML());
}
-
-</script>
-</head>
-<body scroll="no" onload="init()" 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>
-
-</body></html>
+ </script>
+ <style type="text/css"> html, body { height: 100%; margin: 0px; border: 0px; background-color: buttonface; } </style>
+ </head>
+ <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>
+ </body>
+</html>
Index: select_color.html
===================================================================
RCS file: /cvsroot/php-blog/serendipity/htmlarea/popups/select_color.html,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- select_color.html 28 Mar 2003 20:05:29 -0000 1.1.1.1
+++ select_color.html 23 Mar 2004 15:41:10 -0000 1.2
@@ -1,11 +1,12 @@
<!-- note: this version of the color picker is optimized for IE 5.5+ only -->
-<html style="width: 238px; height: 182px"><head><title>Select Color</title>
+<html><head><title>Select Color</title>
<script type="text/javascript" src="popup.js"></script>
<script type="text/javascript">
+window.resizeTo(240, 182);
function _CloseOnEsc() {
if (event.keyCode == 27) { window.close(); return; }
}
|