head.html 12.5 KB
<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>