?? script.js
字號:
function LoadSld()
{
var sld=GetObj("SlideObj")
if( !g_supportsPPTHTML ) {
sld.style.visibility="visible"
return
}
if( MakeNotesVis() ) return
runAnimations = _InitAnimations();
if( IsWin("PPTSld") )
parent.SldUpdated(GetSldId())
g_origSz=parseInt(SlideObj.style.fontSize)
g_origH=sld.style.posHeight
g_origW=sld.style.posWidth
g_scaleHyperlinks=(document.all.tags("AREA").length>0)
if( g_scaleHyperlinks )
InitHLinkArray()
if( g_scaleInFrame||(IsWin("PPTSld") && parent.IsFullScrMode() ) )
document.body.scroll="no"
_RSW()
if( IsWin("PPTSld") && parent.IsFullScrMode() )
FullScrInit();
MakeSldVis();
ChkAutoAdv()
if( runAnimations )
{
if( document.all("NSPlay") )
document.all("NSPlay").autoStart = false;
if( sld.filters && sld.filters.revealtrans )
setTimeout( "document.body.start()", sld.filters.revealtrans.duration * 1000 );
else
document.body.start();
}
}
function MakeSldVis()
{
var fTrans=g_showAnimation && SldHasTrans()
if( fTrans )
{
if( g_bgSound ) {
idx=g_bgSound.indexOf(",");
pptSound.src=g_bgSound.substr( 0, idx );
pptSound.loop= -(parseInt(g_bgSound.substr(idx+1)));
}
SlideObj.filters.revealtrans.Apply()
}
SlideObj.style.visibility="visible"
if( fTrans )
SlideObj.filters.revealtrans.Play()
}
function MakeNotesVis()
{
if( !IsNts() ) return false
SlideObj.style.display="none"
nObj = document.all.item("NotesObj")
parent.SetHasNts(0)
if( nObj ) {
nObj.style.display=""
parent.SetHasNts(1)
}
return 1
}
function ChkAutoAdv()
{
if(SldHasTrans())
SlideObj.onfilterchange=AutoAdv
else
AutoAdv()
}
function AutoAdv()
{
if(!IsWin("PPTSld") || !gUseSldTimings )return
var sld=GetCurSld()
if( (sld.mAdvDelay>0) && !parent.IsFramesMode() )
setTimeout("parent.GoToNextSld()",sld.mAdvDelay)
}
function GetObj(id)
{
if(g_supportsPPTHTML) return document.all(id);
else return document.getElementById(id);
}
function SldHasTrans() { return SlideObj.style.getAttribute("filter")!="" }
function GetSldId() { return sId=location.href.substring(location.href.lastIndexOf('/')+1) }
function HideMenu() { if( frames["PPTSld"] && PPTSld.document.all.item("ctxtmenu") && PPTSld.ctxtmenu.style.display!="none" ) { PPTSld.ctxtmenu.style.display='none'; return true } return false }
function IsWin( name ) { return window.name == name }
function IsNts() { return IsWin("PPTNts") }
function IsSldOrNts() { return( IsWin("PPTSld")||IsWin("PPTNts") ) }
function SupportsPPTAnimation() { return( navigator.platform == "Win32" && navigator.appVersion.indexOf("Windows")>0 ) }
function SupportsPPTHTML()
{
var appVer=navigator.appVersion, msie=appVer.indexOf("MSIE "), ver=0
if( msie >= 0 )
ver=parseFloat( appVer.substring( msie+5, appVer.indexOf(";",msie) ) )
else
ver=parseInt(appVer)
return( ver >= 4 && msie >= 0 )
}
function _RSW()
{
if( !g_supportsPPTHTML || IsNts() ||
( !g_scaleInFrame && (!IsWin("PPTSld") || !parent.IsFullScrMode()) ) )
return
var padding=0;
if( IsWin("PPTSld") && parent.IsFramesMode() ) padding=6
cltWidth=document.body.clientWidth-padding
cltHeight=document.body.clientHeight-padding
factor=(1.0*cltWidth)/g_origW
if( cltHeight < g_origH*factor )
factor=(1.0*cltHeight)/g_origH
newSize = g_origSz * factor
if( newSize < 1 ) newSize=1
s=SlideObj.style
s.fontSize=newSize+"px"
s.posWidth=g_origW*factor
s.posHeight=g_origH*factor
s.posLeft=(cltWidth-s.posWidth+padding)/2
s.posTop=(cltHeight-s.posHeight+padding)/2
if( g_scaleHyperlinks )
ScaleHyperlinks( factor )
}
function _InitAnimations()
{
animRuntimeInstalled = ''+document.body.localTime != 'undefined';
isFullScreen = (window.name == "PPTSld") && !parent.IsFramesMode();
g_animUseRuntime = g_showAnimation && animRuntimeInstalled && !(isFullScreen && parent.IsSldVisited());
if( g_animUseRuntime ) {
collSeq = document.all.tags("seq");
if( collSeq != null ) {
for(ii=0;ii<collSeq.length;ii++) {
if( collSeq[ii].getAttribute( "p:nodeType" ) == "mainSeq" ) {
g_animMainSequence = collSeq[ii];
break;
}
}
}
if( g_animItemsToHide ) {
for(jj = 0; jj < g_animItemsToHide.length; jj++) {
if( hideObj = GetObj(g_animItemsToHide[jj]) )
hideObj.runtimeStyle.visibility="hidden";
}
}
if( g_animInteractiveItems ){
for(jj = 0; jj < g_animInteractiveItems.length; jj++) {
if( triggerObj = GetObj(g_animInteractiveItems[jj]) )
triggerObj.runtimeStyle.cursor="hand";
}
}
if( gUseSldTimings && ''+g_animSlideTime != 'undefined' ) {
adjustedTime = document.body.calculateAutoAdvanceTimes( g_animSlideTime, g_animEffectTimings );
if( IsWin("PPTSld") && adjustedTime != g_animSlideTime ) {
var sld = GetCurSld();
sld.mAdvDelay = adjustedTime * 1000;
}
}
}
return g_animUseRuntime;
}
gSldJump = 0, gSldJumpTrack = 0, gSldJumpIdx = "";
function _KPH()
{
if( IsNts() ) return;
if( !parent.IsFramesMode() && event.keyCode == 27 && !HideMenu() )
parent.window.close( self );
else if( event.keyCode == 32 ) {
if( window.name == "PPTSld" )
parent.PPTSld.DocumentOnClick();
else
parent.GoToNextSld();
}
CatchNumKeys( parent, event );
}
function CatchNumKeys( win, event ) {
if( win.IsFullScrMode() && (48<=event.keyCode) && (event.keyCode<=57) ) {
gSldJump = 1;
gSldJumpIdx += (event.keyCode-48).toString();
}
if( win.IsFullScrMode() && gSldJump && event.keyCode == 13 ) {
var numSlds = parent.GetSldList().mList.length
if ( gSldJumpIdx > numSlds )
gSldJumpIdx = numSlds;
if ( gSldJumpIdx >= 0 ) {
if ( gSldJumpIdx == 0 )
gSldJumpIdx = 1;
var jumpTo = parseInt(gSldJumpIdx);
gSldJump = 0; gSldJumpIdx = "";
win.GoToSld( parent.GetSldList().mList[jumpTo-1].mSldHref )
}
}
}
function _KDH()
{
if( event.keyCode == 8 ) {
event.returnValue = 0;
parent.GoToPrevSld();
}
}
var g_HLinkArray = new Array();
function IMapAreaObj( areaObj, coords )
{
this.areaObj = areaObj;
this.coords = coords;
}
function InitHLinkArray()
{
var appVer = navigator.appVersion;
var msie = appVer.indexOf ( "MSIE " )
var ver = 0;
if ( msie >= 0 )
ver = parseInt ( appVer.substring( msie+5 ) );
linkNum = 0;
for (i=0; i<document.all.tags("AREA").length; i++) {
areaObj = document.all.tags("AREA").item(i);
if( ( areaObj.id != "pptxscale" ) || ( ver > 4 ) )
g_HLinkArray[linkNum++] = new IMapAreaObj( areaObj, ParseCoords( areaObj.coords ) );
}
}
function ScaleHyperlinks( factor )
{
for ( ii=0; ii< g_HLinkArray.length; ii++) {
coordsStr="";
imaObj = g_HLinkArray[ii];
for ( jj=0; jj < imaObj.coords.length-1; jj++ )
coordsStr += (imaObj.coords[jj]*factor) + ",";
coordsStr += (imaObj.coords[jj]*factor);
imaObj.areaObj.coords = coordsStr;
}
}
function ParseCoords( coordsStr )
{
var numArray = new Array();
var i = curPos = commaPos = 0;
while ( ( commaPos = coordsStr.indexOf(",", curPos) ) != -1 ) {
numArray[i++] = parseInt( coordsStr.substr( curPos, commaPos ) );
curPos = commaPos + 1;
}
numArray[i] = parseInt( coordsStr.substr( curPos ) );
return numArray;
}
function PlaySound( href, loop ){
href= unescape(href);
if( window.event ) window.event.cancelBubble = true;
pptSound.src = href;
pptSound.loop = loop ? -1 : 0;
}
function DocumentOnClick()
{
if( IsNts() || parent.HideMenu() ) return;
if( ( g_allowAdvOnClick && (window.name=="PPTSld") && !parent.IsFramesMode() ) ||
(event && event.keyCode==32) ) {
if( g_animUseRuntime && g_animMainSequence && g_animMainSequence.cangonext )
return;
parent.GoToNextSld();
}
}
var g_supportsPPTHTML = SupportsPPTHTML(), g_scaleInFrame = 1, gId="", g_bgSound="",
g_scaleHyperlinks = false, g_allowAdvOnClick = 1, g_showInBrowser = 0, gLoopCont = 0, gUseSldTimings = 0;
var g_showAnimation = g_supportsPPTHTML && SupportsPPTAnimation() && ( (window.name=="PPTSld" && !parent.IsFramesMode()) || g_showInBrowser );var g_animManager = null;
var g_animUseRuntime = false;
var g_animItemsToHide, g_animInteractiveItems, g_animSlideTime;
var g_animMainSequence = null;
var ENDSHOW_MESG="放映結束,單擊鼠標退出。", SCREEN_MODE="Frames", gIsEndShow=0, NUM_VIS_SLDS=140, SCRIPT_HREF="script.js", FULLSCR_HREF="fullscreen.htm";
var gCurSld = gPrevSld = 1, g_offset = 0, gNtsOpen = gHasNts = gOtlTxtExp = 0, gHasNarration = 0, gOtlOpen = true
window.gPPTHTML=SupportsPPTHTML()
var gMainDoc=new Array(new hrefList("slide0001.htm",1,-1,1),new hrefList("slide0352.htm",1,-1,1),new hrefList("slide0096.htm",1,-1,1),new hrefList("slide0280.htm",1,-1,1),new hrefList("slide0281.htm",1,-1,1),new hrefList("slide0282.htm",1,-1,1),new hrefList("slide0286.htm",1,-1,1),new hrefList("slide0283.htm",1,-1,1),new hrefList("slide0284.htm",1,-1,1),new hrefList("slide0165.htm",1,-1,1),new hrefList("slide0166.htm",1,-1,1),new hrefList("slide0287.htm",1,-1,1),new hrefList("slide0168.htm",1,-1,1),new hrefList("slide0167.htm",1,-1,1),new hrefList("slide0288.htm",1,-1,1),new hrefList("slide0317.htm",1,-1,1),new hrefList("slide0290.htm",1,-1,1),new hrefList("slide0291.htm",1,-1,1),new hrefList("slide0292.htm",1,-1,1),new hrefList("slide0293.htm",1,-1,1),new hrefList("slide0294.htm",1,-1,1),new hrefList("slide0169.htm",1,-1,1),new hrefList("slide0171.htm",1,-1,1),new hrefList("slide0295.htm",1,-1,1),new hrefList("slide0296.htm",1,-1,1),new hrefList("slide0297.htm",1,-1,1),new hrefList("slide0298.htm",1,-1,1),new hrefList("slide0318.htm",1,-1,1),new hrefList("slide0319.htm",1,-1,1),new hrefList("slide0320.htm",1,-1,1),new hrefList("slide0299.htm",1,-1,1),new hrefList("slide0314.htm",1,-1,1),new hrefList("slide0315.htm",1,-1,1),new hrefList("slide0170.htm",1,-1,1),new hrefList("slide0301.htm",1,-1,1),new hrefList("slide0316.htm",1,-1,1),new hrefList("slide0303.htm",1,-1,1),new hrefList("slide0304.htm",1,-1,1),new hrefList("slide0305.htm",1,-1,1),new hrefList("slide0306.htm",1,-1,1),new hrefList("slide0307.htm",1,-1,1),new hrefList("slide0308.htm",1,-1,1),new hrefList("slide0309.htm",1,-1,1),new hrefList("slide0310.htm",1,-1,1),new hrefList("slide0311.htm",1,-1,1),new hrefList("slide0312.htm",1,-1,1),new hrefList("slide0313.htm",1,-1,1),new hrefList("slide0194.htm",1,-1,1),new hrefList("slide0196.htm",1,-1,1),new hrefList("slide0211.htm",1,-1,1),new hrefList("slide0212.htm",1,-1,1),new hrefList("slide0213.htm",1,-1,1),new hrefList("slide0214.htm",1,-1,1),new hrefList("slide0215.htm",1,-1,1),new hrefList("slide0321.htm",1,-1,1),new hrefList("slide0216.htm",1,-1,1),new hrefList("slide0217.htm",1,-1,1),new hrefList("slide0218.htm",1,-1,1),new hrefList("slide0219.htm",1,-1,1),new hrefList("slide0220.htm",1,-1,1),new hrefList("slide0221.htm",1,-1,1),new hrefList("slide0222.htm",1,-1,1),new hrefList("slide0223.htm",1,-1,1),new hrefList("slide0322.htm",1,-1,1),new hrefList("slide0224.htm",1,-1,1),new hrefList("slide0225.htm",1,-1,1),new hrefList("slide0226.htm",1,-1,1),new hrefList("slide0227.htm",1,-1,1),new hrefList("slide0228.htm",1,-1,1),new hrefList("slide0253.htm",1,-1,1),new hrefList("slide0254.htm",1,-1,1),new hrefList("slide0255.htm",1,-1,1),new hrefList("slide0256.htm",1,-1,1),new hrefList("slide0257.htm",1,-1,1),new hrefList("slide0258.htm",1,-1,1),new hrefList("slide0261.htm",1,-1,1),new hrefList("slide0262.htm",1,-1,1),new hrefList("slide0263.htm",1,-1,1),new hrefList("slide0230.htm",1,-1,1),new hrefList("slide0229.htm",1,-1,1),new hrefList("slide0267.htm",1,-1,1),new hrefList("slide0268.htm",1,-1,1),new hrefList("slide0269.htm",1,-1,1),new hrefList("slide0252.htm",1,-1,1),new hrefList("slide0231.htm",1,-1,1),new hrefList("slide0232.htm",1,-1,1),new hrefList("slide0233.htm",1,-1,1),new hrefList("slide0234.htm",1,-1,1),new hrefList("slide0235.htm",1,-1,1),new hrefList("slide0236.htm",1,-1,1),new hrefList("slide0237.htm",1,-1,1),new hrefList("slide0265.htm",1,-1,1),new hrefList("slide0238.htm",1,-1,1),new hrefList("slide0270.htm",1,-1,1),new hrefList("slide0271.htm",1,-1,1),new hrefList("slide0239.htm",1,-1,1),new hrefList("slide0240.htm",1,-1,1),new hrefList("slide0264.htm",1,-1,1),new hrefList("slide0242.htm",1,-1,1),new hrefList("slide0243.htm",1,-1,1),new hrefList("slide0244.htm",1,-1,1),new hrefList("slide0272.htm",1,-1,1),new hrefList("slide0273.htm",1,-1,1),new hrefList("slide0274.htm",1,-1,1),new hrefList("slide0276.htm",1,-1,1),new hrefList("slide0275.htm",1,-1,1),new hrefList("slide0324.htm",1,-1,1),new hrefList("slide0325.htm",1,-1,1),new hrefList("slide0326.htm",1,-1,1),new hrefList("slide0327.htm",1,-1,1),new hrefList("slide0328.htm",1,-1,1),new hrefList("slide0329.htm",1,-1,1),new hrefList("slide0245.htm",1,-1,1),new hrefList("slide0246.htm",1,-1,1),new hrefList("slide0278.htm",1,-1,1),new hrefList("slide0247.htm",1,-1,1),new hrefList("slide0279.htm",1,-1,1),new hrefList("slide0248.htm",1,-1,1),new hrefList("slide0277.htm",1,-1,1),new hrefList("slide0330.htm",1,-1,1),new hrefList("slide0337.htm",1,-1,1),new hrefList("slide0338.htm",1,-1,1),new hrefList("slide0339.htm",1,-1,1),new hrefList("slide0340.htm",1,-1,1),new hrefList("slide0341.htm",1,-1,1),new hrefList("slide0342.htm",1,-1,1),new hrefList("slide0344.htm",1,-1,1),new hrefList("slide0345.htm",1,-1,1),new hrefList("slide0346.htm",1,-1,1),new hrefList("slide0347.htm",1,-1,1),new hrefList("slide0348.htm",1,-1,1),new hrefList("slide0351.htm",1,-1,1),new hrefList("slide0349.htm",1,-1,1),new hrefList("slide0331.htm",1,-1,1),new hrefList("slide0332.htm",1,-1,1),new hrefList("slide0333.htm",1,-1,1),new hrefList("slide0334.htm",1,-1,1),new hrefList("slide0354.htm",1,-1,1),new hrefList("slide0336.htm",1,-1,1),new hrefList("slide0353.htm",1,-1,1));
function FullScrInit()
{
g_allowAdvOnClick = GetCurSld().mAdvOnClk
document.body.style.backgroundColor="black"
document.oncontextmenu=parent._CM;
document.onkeydown = _KDH;
document.ondragstart=Cancel
document.onselectstart=Cancel
self.focus()
}
function Redirect( frmId )
{
var str=document.location.hash,idx=str.indexOf('#'), sId=GetSldId()
if(idx>=0) str=str.substr(1);
if( window.name != frmId && ( sId != str) ) {
obj = GetObj("Main-File")
window.location.href=obj.href+"#"+sId
return 1
}
return 0
}
var MHTMLPrefix = CalculateMHTMLPrefix();
function CalculateMHTMLPrefix()
{
if ( document.location.protocol == 'mhtml:') {
href=new String(document.location.href)
Start=href.indexOf('!')+1
End=href.lastIndexOf('/')+1
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -