version 1.1, 2004/02/18 08:07:16
|
version 1.2, 2004/06/01 23:46:11
|
Line 1
|
Line 1
|
<html style="width: 398; height: 218"> |
<html>
|
|
|
<head> |
<head>
|
<title>Insert Image</title> |
<title>Insert Image</title>
|
|
|
<script type="text/javascript" src="popup.js"></script> |
<script type="text/javascript" src="popup.js"></script>
|
|
|
<script type="text/javascript"> |
<script type="text/javascript">
|
var preview_window = null; |
|
|
window.resizeTo(400, 100);
|
function Init() { |
|
__dlg_init(); |
function Init() {
|
document.getElementById("f_url").focus(); |
__dlg_init();
|
}; |
var param = window.dialogArguments;
|
|
if (param) {
|
function onOK() { |
document.getElementById("f_url").value = param["f_url"];
|
var required = { |
document.getElementById("f_alt").value = param["f_alt"];
|
"f_url": "You must enter the URL", |
document.getElementById("f_border").value = param["f_border"];
|
"f_alt": "Please enter the alternate text" |
document.getElementById("f_align").value = param["f_align"];
|
}; |
document.getElementById("f_vert").value = param["f_vert"];
|
for (var i in required) { |
document.getElementById("f_horiz").value = param["f_horiz"];
|
var el = document.getElementById(i); |
window.ipreview.location.replace(param.f_url);
|
if (!el.value) { |
}
|
alert(required[i]); |
document.getElementById("f_url").focus();
|
el.focus(); |
};
|
return false; |
|
} |
function onOK() {
|
} |
var required = {
|
// pass data back to the calling window |
"f_url": "You must enter the URL"
|
var fields = ["f_url", "f_alt", "f_align", "f_border", |
};
|
"f_horiz", "f_vert"]; |
for (var i in required) {
|
var param = new Object(); |
var el = document.getElementById(i);
|
for (var i in fields) { |
if (!el.value) {
|
var id = fields[i]; |
alert(required[i]);
|
var el = document.getElementById(id); |
el.focus();
|
param[id] = el.value; |
return false;
|
} |
}
|
if (preview_window) { |
}
|
preview_window.close(); |
// pass data back to the calling window
|
} |
var fields = ["f_url", "f_alt", "f_align", "f_border",
|
__dlg_close(param); |
"f_horiz", "f_vert"];
|
return false; |
var param = new Object();
|
}; |
for (var i in fields) {
|
|
var id = fields[i];
|
function onCancel() { |
var el = document.getElementById(id);
|
if (preview_window) { |
param[id] = el.value;
|
preview_window.close(); |
}
|
} |
__dlg_close(param);
|
__dlg_close(null); |
return false;
|
return false; |
};
|
}; |
|
|
function onCancel() {
|
function onPreview() { |
__dlg_close(null);
|
alert("FIXME: preview needs rewritten:\n show the image inside this window instead of opening a new one."); |
return false;
|
var f_url = document.getElementById("f_url"); |
};
|
var url = f_url.value; |
|
if (!url) { |
function onPreview() {
|
alert("You have to enter an URL first"); |
var f_url = document.getElementById("f_url");
|
f_url.focus(); |
var url = f_url.value;
|
return false; |
if (!url) {
|
} |
alert("You have to enter an URL first");
|
var img = new Image(); |
f_url.focus();
|
img.src = url; |
return false;
|
var win = null; |
}
|
if (!document.all) { |
window.ipreview.location.replace(url);
|
win = window.open("about:blank", "ha_imgpreview", "toolbar=no,menubar=no,personalbar=no,innerWidth=100,innerHeight=100,scrollbars=no,resizable=yes"); |
return false;
|
} 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"); |
</script>
|
} |
|
preview_window = win; |
<style type="text/css">
|
var doc = win.document; |
html, body {
|
var body = doc.body; |
background: ButtonFace;
|
if (body) { |
color: ButtonText;
|
body.innerHTML = ""; |
font: 11px Tahoma,Verdana,sans-serif;
|
body.style.padding = "0px"; |
margin: 0px;
|
body.style.margin = "0px"; |
padding: 0px;
|
var el = doc.createElement("img"); |
}
|
el.src = url; |
body { padding: 5px; }
|
|
table {
|
var table = doc.createElement("table"); |
font: 11px Tahoma,Verdana,sans-serif;
|
body.appendChild(table); |
}
|
table.style.width = "100%"; |
form p {
|
table.style.height = "100%"; |
margin-top: 5px;
|
var tbody = doc.createElement("tbody"); |
margin-bottom: 5px;
|
table.appendChild(tbody); |
}
|
var tr = doc.createElement("tr"); |
.fl { width: 9em; float: left; padding: 2px 5px; text-align: right; }
|
tbody.appendChild(tr); |
.fr { width: 6em; float: left; padding: 2px 5px; text-align: right; }
|
var td = doc.createElement("td"); |
fieldset { padding: 0px 10px 5px 5px; }
|
tr.appendChild(td); |
select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
|
td.style.textAlign = "center"; |
button { width: 70px; }
|
|
.space { padding: 2px; }
|
td.appendChild(el); |
|
win.resizeTo(el.offsetWidth + 30, el.offsetHeight + 30); |
.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;
|
win.focus(); |
}
|
return false; |
form { padding: 0px; margin: 0px; }
|
}; |
</style>
|
</script> |
|
|
</head>
|
<style type="text/css"> |
|
html, body { |
<body onload="Init()">
|
background: ButtonFace; |
|
color: ButtonText; |
<div class="title">Insert Image</div>
|
font: 11px Tahoma,Verdana,sans-serif; |
<!--- new stuff --->
|
margin: 0px; |
<form action="" method="get">
|
padding: 0px; |
<table border="0" width="100%" style="padding: 0px; margin: 0px">
|
} |
<tbody>
|
body { padding: 5px; } |
|
table { |
<tr>
|
font: 11px Tahoma,Verdana,sans-serif; |
<td style="width: 7em; text-align: right">Image URL:</td>
|
} |
<td><input type="text" name="url" id="f_url" style="width:75%"
|
form p { |
title="Enter the image URL here" />
|
margin-top: 5px; |
<button name="preview" onclick="return onPreview();"
|
margin-bottom: 5px; |
title="Preview the image in a new window">Preview</button>
|
} |
</td>
|
.fl { width: 9em; float: left; padding: 2px 5px; text-align: right; } |
</tr>
|
.fr { width: 6em; float: left; padding: 2px 5px; text-align: right; } |
<tr>
|
fieldset { padding: 0px 10px 5px 5px; } |
<td style="width: 7em; text-align: right">Alternate text:</td>
|
select, input, button { font: 11px Tahoma,Verdana,sans-serif; } |
<td><input type="text" name="alt" id="f_alt" style="width:100%"
|
button { width: 70px; } |
title="For browsers that don't support images" /></td>
|
.space { padding: 2px; } |
</tr>
|
|
|
.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px; |
</tbody>
|
border-bottom: 1px solid black; letter-spacing: 2px; |
</table>
|
} |
|
form { padding: 0px; margin: 0px; } |
<p />
|
</style> |
|
|
<fieldset style="float: left; margin-left: 5px;">
|
</head> |
<legend>Layout</legend>
|
|
|
<body onload="Init()"> |
<div class="space"></div>
|
|
|
<div class="title">Insert Image</div> |
<div class="fl">Alignment:</div>
|
|
<select size="1" name="align" id="f_align"
|
<form action="" method="get"> |
title="Positioning of this image">
|
<table border="0" width="100%" style="padding: 0px; margin: 0px"> |
<option value="" >Not set</option>
|
<tbody> |
<option value="left" >Left</option>
|
|
<option value="right" >Right</option>
|
<tr> |
<option value="texttop" >Texttop</option>
|
<td style="width: 7em; text-align: right">Image URL:</td> |
<option value="absmiddle" >Absmiddle</option>
|
<td><input type="text" name="url" id="f_url" style="width:75%" |
<option value="baseline" selected="1" >Baseline</option>
|
title="Enter the image URL here" /> |
<option value="absbottom" >Absbottom</option>
|
<button name="preview" onclick="return onPreview();" |
<option value="bottom" >Bottom</option>
|
title="Preview the image in a new window">Preview</button> |
<option value="middle" >Middle</option>
|
</td> |
<option value="top" >Top</option>
|
</tr> |
</select>
|
<tr> |
|
<td style="width: 7em; text-align: right">Alternate text:</td> |
<p />
|
<td><input type="text" name="alt" id="f_alt" style="width:100%" |
|
title="For browsers that don't support images" /></td> |
<div class="fl">Border thickness:</div>
|
</tr> |
<input type="text" name="border" id="f_border" size="5"
|
|
title="Leave empty for no border" />
|
</tbody> |
|
</table> |
<div class="space"></div>
|
|
|
<p /> |
</fieldset>
|
|
|
<fieldset style="float: left; margin-left: 5px;"> |
<fieldset style="float:right; margin-right: 5px;">
|
<legend>Layout</legend> |
<legend>Spacing</legend>
|
|
|
<div class="space"></div> |
<div class="space"></div>
|
|
|
<div class="fl">Alignment:</div> |
<div class="fr">Horizontal:</div>
|
<select size="1" name="align" id="f_align" |
<input type="text" name="horiz" id="f_horiz" size="5"
|
title="Positioning of this image"> |
title="Horizontal padding" />
|
<option value="" >Not set</option> |
|
<option value="left" >Left</option> |
<p />
|
<option value="right" >Right</option> |
|
<option value="texttop" >Texttop</option> |
<div class="fr">Vertical:</div>
|
<option value="absmiddle" >Absmiddle</option> |
<input type="text" name="vert" id="f_vert" size="5"
|
<option value="baseline" selected="1" >Baseline</option> |
title="Vertical padding" />
|
<option value="absbottom" >Absbottom</option> |
|
<option value="bottom" >Bottom</option> |
<div class="space"></div>
|
<option value="middle" >Middle</option> |
|
<option value="top" >Top</option> |
</fieldset>
|
</select> |
<br clear="all" />
|
|
<table width="100%" style="margin-bottom: 0.2em">
|
<p /> |
<tr>
|
|
<td valign="bottom">
|
<div class="fl">Border thickness:</div> |
Image Preview:<br />
|
<input type="text" name="border" id="f_border" size="5" |
<iframe name="ipreview" id="ipreview" frameborder="0" style="border : 1px solid gray;" height="200" width="300" src=""></iframe>
|
title="Leave empty for no border" /> |
</td>
|
|
<td valign="bottom" style="text-align: right">
|
<div class="space"></div> |
<button type="button" name="ok" onclick="return onOK();">OK</button><br>
|
|
<button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
|
</fieldset> |
</td>
|
|
</tr>
|
<fieldset style="float:right; margin-right: 5px;"> |
</table>
|
<legend>Spacing</legend> |
</form>
|
|
</body>
|
<div class="space"></div> |
</html>
|
|
|
<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> |
|