📄 mcprintx.htm
字号:
<HTML XMLNS:IE>
<HEAD>
<META HTTP-EQUIV="MSThemeCompatible" CONTENT="Yes">
<!-- TriPrint (c) 2000-2004 by MeadCo Limited <scriptx@meadroid.com> -->
<object id="printx" classid="clsid:1663ed6a-23eb-11d2-b92f-008048fdd814" viewastext>
<param name="__PX__template" value="true">
</object>
<!-- TriPrint -->
<!-- Change Log --
------------------------------------------------------------
if ( IsPersistedDoc()
&& ( !oTargetFrame.src /* captain: oTargetFrame.src check */
|| oTargetFrame.src == "res://SHDOCLC.DLL/printnof.htm"
|| oTargetFrame.src == "about:blank" ))
------------------------------------------------------------
if (!strSrc /* captain: strSrc check */
|| strSrc == "res://SHDOCLC.DLL/printnof.htm")
------------------------------------------------------------
// captain: "Math.max" safety checks
var top = Math.max(Printer.marginTop / 100, 0);
...
------------------------------------------------------------
var docToPrint = this._aaRect[1][0].contentDocument; // captain: use document.title
if (Printer.startDoc(docToPrint.title? docToPrint.title: docToPrint.URL))
------------------------------------------------------------
-->
<!-- changes by MeadCo::Pete Cole --
onLoadBody() calls window.setTimeout("printx.PreviewLayoutComplete()",10) for
Zeepe host integration.
Changes for XP SP2 Compatibility.
-->
<?import namespace="ie" implementation="#default">
<TITLE>Print Preview</TITLE>
<STYLE>
.divPage
{
position: absolute;
top: -20000px;
border-left: 1 solid black;
border-top: 1 solid black;
border-right: 4 solid black;
border-bottom: 4 solid black;
}
.page
{
background: white;
width: 8.5in;
height: 11in;
margin: 0px;
overflow: hidden;
}
.mRect
{
position: absolute;
margin: 1in;
width: 6.5in;
height: 9in;
border: none;
overflow : hidden;
}
.divHead
{
position: absolute;
overflow: hidden;
top: 0in;
left: 0in;
width: 8.5in;
}
.divFoot
{
position: absolute;
overflow: hidden;
bottom: 0in;
left: 0in;
width: 8.5in;
}
BODY { overflow: hidden; padding: 0; margin: 0; background: threedface; }
TABLE { margin: 0px; padding: 0px; background: threedface; }
.THeader { border: none; background: white; color: black; }
.TFooter { border: none; background: white; color: black; }
TD { padding: 0; margin: 0; border: none; }
TD.UIPane { width: 20px; border: none; font-family: 'ms sans serif'; font-size: 8pt; }
TD.UISeparator { width: 1px; border-left: 2px threedhighlight ridge; }
BUTTON { border: 1px solid threedface; background: threedface; font-family: 'ms sans serif'; font-size: 8pt; color: buttontext;}
</STYLE>
<SCRIPT DEFER>
var g_aDocTree = new Object();
var g_nDispPage = -1;
var g_nZoomFactor = 0;
var g_cLeftToPrint = 0;
var g_fRTL;
var g_fPreview;
var g_fDelayClose = false;
var g_nMarginTop = 0;
var g_nMarginBottom = 0;
var g_nMarginLeft = 0;
var g_nMarginRight = 0;
var g_nPageWidth = 0;
var g_nPageHeight = 0;
var g_nUnprintTop = 0;
var g_nUnprintBottom = 0;
var g_strHeader = "";
var g_strFooter = "";
var g_fTableOfLinks = false;
var g_cPagesDisplayed = 0;
var g_cxDisplaySlots = 1;
var g_cyDisplaySlots = 1;
var g_imgUnderMouse = null;
var g_nFramesetLayout = 0;
var g_strActiveFrame = null;
var g_nTotalPages = 0;
var g_nDocsToCalc = 0;
var g_nFramesLeft = 0;
function GetRuleFromSelector(strSelector)
{
var i;
var oRule;
var oSS = document.styleSheets[0];
for (i=0;;i++)
{
oRule = oSS.rules[i];
if (oRule == null)
break;
if (oRule.selectorText == strSelector)
break;
}
return oRule;
}
function UnprintableURL(strLink)
{
var fUnprintable = false;
var cIndex;
cIndex = strLink.indexOf(":");
switch (cIndex)
{
case 4:
if (strLink.substr(0, cIndex) == "news")
fUnprintable = true;
break;
case 5:
if (strLink.substr(0, cIndex) == "snews")
fUnprintable = true;
break;
case 6:
if ( strLink.substr(0, cIndex) == "telnet"
|| strLink.substr(0, cIndex) == "mailto")
fUnprintable = true;
break;
case 8:
if (strLink.substr(0,cIndex) == "vbscript")
fUnprintable = true;
break;
case 10:
if (strLink.substr(0,cIndex) == "javascript")
fUnprintable = true;
break;
}
return fUnprintable;
}
function OnKeyPress()
{
if (event.keyCode == 27)
{
Close();
}
}
function OnKeyDown()
{
if (event.altKey)
{
switch (event.keyCode)
{
case 37:
ChangeDispPage(g_nDispPage-1);
break;
case 39:
ChangeDispPage(g_nDispPage+1);
break;
case 107:
case 187:
HandleZoom(-1);
break;
case 109:
case 189:
HandleZoom(1);
break;
case 35:
HandleLastPage();
break;
case 36:
HandleFirstPage();
break;
}
}
}
function ShowHelp()
{
window.showHelp("iexplore.chm::/print_preview.htm");
}
function AttachDialogEvents()
{
butPrint.onclick = HandlePrintClick;
butPageSetup.onclick = HandlePageSetup;
butFirstPage.onclick = HandleFirstPage;
butBackPage.onclick = HandleBackPage;
butNextPage.onclick = HandleForwardPage;
butLastPage.onclick = HandleLastPage;
butZoomIn.onclick = HandleZoomInButton;
butZoomOut.onclick = HandleZoomOutButton;
butClose.onclick = Close;
butHelp.onclick = ShowHelp;
document.onhelp = ShowHelp;
butPrint.onmousedown = buttonDown;
butPageSetup.onmousedown = buttonDown;
butFirstPage.onmousedown = buttonDown;
butBackPage.onmousedown = buttonDown;
butNextPage.onmousedown = buttonDown;
butLastPage.onmousedown = buttonDown;
butZoomIn.onmousedown = buttonDown;
butZoomOut.onmousedown = buttonDown;
butClose.onmousedown = buttonDown;
butHelp.onmousedown = buttonDown;
printCtl.onmouseover = buttonOver;
printCtl.onmouseout = buttonOut;
begin.onmouseover = buttonOver;
begin.onmouseout = buttonOut;
prev.onmouseover = buttonOver;
prev.onmouseout = buttonOut;
next.onmouseover = buttonOver;
next.onmouseout = buttonOut;
end.onmouseover = buttonOver;
end.onmouseout = buttonOut;
zoomIn.onmouseover = buttonOver;
zoomIn.onmouseout = buttonOut;
zoomOut.onmouseover = buttonOver;
zoomOut.onmouseout = buttonOut;
butPrint.onmouseover = new Function("buttonRaise(this);");
butPrint.onmouseout = new Function("buttonLower(this);");
butClose.onmouseover = new Function("buttonRaise(this);");
butClose.onmouseout = new Function("buttonLower(this);");
butHelp.onmouseover = new Function("buttonRaise(this);");
butHelp.onmouseout = new Function("buttonLower(this);");
inputPageNum.onkeypress = HandleInputKeyPress;
inputPageNum.onchange = HandlePageSelect;
selectZoom.onchange = HandleZoomSelect;
selectFrameset.onchange = HandleFramesetSelect;
window.onresize = OnResizeBody;
window.onerror = HandleError;
window.onfocus = new Function("MasterContainer.focus()");
document.body.onkeypress = OnKeyPress;
document.body.onkeydown = OnKeyDown;
}
function OnLoadBody()
{
g_fRTL = (document.body.currentStyle.direction.toLowerCase() == "rtl");
g_fPreview = dialogArguments.__IE_PrintType == "Preview";
if (UnprintableURL(dialogArguments.__IE_ContentDocumentUrl))
{
var L_Invalid_Text = "Unable to print URL. Please navigate directly to this page and select Print.";
alert(L_Invalid_Text);
window.close();
}
var str;
str = begin.src;
begin.base = str.slice(str.lastIndexOf("/")+1,str.indexOf("_"));
str = end.src;
end.base = str.slice(str.lastIndexOf("/")+1,str.indexOf("_"));
str = next.src;
next.base = str.slice(str.lastIndexOf("/")+1,str.indexOf("_"));
str = prev.src;
prev.base = str.slice(str.lastIndexOf("/")+1,str.indexOf("_"));
ChangeZoom(75);
if (dialogArguments.__IE_HeaderString)
Printer.header = dialogArguments.__IE_HeaderString
if (dialogArguments.__IE_FooterString)
Printer.footer = dialogArguments.__IE_FooterString
EnsureDocuments();
window.document.body.style.cursor="wait";
CreateDocument("document", "C", true);
ChangeDispPage(1);
g_nFramesLeft = 1;
OnBuildAllFrames("C");
if (g_fPreview)
{
AttachDialogEvents();
OverflowContainer.style.top = idDivToolbar.offsetHeight;
OverflowContainer.style.height = document.body.clientHeight - idDivToolbar.offsetHeight;
window.setTimeout("printx.PreviewLayoutComplete()",10);
}
else
{
PrintNow(dialogArguments.__IE_PrintType == "Prompt");
}
}
function BuildAllFramesComplete()
{
;
window.document.body.style.cursor="auto";
UpdateFramesetSelect();
}
function CalcDocsComplete()
{
;
if (g_nFramesetLayout == 2)
{
ChangeFramesetLayout(g_nFramesetLayout, true)
}
}
function OnResizeBody()
{
OverflowContainer.style.height = Math.max(0, document.body.clientHeight - idDivToolbar.offsetHeight);
HandleDynamicZoom();
PositionPages(g_nDispPage);
}
function HandleError(message, url, line)
{
var L_Internal_ErrorMessage = "There was an internal error, and Internet Explorer is unable to print this document.";
alert(L_Internal_ErrorMessage);
window.close();
return true;
}
function OnRectComplete( strDoc )
{
if (!g_aDocTree[strDoc])
{
HandleError("Document " + strDoc + " does not exist.", document.URL, "OnRectComplete");
return;
}
window.setTimeout("OnRectCompleteNext('" + strDoc + "', " + event.contentOverflow + ",'" + event.srcElement.id + "');", 25);
}
function OnRectCompleteNext( strDoc, fOverflow, strElement)
{
g_aDocTree[strDoc].RectComplete(fOverflow, strElement);
}
function enableButton(btn, img)
{
btn.disabled = false;
if (g_imgUnderMouse == img)
{
img.src = img.base + "_hilite.gif";
buttonRaise(btn);
}
else
{
img.src = img.base + ".gif";
buttonLower(btn);
}
}
function disableButton(btn, img)
{
btn.disabled = true;
buttonLower(btn);
if (img != null)
{
img.src = img.base + "_inactive.gif";
}
}
function updateNavButtons()
{
if (g_nDispPage == 1)
{
disableButton(butFirstPage, begin);
disableButton(butBackPage, prev);
}
else
{
enableButton(butFirstPage, begin);
enableButton(butBackPage, prev);
}
if (TotalDisplayPages() - g_nDispPage < g_cxDisplaySlots * g_cyDisplaySlots)
{
disableButton(butNextPage, next);
disableButton(butLastPage, end);
}
else
{
enableButton(butNextPage, next);
enableButton(butLastPage, end);
}
}
function updateZoomButtons()
{
var fZoomOutDisabled = false;
var fZoomInDisabled = false;
var oOptions = selectZoom.options;
if (g_nZoomFactor >= parseInt(oOptions[0].value))
{
disableButton(butZoomIn, null);
zoomIn.src = "zoom_inactive.gif";
fZoomInDisabled = true;
}
else if (g_nZoomFactor <= parseInt(oOptions[oOptions.length-1-3].value))
{
disableButton(butZoomOut, null);
zoomOut.src = "zoom_inactive.gif";
fZoomOutDisabled = true;
}
if (!fZoomOutDisabled)
{
enableButton(butZoomOut, zoomOut);
}
if (!fZoomInDisabled)
{
enableButton(butZoomIn, zoomIn);
}
}
function UpdateFramesetSelect()
{
if ( g_aDocTree["C"]._fFrameset )
{
if (!g_strActiveFrame)
{
selectFrameset.options.remove(1);
}
separatorFrameset.style.display = "inline";
cellFrameset.style.display = "inline";
}
}
function getPageWidth()
{
return g_aDocTree["C"].Page(1).offsetWidth;
}
function getPageHeight()
{
return g_aDocTree["C"].Page(1).offsetHeight;
}
function UndisplayPages()
{
while (g_cPagesDisplayed > 0)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -