⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 script.js

📁 个人整理的java学习资料
💻 JS
📖 第 1 页 / 共 2 页
字号:

function LoadSld( slideId )
{
	if( !g_supportsPPTHTML ) return
	if( slideId )
		parent.SldUpdated(slideId)
	g_origSz=parseInt(SlideObj.style.fontSize)
	g_origH=SlideObj.style.posHeight
	g_origW=SlideObj.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() )	{
		document.oncontextmenu=parent._CM;
		self.focus()
	}
}
function MakeSldVis( fTrans ) 
{
	fTrans=fTrans && g_showAnimation
	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 Redirect( frmId,sId )
{
	var str=document.location.hash,idx=str.indexOf('#')
	if(idx>=0) str=str.substr(1);
	if( window.name != frmId && ( sId != str) ) {
		obj = document.all.item("Main-File")
		window.location.href=obj.href+"#"+sId
		return 1
	}
	return 0
}
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 )
}
var MHTMLPrefix = CalculateMHTMLPrefix(); 
function CalculateMHTMLPrefix()
{
	if ( document.location.protocol == 'mhtml:') { 
		href=new String(document.location.href) 
		Start=href.indexOf('!')+1 
		End=href.lastIndexOf('/')+1 
		if (End < Start) 
			return href.substring(0, Start) 
		else 
		return href.substring(0, End) 
	}
	return '';
}

function _RSW()
{
	if( !g_supportsPPTHTML || IsNts() ||
	  ( !g_scaleInFrame && (( window.name != "PPTSld" ) || !parent.IsFullScrMode()) ) )
		return

	cltWidth=document.body.clientWidth
	cltHeight=document.body.clientHeight
	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)/2
	s.posTop=(cltHeight-s.posHeight)/2

	if( g_scaleHyperlinks )
		ScaleHyperlinks( factor )
}

