🔖 调整细节

上级 f818716d
......@@ -113,8 +113,6 @@ var zhyd = window.zhyd || {
}, options);
var E = window.wangEditor;
editor = new E('#' + $op.id);
// 通过 url 参数配置 debug 模式。url 中带有 wangeditor_debug_mode=1 才会开启 debug 模式
editor.customConfig.debug = location.href.indexOf('wangeditor_debug_mode=1') > 0;
// 关闭粘贴样式的过滤
editor.customConfig.pasteFilterStyle = false;
editor.customConfig.zIndex = 100;
......
......@@ -35,7 +35,6 @@
_option: {},
init: function (options) {
$.tableUtil._option = options;
// console.log(options.url);
var $tablelist = $('#tablelist');
$tablelist.bootstrapTable('destroy').bootstrapTable({
url: options.url,
......@@ -123,14 +122,17 @@
/* 添加 */
$("#btn_add").click(function () {
resetForm();
$("#addOrUpdateModal").modal('show');
$("#addOrUpdateModal").find(".modal-dialog .modal-content .modal-header h4.modal-title").html("添加" + options.modalName);
var $addOrUpdateModal = $("#addOrUpdateModal");
$addOrUpdateModal.modal('show');
$addOrUpdateModal.find(".modal-dialog .modal-content .modal-header h4.modal-title").html("添加" + options.modalName);
if ($("#password") && $("#password")[0]) {
$("#password").attr("required", "required");
var $password = $("#password");
if ($password && $password[0]) {
$password.attr("required", "required");
}
if ($("#username") && $("#username")[0]) {
$("#username").removeAttr("readonly");
var $username = $("#username");
if ($username && $username[0]) {
$username.removeAttr("readonly");
}
bindSaveInfoEvent(options.createUrl);
});
......@@ -144,15 +146,17 @@
url: options.getInfoUrl.replace("{id}", userId),
success: function (json) {
var info = json.data;
// console.log(info);
resetForm(info);
$("#addOrUpdateModal").modal('show');
$("#addOrUpdateModal").find(".modal-dialog .modal-content .modal-header h4.modal-title").html("修改" + options.modalName);
if ($("#password") && $("#password")[0]) {
$("#password").removeAttr("required");
var $addOrUpdateModal = $("#addOrUpdateModal");
$addOrUpdateModal.modal('show');
$addOrUpdateModal.find(".modal-dialog .modal-content .modal-header h4.modal-title").html("修改" + options.modalName);
var $password = $("#password");
if ($password && $password[0]) {
$password.removeAttr("required");
}
if ($("#username") && $("#username")[0]) {
$("#username").attr("readonly", "readonly");
var $username = $("#username");
if ($username && $username[0]) {
$username.attr("readonly", "readonly");
}
bindSaveInfoEvent(options.updateUrl);
......@@ -171,7 +175,6 @@
traditional: true,
data: {'ids': ids},
success: function (json) {
console.warn(json);
$.alert.ajaxSuccess(json);
$.tableUtil.refresh();
},
......@@ -206,8 +209,7 @@
})(jQuery);
function bindSaveInfoEvent(url) {
$(".addOrUpdateBtn").unbind('click');
$(".addOrUpdateBtn").click(function () {
$(".addOrUpdateBtn").unbind('click').click(function () {
if (validator.checkAll($("#addOrUpdateForm"))) {
$.ajax({
type: "post",
......@@ -225,6 +227,10 @@ function bindSaveInfoEvent(url) {
}
function resetForm(info) {
var $combox = $("#addOrUpdateModal form select[target=combox]");
if($combox && $combox[0]) {
zhyd.combox.init();
}
$("#addOrUpdateModal form input,#addOrUpdateModal form select,#addOrUpdateModal form textarea").each(function () {
var $this = $(this);
clearText($this, this.type, info);
......
......@@ -67,6 +67,7 @@
</html>
</#macro>
<#-- 面包屑导航内容 + 系统通知 -->
<#macro breadcrumb>
<div class="row">
<div class="col col-md-9">
......
......@@ -101,7 +101,7 @@
</div>
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12 top_tiles">
<#-- 文章 -->
<#-- 文章 -->
<a href="/articles" class="statistics-panel">
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 statistics-article" data-key="articleCount">
<div class="tile-stats statistics-box">
......@@ -111,7 +111,7 @@
</div>
</div>
</a>
<#-- 标签 -->
<#-- 标签 -->
<a href="/article/tags" class="statistics-panel">
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 statistics-tag" data-key="tagCount">
<div class="tile-stats statistics-box">
......@@ -121,7 +121,7 @@
</div>
</div>
</a>
<#-- 分类 -->
<#-- 分类 -->
<a href="/article/types" class="statistics-panel">
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 statistics-type" data-key="typeCount">
<div class="tile-stats statistics-box">
......@@ -131,7 +131,7 @@
</div>
</div>
</a>
<#-- 评论 -->
<#-- 评论 -->
<a href="/comments" class="statistics-panel">
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 statistics-comment" data-key="commentCount">
<div class="tile-stats statistics-box">
......@@ -144,7 +144,7 @@
</div>
</div>
<div class="row">
<#-- 分类文章数统计 -->
<#-- 分类文章数统计 -->
<div class="col-md-4 col-sm-4 col-xs-12">
<div class="x_panel fixed_height_320 statistics-box">
<div class="x_title">
......@@ -159,7 +159,7 @@
</div>
</div>
</div>
<#-- 文章访问TOP.10 -->
<#-- 文章访问TOP.10 -->
<div class="col-md-4 col-sm-4 col-xs-12">
<div class="x_panel fixed_height_320 statistics-box">
<div class="x_title">
......@@ -183,7 +183,7 @@
</div>
</div>
</div>
<#-- 爬虫访问统计TOP.10 -->
<#-- 爬虫访问统计TOP.10 -->
<div class="col-md-4 col-sm-4 col-xs-12">
<div class="x_panel fixed_height_320 statistics-box">
<div class="x_title">
......@@ -199,7 +199,7 @@
</div>
</div>
<#-- 近期文章 -->
<#-- 近期文章 -->
<div class="col-md-6 col-sm-6 col-xs-12">
<div class="x_panel statistics-box">
<div class="x_title">
......@@ -238,7 +238,7 @@
</div>
</div>
</div>
<#-- 近期评论 -->
<#-- 近期评论 -->
<div class="col-md-6 col-sm-6 col-xs-12">
<div class="x_panel statistics-box">
<div class="x_title">
......@@ -260,18 +260,18 @@
</tr>
</thead>
<tbody>
<@zhydTag method="recentComments" pageSize="5">
<#if recentComments?exists && (recentComments?size > 0)>
<#list recentComments as item>
<tr>
<th class="title word-prase"><div><a href="${item.url}" target="_blank" rel="external nofollow">${item.nickname?if_exists}</a></div></th>
<td class="content"><div class="word-prase">${item.briefContent?if_exists}</div></td>
<td class="source"><div class="word-prase"><a href="${config.siteUrl}${item.sourceUrl}#comment-${item.id?c}" target="_blank" rel="external nofollow">${item.articleTitle?if_exists}</a></div></td>
<td>${item.createTime?string('yyyy-MM-dd')}</td>
</tr>
</#list>
</#if>
</@zhydTag>
<@zhydTag method="recentComments" pageSize="5">
<#if recentComments?exists && (recentComments?size > 0)>
<#list recentComments as item>
<tr>
<th class="title word-prase"><div><a href="${item.url}" target="_blank" rel="external nofollow">${item.nickname?if_exists}</a></div></th>
<td class="content"><div class="word-prase">${item.briefContent?if_exists}</div></td>
<td class="source"><div class="word-prase"><a href="${config.siteUrl}${item.sourceUrl}#comment-${item.id?c}" target="_blank" rel="external nofollow">${item.articleTitle?if_exists}</a></div></td>
<td>${item.createTime?string('yyyy-MM-dd')}</td>
</tr>
</#list>
</#if>
</@zhydTag>
</tbody>
</table>
</div>
......
<#include "include/macros.ftl">
<@header></@header>
<@header>
<style>
.messanger {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
}
.messanger .messages {
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1;
margin: 10px 0;
padding: 0 10px;
max-height: 260px;
overflow-y: auto;
overflow-x: hidden;
}
.messanger .messages .message, .messanger .messages .ready {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
margin-bottom: 15px;
-webkit-box-align: start;
-ms-flex-align: start;
align-items: flex-start;
}
.messanger .messages .message.me {
-webkit-box-orient: horizontal;
-webkit-box-direction: reverse;
-ms-flex-direction: row-reverse;
flex-direction: row-reverse;
}
.messanger .messages .message.me img {
margin-right: 0;
margin-left: 15px;
}
.messanger .messages .message.me .info {
background-color: #009688;
color: #FFF;
}
.messanger .messages .message.me .info:before {
display: none;
}
.messanger .messages .message.me .info:after {
position: absolute;
right: -13px;
top: 0;
content: "";
width: 0;
height: 0;
border-style: solid;
border-width: 0 16px 16px 0;
border-color: transparent #009688 transparent transparent;
-webkit-transform: rotate(270deg);
-ms-transform: rotate(270deg);
transform: rotate(270deg);
}
.messanger .messages .message img {
border-radius: 50%;
margin-right: 15px;
width: 48px;
}
.messanger .messages .message .info, .messanger .messages .ready .info {
margin: 0;
background-color: #ddd;
padding: 5px 10px;
border-radius: 3px;
position: relative;
-ms-flex-item-align: start;
align-self: flex-start;
}
.messanger .messages .message .info:before {
position: absolute;
left: -14px;
top: 0;
content: "";
width: 0;
height: 0;
border-style: solid;
border-width: 0 16px 16px 0;
border-color: transparent #ddd transparent transparent;
}
.messanger .sender {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
}
.messanger .sender input[type="text"] {
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1;
border: 1px solid #009688;
outline: none;
padding: 5px 10px;
}
.messanger .sender button {
border-radius: 0;
}
</style>
</@header>
<div class="clearfix"></div>
<div class="row">
......@@ -12,28 +128,53 @@
</@breadcrumb>
<div class="x_panel">
<div class="x_title">
<h2>Websocket实现向用户发送通知 <small>当前在线人数: ${online!("0")}</small></h2>
<h2>向web端发送消息通知 <small>需要web端用户授权</small></h2>
<ul class="nav navbar-right panel_toolbox">
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
</li>
</ul>
<div class="clearfix"></div>
</div>
<div class="x_content">
<form class="form-horizontal form-label-left" novalidate>
<div class="item form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="domain">消息通知内容<span class="required">*</span></label>
<div class="col-md-6 col-sm-6 col-xs-12">
<textarea class="form-control col-md-7 col-xs-12" id="msg" name="msg" required="required" placeholder="请输入消息通知内容" rows="5"></textarea>
<div class="x_content" style="display: flex;justify-content: center;">
<div class="col-md-6 col-sm-6 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2><i class="fa fa-whatsapp"></i> 聊天 <small>socket通信,当前在线: ${online!("0")}</small></h2>
<ul class="nav navbar-right panel_toolbox">
<li></li>
</ul>
<div class="clearfix"></div>
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="comment"></label>
<div class="col-md-6 col-sm-6 col-xs-12">
<button type="button" class="btn btn-primary" id="saveBtn"><i class="fa fa-send"> 发送</i></button>
<div class="x_content">
<div class="messanger">
<div class="messages">
<div class="ready">
<p class="info">......</p>
</div>
<#--<div class="message">
<img src="/assets/images/user.png">
<p class="info">Hello there!<br>Good Morning</p>
</div>
<div class="message me">
<img src="/assets/images/loading.gif">
<p class="info">Hi<br>Good Morning</p>
</div>
<div class="message"><img src="/assets/images/user.png">
<p class="info">How are you?</p>
</div>
<div class="message me"><img src="/assets/images/loading.gif">
<p class="info">I'm Fine.</p>
</div>-->
</div>
<div class="sender">
<input type="text" name="msg" id="msg" placeholder="Send Message">
<button class="btn btn-primary" id="send-btn" type="button" style="margin: 0;"><i class="fa fa-lg fa-fw fa-paper-plane"></i></button>
</div>
</div>
<div class="clearfix"></div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
......@@ -41,11 +182,17 @@
</div>
<@footer>
<script type="text/javascript">
$("#saveBtn").click(function () {
var $form = $(this).parents("form");
$("#send-btn").click(function () {
var $messages = $(".messages");
var msg = $("#msg").val();
$.post("/api/notice", {msg : msg}, function (json) {
$.alert.ajaxSuccess(json);
if (json.status == 200) {
$messages.append('<div class="message me"><img src="/assets/images/loading.gif"><p class="info">' + msg + '</p></div>');
} else {
if (json.message) {
$.alert.error(json.message);
}
}
})
});
</script>
......
......@@ -523,7 +523,7 @@ a:-webkit-any-link {
float: left;
color: #666;
margin-right: 8px;
margin-top: 5px;
margin-top: 3px;
}
.notify i {
......
......@@ -9,7 +9,7 @@
<div class="container custome-container">
<@prompt></@prompt>
<nav class="breadcrumb">
<div class="notify"><i class="fa fa-volume-up"></i></div>
<div class="notify"><i class="fa fa-bullhorn fa-fw"></i></div>
<div id="scrolldiv">
<div class="scrolltext">
<ul class="list-unstyled" id="notice-box">
......
......@@ -6,10 +6,15 @@
- 关闭issue:
- Fixed issue : [IN4T1](https://gitee.com/yadong.zhang/DBlog/issues/IN4T1)
- Fixed issue : [IN807](https://gitee.com/yadong.zhang/DBlog/issues/IN807)
- Fixed issue : [IOWDY](https://gitee.com/yadong.zhang/DBlog/issues/IOWDY)
- Fixed issue : [IP2I1](https://gitee.com/yadong.zhang/DBlog/issues/IP2I1)
- 新增:
- admin项目中,在面包屑导航列新增一个系统通知(友情提示)
- 修改:
- web项目中,“更新记录”页面重构
- admin项目中,“推送消息”页面重构,以后准备做个简单的聊天通讯工具
----
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册