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

📄 collectfunction.js

📁 SK信息采集2.0功能介绍: 1.可针对任何静态网页,动态网页进行采集。包括htm,html,shtml,ASP,ASPX,JSP,PHP等。 2.增加自定文件采集.用户可采集网页中的所有文件.
💻 JS
字号:
/*
文件名:CollectFunction.JS
作 用 :采集管理操作的函数集合
说 明:在Collect_Main.asp文件中调用此JS
*/
var DocElementArrInitialFlag=false;
var DocElementArr = new Array();
var DocContextMenuArr=new Array();
var SelectedFile='',SelectedFolder='';
function document.onreadystatechange()
{   if (DocElementArrInitialFlag) return;
	InitialDocElementArr('FolderID','ItemID');
	InitialContextMenu();
	DocElementArrInitialFlag=true;
}
function InitialContextMenu()
{	DocContextMenuArr[DocContextMenuArr.length]=new ContextMenuItem("parent.CreateCollectItem('');",'添加项目(N)','disabled');
    DocContextMenuArr[DocContextMenuArr.length]=new ContextMenuItem("parent.SetCollectItemPro('');",'设置属性(P)','disabled');
    DocContextMenuArr[DocContextMenuArr.length]=new ContextMenuItem("parent.TestCollectItem('');",'项目测试(T)','disabled');
    DocContextMenuArr[DocContextMenuArr.length]=new ContextMenuItem('seperator','','');
	DocContextMenuArr[DocContextMenuArr.length]=new ContextMenuItem("parent.SelectAllElement();",'全 选(A)','disabled');
	DocContextMenuArr[DocContextMenuArr.length]=new ContextMenuItem("parent.EditCollectItem('');",'编 辑(E)','disabled');
	DocContextMenuArr[DocContextMenuArr.length]=new ContextMenuItem("parent.DelCollectItem('');",'删 除(D)','disabled');

		 DocContextMenuArr[DocContextMenuArr.length]=new ContextMenuItem('seperator','','');
		//预留功能 DocContextMenuArr[DocContextMenuArr.length]=new ContextMenuItem("parent.Cut();",'剪 切(X)','disabled');
	     DocContextMenuArr[DocContextMenuArr.length]=new ContextMenuItem("parent.Copy();",'复 制(C)','disabled');
	     DocContextMenuArr[DocContextMenuArr.length]=new ContextMenuItem("parent.Paste();",'粘 贴(V)','disabled');

	
    DocContextMenuArr[DocContextMenuArr.length]=new ContextMenuItem('seperator','','');
	DocContextMenuArr[DocContextMenuArr.length]=new ContextMenuItem("parent.location.reload();",'刷 新(Z)','disabled');
}
function DocDisabledContextMenu()
{   var PasteTFStr='';
	if (top.CommonCopyCut.PasteTypeID==0||top.CommonCopyCut.ChannelID!=100)PasteTFStr='粘 贴(V),';
    DisabledContextMenu('FolderID','ItemID',PasteTFStr+'编 辑(E),删 除(D),剪 切(X),复 制(C)',PasteTFStr+'',PasteTFStr+'',PasteTFStr+'',PasteTFStr+'')
}
function CreateCollectItem()
{location.href='Collect_ItemAddNew.asp';
}
function EditCollectItem()
{
	GetSelectStatus('FolderID','ItemID');
 if (SelectedFile!='')
   if (SelectedFile.indexOf(',')==-1)
   location.href='Collect_ItemModify.asp?ItemID='+SelectedFile;
   else
   alert('一次只能够编辑一个采集项目!'); 
 else
  alert('请选择要编辑的采集项目!');
  SelectedFile='';
}
function DelCollectItem()
{
 GetSelectStatus('FolderID','ItemID');
 if (SelectedFile!='')
  {
   if (confirm('真的要删除选中的采集项目吗?'))
    location="Collect_ItemDel.asp?Page="+Page+"&ItemID="+SelectedFile;
  }
 else
  alert('请选择要删除的采集项目!');
  SelectedFile='';
}
function SetCollectItemPro()
{
	GetSelectStatus('FolderID','ItemID');
 if (SelectedFile!='')
   if (SelectedFile.indexOf(',')==-1)
   location.href='Collect_ItemAttribute.asp?ItemID='+SelectedFile;
   else
   alert('一次只能够设置一个采集项目的属性!'); 
 else
  alert('请选择要设置属性的采集项目!');
  SelectedFile='';
}
function TestCollectItem()
{
	GetSelectStatus('FolderID','ItemID');
 if (SelectedFile!='')
   if (SelectedFile.indexOf(',')==-1)
   location.href='Collect_ItemModify5.asp?ItemID='+SelectedFile;
   else
   alert('一次只能够测试一个采集项目!'); 
 else
  alert('请选择要测试的采集项目!');
  SelectedFile='';
}
function Cut()
{  
    GetSelectStatus('FolderID','ItemID');
	if (!((SelectedFile=='')&&(SelectedFolder=='')))
	  {
	   top.CommonCopyCut.ChannelID=100;
	   top.CommonCopyCut.PasteTypeID=1;
	   top.CommonCopyCut.SourceFolderID=ClassID;
	   top.CommonCopyCut.FolderID=SelectedFolder;
	   top.CommonCopyCut.ContentID=SelectedFile;
	   SelectedFolder='';
	   SelectedFile='';
	  }
    else
	 alert('请选择要剪切的目录或项目!');
}
function Copy()
{
    GetSelectStatus('FolderID','ItemID');
	if (!((SelectedFile=='')&&(SelectedFolder=='')))
	  {
	   top.CommonCopyCut.ChannelID=100;
	   top.CommonCopyCut.PasteTypeID=2;
	  // top.CommonCopyCut.SourceFolderID=ClassID;
	   top.CommonCopyCut.FolderID=SelectedFolder;
	   top.CommonCopyCut.ContentID=SelectedFile;
	   SelectedFolder='';
	   SelectedFile='';
	  }
    else
	 alert('请选择要复制的目录或项目!');
}
function Paste()
{ 
  if (top.CommonCopyCut.ChannelID==100 && top.CommonCopyCut.PasteTypeID!=0)
   {  var Param='';
      Param='?Page='+Page;
     //Param+='&PasteTypeID='+top.CommonCopyCut.PasteTypeID+'&DestFolderID='+ClassID+'&SourceFolderID='+top.CommonCopyCut.SourceFolderID+'&FolderID='+top.CommonCopyCut.FolderID+'&ContentID='+top.CommonCopyCut.ContentID;
	 Param+='&PasteTypeID='+top.CommonCopyCut.PasteTypeID+'&DestFolderID=0&SourceFolderID='+top.CommonCopyCut.SourceFolderID+'&FolderID='+top.CommonCopyCut.FolderID+'&ContentID='+top.CommonCopyCut.ContentID;
     if (top.CommonCopyCut.PasteTypeID==1)      //剪切
	 {  
        top.CommonCopyCut.PasteTypeID=0;       //设置为0,使粘贴不可用
	    if (top.CommonCopyCut.SourceFolderID==ClassID) return;
		location.href='Article_Paste.asp'+Param;
	 }
	else if (top.CommonCopyCut.PasteTypeID==2) //复制
	 {
		location.href='Collect_Paste.asp'+Param;
	 }
	else
	 alert('非法操作!');
   }
  else
   alert('系统剪切板没有内容!');
}
function GetKeyDown()
{ 
if (event.ctrlKey)
  switch  (event.keyCode)
  {  case 90 : location.reload(); break;
	 case 65 : SelectAllElement();break;
	 case 78 : event.keyCode=0;event.returnValue=false;CreateCollectItem();break;
     case 69 : event.keyCode=0;event.returnValue=false;EditCollectItem();break;
     case 80 : event.keyCode=0;event.returnValue=false;SetCollectItemPro();break;
     case 84 : event.keyCode=0;event.returnValue=false;TestCollectItem();break;
	 case 68 : DelCollectItem('');break;
	//case 88 : 
	//   if (ClassID!='0')
	//    { event.keyCode=0;event.returnValue=false;Cut();}
	//   else
	//     return;
	//	break;
	 case 67 : 
	   event.keyCode=0;event.returnValue=false;Copy();
		break;
	 case 86 : 
	   if (top.CommonCopyCut.ChannelID==100 && top.CommonCopyCut.PasteTypeID!=0)
	   { event.keyCode=0;event.returnValue=false;Paste();}
	   else
	    return;
		break;
   }	
else	
 if (event.keyCode==46) DelCollectItem();
}

⌨️ 快捷键说明

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