home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2002 March
/
PCWorld_2002-03_cd.bin
/
Novinky
/
msie
/
Setup
/
IEMIL_3.CAB
/
MSHTMLER.DLL
/
HTML
/
INSIMAGE.DLG
< prev
next >
Wrap
Text File
|
2001-10-22
|
12KB
|
378 lines
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML 3.2//EN">
<HTML id=dlgImage STYLE="font-family: MS Shell Dlg; font-size: 8pt;
width: 40.1em; height: 18em">
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
<meta http-equiv="MSThemeCompatible" content="Yes">
<TITLE>
Obrßzek
</TITLE>
<SCRIPT defer>
function callHelp(elm)
{
if (null != elm.helpid)
{
window.showHelp(elm.helpfile, "" + parseInt(elm.helpid),
"popup");
}
else
{
if ("BODY" != elm.tagName)
{
callHelp(elm.parentElement);
}
}
}
function btnCancelClick()
{
window.close();
}
function getTextRange(elm)
{
var r = elm.parentTextEdit.createTextRange();
r.moveToElementText(elm);
return r;
}
function mouseClick()
{
if (window.event.srcElement.id.substring(0,3)
== "txt")
{
return;
}
if (window.event.button == 2)
{
callHelp(window.event.srcElement);
}
}
function txtDefaultESC()
{
if (event.keyCode == 27)
{
window.close();
return;
}
}
window.onerror = HandleError
var L_Dialog_ErrorMessage = "Vátomto dialogovΘm okn∞ doÜlo káchyb∞.";
var L_ErrorNumber_Text = "Chyba: ";
function HandleError(message, url, line)
{
var str = L_Dialog_ErrorMessage + "\n\n"
+ L_ErrorNumber_Text + line + "\n"
+ message;
alert (str);
window.close();
return true;
}
function setOKState(fEvent) { if (fEvent && (event.propertyName != "value")) { return; } if (("" == txtFileName.value) == g_fOKEnabled) { btnOK.disabled = g_fOKEnabled; g_fOKEnabled = !g_fOKEnabled; } } var g_fOKEnabled = false;
function btnBrowseClick()
{
var L_Picture_DIALOG_Title_DialogTitle = "Obrßzek";
var L_Picture_DIALOG_FileTypes_Text = "GIF a JPEG (*.gif, *.jpg)|*.gif;*.jpg|Rastrov² obrßzek (*.bmp)|*.bmp|Metasoubor systΘmu Windows (*.wmf)|*.wmf|XBM (*.xbm)|*.xbm|ART (*.art)|*.art|VÜechny soubory (*.*)|*.*|";
var strFileName;
strFileName = dialogHelper.openfiledlg("", "",
L_Picture_DIALOG_FileTypes_Text,L_Picture_DIALOG_Title_DialogTitle);
if ("" != strFileName)
{
txtFileName.value = strFileName;
}
setOKState(false);
}
function getProtocolFromURL(strURL)
{
var index;
return strURL.substring(0, strURL.indexOf(":") + 1);
}
function bdyLoad()
{
var elmSelectedImage;
var htmlSelectionControl = "Control";
var globalDoc = window.dialogArguments;
var grngMaster = globalDoc.selection.createRange();
txtFileName.onfocus = new Function("txtFileName.select()");
txtFileName.onkeypress = new Function("txtDefaultESC()");
txtAltText.onfocus = new Function("txtAltText.select()");
txtAltText.onkeypress = new Function("txtDefaultESC()");
txtHorizontal.onfocus = new Function("txtHorizontal.select()");
txtHorizontal.onkeypress = new Function("txtDefaultESC()");
txtBorder.onfocus = new Function("txtBorder.select()");
txtBorder.onkeypress = new Function("txtDefaultESC()");
txtVertical.onfocus = new Function("txtVertical.select()");
txtVertical.onkeypress = new Function("txtDefaultESC()");
btnBrowse.onclick = new Function("btnBrowseClick()");
btnOK.onclick = new Function("btnOKClick()");
btnCancel.onclick = new Function("btnCancelClick()");
document.onhelp = new Function("callHelp(window.event.srcElement)");
document.onmouseup = new Function("mouseClick()");
txtFileName.onpropertychange = new Function("setOKState(true)");
txtFileName.fImageLoaded = false;
txtFileName.intImageWidth = 0;
txtFileName.intImageHeight = 0;
if (globalDoc.selection.type == htmlSelectionControl)
{
if (grngMaster.length == 1)
{
elmSelectedImage = grngMaster.item(0);
if (elmSelectedImage.tagName == "IMG")
{
txtFileName.fImageLoaded = true;
if (elmSelectedImage.src)
txtFileName.value = elmSelectedImage.src;
txtFileName.intImageHeight = elmSelectedImage.height;
txtFileName.intImageWidth = elmSelectedImage.width;
txtVertical.value = elmSelectedImage.vspace;
txtHorizontal.value = elmSelectedImage.hspace;
txtBorder.value = elmSelectedImage.border;
txtAltText.value = elmSelectedImage.alt;
selAlignment.value = elmSelectedImage.align;
}
}
}
setOKState(false);
txtFileName.focus();
}
function testTextValue(txtBox)
{
var val = parseInt(txtBox.value);
if (isNaN(val) || val < 0 || val > 999)
{
return false;
}
return true;
}
function btnOKClick()
{
var elmImage;
var intAlignment;
var L_HorizontalNotNumber_ErrorMessage
= "Pro vodorovnΘ mezery musφte zadat Φφslo mezi 0 a 999.";
var L_VerticalNotNumber_ErrorMessage
= "Pro svislΘ mezery musφte zadat Φφslo mezi 0 a 999.";
var L_BoderNotNumber_ErrorMessage
= "Pro tlouÜ¥ku ohraniΦenφ musφte zadat Φφslo mezi 0 a 999.";
var cmdInsertImage = "InsertImage";
var cmdDelete = "Delete";
var htmlSelectionControl = "Control";
var globalDoc = window.dialogArguments;
var grngMaster = globalDoc.selection.createRange();
if ("" != txtHorizontal.value)
{
if (!testTextValue(txtHorizontal))
{
alert(L_HorizontalNotNumber_ErrorMessage);
txtHorizontal.focus();
return;
}
}
if ("" != txtBorder.value)
{
if (!testTextValue(txtBorder))
{
alert(L_BoderNotNumber_ErrorMessage);
txtBorder.focus();
return;
}
}
if ("" != txtVertical.value)
{
if (!testTextValue(txtVertical))
{
alert(L_VerticalNotNumber_ErrorMessage);
txtVertical.focus();
return;
}
}
if (globalDoc.selection.type == htmlSelectionControl
&& !txtFileName.fImageLoaded)
{
grngMaster.execCommand(cmdDelete);
grngMaster = globalDoc.selection.createRange();
}
idstr = "\" id=\"c2eec6217e1a474eb649bfedd577334a";
if (!txtFileName.fImageLoaded)
{
grngMaster.execCommand(cmdInsertImage, false, idstr);
elmImage = globalDoc.all.c2eec6217e1a474eb649bfedd577334a;
elmImage.removeAttribute("id");
elmImage.removeAttribute("src");
grngMaster.moveStart("character", -1);
}
else
{
elmImage = grngMaster.item(0);
if (elmImage.src != txtFileName.value)
{
grngMaster.execCommand(cmdDelete);
grngMaster = globalDoc.selection.createRange();
grngMaster.execCommand(cmdInsertImage, false, idstr);
elmImage = globalDoc.all.c2eec6217e1a474eb649bfedd577334a;
elmImage.removeAttribute("id");
elmImage.removeAttribute("src");
grngMaster.moveStart("character", -1);
txtFileName.fImageLoaded = false;
}
grngMaster = getTextRange(elmImage);
}
if (txtFileName.fImageLoaded)
{
elmImage.style.width = txtFileName.intImageWidth;
elmImage.style.height = txtFileName.intImageHeight;
}
if (txtFileName.value.length > 2040)
txtFileName.value = txtFileName.value.substring(0,2040);
if ("" == getProtocolFromURL(txtFileName.value))
{
elmImage.src = "file://" + txtFileName.value;
}
else
{
elmImage.src = txtFileName.value;
}
if (txtHorizontal.value != "")
{
elmImage.hspace = parseInt(txtHorizontal.value);
}
else
{
elmImage.hspace = 0;
}
if (txtVertical.value != "")
{
elmImage.vspace = parseInt(txtVertical.value);
}
else
{
elmImage.vspace = 0;
}
elmImage.alt = txtAltText.value;
if (txtBorder.value != "")
{
elmImage.border = parseInt(txtBorder.value);
}
else
{
elmImage.border = 0;
}
elmImage.align = selAlignment.value;
grngMaster.collapse(false);
grngMaster.select();
window.close();
}
</SCRIPT>
</HEAD>
<BODY id=bdy onload="bdyLoad()" style="font-family: MS Shell Dlg;
font-size: 8pt; background: threedface; color: windowtext;" scroll=no>
<OBJECT ID="dialogHelper" CLASSID="CLSID:3050f4e1-98b5-11cf-bb82-00aa00bdce0b"
HEIGHT=0 WIDTH=0 tabindex=-1>
</OBJECT>
<DIV id=divFileName style="font-family: MS Shell Dlg; font-size: 8pt; position: absolute;
left: 0.9em; top: 1.2em; width: 7em; height: 1.2em; ">
<LABEL id=lblFileName FOR=txtFileName tabIndex=-1
helpid="35450" helpfile=msoe.hlp>
<U>Z</U>droj obrßzku:
</LABEL>
</DIV>
<INPUT ID=txtFileName type=text style="font-family: MS Shell Dlg; font-size: 8pt;
position: absolute; left: 8.5em; top: 1em; width: 13.5em;
height: 2.1em; " tabIndex=10 ACCESSKEY=z
helpid="35450" helpfile=msoe.hlp>
<DIV id=divAltText style="font-family: MS Shell Dlg; font-size: 8pt; position: absolute;
left: 0.9em; top: 4.1em; width: 7.7em; height: 1.7em; ">
<LABEL id=lblAltText FOR=txtAltText tabIndex=-1
helpid="35455" helpfile=msoe.hlp>
Alternativnφ te<u>x</u>t:
</LABEL>
</DIV>
<INPUT type=text ID=txtAltText tabIndex=15 ACCESSKEY=x
style="font-family: MS Shell Dlg; font-size: 8pt; position: absolute;
left: 8.5em; top: 3.8em; width: 21.5em; height: 2.1em; "
helpid="35455" helpfile=msoe.hlp>
<BUTTON ID=btnBrowse style="font-family: MS Shell Dlg; font-size: 8pt; position: absolute;
left: 22.9em; top: 1em; width: 7em; height: 2.2em; "
ACCESSKEY=r tabIndex=12 helpid="35462" helpfile=msoe.hlp>
P<U>r</U>ochßzet...
</BUTTON>
<FIELDSET id=fldLayout style="font-family: MS Shell Dlg; font-size: 8pt;
position: absolute; left: .9em; top: 7.1em; width: 17.4em;
height: 7.6em;">
<LEGEND id=lgdLayout>
Rozlo₧enφ
</LEGEND>
</FIELDSET>
<FIELDSET id=fldSpacing style="font-family: MS Shell Dlg; font-size: 8pt;
position: absolute; left: 18.9em; top: 7.1em; width: 11em;
height: 7.6em;">
<LEGEND id=lgdSpacing>
Mezery
</LEGEND>
</FIELDSET>
<DIV id=divAlign style="font-family: MS Shell Dlg; font-size: 8pt;
position: absolute; left: 1.8em; top: 9.1em; width: 4.7em;
height: 1.2em; ">
<LABEL id=lblAlignment FOR=selAlignment tabIndex=-1 helpid="35465"
helpfile=msoe.hlp>
Z<U>a</U>rovnßnφ:
</LABEL>
</DIV>
<SELECT size=1 ID=selAlignment tabIndex=20 ACCESSKEY=a
style="font-family: MS Shell Dlg; font-size: 8pt; position: absolute;
left: 6.8em; top: 8.8em; width: 10.7em; height: 1.2em; "
helpid="35465" helpfile=msoe.hlp>
<OPTION id=optNotSet value=""> Nenastaveno </OPTION>
<OPTION id=optLeft value=left> Vlevo</OPTION>
<OPTION id=optRight value=right> Vpravo</OPTION>
<OPTION id=optTexttop value=textTop> K hornφmu okraji textu </OPTION>
<OPTION id=optAbsMiddle value=absMiddle> Zcela na st°ed </OPTION>
<OPTION id=optBaseline value=baseline SELECTED> Na zßkladnu </OPTION>
<OPTION id=optAbsBottom value=absBottom> Zcela dol∙ </OPTION>
<OPTION id=optBottom value=bottom> Bottom </OPTION>
<OPTION id=optMiddle value=middle> Middle </OPTION>
<OPTION id=optTop value=top> Top </OPTION>
</SELECT>
<DIV id=divHoriz style="font-family: MS Shell Dlg; font-size: 8pt; position: absolute;
left: 19.8em; top: 9.1em; width: 4.7em; height: 1.2em; ">
<LABEL id=lblHorizontal FOR=txtHorizontal tabIndex=-1 helpid="35475"
helpfile=msoe.hlp>
<U>V</U>odorovn∞:
</LABEL>
</DIV>
<INPUT ID=txtHorizontal style="font-family: MS Shell Dlg; font-size: 8pt; position: absolute;
left: 25.9em; top: 8.8em; width: 3.2em; height: 2.1em; ime-mode: disabled;"
type=text size=3 value="" tabIndex=25 ACCESSKEY=v
helpid="35475" helpfile=msoe.hlp>
<DIV id=divBorder style="font-family: MS Shell Dlg; font-size: 8pt; position: absolute;
left: 1.8em; top: 12em; width: 8.1em; height: 1.2em; ">
<LABEL id=lblBorder tabIndex=-1 FOR=txtBorder helpid="35470"
helpfile=msoe.hlp>
<u>T</U>louܥka okraje:
</LABEL>
</DIV>
<INPUT ID=txtBorder style="font-family: MS Shell Dlg; font-size: 8pt; position: absolute;
left: 9.4em; top: 11.7em; width: 8.1em; height: 2.1em; ime-mode: disabled;"
type=text size=3 value="" tabIndex=21 ACCESSKEY=t
helpid="35470" helpfile=msoe.hlp>
<DIV id=divVert style="font-family: MS Shell Dlg; font-size: 8pt; position: absolute;
left: 19.8em; top: 12em; width: 3.6em; height: 1.2em; ">
<LABEL id=lblVertical FOR=txtVertical tabIndex=-1 helpid="35480"
helpfile=msoe.hlp>
<U>S</U>visle:
</LABEL>
</DIV>
<INPUT ID=txtVertical style="font-family: MS Shell Dlg; font-size: 8pt; position: absolute;
left: 25.9em; top: 11.5em; width: 3.2em; height: 2.1em; ime-mode: disabled;"
type=text size=3 value="" tabIndex=30 ACCESSKEY=s
helpid="35480" helpfile=msoe.hlp>
<BUTTON ID=btnOK style="font-family: MS Shell Dlg; font-size: 8pt; position: absolute;
left: 31.3em; top: 1em; width: 7em; height: 2.2em; " type=submit
tabIndex=40 DISABLED=1 helpid="28443" helpfile="windows.hlp">
OK
</BUTTON>
<BUTTON ID=btnCancel style="font-family: MS Shell Dlg; font-size: 8pt; position: absolute;
left: 31.3em; top: 3.6em; width: 7em; height: 2.2em; " type=reset
tabIndex=45 helpid="28444" helpfile="windows.hlp">
Storno
</BUTTON>
</BODY>
</HTML>