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

📄 worklflowobject(9.0)_utils.js

📁 对web开发很有帮助的
💻 JS
📖 第 1 页 / 共 2 页
字号:

var g_theApp = parent.g_theApp;

var layerRef="";
var layerStyleRef = "";
var styleSwitch = "";
var FILEProtocol = "file://";
var HTTPProtocol = "http://";

if (navigator.appName == "Netscape")
	{
	layerStyleRef="layer.";
	layerRef="document.layers";
	styleSwitch="";
	}
else
	{
	layerStyleRef="layer.style.";
	layerRef="document.all";
	styleSwitch=".style";
	}

function CImage(id)
	{
	this.id = id;

	if ( g_theApp.isIE )
		this.image = eval('document.images.' + this.id);
	else
		this.image = eval('document.images["' + this.id + '"]');

	this.put_Source = SetSource;
	this.get_Source = GetSource;
	this.put_Title = put_Title;
	this.get_Title = get_Title;
	}

function SetSource(newsrc)
	{
	if ( this.image )
		this.image.src = newsrc;
	}

function GetSource()
	{
	if ( this.image )
		return this.image.src;
	}

function put_Title(txt)
	{
	if ( this.image && g_theApp.isIE )
		this.image.title = txt;
	}

function get_Title(txt)
	{
	if ( this.image && g_theApp.isIE )
		return this.image.title;
	}

function CDiv(id, doc)
	{
	this.id = id;
	this.layer = FindLayer(id, doc);

	this.Show = Show;
	this.Hide = Hide;
	this.IsHidden = IsHidden;
	this.put_innerHTML = put_innerHTML;
	}

function Show()
	{
	if ( this.layer )
		eval('this.' + layerStyleRef + 'visibility' + '= "visible"');
	}

function Hide()
	{
	if ( this.layer )
		eval('this.' + layerStyleRef + 'visibility' + '= "hidden"');
	}

function IsHidden()
	{
	if ( this.layer && 
		 (-1 != eval('this.' + layerStyleRef + 'visibility').indexOf("hid")) )
		return true;
	
	return false;
	}

function put_innerHTML(txt)
	{
	if ( this.layer )
		{
		if ( g_theApp.isIE )
			this.layer.innerHTML = txt;
		else
			{
			this.layer.document.writeln(txt);
			this.layer.document.close();
			}
		}
	}

function SetZoomControl(f)
	{
	if ( !parent.g_NavBarLoaded )
		return;

	var formZoom = FindForm("zoomForm", parent.frmZoomBox.document);
	if (formZoom != null)
		{
		s = formZoom.zoomFactor;

		if ( -1 != f )
			f *= 100;

		for ( i = 0 ; i < s.options.length ; i++ )
			{
			if ( s.options[i].value == f )
				{
				s.selectedIndex = i;
				break;
				}
			}
		}
	}

function zoom_onchange(val)
{
	if ( g_theApp.ActiveViewMgr )
	{
		if ( g_theApp.ActiveViewMgr.ZoomIsPresent == true)
		{
			g_theApp.ActiveViewMgr.put_Zoom(parseInt(val));
		}
	}
}

function CViewMgr()
	{
//Set all zoom functions to null assuming the addons related
//to the data will provide their own functions.
	this.onResize = null;
	this.put_Zoom = null;
	this.get_Zoom = null;
	this.ApplyZoom = null;
	
	//General functions.
	this.onLoad = ViewMgrOnLoad;
	this.put_Location = ViewMgrDefaultFind; //MUST BE SET FOR FIND FEATURE 
	this.ZoomIsPresent = false;
	}

function ViewMgrOnLoad()
	{
	this.id = "ConvertedImage";
	this.zoomFactor = -1;
	this.zoomLast = -1;
	this.origWH = 1;
	this.origWidth = 100;

	if ( g_theApp.isIE )
	{
		p = document.all;
		this.s = document.all(this.id).style;
		

		if ( this.s )
		{
			this.s.position = "absolute";
			this.origWidth = this.s.pixelWidth;
			this.origWH = this.s.pixelWidth / this.s.pixelHeight;
		}
	}
	else
	{
		this.s = null;
	}
	SetZoomControl(this.zoomFactor);
}

function ViewMgrDefaultFind()
{
	return;
}

function handleResize()
	{
	location.reload();
	return false;
	}

function IsFrame(frameName)
	{
	return window.name == frameName;
	}

function UpdNavBar()
	{
	if (g_theApp.PageUpdateFunc != null)
		g_theApp.PageUpdateFunc ();

	if ( parent.g_NavBarLoaded )
		//parent.frmZoomBox.UpdateNavBar();
		parent.frmNavBar.UpdateNavBar();
	}

function UpdZoom()
	{
	if (g_theApp.ZoomResetFunc != null)
		g_theApp.ZoomResetFunc ();
	}

function UpdCPViewer()
	{
	if (g_theApp.CPResetFunc != null)
		g_theApp.CPResetFunc ();
	}

function UpdTitleBar()
	{
	if ( parent.g_TitleBarLoaded )
		parent.frmTitleBar.UpdateTitleBar();
	}

function GetCurPageNum()	{ return g_theApp.CurrentPageIX; }
function GetNumPages()		{ return g_theApp.FileList.length; }

function GoToNextPage()		{ GoToPage(g_theApp.CurrentPageIX + 1); }
function GoToPrevPage()		{ GoToPage(g_theApp.CurrentPageIX - 1); }
function GoToFirstPage()	{ GoToPage(0); }
function GoToLastPage()		{ GoToPage(gDocTable.length - 1) };

function GoToPage(ix)
	{
	var entry;

	if ( (g_theApp != null) &&
		 (ix != g_theApp.CurrentPageIX) && 
		 (null != (entry = g_theApp.FileList[ix])) )
		{
		var newPage;

		if (SupportsPriOutputType ())
			{
			newPage = entry.PriImage;

			if ( "" == newPage )
				newPage = newPage = entry.SecImage;
			}
		else
			newPage = entry.SecImage;

		if (frames["frmPageView"] != null)
			{
			frames["frmPageView"].window.location = newPage;
			}
		else
			{
			parent.frmPageView.location = newPage;
			}

		PageUpdated (ix);
		}
	}

function PageUpdated (ix)
{
	g_theApp.CurrentPageIX = ix;
	NotifyPageSyncs(ix);
}

function GoToPageByName(pageName)
{
	var pageIndex = PageIndexFromName (pageName);
	if (pageIndex >= 0)
	{
		GoToPage (pageIndex);
	}
}

function GoToPageByID(pageID)
{
	var pageIndex = PageIndexFromID (pageID);
	if (pageIndex >= 0)
	{
		GoToPage (pageIndex);
	}
}

function PageIndexFromName (pageName)
{
	if (g_theApp != null)
	{
		var entry;

		var count;
		var fileEntry;
		var bFoundEntry = false;
		for (count = 0; 
			 count < g_theApp.FileList.length && !bFoundEntry; 
			 count++)
		{
			fileEntry = g_theApp.FileList[count];
			if (pageName == fileEntry.PageName)
			{
				return count;
			}
		}
	}

	return -1;
}

function PageIndexFromID (pageID)
{
	if (g_theApp != null)
	{
		var entry;

		var count;
		var fileEntry;
		var bFoundEntry = false;
		for (count = 0; 
			 count < g_theApp.FileList.length && !bFoundEntry; 
			 count++)
		{
			fileEntry = g_theApp.FileList[count];
			if (pageID == fileEntry.PageID)
			{
				return count;
			}
		}
	}
	return -1;
}

function ZoomAvailable()
{
	if (SupportsPriOutputType () && g_theApp.FileList[0].PriImage != "")
	{
		return g_theApp.PriFormatSupportsZoom;
	}
	else
	{
		return (g_theApp.SecFormatSupportsZoom && g_theApp.FileList[0].SecImage != "");
	}
}

function NotifyPageSyncs(ix)
	{
	UpdNavBar();
	UpdTitleBar();
	UpdZoom();
	UpdCPViewer();
	}

function HasPrevSld()	{ return (GetCurPageNum() > 0); }
function HasNextSld()	{ return ((GetCurPageNum() + 1) < GetNumPages()); }

function CancelDrag()
	{
	window.event.cancelBubble=true;
	window.event.returnValue=false
	}

function html_escape(txt)
	{
	var result = "";

	for ( var i = 0 ; i < txt.length ; i++ )
		{
		if ( txt.charAt(i) == '&' )
			result += "&amp;";
		else if ( txt.charAt(i) == '<' )
			result += "&lt;";
		else if ( txt.charAt(i) == '>' )

⌨️ 快捷键说明

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