function _KPH()
{ 
  if( IsNts() ) return;

  if( !parent.IsFramesMode() && event.keyCode == 27 && !parent.HideMenu() )
    parent.window.close( self );
  else if( event.keyCode == 32 )
  {
    if( window.name == "PPTSld" )
      parent.PPTSld.DocumentOnClick();
    else
      parent.GoToNextSld();
  }
}
var AE_NONE = 0, AE_DIM = 1, AE_HIDE = 2, AE_HIDEIMDTLY = 3, LONG_INTERVAL = 10, SHORT_INTERVAL = 5, g_curAnim = null, g_vml = 0;
function ParseAnimations(){
	nr = document.all.tags("DIV").length;
	while(nr > 0) {
		rObj = document.all.tags("DIV").item(--nr);
		if(rObj.style.cssText != null) {
			build = rObj.style.cssText.indexOf("mso-build");
			if(build >= 0)
				AddAnimation(rObj);
		}
	}
	if(g_autoTrans){
		totT=0, autoAnims=0;
		rAnims=g_animManager.m_anims;
		nBuilds=g_animManager.m_numBuilds;
		for(x=nBuilds;x>0;x--)
		if(-1 != rAnims[x].m_secs){
			totT+=rAnims[x].m_secs;
			autoAnims++;
		}
		time=g_transSecs-totT;
		if(time<0) time=0;
		time=time/(nBuilds-autoAnims+1);
		for(x=nBuilds;x>0;x--)
			if(-1 == rAnims[x].m_secs)
				rAnims[x].m_secs=time;
	}
}
function AddAnimation(rObj){
	a =new Animation();
	a.m_obj =rObj;
	a.m_oldc =rObj.color;
	GetVal=rObj.style.getAttribute;
	var t;
	if( t=GetVal("mso-build") ) a.m_build=t-0;
	if( t=GetVal("mso-build-after-action") ) a.m_aAct=t-0;
	if( t=GetVal("mso-build-after-color") ) a.m_oldc=t;
	if( t=GetVal("mso-build-auto-secs") ) a.m_secs=t-0;
	if( t=GetVal("mso-build-avi") ) a.m_video=t;
	if( t=GetVal("mso-build-dual-id") ) a.m_dId=t;
	if( t=GetVal("mso-build-order") ) a.m_order=t-0;
	if( t=GetVal("mso-build-sound-name") ) a.m_sound=t;

	g_animManager.AddAnimation(a);
}
function ShowVGXObj(rObj){
	vmlId=null,ImgTag=null;
	curObj=rObj;
	sObj =document.all.item("SlideObj");
	while(null == ImgTag && null != curObj && sObj != curObj){
		ImgTag =curObj.children.tags("IMG").item(0);
		curObj =(curObj.parentElement.tagName == "DIV") ? curObj.parentElement : null
	}
	if(null !=ImgTag)
		vmlId =ImgTag.getAttribute("v:shapes");
	if(null !=vmlId) {
		idx =vmlId.indexOf(",");
		if(idx > 0) vmlId =vmlId.substr(0, idx);
		vgxObj =document.all.item(vmlId);
		if((null != vgxObj) && (null != vgxObj.parentElement) && (vgxObj.parentElement.style.display != "none")){
			vgxObj.parentElement.style.visibility = "visible";
			ImgTag.style.visibility = "hidden";
		}
		else
			rObj.style.visibility = "visible";
	}
}
function AnimationManager(){
	t=this;
	t.m_anims=new Array();
	t.m_numBuilds=0;
	t.m_activeObj=null;
	t.m_curBuild=1;
	t.m_timer=-1;
	t.m_objToHide=null;
	t.m_objToDim=null;
	t.m_colorToDim=-1;
	t.m_isPlaying=0;
	t.m_autoTimer=-1;
	t.Peek=AM_Peek;
	t.Next=AM_Next;
	t.Previous=AM_Previous;
	t.AddAnimation=AM_AddAnimation;
	t.ShowShapes=AM_ShowShapes;
	t.Swap=AM_Swap;
}
function AM_ShowShapes(){
	for(x=this.m_numBuilds; x>0; x--){
		if(g_vml)
			ShowVGXObj(this.m_anims[x].m_obj);
		aObj =this.m_anims[x].m_obj;
		if(aObj)
			aObj.style.visibility = "visible";
	}
	this.m_numBuilds =0;
}
function AM_Swap(cur){
	rList =this.m_anims;
	t =rList[cur+1];
	rList[cur+1] =rList[cur];
	rList[cur] =t;
}
function AM_AddAnimation(a){
	this.m_anims[++this.m_numBuilds] = a;
	this.m_curBuild =this.m_numBuilds;
	cur =this.m_numBuilds;
	if(a.m_order > 0){
		while(cur-- > 1 && Math.abs(this.m_anims[cur+1].m_order) > Math.abs(this.m_anims[cur].m_order))
			this.Swap(cur);
	}
	else {
		while(cur-- > 1 && Math.abs(this.m_anims[cur+1].m_order) >= Math.abs(this.m_anims[cur].m_order))
			this.Swap(cur);
	}
}
function AM_Peek(){
	if(g_animManager.m_curBuild > 0 && 0 < g_animManager.m_numBuilds) {
		secs =g_animManager.m_anims[g_animManager.m_curBuild].m_secs;
		if(secs != -1)
			g_animManager.m_autoTimer = window.setTimeout("_DocAction()", secs);
	}
	else if(1 == g_autoTrans && IsWin("PPTSld") && !parent.IsFramesMode()){
		setTimeout("parent.GoToNextSld()", g_transSecs);
	}
}
function AM_Next(){
	if(0 == this.m_numBuilds || (g_curAnim != null)) return 0; 
	success=0;
	if(this.m_autoTimer != -1)
		window.clearTimeout(this.m_autoTimer);
	if(this.m_objToHide != null)
		this.m_objToHide.style.visibility = "hidden";
	if(this.m_objToDim != null) {
		nr = document.all.length;
		while(nr-- > 0) {
			rObj =document.all.item(nr);
			if(this.m_objToDim.contains(rObj))
				rObj.style.color = this.m_colorToDim;
		}
	}
	if(this.m_curBuild > 0) {
		this.m_activeObj =this.m_anims[this.m_curBuild--];
		this.m_activeObj.Start();
		success =1;
	}
	return success;
}
function AM_Previous(){
	if((null == g_curAnim) && (this.m_curBuild <= this.m_numBuilds)) {
		this.m_curBuild++;
		var animObj = this.m_anims[this.m_curBuild];
		if(this.m_curBuild >= 1)
			animObj.m_obj.style.visibility = "hidden";
	}
}
function InitBuildEffects(){
	g_animManager =new AnimationManager();
	ParseAnimations();
	isFullScreen =(window.name == "PPTSld") && !parent.IsFramesMode();
	if(!g_showAnimation || (isFullScreen && parent.IsSldVisited()))
		g_animManager.ShowShapes();
	else if(!g_hasTrans)
		g_animManager.Peek();
	if(isFullScreen && !g_isKiosk)
		parent.SetSldVisited();
}
function Animation(){
	t=this;
	t.m_obj=0;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -