📄 event.js
字号:
/*
* 共用操作类
* @params 操作事件方法
* @params 执行的ID号
*/
function doEvent(_method,_params)
{
switch (_method)
{
case "addnew":
dialog.Method = "showModelessDialog";
dialog.Href = root.path + "frame.jsp?url=" + root.path + "templates/templates.jsp?action=addnew";
dialog.Width = window.screen.width/1.7 + "px";
dialog.Height = window.screen.height/1.7 + "px";
dialog.Open();
break;
case "edit":
dialog.Method = "showModelessDialog";
dialog.Href = root.path + "frame.jsp?url=" + root.path + "templates/templates.jsp?action=edit[J_Blog_ID="+_params+"]";
dialog.Width = window.screen.width/1.7 + "px";
dialog.Height = window.screen.height/1.7 + "px";
dialog.Open();
break;
case "use":
if (sAlert("您确定要应用选中的模板为当前模板吗?","这个过程可能需要很长的时间,您确认现在执行么?",true))
{
doEvent("lockelement",0);
hiddenexec.location = "/j_blog_get.jsp?action=usetemplates&J_Blog_ID=" + _params;
}
break;
case "delete":
if (sAlert("您确定要删除选中的模板吗?","这个过程可能需要很长的时间,您确认现在执行么?<br /><font color=red>正在应用的模板将不被删除!</font>",true))
{
doEvent("lockelement",0);
hiddenexec.location = "/j_blog_get.jsp?action=deletetemplates&J_Blog_ID=" + _params;
}
break;
case "reload":
reLoad();
break;
case "lockelement":
doLockElement(_params);
break;
}
}
/**
* 琐定/激活当前所有的 Element 控件
* @params 琐定/激活
*/
function doLockElement(action)
{
if (action == 0)
{
document.all.eachitem.disabled = true;
}else if(action == 1){
var sURL = root.path + "system_templates.jsp?page=" + top.request("page",self.window.location.href);
document.all.eachitem.disabled = false;
//hiddenexec.location = sURL;
frmlist.location = sURL;
doClickcheckbox(this,"noview");
}else{
document.all.eachitem.disabled = false;
doClickcheckbox(this,"noview");
}
}
/**
* 保存HTML信息
* 无刷新更新 DivEachItem 中的数据信息
* @params 更新HTML代码
*/
function setData(sHTML)
{
document.all.DivEachItem.innerHTML = sHTML;
}
/**
* 系统对话框
* @params 标题
* @params 备注说明
* @params 事件响应(True,False)
* @params 窗口宽度
* @params 窗口高度
*/
function sAlert(Title,Description,isConfirm,showtype,Width,Height)
{
var odialog;
odialog = getDialog(Title,Description,showtype,Width,Height);
if (isConfirm)
{
if (odialog == 1)
{
return true;
}else{
return false;
}
}else{
if (odialog == 1)
{
return false;
}else{
return true;
}
}
}
/**
* 打开系统对话框
* @params 标题
* @params 备注说明
* @params 事件响应(True,False)
* @params 窗口宽度
* @params 窗口高度
*/
function getDialog(title,description,showtype,width,height)
{
showtype = showtype?showtype:"alert";
if (showtype == "alert")
{
this.url = root.path + "confirm.jsp?title="+title+"&description="+description;
}else{
this.url = root.path + "alert.jsp?title="+title+"&description="+description;
}
this.width = width?width:"350px";
this.height = height?height:"200px";
dialog.Method = "showModalDialog";
dialog.Href = this.url;
dialog.Width = this.width;
dialog.Height = this.height;
dialog.Status = "no";
return (dialog.Open());
}
/**
* 选中表单窗体中的所有 checkbox 对象
*/
function doClickcheckbox(object,oview)
{
checkBoxALL(frm_category_itemlist,object,'selected_checkbox',oview);
}
/**
* 取表单中的所有checkbox对象并选中且名称标识等于Id的所有值
* @params 表单对象
* @return 选中对象的连接字符串;如:(1,2,3,4,5,6)
*/
function getFromAllElement(frm)
{
var sHTML = "";
for (var i=0;i<=frm.elements.length-1;i++)
{
var e = frm.elements[i];
if ((e.type == "checkbox") && (e.checked) && (e.name == "Id"))
{
if (sHTML.length == 0)
{
sHTML = e.value;
}else{
sHTML += "," + e.value;
}
}
}
return (sHTML);
}
/**
* 重载当前页面
*/
function reLoad()
{
this.location.href = root.path + "system_templates.jsp?page=" + top.request("page",self.window.location.href);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -