📄 mcprintx.htm
字号:
function CPrintDoc_AddPage()
{
var newHTM = "";
var aPage = this._aaPage[this._nStatus];
var aRect = this._aaRect[this._nStatus];
;
(this._acPage[this._nStatus])++;
HeadFoot.URL = this.EnsureURL();
HeadFoot.title = this.EnsureTitle();
HeadFoot.pageTotal = this.Pages();
HeadFoot.page = HeadFoot.pageTotal;
if (this._acPage[this._nStatus] <= aPage.length)
{
var oPage = aPage[this._acPage[this._nStatus] - 1];
oPage.children("header").innerHTML = HeadFoot.HtmlHead;
oPage.children("footer").innerHTML = HeadFoot.HtmlFoot;
}
else
{
newHTM = "<DIV class=divPage><IE:DeviceRect media=\"print\" class=page id=mDiv" + this._nStatus + this._strDoc + "p" + aPage.length + ">";
newHTM += "<IE:LAYOUTRECT id=mRect" + this._nStatus + this._strDoc + "p" + aRect.length;
newHTM += " class=mRect nextRect=mRect" + this._nStatus + this._strDoc + "p" + (aRect.length + 1);
newHTM += " onlayoutcomplete=OnRectComplete('" + this._strDoc + "')";
newHTM += " tabindex=-1 onbeforefocusenter='event.returnValue=false;' ";
newHTM += " /><DIV class=divHead id=header>";
newHTM += HeadFoot.HtmlHead;
newHTM += "</DIV><DIV class=divFoot id=footer>";
newHTM += HeadFoot.HtmlFoot;
newHTM += " </DIV></IE:DeviceRect></DIV>";
MasterContainer.insertAdjacentHTML("beforeEnd", newHTM);
aPage[aPage.length] = eval( "document.all.mDiv" + this._nStatus + this._strDoc + "p" + aPage.length);
aRect[aRect.length] = eval("document.all.mRect" + this._nStatus + this._strDoc + "p" + aRect.length);
}
}
function CPrintDoc_AddFirstPage()
{
this._acPage[this._nStatus] = 0;
if (this._anMerge[this._nStatus] == 0)
{
this.AddPage();
}
else
{
var aRect = this._aaRect[this._nStatus];
var oPage = this._aaPage[this._nStatus - 1][this._acPage[this._nStatus - 1] - 1];
var oTop = this._aaRect[this._nStatus - 1][this._acPage[this._nStatus - 1] + this._anMerge[this._nStatus - 1] - 1];
var nTop = oTop.offsetTop + oTop.scrollHeight;
var nHeight = oTop.clientHeight - oTop.scrollHeight;
;
;
if (aRect.length > 0)
{
var oNode = aRect[0];
oNode.style.marginTop = nTop + "px";
oNode.style.pixelHeight = nHeight;
if (oNode.parentElement != oPage)
oPage.insertBefore(oNode);
}
else
{
var newHTM;
var oNode;
newHTM = "<IE:LAYOUTRECT id=mRect" + this._nStatus + this._strDoc + "p0";
newHTM += " class=mRect nextRect=mRect" + this._nStatus + this._strDoc + "p1";
newHTM += " onlayoutcomplete=OnRectComplete('" + this._strDoc + "')";
newHTM += " tabindex=-1 onbeforefocus='event.returnValue=false;' />";
oPage.insertAdjacentHTML("beforeEnd", newHTM);
oNode = eval("document.all.mRect" + this._nStatus + this._strDoc + "p0");
aRect[0] = oNode;
oNode.style.marginTop = nTop + "px";
oNode.style.height = nHeight + "px";
}
}
}
function CPrintDoc_InitDocument( fUseStreamHeader )
{
var fReallyUseStreamHeader = (fUseStreamHeader && (dialogArguments.__IE_OutlookHeader != null));
this._anMerge[1] = (fReallyUseStreamHeader) ? 1 : 0;
this._nStatus = (fReallyUseStreamHeader) ? 0 : 1;
this.AddFirstPage();
this._aaRect[this._nStatus][0].contentSrc = (fReallyUseStreamHeader)
? dialogArguments.__IE_OutlookHeader
: this._strDocURL;
}
function CPrintDoc_PrintAllSubDocuments( fRecursionOK )
{
if (!this._aDoc)
return;
var nDocs = this._aDoc.length;
var i;
g_cLeftToPrint += nDocs;
for (i = 0; i < nDocs; i++)
{
PrintSentinel(this._aDoc[i]._strDoc, fRecursionOK);
}
}
function CPrintDoc_BuildAllLinkedDocuments()
{
var strURL = this._aaRect[1][0].contentDocument.URL;
var aLinks = this._aaRect[1][0].contentDocument.links;
var nLinks = aLinks.length;
var i;
var j;
var strLink;
for (i = 0; i < nLinks; i++)
{
strLink = aLinks[i].href;
if ( (strURL == strLink)
|| UnprintableURL(strLink) )
continue;
for (j = 0; j < i; j++)
{
if (strLink == aLinks[j].href)
break;
}
if (j < i)
continue;
this.CreateSubDocument(strLink, false);
}
}
function OnBuildAllFrames( strDoc )
{
if ( !g_aDocTree[strDoc]
|| !g_aDocTree[strDoc]._aaRect[1][0]
|| !g_aDocTree[strDoc]._aaRect[1][0].contentDocument.body)
{
window.setTimeout("OnBuildAllFrames('" + strDoc + "');", 100);
return;
}
g_aDocTree[strDoc].BuildAllFrames();
}
function IsPersistedDoc()
{
return (!!g_aDocTree["C"]._aaRect[1][0].contentDocument.all.tags("HTML")[0].__IE_DisplayURL);
}
function CPrintDoc_BuildAllFrames()
{
var aFrames = this._aaRect[1][0].contentDocument.all.tags("FRAME");
var nFrames = aFrames.length;
var nActive = parseInt(this._aaRect[1][0].contentDocument.all.tags("HTML").item(0).__IE_ActiveFrame);
var i;
var strSrc;
var strDoc;
if (nFrames > 0)
this._fFrameset = true;
for (i = 0; i < nFrames; i++)
{
strSrc = aFrames[i].src;
if (!strSrc /* captain: strSrc check */
|| strSrc == "res://SHDOCLC.DLL/printnof.htm")
continue;
strDoc = this.CreateSubDocument(strSrc, true);
if (i == nActive)
g_strActiveFrame = strDoc;
g_nFramesLeft++;
OnBuildAllFrames(strDoc);
}
g_nFramesLeft--;
if (g_nFramesLeft <= 0)
BuildAllFramesComplete();
}
function CPrintDoc_CreateSubDocument( docURL, fUseStreamHeader )
{
if (!this._aDoc)
this._aDoc = new Array();
var nDoc = this._aDoc.length;
var strDoc = this._strDoc + "_" + nDoc;
CreateDocument(docURL, strDoc, fUseStreamHeader);
this._aDoc[nDoc] = g_aDocTree[strDoc];
return (strDoc);
}
function CPrintDoc_AddTableOfLinks()
{
;
if (!g_fTableOfLinks)
{
this._nStatus = 3;
ChangeDispPage(g_nDispPage);
this.FixupHF();
}
else
{
var oTableOfLinks = BuildTableOfLinks(this._aaRect[1][0].contentDocument);
if (oTableOfLinks != null)
{
var oBody = oTableOfLinks.body;
this.AddFirstPage()
this._aaRect[this._nStatus][0].contentSrc = oBody.document;
}
else
{
this._nStatus = 3;
ChangeDispPage(g_nDispPage);
this.FixupHF();
}
}
}
function OnTickHF( strDoc )
{
if (!g_aDocTree[strDoc])
{
HandleError("Document " + strDoc + " does not exist.", document.URL, "OnRectComplete");
return;
}
g_aDocTree[strDoc].TickHF();
}
function CPrintDoc_TickHF()
{
var i, j;
var iTo, jTo;
var aTok;
var oTok;
var nStartPage = this._nNextHF;
var cPages = this.Pages();
iTo = nStartPage + 2;
if (iTo > cPages)
iTo = cPages;
for (i = nStartPage; i <= iTo; i++)
{
aTok = this.Page(i).children[0].getElementsByTagName("SPAN");
for (j=0, jTo = aTok.length; j < jTo; j++)
{
oTok = aTok[j];
if (oTok.className == "hfPageTotal")
oTok.innerText = cPages;
else if ( oTok.className == "hfUrl"
&& oTok.innerText == "" )
oTok.innerText = this.EnsureURL();
else if ( oTok.className == "hfTitle"
&& oTok.innerText == "" )
oTok.innerText = this.EnsureTitle();
}
}
this._nNextHF = i;
if (iTo == cPages)
{
this._nStatus = 4;
if (--g_nDocsToCalc == 0)
CalcDocsComplete();
}
else
{
this._nTimerHF = window.setTimeout("OnTickHF('" + this._strDoc + "');", 250);
}
}
function CPrintDoc_FixupHF()
{
;
this.TickHF();
}
function CPrintDoc_Pages()
{
var i;
var c;
for (i = 0, c = 0; i < 3; i++)
{
c += this._acPage[i];
}
return c;
}
function CPrintDoc_Page(nPage)
{
var i;
var n = nPage;
if (n <= 0)
return null;
for (i = 0; i < 3; i++)
{
if (n <= this._acPage[i])
return this._aaPage[i][n - 1].parentElement;
n -= this._acPage[i];
}
return null;
}
function CPrintDoc_EnsureURL()
{
if (this._strURL == null)
{
if ( this._aaRect[1][0]
&& this._aaRect[1][0].contentDocument)
{
this._strURL = this._aaRect[1][0].contentDocument.URL;
}
if (this._strURL == null)
return "";
}
return this._strURL;
}
function CPrintDoc_EnsureTitle()
{
if (this._strTitle == null)
{
if ( this._aaRect[1][0]
&& this._aaRect[1][0].contentDocument)
{
this._strTitle = this._aaRect[1][0].contentDocument.title;
}
if (this._strTitle == null)
return "";
}
return this._strTitle;
}
function CPrintDoc_ResetDocument()
{
var i;
for (i = 0; i < 3; i++)
{
this._acPage[i] = 0;
if (this._aaRect[i][0])
this._aaRect[i][0].contentSrc = "";
}
this.StopFixupHF();
}
function CPrintDoc_ResetTableOfLinks()
{
if (this._nStatus <= 2)
return;
this.StopFixupHF();
this._nStatus = 2;
this.AddTableOfLinks();
}
function CPrintDoc_StopFixupHF()
{
if (this._nTimerHF != -1)
window.clearTimeout(this._nTimerHF);
this._nTimerHF = -1;
this._nNextHF = 1;
}
function CPrintDoc( nDocNum, strDocURL )
{
var i;
this._aDoc = null;
this._strDoc = nDocNum;
this._strDocURL = strDocURL;
this._nStatus = 0;
this._aaPage = new Array(3);
this._aaRect = new Array(3);
this._acPage = new Array(3);
this._anMerge = new Array(3);
for (i=0; i<3; i++)
{
this._aaPage[i] = new Array();
this._aaRect[i] = new Array();
this._acPage[i] = 0;
this._anMerge[i] = 0;
}
this._nNextHF = 1;
this._nTimerHF = -1;
this._strURL = null;
this._strTitle = null;
this._fFrameset = false;
this._nStartingPage = 0;
}
CPrintDoc.prototype.RectComplete = CPrintDoc_RectComplete;
CPrintDoc.prototype.AddPage = CPrintDoc_AddPage;
CPrintDoc.prototype.AddFirstPage = CPrintDoc_AddFirstPage;
CPrintDoc.prototype.AddTableOfLinks = CPrintDoc_AddTableOfLinks;
CPrintDoc.prototype.FixupHF = CPrintDoc_FixupHF;
CPrintDoc.prototype.StopFixupHF = CPrintDoc_StopFixupHF;
CPrintDoc.prototype.TickHF = CPrintDoc_TickHF;
CPrintDoc.prototype.InitDocument = CPrintDoc_InitDocument;
CPrintDoc.prototype.ResetDocument = CPrintDoc_ResetDocument;
CPrintDoc.prototype.ResetTableOfLinks = CPrintDoc_ResetTableOfLinks;
CPrintDoc.prototype.BuildAllLinkedDocuments = CPrintDoc_BuildAllLinkedDocuments;
CPrintDoc.prototype.BuildAllFrames = CPrintDoc_BuildAllFrames;
CPrintDoc.prototype.CreateSubDocument = CPrintDoc_CreateSubDocument;
CPrintDoc.prototype.Print = CPrintDoc_Print;
CPrintDoc.prototype.PrintAllSubDocuments = CPrintDoc_PrintAllSubDocuments;
CPrintDoc.prototype.ReadyToPrint = CPrintDoc_ReadyToPrint;
CPrintDoc.prototype.Page = CPrintDoc_Page;
CPrintDoc.prototype.Pages = CPrintDoc_Pages;
CPrintDoc.prototype.EnsureURL = CPrintDoc_EnsureURL;
CPrintDoc.prototype.EnsureTitle = CPrintDoc_EnsureTitle;
</SCRIPT>
<base href="res://SHDOCLC.DLL/">
</HEAD>
<BODY onload="setTimeout('OnLoadBody()', 400);">
<!-- Controls for printing -->
<IE:TemplatePrinter id=Printer />
<IE:HeaderFooter id=HeadFoot />
<DIV id=idDivToolbar style="width:100%; overflow:hidden;">
<DIV style="width=100%; border:'thin threedhighlight groove';">
<TABLE><TR>
<TD class="UIPane"> <BUTTON id="butPrint" title="Print Document (Alt+P)" accesskey=p><U>P</U>rint...</BUTTON></TD>
<TD class="UISeparator"><IMG width=0 height=0></TD>
<TD class="UIPane"> <BUTTON id="butPageSetup" accesskey=u><IMG id="printCtl" src="printctl.gif" alt="Page Setup (Alt+U)"></BUTTON></TD>
<TD class="UISeparator"><IMG width=0 height=0></TD>
<TD class="UIPane"> <BUTTON id="butFirstPage"><IMG id="begin" src="begin_inactive.gif" alt="First Page (Alt+Home)"></BUTTON></TD>
<TD class="UIPane"> <BUTTON id="butBackPage"> <IMG id="prev" src="prev_inactive.gif" alt="Previous Page (Alt+LeftArrow)"></BUTTON></TD>
<TD class="UIPane"><SPAN style="color:windowtext;"><NOBR Loc> <ID id=idTdPageXofYLocText1>P<U>a</U>ge</ID> <INPUT type=text id="inputPageNum" title="Preview Page (Alt+A)" value="1" style="height:1.5em; width: 2em; color:windowtext;" accesskey=a><ID id=idTdPageXofYLocText2> of </ID><SPAN id="spanPageTotal"></SPAN>
</SPAN></NOBR></TD>
<TD class="UIPane"> <BUTTON id="butNextPage"> <IMG id="next" src="next_inactive.gif" alt="Next Page (Alt+RightArrow)"></BUTTON></TD>
<TD class="UIPane"> <BUTTON id="butLastPage"> <IMG id="end" src="end_inactive.gif" alt="Last Page (Alt+End)"></BUTTON></TD>
<TD class="UISeparator"><IMG width=0 height=0></TD>
<TD class="UIPane"> <BUTTON id="butZoomOut"> <IMG id="zoomOut" base="zoomOut" src="zoomout.gif" alt="Zoom Out (Alt+Minus)"></BUTTON></TD>
<TD class="UIPane"> <BUTTON id="butZoomIn"> <IMG id="zoomIn" base="zoomIn" src="zoomin.gif" alt="Zoom In (Alt+Plus)"></BUTTON></TD>
<TD class="UIPane"> <SELECT id="selectZoom" accesskey=z>
<OPTION VALUE="500" >500%
<OPTION VALUE="200" >200%
<OPTION VALUE="150" >150%
<OPTION VALUE="100" >100%
<OPTION VALUE="75" SELECTED >75%
<OPTION VALUE="50" >50%
<OPTION VALUE="25" >25%
<OPTION VALUE="10" >10%
<!-- ID's are for localization -->
<OPTION VALUE=-1 id="idPageWidth">Page Width</OPTION>
<OPTION VALUE=-2 id="idWholePage">Whole Page</OPTION>
<OPTION VALUE=-3 id="idTwoPages" >Two Pages </OPTION>
</SELECT></TD>
<TD class="UISeparator" id="separatorFrameset" style="display:none"><IMG width=0 height=0></TD>
<TD class="UIPane" id="cellFrameset" style="display:none"> <SELECT id="selectFrameset" accesskey=f>
<OPTION VALUE=0 id="idLaidOut">As laid out on screen</OPTION>
<OPTION VALUE=1 id="idSelected">Only the selected frame</OPTION>
<OPTION VALUE=2 id="idSeparate">All frames individually</OPTION>
</SELECT></TD>
<TD class="UISeparator"><IMG width=0 height=0></TD>
<TD class="UIPane"> <BUTTON id="butHelp" title="Print Preview Help (Alt+H)" accesskey=h><U>H</U>elp</BUTTON></TD>
<TD class="UISeparator"><IMG width=0 height=0></TD>
<TD class="UIPane"> <BUTTON id="butClose" title="Close Print Preview (Alt+C)" accessKey=c><U>C</U>lose</BUTTON></TD>
</TR></TABLE>
</DIV>
</DIV>
<DIV id=OverflowContainer onclick="this.focus();" onfocus="butPrint.scrollIntoView();" tabindex=1 style="position:absolute; left:0; width:100%; overflow:auto; border:'thin threedhighlight inset'; background:threedshadow;">
<DIV id=MasterContainer tabindex=0 style="width:100%; position:absolute;">
<!-- Pages go here -->
</DIV>
</DIV>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -