?? event.js
字號:
/*
* 共用操作類
* @params 操作事件方法
* @params 執(zhí)行的ID號
*/
function doEvent(_method,_params)
{
switch (_method)
{
case "backup":
if (sAlert("您確定要備份選中的數(shù)據(jù)表嗎?","這個過程可能需要很長的時間,您確認(rèn)現(xiàn)在執(zhí)行么?",true))
{
doEvent("lockelement",0);
hiddenexec.location = "/j_blog_get.jsp?action=backuptable&J_Blog_TableName=" + _params;
}
break;
case "optimize":
if (sAlert("您確定要優(yōu)化選中的數(shù)據(jù)表嗎?","這個過程可能需要很長的時間,您確認(rèn)現(xiàn)在執(zhí)行么?",true))
{
doEvent("lockelement",0);
hiddenexec.location = "/j_blog_get.jsp?action=optimizetable&J_Blog_TableName=" + _params;
}
break;
case "repair":
if (sAlert("您確定要修復(fù)選中的數(shù)據(jù)表嗎?","這個過程可能需要很長的時間,您確認(rèn)現(xiàn)在執(zhí)行么?",true))
{
doEvent("lockelement",0);
hiddenexec.location = "/j_blog_get.jsp?action=repairtable&J_Blog_TableName=" + _params;
}
break;
case "reload":
reLoad();
break;
case "lockelement":
doLockElement(_params);
break;
}
}
/**
* 瑣定/激活當(dāng)前所有的 Element 控件
* @params 瑣定/激活
*/
function doLockElement(action)
{
if (action == 0)
{
document.all.eachitem.disabled = true;
}else if(action == 1){
var sURL = root.path + "system_database.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 中的數(shù)據(jù)信息
* @params 更新HTML代碼
*/
function setData(sHTML)
{
document.all.DivEachItem.innerHTML = sHTML;
}
/**
* 系統(tǒng)對話框
* @params 標(biāo)題
* @params 備注說明
* @params 事件響應(yīng)(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;
}
}
}
/**
* 打開系統(tǒng)對話框
* @params 標(biāo)題
* @params 備注說明
* @params 事件響應(yīng)(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對象并選中且名稱標(biāo)識等于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);
}
/**
* 重載當(dāng)前頁面
*/
function reLoad()
{
this.location.href = root.path + "system_database.jsp?page=" + top.request("page",self.window.location.href);
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -