📄 labelfunction.js
字号:
/*
文件名:LabelFunction.JS
作 用 :标签管理操作的函数集合
说 明:在Label_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','LabelID');
InitialDocContextMenuArr();
DocElementArrInitialFlag=true;
}
function InitialDocContextMenuArr()
{
if (KeyWord=='')
{
DocContextMenuArr[DocContextMenuArr.length]=new ContextMenuItem("parent.AddFolder();",'新建目录(N)','disabled');
DocContextMenuArr[DocContextMenuArr.length]=new ContextMenuItem("parent.AddLabel('');",'新建标签(M)','disabled');
DocContextMenuArr[DocContextMenuArr.length]=new ContextMenuItem('seperator','','');
}
DocContextMenuArr[DocContextMenuArr.length]=new ContextMenuItem("parent.SelectAllElement();",'全 选(A)','disabled');
DocContextMenuArr[DocContextMenuArr.length]=new ContextMenuItem("parent.Edit('');",'编 辑(E)','disabled');
DocContextMenuArr[DocContextMenuArr.length]=new ContextMenuItem("parent.Delete('');",'删 除(D)','disabled');
DocContextMenuArr[DocContextMenuArr.length]=new ContextMenuItem('seperator','','');
DocContextMenuArr[DocContextMenuArr.length]=new ContextMenuItem("parent.Paste();",'克 隆(V)','disabled');
DocContextMenuArr[DocContextMenuArr.length]=new ContextMenuItem('seperator','','');
DocContextMenuArr[DocContextMenuArr.length]=new ContextMenuItem('parent.ChangeUp();','后 退(B)','');
DocContextMenuArr[DocContextMenuArr.length]=new ContextMenuItem("parent.Reload('');",'刷 新(Z) ','');
}
function DocDisabledContextMenu()
{
var TempDisabledStr='';
if (FolderID=='0') TempDisabledStr='后 退(B),';
DisabledContextMenu('FolderID','LabelID',TempDisabledStr+'编 辑(E),删 除(D),克 隆(V)','克 隆(V)','','编 辑(E),克 隆(V)','编 辑(E),克 隆(V)','克 隆(V)')
}
function ChangeUp()
{
if (FolderID=='0') return;
location.href='Label_Main.asp?LabelType='+LabelType+'&FolderID='+ParentID;
if (LabelType==0)
parent.frames['BottomFrame'].location.href='../Split.asp?OpStr=标签管理 >> 系统函数标签&ButtonSymbol=FunctionLabel&LabelFolderID='+ParentID;
else
parent.frames['BottomFrame'].location.href='../Split.asp?OpStr=标签管理 >> 自由标签&ButtonSymbol=FreeLabel&LabelFolderID='+ParentID;
}
function OpenLabelFolder(FolderID)
{
location.href='Label_Main.asp?LabelType='+LabelType+'&FolderID='+FolderID;
if (LabelType==0)
parent.frames['BottomFrame'].location.href='../Split.asp?OpStr=标签管理 >> 系统函数标签&ButtonSymbol=FunctionLabel&LabelFolderID='+FolderID;
else
parent.frames['BottomFrame'].location.href='../Split.asp?OpStr=标签管理 >> 自由标签&ButtonSymbol=FreeLabel&LabelFolderID='+FolderID;
}
function AddFolder()
{
if (LabelType==1)
OpenWindow('LabelFrame.asp?Url=LabelFolder.asp&PageTitle=新建自由标签目录&LabelType=1&FolderID='+FolderID,450,360,window);
else
OpenWindow('LabelFrame.asp?Url=LabelFolder.asp&PageTitle=新建系统函数标签目录&LabelType=0&FolderID='+FolderID,450,360,window);
Reload('');
}
function AddLabel(TempUrl)
{
if (LabelType==1)
{
location.href=TempUrl+'LabelAdd.asp?LabelType=1&Action=AddNew&FolderID='+FolderID;
parent.frames['BottomFrame'].location.href=TempUrl+'../Split.asp?OpStr=标签管理 >> <font color=red>添加自由标签</font>&ButtonSymbol=LabelAdd';
}
else
{ OpenWindow('LabelFrame.asp?Url=AddFunctionLabel.asp&FolderID='+FolderID+'&PageTitle=添加函数标签',280,350,window);
Reload(TempUrl);
}
}
function EditLabel(TempUrl,id)
{ if (LabelType==1)
if (KeyWord=='')
{ location.href=TempUrl+'LabelAdd.asp?LabelType=1&page='+Page+'&Action=EditLabel&LabelID='+id;
parent.frames['BottomFrame'].location.href=TempUrl+'../Split.asp?OpStr=标签管理 >> <font color=red>修改自由标签</font>&ButtonSymbol=LabelAdd';
}
else
{ location.href=TempUrl+'LabelAdd.asp?LabelType=1&page='+Page+'&Action=EditLabel&'+SearchParam+'&LabelID='+id;
parent.frames['BottomFrame'].location.href=TempUrl+'../Split.asp?OpStr=标签管理 >> 搜索自由标签结果 >> <font color=red>修改自由标签</font>&ButtonSymbol=LabelAdd';
}
else
{ OpenWindow('LabelFrame.asp?Url=EditFunctionLabel.asp&PageTitle=修改函数标签&LabelID='+id,450,400,window);
Reload(TempUrl);
}
}
function EditFolder(ID)
{
OpenWindow('LabelFrame.asp?Url=LabelFolder.asp&PageTitle=编辑标签目录&Action=EditFolder&FolderID='+ID,450,360,window);
Reload('');
}
function Edit(TempUrl)
{ GetSelectStatus('FolderID','LabelID');
if (!((SelectedFile=='')&&(SelectedFolder=='')))
{
if (SelectedFolder!='')
{
if (TempUrl=='Folder'||TempUrl=='')
if (SelectedFolder.indexOf(',')==-1)
{ EditFolder(SelectedFolder);
}
else alert('一次只能够编辑一个标签目录');
}
if (SelectedFile!='')
{
if (TempUrl!='Folder'||TempUrl=='')
{if (SelectedFile.indexOf(',')==-1)
EditLabel(TempUrl,SelectedFile);
else alert('一次只能够编辑一个标签');
}
}
}
else
{
alert('请选择要编辑的标签或目录');
}
SelectedFile='';
SelectedFolder='';
}
function Delete(TempUrl)
{ GetSelectStatus('FolderID','LabelID');
if (!((SelectedFile=='')&&(SelectedFolder=='')))
{
if (confirm('删除确认:\n\n真的要执行删除操作吗?'))
{ if (SelectedFolder!='')
if (TempUrl=='Folder'||TempUrl=='')
location='LabelFolderDel.asp?ID='+SelectedFolder;
if (SelectedFile!='')
if (TempUrl!='Folder'||TempUrl=='')
location=TempUrl+'LabelDel.asp?Page='+Page+'&ID='+SelectedFile;
}
}
else alert('请选择要删除的标签目录或标签');
SelectedFile='';
SelectedFolder='';
}
function Paste()
{
GetSelectStatus('FolderID','LabelID');
if (SelectedFile!='')
OpenWindow('LabelFrame.asp?Url=Label_Main.asp&Action=SetPasteParam&PageTitle=请输入新标签名称&LabelType=0&LabelID='+SelectedFile,350,120,window);
else alert('请选择要克隆的标签');
SelectedFile='';
SelectedFolder='';
Reload('');
}
function GetKeyDown()
{
if (event.ctrlKey)
switch (event.keyCode)
{ case 90 : Reload(''); break;
case 65 : SelectAllElement();break;
case 66 : event.keyCode=0;event.returnValue=false;ChangeUp();break;
case 78 : event.keyCode=0;event.returnValue=false; AddFolder();break;
case 77 : event.keyCode=0;event.returnValue=false; AddLabel('');break;
case 69 : event.keyCode=0;event.returnValue=false;Edit('');break;
case 86 : event.keyCode=0;event.returnValue=false;Paste();break;
case 68 : Delete('');break;
case 70 :event.keyCode=0;event.returnValue=false;
if (LabelType==0)
parent.frames['LeftFrame'].initializeSearch('SysLabel')
else
parent.frames['LeftFrame'].initializeSearch('FreeLabel')
}
else if (event.keyCode==46)
Delete('');
}
function Reload(TempUrl)
{
location.href=TempUrl+'Label_Main.asp?FolderID='+FolderID+'&page='+Page+'&LabelType='+LabelType+'&'+SearchParam;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -