diff --git a/src/admin/js/key.js b/src/admin/js/key.js
index fd72d27f..576c7cab 100644
--- a/src/admin/js/key.js
+++ b/src/admin/js/key.js
@@ -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()
{
- if (window.confirm("您确定要删除选定的关键字吗")) {
+ DedeConfirm("您确定要删除选定的关键字吗?").then((v)=>{
document.form3.dopost.value = 'delall';
document.form3.submit();
- }
+ }).catch((e)=>{
+ console.log(e)
+ });
}
\ No newline at end of file
diff --git a/src/admin/js/main.js b/src/admin/js/main.js
index 33ae09f6..38e16f9c 100644
--- a/src/admin/js/main.js
+++ b/src/admin/js/main.js
@@ -511,6 +511,45 @@ function guid() {
}
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 = ` `;
+ let modal = `
`;
+ $("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
function ShowMsg(content, ...args) {
title = "系统提示";
diff --git a/src/admin/templets/diy_edit.htm b/src/admin/templets/diy_edit.htm
index 56418192..ff5b3e50 100644
--- a/src/admin/templets/diy_edit.htm
+++ b/src/admin/templets/diy_edit.htm
@@ -18,10 +18,6 @@
}
return true;
}
- function DelNote(gourl) {
- if (!window.confirm("您确认要删除这条记录吗")) { return false; }
- location.href = gourl;
- }
diff --git a/src/admin/templets/feedback_main.htm b/src/admin/templets/feedback_main.htm
index a659543a..0b2ce504 100644
--- a/src/admin/templets/feedback_main.htm
+++ b/src/admin/templets/feedback_main.htm
@@ -45,23 +45,51 @@
}
function delFeedback() {
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() {
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() {
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() {
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)
+ });
}
diff --git a/src/admin/templets/freelist_main.htm b/src/admin/templets/freelist_main.htm
index ce0b69e3..c0c3d09c 100644
--- a/src/admin/templets/freelist_main.htm
+++ b/src/admin/templets/freelist_main.htm
@@ -12,8 +12,8 @@
diff --git a/src/static/web/js/style.js b/src/static/web/js/style.js
index 546a49cb..6815cf20 100644
--- a/src/static/web/js/style.js
+++ b/src/static/web/js/style.js
@@ -29,6 +29,46 @@ function guid() {
}
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 = ` `;
+ let modal = ``;
+ $("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
function ShowMsg(content, ...args) {
title = "系统提示";
diff --git a/src/user/templets/content_list.htm b/src/user/templets/content_list.htm
index f088d5ab..e0707920 100755
--- a/src/user/templets/content_list.htm
+++ b/src/user/templets/content_list.htm
@@ -17,7 +17,11 @@
location = "archives_do.php?dopost=edit&channelid=" + channelid + "&aid=" + 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)
+ });
}
diff --git a/src/user/templets/content_sg_list.htm b/src/user/templets/content_sg_list.htm
index eb1b74cb..74ffe1ae 100755
--- a/src/user/templets/content_sg_list.htm
+++ b/src/user/templets/content_sg_list.htm
@@ -17,7 +17,11 @@
location = "archives_do.php?dopost=edit&channelid=" + channelid + "&aid=" + 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)
+ });
}
diff --git a/src/user/templets/mypay.htm b/src/user/templets/mypay.htm
index c0d59b30..e24a3101 100755
--- a/src/user/templets/mypay.htm
+++ b/src/user/templets/mypay.htm
@@ -68,6 +68,9 @@
//获得选中文件的文件名
function GetCheckfolderItem() {
var allSel = '';
+ if (typeof document.form1.deleteid == "undefined") {
+ return '';
+ }
if (document.form1.deleteid.value) return document.form1.deleteid.value;
for (i = 0; i < document.form1.deleteid.length; i++) {
if (document.form1.deleteid[i].checked) {
@@ -82,12 +85,14 @@
function DoSubmit() {
var selid = GetCheckfolderItem();
if (selid == '') {
- alert("您没选中任何信息");
+ ShowMsg("您没选中任何信息");
return false;
}
- if (window.confirm("您确定要删除这些消息吗")) {
+ DedeConfirm("您确定要删除这些消息吗?").then((v)=>{
location = "mypay.php?dopost=del&ids=" + selid;
- }
+ }).catch((e)=>{
+ console.log(e)
+ });
}