head.html
12.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
<html xmlns:th="http://www.thymeleaf.org">
<head th:fragment="head">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>审核云平台内容管理系统</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<meta name="csrf-token" content="1S0PDRJgENm1wNWmFo4hb3CLm5PjPLFWxQM88P4G">
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<!--JQuery-->
<script src="../../static/js/jquery.min.js"></script>
<!--Bootstrap-->
<link href="../../static/css/bootstrap.min.css" rel="stylesheet">
<script src="../../static/js/bootstrap.min.js"></script>
<!-- Font Awesome -->
<link href="../../static/css/font-awesome.min.css" rel="stylesheet">
<!-- Theme style -->
<link rel="stylesheet" href="../../static/css/AdminLTE.min.css">
<!-- AdminLTE Skins. Choose a skin from the css/skins
folder instead of downloading all of them to reduce the load. -->
<link rel="stylesheet" href="../../static/css/_all-skins.min.css">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<!-- <script src="//cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>-->
<![endif]-->
<!--Bootstrap-Table-->
<link href="../../static/css/bootstrap-table.min.css" rel="stylesheet">
<!-- <script src="../../static/js/bootstrap-table.min.js"></script>
<script src="../../static/js/bootstrap-table-editable.min.js"></script>
<script src="../../static/js/bootstrap-table-zh-CN.min.js"></script>-->
<!--Moment.js-->
<script src="../../static/js/moment.min.js"></script>
<script src="../../static/js/moment-with-locales.min.js"></script>
<script src="../../static/js/locales.js"></script>
<!--CKEditor-->
<script src="../../static/js/ckeditor.js"></script><style>.cke{visibility:hidden;}</style>
<!--Bootstrap-DatetimePicker-->
<link href="../../static/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
<script src="../../static/js/bootstrap-datetimepicker.min.js"></script>
<!--X-editable-->
<link href="../../static/css/bootstrap-editable.css" rel="stylesheet">
<!-- <script src="../../static/js/bootstrap-editable.min.js"></script>-->
<!--Bootstrap-TreeView-->
<link href="../../static/css/bootstrap-treeview.min.css" rel="stylesheet">
<!-- <script src="../../static/js/bootstrap-treeview.min.js"></script>-->
<!--Bootstrap-fileinput-->
<link href="../../static/css/fileinput.min.css" rel="stylesheet">
<script src="../../static/js/canvas-to-blob.min.js"></script>
<script src="../../static/js/sortable.min.js"></script>
<script src="../../static/js/purify.min.js"></script>
<script src="../../static/js/fileinput.min.js"></script>
<script src="../../static/js/zh.js"></script>
<!--Toastr.js-->
<script src="../../static/js/toastr.min.js"></script>
<link href="../../static/css/toastr.min.css" rel="stylesheet">
<!--JqueryUI custom-->
<script src="../../static/js/jquery-ui.min.js"></script>
<link href="../../static/css/app.css" rel="stylesheet">
<script src="../../static/js/app.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<!-- <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" -->
<!-- integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" -->
<!-- crossorigin="anonymous"></script> -->
<!--添加Dialog 的js-->
<!-- <script type="text/javascript" src="http://resweb.cnliveimg.com/system/dialog/zDrag.js"></script> -->
<!-- <script type="text/javascript" src="http://resweb.cnliveimg.com/system/dialog/zDialog.js"></script> -->
<!-- <link href="../../static/css/dialog.css" rel="stylesheet"> -->
<!-- <link href="../../static/js/JetDialog.js" rel="stylesheet"> -->
<script language=javascript>
var x0=0,y0=0,x1=0,y1=0;
// var offx=6,offy=6;
var moveable=false;//鼠标是否是按下状态
// var hover='orange',normal='slategray';//color;
var hover='slategray',normal='slategray';//color;
var index=10000;//z-index;
var isShow=true;//是否显示消息框
//创建一个对象;
function xWin(id,tit,msg,url)
{
index = index+2;
isShow=false;
this.id = id;
this.width = 300;//主窗体宽度
this.height = 200;//主窗体高度
this.right = 0;//位置距右
this.bottom = 0;//位置距下
this.zIndex = index;
this.title = tit;//标题
this.message = msg;//消息体
this.url = url;//url
this.obj = null;
this.bulid = bulid;
this.bulid();
}
//初始化;
function bulid(){
var str = ""
+ "<div id=xMsg" + this.id + " "
+ "style='"
+ "z-index:" + this.zIndex + ";"
+ "width:" + this.width + "px;"
+ "height:" + this.height + "px;"
+ "right:" + this.right + ";"
+ "bottom:" + this.bottom + ";"
+ "background-color:white;"
+ "color:" + normal + ";"
+ "font-size:18px;"
+ "font-family:Verdana;"
+ "position:fixed;"
+ "cursor:default;"
+ "-webkit-user-select:none;"
+ "-moz-user-select:none;"
+ "-ms-user-select:none;"
+ "user-select:none;"
+ "border:2px solid " + normal + ";"
+ "' "
+ "οnmοusedοwn='getFocus(this)'"
+">"
// 标题开始
+ "<div "
+ "style='"
+ "background-color:" + normal + ";"
+ "width:" + (this.width-2*2) + "px;"
+ "height:28px;"
+ "color:white;"
+ "' "
+ "onmousedown='startDrag(this)' "
+ "onmouseup='stopDrag(this)' "
+ "onmousemove='drag(this)' "
+ "ondblclick='min(this.childNodes[1])'"
+ ">"
+ "<span style='width:" + (this.width-2*25-4) + "px;padding-left:3px; display:-moz-inline-box; display:inline-block;'>" + this.title + "</span>"
+ "<span style='width:25px;border-width:0px;color:white;font-family:webdings;display:-moz-inline-box; display:inline-block;' onclick='min(this)'>0</span>"
+ "<span style='width:25px;border-width:0px;color:white;font-family:webdings;display:-moz-inline-box; display:inline-block;' onclick='cls(this)'>r</span>"
+ "</div>"
// 主窗体开始
+ "<div style='"
+ "width:100%;"
+ "height:" + (this.height-28-4) + "px;"
+ "min-height:" + (this.height-28-4) + "px;"
+ "background-color:white;"
+ "word-break:break-all;"
+ "padding:3px;"
+ "'>"
// 主窗体的内容部分
+ "<div style='"
+ "width:100%;"
+ "height:" + (this.height-28-4-50) + "px;"
+ "min-height:" + (this.height-28-4-50) + "px;"
+ "line-height:20px;"
+ "text-align: center;"
+ "word-break:break-all;"
+ "padding:3px;"
+ "padding-top: 40px;"
+ "color:red;"
+ "'>"
+ this.message
+ "</div>"
// 主窗体的按钮部分(按钮1)
+ "<div style='"
+ "width:60px;"
+ "height:30px;"
+ "color: #fff;"
+ "line-height: 30px;"
+ "text-align: center;"
+ "font-size: 15px;"
+ "float:left;"
+ "margin-left: 120px;"
+ "background-color:" + normal + ";"
+ "'"
+" type='button'"
+" onclick='cls(this)'"
+">确定</div>"
// 主窗体的按钮部分(按钮2)
+ "<div style='"
+ "width:60px;"
+ "height:30px;"
+ "color: #fff;"
+ "line-height: 30px;"
+ "text-align: center;"
+ "font-size: 15px;"
+ "float:right;"
+ "margin-right:20px;"
+ "background-color:" + normal + ";"
+ "'"
+" type='button'"
+" onclick=\"toLink('"+this.url+"')\""
+">查看</div>"
+ "</div>"
+ "</div>";
document.body.insertAdjacentHTML("beforeEnd",str);
}
//开始拖动;
function startDrag(obj){
if(event.button==0){
//锁定标题栏;
// obj.setCapture();
//定义对象;
var win = obj.parentNode;
// var sha = win.nextSibling;
//记录鼠标和层位置;
x0 = event.clientX;
y0 = event.clientY;
x1 = parseInt(win.style.right.replace("px",""));
y1 = parseInt(win.style.bottom.replace("px",""));
//记录颜色;
normal = obj.style.backgroundColor;
//改变风格;
obj.style.backgroundColor = hover;
win.style.borderColor = hover;
obj.nextSibling.style.color = hover;
// sha.style.right = (x1 - offx)+"px";
// sha.style.bottom = (y1 - offy)+"px";
moveable = true;
}
}
//拖动;
function drag(obj){
if(moveable){
var win = obj.parentNode;
// var sha = win.nextSibling;
win.style.right = ( x1+x0-event.clientX)+"px";
win.style.bottom = ( y1+y0-event.clientY)+"px";
// sha.style.right = (parseInt(win.style.right.replace("px","")) - offx)+"px";
// sha.style.bottom = (parseInt(win.style.bottom.replace("px","")) - offy)+"px";
}
}
//停止拖动;
function stopDrag(obj){
if(moveable){
var win = obj.parentNode;
// var sha = win.nextSibling;
var msg = obj.nextSibling;
win.style.borderColor = normal;
obj.style.backgroundColor = normal;
msg.style.color = normal;
// sha.style.right = obj.parentNode.style.right;
// sha.style.bottom = obj.parentNode.style.bottom;
// obj.releaseCapture();
moveable = false;
}
}
//获得焦点;
function getFocus(obj)
{
if(obj.style.zIndex!=index)
{
index = index + 2;
var idx = index;
obj.style.zIndex=idx;
obj.nextSibling.style.zIndex=idx-1;
}
}
//最小化;
function min(obj){
var win = obj.parentNode.parentNode;
// var sha = win.nextSibling;
var tit = obj.parentNode;
var msg = tit.nextSibling;
var flg = msg.style.display=="none";
if(flg)
{
win.style.height = (parseInt(msg.style.height.replace("px","")) + parseInt(tit.style.height.replace("px","")) + 2*2)+"px";
// sha.style.height = win.style.height;
msg.style.display = "block";
obj.innerHTML = "0";
}
else
{
win.style.height = (parseInt(tit.style.height.replace("px","")) + 2*2)+"px";
// sha.style.height = win.style.height;
obj.innerHTML = "2";
msg.style.display = "none";
}
}
//关闭;
function cls(obj){
var win = obj.parentNode.parentNode;
// var sha = win.nextSibling;
win.style.visibility = "hidden";
// sha.style.visibility = "hidden";
isShow=true;
}
//点击查看跳转链接
function toLink(url){
isShow=true;
window.location.href= url;
// window.location.href= window.location.protocol+"//"+window.location.host+"/channel/page?shenhe_status=0&receive=0";
}
//-->
</script>
<script language='JScript'>
function initialize(){
var a = new xWin("1","新频道审核通知","您有三条未审核的频道消息,请尽快审核,谢谢!","www.baidu.com");
// var b = new xWin("2",100,200,0,200,"arui2","test2");
//var c = new xWin("3",200,160,250,50,"arui3","test3");
}
// window.onload = initialize;
var t1;
$(function(){
t1 = window.setInterval(
function(){
if(isShow){
notice()
}
},10000);
});
function notice(){
$.ajax({
type:'get',
dataType:'json',
data:'',
url: "/api/channel/channelNotice",
success:function(data){
if(data!=null && data!="" ){
// alert(data.title+":"+data.content);
//去掉定时器的方法
// window.clearInterval(t1);
new xWin(data.id,data.title,data.content,data.url);
}
}
});
}
//去掉定时器的方法
//window.clearInterval(t1);
</script>
</head>
</html>