From 8e2d6d8dac51c8da78a854fbd96a95f96162ae1c Mon Sep 17 00:00:00 2001 From: "xueli.xue" Date: Fri, 12 Aug 2016 19:56:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E5=85=B1=E5=BC=B9=E6=A1=86=E6=8F=92?= =?UTF-8?q?=E4=BB=B6,=E6=A8=A1=E5=9D=97=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WEB-INF/template/common/common.macro.ftl | 114 +-------------- .../src/main/webapp/WEB-INF/template/help.ftl | 1 - .../template/jobcode/jobcode.index.ftl | 1 - .../template/jobinfo/jobinfo.index.ftl | 1 - .../WEB-INF/template/joblog/joblog.index.ftl | 1 - .../main/webapp/WEB-INF/template/login.ftl | 1 - .../src/main/webapp/static/js/xxl.alert.1.js | 132 ++++++++++++++++++ 7 files changed, 138 insertions(+), 113 deletions(-) create mode 100644 xxl-job-admin/src/main/webapp/static/js/xxl.alert.1.js diff --git a/xxl-job-admin/src/main/webapp/WEB-INF/template/common/common.macro.ftl b/xxl-job-admin/src/main/webapp/WEB-INF/template/common/common.macro.ftl index 59d10c14..3899aa23 100644 --- a/xxl-job-admin/src/main/webapp/WEB-INF/template/common/common.macro.ftl +++ b/xxl-job-admin/src/main/webapp/WEB-INF/template/common/common.macro.ftl @@ -44,10 +44,14 @@ - + <#-- jquery cookie --> + + + <#-- common --> + - + <#macro commonHeader> @@ -175,110 +179,4 @@ oschina - - -<#macro comAlert > - - - - - - - \ No newline at end of file diff --git a/xxl-job-admin/src/main/webapp/WEB-INF/template/help.ftl b/xxl-job-admin/src/main/webapp/WEB-INF/template/help.ftl index cd577a25..094e69d9 100644 --- a/xxl-job-admin/src/main/webapp/WEB-INF/template/help.ftl +++ b/xxl-job-admin/src/main/webapp/WEB-INF/template/help.ftl @@ -52,6 +52,5 @@ <@netCommon.commonFooter /> <@netCommon.commonScript /> -<@netCommon.comAlert /> diff --git a/xxl-job-admin/src/main/webapp/WEB-INF/template/jobcode/jobcode.index.ftl b/xxl-job-admin/src/main/webapp/WEB-INF/template/jobcode/jobcode.index.ftl index 47c95c74..63c93fec 100644 --- a/xxl-job-admin/src/main/webapp/WEB-INF/template/jobcode/jobcode.index.ftl +++ b/xxl-job-admin/src/main/webapp/WEB-INF/template/jobcode/jobcode.index.ftl @@ -88,7 +88,6 @@ <@netCommon.commonFooter /> -<@netCommon.comAlert /> <@netCommon.commonScript /> diff --git a/xxl-job-admin/src/main/webapp/WEB-INF/template/jobinfo/jobinfo.index.ftl b/xxl-job-admin/src/main/webapp/WEB-INF/template/jobinfo/jobinfo.index.ftl index 54a433b9..29412ce7 100644 --- a/xxl-job-admin/src/main/webapp/WEB-INF/template/jobinfo/jobinfo.index.ftl +++ b/xxl-job-admin/src/main/webapp/WEB-INF/template/jobinfo/jobinfo.index.ftl @@ -250,7 +250,6 @@ public class DemoJobHandler extends IJobHandler { <@netCommon.commonScript /> -<@netCommon.comAlert /> diff --git a/xxl-job-admin/src/main/webapp/WEB-INF/template/joblog/joblog.index.ftl b/xxl-job-admin/src/main/webapp/WEB-INF/template/joblog/joblog.index.ftl index 610c874c..7b73c702 100644 --- a/xxl-job-admin/src/main/webapp/WEB-INF/template/joblog/joblog.index.ftl +++ b/xxl-job-admin/src/main/webapp/WEB-INF/template/joblog/joblog.index.ftl @@ -104,7 +104,6 @@ <@netCommon.commonScript /> -<@netCommon.comAlert /> diff --git a/xxl-job-admin/src/main/webapp/WEB-INF/template/login.ftl b/xxl-job-admin/src/main/webapp/WEB-INF/template/login.ftl index 3991d730..98e83b71 100644 --- a/xxl-job-admin/src/main/webapp/WEB-INF/template/login.ftl +++ b/xxl-job-admin/src/main/webapp/WEB-INF/template/login.ftl @@ -38,7 +38,6 @@ <@netCommon.commonScript /> -<@netCommon.comAlert /> diff --git a/xxl-job-admin/src/main/webapp/static/js/xxl.alert.1.js b/xxl-job-admin/src/main/webapp/static/js/xxl.alert.1.js new file mode 100644 index 00000000..5c12e2b2 --- /dev/null +++ b/xxl-job-admin/src/main/webapp/static/js/xxl.alert.1.js @@ -0,0 +1,132 @@ +/** + * Created by xuxueli on 16/8/12. + * + * dependency, jquery + bootstrap + */ + +// 通用提示 +var ComAlert = { + html:function(){ + var html = + ''; + return html; + }, + show:function(type, msg, callback){ + // dom init + if ($('#ComAlert').length == 0){ + $('body').append(ComAlert.html()); + } + + // 弹框初始 + if (type == 1) { + $('#ComAlert .alert').attr('class', 'alert alert-success'); + } else { + $('#ComAlert .alert').attr('class', 'alert alert-warning'); + } + $('#ComAlert .alert').html(msg); + $('#ComAlert').modal('show'); + + $('#ComAlert .ok').click(function(){ + $('#ComAlert').modal('hide'); + if(typeof callback == 'function') { + callback(); + } + }); + + // $("#ComAlert").on('hide.bs.modal', function () { }); // 监听关闭 + } +}; + +// 通用确认弹框 +var ComConfirm = { + html:function(){ + var html = + ''; + return html; + }, + show:function(msg, callback){ + // dom init + if ($('#ComConfirm').length == 0){ + $("body").append(ComConfirm.html()); + } + + // 弹框初始 + $('#ComConfirm .alert').attr('class', 'alert alert-warning'); + $('#ComConfirm .alert').html(msg); + $('#ComConfirm').modal('show'); + + $('#ComConfirm .ok').unbind("click"); // 解绑陈旧事件 + $('#ComConfirm .ok').click(function(){ + $('#ComConfirm').modal('hide'); + if(typeof callback == 'function') { + callback(); + return; + } + }); + + $('#ComConfirm .cancel').click(function(){ + $('#ComConfirm').modal('hide'); + return; + }); + } +}; +// 提示-科技主题 +var ComAlertTec = { + html:function(){ + var html = + ''; + return html; + }, + show:function(msg, callback){ + // dom init + if ($('#ComAlertTec').length == 0){ + $('body').append(ComAlertTec.html()); + } + + // 弹框初始 + $('#ComAlertTec .alert').html(msg); + $('#ComAlertTec').modal('show'); + + $('#ComAlertTec .ok').click(function(){ + $('#ComAlertTec').modal('hide'); + if(typeof callback == 'function') { + callback(); + } + }); + } +}; \ No newline at end of file