📄 event.js
字号:
function doEvent(_method,_params,_params2)
{
switch (_method)
{
case "addnew":
dialog.Method = "open";
dialog.Href = root.path + "frame.jsp?url=" + root.path + "blog/blog.jsp?action=addnew";
dialog.Width = window.screen.width/1.5 + "px";
dialog.Height = window.screen.height/1.5 + "px";
dialog.Resize = "yes";
dialog.Open();
break;
case "edit":
dialog.Method = "open";
dialog.Href = root.path + "frame.jsp?url=" + root.path + "blog/blog.jsp?action=edit[J_Blog_ID="+_params+"]";
dialog.Width = window.screen.width/1.5 + "px";
dialog.Height = window.screen.height/1.5 + "px";
dialog.Resize = "yes";
dialog.Open();
break;
case "locked":
if (sAlert("您确定要锁定选中的日志吗?","这个过程可能需要很长的时间,您确认现在执行么?",true))
{
doEvent("lockelement",0);
hiddenexec.location = "/j_blog_get.jsp?action=lockblog&J_Blog_Lock=1&J_Blog_ID="+_params;
}
break;
case "unlocked":
if (sAlert("您确定要激活选中的日志吗?","这个过程可能需要很长的时间,您确认现在执行么?",true))
{
doEvent("lockelement",0);
hiddenexec.location = "/j_blog_get.jsp?action=lockblog&J_Blog_Lock=0&J_Blog_ID="+_params;
}
break;
case "delete":
if (sAlert("您确定要删除选中的日志吗?","这个过程可能需要很长的时间,您确认现在执行么?",true))
{
doEvent("lockelement",0);
hiddenexec.location = "/j_blog_get.jsp?action=deleteblog&J_Blog_ID="+_params;
}
break;
case "preview":
dialog.Method = "open";
dialog.Href = root.path + "redirect.jsp?url=../archives.jsp?id=" + _params + "|cid=" + _params2.CategoryID;
dialog.Width = "900";
dialog.Height = "500";
dialog.Resize = "yes";
dialog.Open();
break;
case "related":
window.location = root.path + "system_blog.jsp?page=1&condition=J_Blog_Category=[" + _params.CategoryID + "]";
break;
case "comment":
window.location = root.path + "system_comment.jsp?page=1&J_Blog_ID=" + _params;
break;
case "api":
window.location = root.path + "system_api.jsp?page=1&J_Blog_ApiCategory=" + _params.CategoryID;
break;
case "gotourl":
this._params = _params && "-" != _params ? _params : "about:blank";
if ((this._params.indexOf("http") == -1) && (this._params != "about:blank"))
{
this._params = "../" + this._params;
}
doEventOpenUrl(this._params);
break;
case "reload":
reLoad();
break;
case "lockelement":
doLockElement(_params);
break;
}
}
/**
* 打开URL地址窗体
*/
function doEventOpenUrl(_params)
{
try{
dialog.Method = "open";
dialog.Href = root.path + "../redirect.jsp?url=" + _params;
dialog.Width = "900";
dialog.Height = "500";
dialog.Resize = "yes";
var oNewWin = dialog.Open();
oNewWin.focus();
}catch (exception){
alert ("本功能需要您的浏览器启用弹出窗口功能,如果您的系统已经启用窗口拦截请先关闭。谢谢!");
}
}
function doLockElement(action)
{
if (action == 0)
{
document.all.eachitem.disabled = true;
}else if(action == 1){
var sURL = "/j_blog_post.jsp?action=search_m&page=" + top.request("page",self.window.location.href) + "&keyword=" + top.request("keyword",self.window.location.href);
document.all.eachitem.disabled = false;
//hiddenexec.location = sURL;
parent.frmlist.location = sURL;
doClickcheckbox(this,"noview");
}
}
function setData(sHTML)
{
document.all.DivEachItem.innerHTML = sHTML;
}
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;
}
}
}
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());
}
function doClickcheckbox(object,oview)
{
checkBoxALL(frm_product_itemlist,object,'selected_checkbox',oview);
}
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()
{
var page = top.request("page",self.window.location.href);
var keyword = top.request("keyword",self.window.location.href);
this.location.href= "/j_blog_post.jsp?action=search_m&page=" + page + "&keyword=" + keyword;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -