| @@ -15,46 +15,13 @@ function noselAll() | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| function delkey() | |||||
| { | |||||
| if (window.confirm("您确定要删除选定的关键字吗")) { | |||||
| document.form3.dopost.value = 'del'; | |||||
| document.form3.submit(); | |||||
| } | |||||
| } | |||||
| function diskey() | |||||
| { | |||||
| if (window.confirm("您确定要禁用选定的关键字吗")) { | |||||
| document.form3.dopost.value = 'dis'; | |||||
| document.form3.submit(); | |||||
| } | |||||
| } | |||||
| function enakey() | |||||
| { | |||||
| if (window.confirm("您确定要启用选定的关键字吗")) { | |||||
| document.form3.dopost.value = 'ena'; | |||||
| document.form3.submit(); | |||||
| } | |||||
| } | |||||
| function urlkey() | |||||
| { | |||||
| if (window.confirm("您确定要更新选定的关键字的网址吗")) { | |||||
| document.form3.dopost.value = 'url'; | |||||
| document.form3.submit(); | |||||
| } | |||||
| } | |||||
| function rankey() | |||||
| { | |||||
| if (window.confirm("您确定要改变选定的关键字的频率吗")) { | |||||
| document.form3.dopost.value = 'ran'; | |||||
| document.form3.submit(); | |||||
| } | |||||
| } | |||||
| //批量删除搜多关键字 | //批量删除搜多关键字 | ||||
| function delall() | function delall() | ||||
| { | { | ||||
| if (window.confirm("您确定要删除选定的关键字吗")) { | |||||
| DedeConfirm("您确定要删除选定的关键字吗?").then((v)=>{ | |||||
| document.form3.dopost.value = 'delall'; | document.form3.dopost.value = 'delall'; | ||||
| document.form3.submit(); | document.form3.submit(); | ||||
| } | |||||
| }).catch((e)=>{ | |||||
| console.log(e) | |||||
| }); | |||||
| } | } | ||||
| @@ -511,6 +511,45 @@ function guid() { | |||||
| } | } | ||||
| return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4()); | return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4()); | ||||
| } | } | ||||
| var _DedeConfirmFuncs = {}; | |||||
| var _DedeConfirmFuncsClose = {}; | |||||
| function __DedeConfirmRun(modalID) { | |||||
| _DedeConfirmFuncs[modalID](); | |||||
| } | |||||
| function __DedeConfirmRunClose(modalID) { | |||||
| _DedeConfirmFuncsClose[modalID](); | |||||
| } | |||||
| function DedeConfirm(content="",title="确认提示") { | |||||
| let modalID = guid(); | |||||
| return new Promise((resolve, reject) => { | |||||
| _DedeConfirmFuncs[modalID] = ()=>{ | |||||
| resolve("success"); | |||||
| CloseModal(`DedeModal${modalID}`); | |||||
| } | |||||
| _DedeConfirmFuncsClose[modalID] = ()=>{ | |||||
| reject("cancel"); | |||||
| CloseModal(`DedeModal${modalID}`); | |||||
| } | |||||
| let footer = `<button type="button" class="btn btn-outline-success btn-sm" onClick="__DedeConfirmRunClose(\'${modalID}\')">取消</button> <button type="button" class="btn btn-success btn-sm" onClick="__DedeConfirmRun(\'${modalID}\')">确定</button>`; | |||||
| let modal = `<div id="DedeModal${modalID}" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="DedeModalLabel${modalID}"> | |||||
| <div class="modal-dialog modal-dialog-centered" role="document"> | |||||
| <div class="modal-content"><div class="modal-header"> | |||||
| <h6 class="modal-title" id="DedeModalLabel${modalID}">${title}</h6>`; | |||||
| modal += `<button type="button" class="close" data-dismiss="modal" aria-label="Close"> | |||||
| <span>×</span> | |||||
| </button>`; | |||||
| modal += `</div><div class="modal-body">${content}</div><div class="modal-footer">${footer}</div></div></div></div>`; | |||||
| $("body").append(modal) | |||||
| $("#DedeModal" + modalID).modal({ | |||||
| backdrop: 'static', | |||||
| show: true | |||||
| }); | |||||
| $("#DedeModal" + modalID).on('hidden.bs.modal', function (e) { | |||||
| $("#DedeModal" + modalID).remove(); | |||||
| }) | |||||
| }) | |||||
| } | |||||
| //函数会返回一个modalID,通过这个id可自已定义一些方法,这里用到了一个展开语法https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/Spread_syntax | //函数会返回一个modalID,通过这个id可自已定义一些方法,这里用到了一个展开语法https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/Spread_syntax | ||||
| function ShowMsg(content, ...args) { | function ShowMsg(content, ...args) { | ||||
| title = "系统提示"; | title = "系统提示"; | ||||
| @@ -18,10 +18,6 @@ | |||||
| } | } | ||||
| return true; | return true; | ||||
| } | } | ||||
| function DelNote(gourl) { | |||||
| if (!window.confirm("您确认要删除这条记录吗")) { return false; } | |||||
| location.href = gourl; | |||||
| } | |||||
| </script> | </script> | ||||
| </head> | </head> | ||||
| <body> | <body> | ||||
| @@ -45,23 +45,51 @@ | |||||
| } | } | ||||
| function delFeedback() { | function delFeedback() { | ||||
| var qstr = getCheckboxItem(); | var qstr = getCheckboxItem(); | ||||
| if (qstr == "") ShowMsg("您没选中任何文档"); | |||||
| else if (window.confirm('您确定要删除这些评论吗')) location.href = "feedback_main.php?job=del&fid=" + qstr; | |||||
| if (qstr == "") { | |||||
| ShowMsg("您没选中任何文档"); | |||||
| return | |||||
| }; | |||||
| DedeConfirm("您确定要删除这些评论吗?").then((v)=>{ | |||||
| location.href = "feedback_main.php?job=del&fid=" + qstr | |||||
| }).catch((e)=>{ | |||||
| console.log(e) | |||||
| }); | |||||
| } | } | ||||
| function delFeedbackIP() { | function delFeedbackIP() { | ||||
| var qstr = getCheckboxItem(); | var qstr = getCheckboxItem(); | ||||
| if (qstr == "") ShowMsg("您没选中任何文档"); | |||||
| else if (window.confirm('您确定要删除这些评论吗')) location.href = "feedback_main.php?job=delall&fid=" + qstr; | |||||
| if (qstr == "") { | |||||
| ShowMsg("您没选中任何文档"); | |||||
| return; | |||||
| }; | |||||
| DedeConfirm("您确定要删除这些评论吗?").then((v)=>{ | |||||
| location.href = "feedback_main.php?job=delall&fid=" + qstr; | |||||
| }).catch((e)=>{ | |||||
| console.log(e) | |||||
| }); | |||||
| } | } | ||||
| function checkFeedback() { | function checkFeedback() { | ||||
| var qstr = getCheckboxItem(); | var qstr = getCheckboxItem(); | ||||
| if (qstr == "") ShowMsg("您没选中任何文档"); | |||||
| else location.href = "feedback_main.php?job=check&fid=" + qstr; | |||||
| if (qstr == "") { | |||||
| ShowMsg("您没选中任何文档"); | |||||
| return; | |||||
| }; | |||||
| DedeConfirm("您确定要删除这些评论吗?").then((v)=>{ | |||||
| location.href = "feedback_main.php?job=check&fid=" + qstr; | |||||
| }).catch((e)=>{ | |||||
| console.log(e) | |||||
| }); | |||||
| } | } | ||||
| function editFeedback() { | function editFeedback() { | ||||
| var qstr = getCheckboxItem(); | var qstr = getCheckboxItem(); | ||||
| if (qstr == "") ShowMsg("您没选中任何文档"); | |||||
| else location.href = "feedback_edit.php?job=edit&fid=" + qstr; | |||||
| if (qstr == "") { | |||||
| ShowMsg("您没选中任何文档"); | |||||
| return; | |||||
| } | |||||
| DedeConfirm("您确定要删除这些评论吗?").then((v)=>{ | |||||
| location.href = "feedback_edit.php?job=edit&fid=" + qstr; | |||||
| }).catch((e)=>{ | |||||
| console.log(e) | |||||
| }); | |||||
| } | } | ||||
| </script> | </script> | ||||
| </head> | </head> | ||||
| @@ -12,8 +12,8 @@ | |||||
| <script src="js/main.js"></script> | <script src="js/main.js"></script> | ||||
| <script> | <script> | ||||
| var pageno = 1; | var pageno = 1; | ||||
| var totalrow = <?php echo $totalRow;?>; | |||||
| var pagesize = <?php echo $pagesize;?>; | |||||
| var totalrow = parseInt('<?php echo $totalRow;?>'); | |||||
| var pagesize = parseInt('<?php echo $pagesize;?>'); | |||||
| var orderby = '<?php echo $orderby?>'; | var orderby = '<?php echo $orderby?>'; | ||||
| var addget = "<?php echo $addget?>"; | var addget = "<?php echo $addget?>"; | ||||
| //加载列表 | //加载列表 | ||||
| @@ -43,24 +43,27 @@ | |||||
| } | } | ||||
| //删除 | //删除 | ||||
| function DelNote(nid) { | function DelNote(nid) { | ||||
| if (!window.confirm("您确认要删除这条记录吗")) { return false; } | |||||
| var listArea = $Obj('rslist'); | |||||
| totalrow = totalrow - 1; | |||||
| var pagenum = Math.ceil(totalrow / pagesize); | |||||
| if (pagenum <= pageno) pageno = pagenum; | |||||
| var errMsg = "网络通信出错<br>[<a href=\"javascript:LoadPage('" + pageno + "')\">点击此重新加载列表</a>]"; | |||||
| fetch("freelist_main.php?dopost=del&aid=" + nid + "&pageno=" + pageno).then(resp=>{ | |||||
| if (resp.ok) { | |||||
| return resp.text() | |||||
| } | |||||
| throw new Error(errMsg); | |||||
| }).then((d)=>{ | |||||
| listArea.innerHTML = d; | |||||
| }).catch((error) => { | |||||
| listArea.innerHTML = errMsg; | |||||
| }); | |||||
| DedeConfirm("您确认要删除这条记录吗?").then((v)=>{ | |||||
| var listArea = $Obj('rslist'); | |||||
| totalrow = totalrow - 1; | |||||
| var pagenum = Math.ceil(totalrow / pagesize); | |||||
| if (pagenum <= pageno) pageno = pagenum; | |||||
| var errMsg = "网络通信出错<br>[<a href=\"javascript:LoadPage('" + pageno + "')\">点击此重新加载列表</a>]"; | |||||
| fetch("freelist_main.php?dopost=del&aid=" + nid + "&pageno=" + pageno).then(resp=>{ | |||||
| if (resp.ok) { | |||||
| return resp.text() | |||||
| } | |||||
| throw new Error(errMsg); | |||||
| }).then((d)=>{ | |||||
| listArea.innerHTML = d; | |||||
| }).catch((error) => { | |||||
| listArea.innerHTML = errMsg; | |||||
| }); | |||||
| ReloadPageNum(pageno); | |||||
| ReloadPageNum(pageno); | |||||
| }).catch((e)=>{ | |||||
| console.log(e) | |||||
| }); | |||||
| } | } | ||||
| //重新加载分页列表 | //重新加载分页列表 | ||||
| function ReloadPageNum(startnum) { | function ReloadPageNum(startnum) { | ||||
| @@ -300,8 +300,11 @@ | |||||
| } | } | ||||
| //删除 | //删除 | ||||
| function DelNote(gourl) { | function DelNote(gourl) { | ||||
| if (!window.confirm("您确认要删除这个字段吗")) { return false; } | |||||
| location.href = gourl; | |||||
| DedeConfirm("您确认要删除这个字段吗?").then((v)=>{ | |||||
| location.href = gourl; | |||||
| }).catch((e)=>{ | |||||
| console.log(e) | |||||
| }); | |||||
| } | } | ||||
| function ShowObj(objname) { | function ShowObj(objname) { | ||||
| var obj = document.getElementById(objname); | var obj = document.getElementById(objname); | ||||
| @@ -94,13 +94,16 @@ | |||||
| }); | }); | ||||
| } | } | ||||
| function DelType() { | function DelType() { | ||||
| if (window.confirm("您确实要删除这个分类吗") == false) return false; | |||||
| var id = GetSelType(); | |||||
| if (id == 0) { | |||||
| ShowMsg("必须选择一个类别"); | |||||
| return false; | |||||
| } | |||||
| location.href = 'stepselect_main.php?action=del&id=' + id; | |||||
| DedeConfirm("您确实要删除这个分类吗?").then((v)=>{ | |||||
| var id = GetSelType(); | |||||
| if (id == 0) { | |||||
| ShowMsg("必须选择一个类别"); | |||||
| return false; | |||||
| } | |||||
| location.href = 'stepselect_main.php?action=del&id=' + id; | |||||
| }).catch((e)=>{ | |||||
| console.log(e) | |||||
| }); | |||||
| } | } | ||||
| function CloseTWin() { | function CloseTWin() { | ||||
| $DE('edsta').innerHTML = loadhtml; | $DE('edsta').innerHTML = loadhtml; | ||||
| @@ -123,7 +126,11 @@ | |||||
| } | } | ||||
| } | } | ||||
| function DelSel() { | function DelSel() { | ||||
| if (window.confirm("您确实要删除这些分类吗")) document.form1.submit(); | |||||
| DedeConfirm("您确实要删除这些分类吗?").then((v)=>{ | |||||
| document.form1.submit(); | |||||
| }).catch((e)=>{ | |||||
| console.log(e) | |||||
| }); | |||||
| } | } | ||||
| function ChangePage2(sobj) { | function ChangePage2(sobj) { | ||||
| var nv = sobj.options[sobj.selectedIndex].value; | var nv = sobj.options[sobj.selectedIndex].value; | ||||
| @@ -9,9 +9,12 @@ | |||||
| <link rel="stylesheet" href="../static/web/css/admin.css"> | <link rel="stylesheet" href="../static/web/css/admin.css"> | ||||
| <script> | <script> | ||||
| function DelTpl(filename) { | function DelTpl(filename) { | ||||
| if (window.confirm('您确定要删除这篇文档吗')) location = 'tpl.php?action=del&acdir=<?php echo $acdir;?>&filename=' + | |||||
| filename; | |||||
| else return false; | |||||
| DedeConfirm("您确实要删除这个模板吗?").then((v)=>{ | |||||
| location = 'tpl.php?action=del&acdir=<?php echo $acdir;?>&filename=' + | |||||
| filename; | |||||
| }).catch((e)=>{ | |||||
| console.log(e) | |||||
| }); | |||||
| } | } | ||||
| </script> | </script> | ||||
| </head> | </head> | ||||
| @@ -29,6 +29,46 @@ function guid() { | |||||
| } | } | ||||
| return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4()); | return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4()); | ||||
| } | } | ||||
| var _DedeConfirmFuncs = {}; | |||||
| var _DedeConfirmFuncsClose = {}; | |||||
| function __DedeConfirmRun(modalID) { | |||||
| _DedeConfirmFuncs[modalID](); | |||||
| } | |||||
| function __DedeConfirmRunClose(modalID) { | |||||
| _DedeConfirmFuncsClose[modalID](); | |||||
| } | |||||
| function DedeConfirm(content="",title="确认提示") { | |||||
| let modalID = guid(); | |||||
| return new Promise((resolve, reject) => { | |||||
| _DedeConfirmFuncs[modalID] = ()=>{ | |||||
| resolve("success"); | |||||
| CloseModal(`DedeModal${modalID}`); | |||||
| } | |||||
| _DedeConfirmFuncsClose[modalID] = ()=>{ | |||||
| reject("cancel"); | |||||
| CloseModal(`DedeModal${modalID}`); | |||||
| } | |||||
| let footer = `<button type="button" class="btn btn-outline-success btn-sm" onClick="__DedeConfirmRunClose(\'${modalID}\')">取消</button> <button type="button" class="btn btn-success btn-sm" onClick="__DedeConfirmRun(\'${modalID}\')">确定</button>`; | |||||
| let modal = `<div id="DedeModal${modalID}" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="DedeModalLabel${modalID}"> | |||||
| <div class="modal-dialog modal-dialog-centered" role="document"> | |||||
| <div class="modal-content"><div class="modal-header"> | |||||
| <h6 class="modal-title" id="DedeModalLabel${modalID}">${title}</h6>`; | |||||
| modal += `<button type="button" class="close" data-dismiss="modal" aria-label="Close"> | |||||
| <span>×</span> | |||||
| </button>`; | |||||
| modal += `</div><div class="modal-body">${content}</div><div class="modal-footer">${footer}</div></div></div></div>`; | |||||
| $("body").append(modal) | |||||
| $("#DedeModal" + modalID).modal({ | |||||
| backdrop: 'static', | |||||
| show: true | |||||
| }); | |||||
| $("#DedeModal" + modalID).on('hidden.bs.modal', function (e) { | |||||
| $("#DedeModal" + modalID).remove(); | |||||
| }) | |||||
| }) | |||||
| } | |||||
| //函数会返回一个modalID,通过这个id可自已定义一些方法,这里用到了一个展开语法:https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/Spread_syntax | //函数会返回一个modalID,通过这个id可自已定义一些方法,这里用到了一个展开语法:https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/Spread_syntax | ||||
| function ShowMsg(content, ...args) { | function ShowMsg(content, ...args) { | ||||
| title = "系统提示"; | title = "系统提示"; | ||||
| @@ -17,7 +17,11 @@ | |||||
| location = "archives_do.php?dopost=edit&channelid=" + channelid + "&aid=" + aid; | location = "archives_do.php?dopost=edit&channelid=" + channelid + "&aid=" + aid; | ||||
| } | } | ||||
| function delArc(aid) { | function delArc(aid) { | ||||
| if (window.confirm('您确定要删除这篇文档吗')) location = "archives_do.php?aid=" + aid + "&dopost=delArc"; | |||||
| DedeConfirm("您确定要删除这篇文档吗?").then((v)=>{ | |||||
| location = "archives_do.php?aid=" + aid + "&dopost=delArc"; | |||||
| }).catch((e)=>{ | |||||
| console.log(e) | |||||
| }); | |||||
| } | } | ||||
| </script> | </script> | ||||
| </head> | </head> | ||||
| @@ -17,7 +17,11 @@ | |||||
| location = "archives_do.php?dopost=edit&channelid=" + channelid + "&aid=" + aid; | location = "archives_do.php?dopost=edit&channelid=" + channelid + "&aid=" + aid; | ||||
| } | } | ||||
| function delArc(aid) { | function delArc(aid) { | ||||
| if (window.confirm('您确定要删除这篇文档吗')) location = "archives_do.php?aid=" + aid + "&dopost=delArc"; | |||||
| DedeConfirm("您确定要删除这篇文档吗?").then((v)=>{ | |||||
| location = "archives_do.php?aid=" + aid + "&dopost=delArc"; | |||||
| }).catch((e)=>{ | |||||
| console.log(e) | |||||
| }); | |||||
| } | } | ||||
| </script> | </script> | ||||
| </head> | </head> | ||||
| @@ -68,6 +68,9 @@ | |||||
| //获得选中文件的文件名 | //获得选中文件的文件名 | ||||
| function GetCheckfolderItem() { | function GetCheckfolderItem() { | ||||
| var allSel = ''; | var allSel = ''; | ||||
| if (typeof document.form1.deleteid == "undefined") { | |||||
| return ''; | |||||
| } | |||||
| if (document.form1.deleteid.value) return document.form1.deleteid.value; | if (document.form1.deleteid.value) return document.form1.deleteid.value; | ||||
| for (i = 0; i < document.form1.deleteid.length; i++) { | for (i = 0; i < document.form1.deleteid.length; i++) { | ||||
| if (document.form1.deleteid[i].checked) { | if (document.form1.deleteid[i].checked) { | ||||
| @@ -82,12 +85,14 @@ | |||||
| function DoSubmit() { | function DoSubmit() { | ||||
| var selid = GetCheckfolderItem(); | var selid = GetCheckfolderItem(); | ||||
| if (selid == '') { | if (selid == '') { | ||||
| alert("您没选中任何信息"); | |||||
| ShowMsg("您没选中任何信息"); | |||||
| return false; | return false; | ||||
| } | } | ||||
| if (window.confirm("您确定要删除这些消息吗")) { | |||||
| DedeConfirm("您确定要删除这些消息吗?").then((v)=>{ | |||||
| location = "mypay.php?dopost=del&ids=" + selid; | location = "mypay.php?dopost=del&ids=" + selid; | ||||
| } | |||||
| }).catch((e)=>{ | |||||
| console.log(e) | |||||
| }); | |||||
| } | } | ||||
| </script> | </script> | ||||
| </body> | </body> | ||||
| @@ -82,9 +82,11 @@ | |||||
| ShowMsg("您没选中任何信息"); | ShowMsg("您没选中任何信息"); | ||||
| return false; | return false; | ||||
| } | } | ||||
| if (window.confirm("您确定要删除这些消息吗")) { | |||||
| DedeConfirm("您确定要删除这些消息吗?").then((v)=>{ | |||||
| location = "operation.php?dopost=del&ids=" + selid; | location = "operation.php?dopost=del&ids=" + selid; | ||||
| } | |||||
| }).catch((e)=>{ | |||||
| console.log(e) | |||||
| }); | |||||
| } | } | ||||
| </script> | </script> | ||||
| </body> | </body> | ||||
| @@ -44,15 +44,23 @@ | |||||
| } | } | ||||
| return allSel; | return allSel; | ||||
| } | } | ||||
| //删除操作 | |||||
| function DoSubmit(myfolder) { | function DoSubmit(myfolder) { | ||||
| var selid = GetCheckfolderItem(); | var selid = GetCheckfolderItem(); | ||||
| if (selid == '') { | if (selid == '') { | ||||
| ShowMsg("您没选中任何信息"); | ShowMsg("您没选中任何信息"); | ||||
| return false; | return false; | ||||
| } | } | ||||
| if (window.confirm("您确定要删除这些消息吗")) { | |||||
| location = "pm.php?dopost=del&ids=" + selid + "&folder=" + myfolder; | |||||
| } | |||||
| DedeConfirm("您确定要删除这些消息吗?").then((v)=>{ | |||||
| $.get("pm.php?dopost=remove&ids=" + selid + "&folder=" + myfolder,function (data) { | |||||
| let result = JSON.parse(data); | |||||
| if (result.code === 200) { | |||||
| location.reload(); | |||||
| } | |||||
| }) | |||||
| }).catch((e)=>{ | |||||
| console.log(e) | |||||
| }); | |||||
| } | } | ||||
| </script> | </script> | ||||
| </head> | </head> | ||||