<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE HTML>
<html>
<head>
<meta name="decorator" content="base" />
<meta charset="utf-8">
<title>详情</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<style>
  .edui-default .edui-editor {
    width: 100% !important;
  }
  #edui1_toolbarbox {
    display: none;
  }
  #edui1_bottombar {
    display: none;
  }
</style>
</head>
<body>
<div class="layui-card">
<div style="padding: 10px;">
  <div class="layui-form addForm" lay-filter="add-form" id="addForm">
    <div class="layui-form-item">
      <label class="layui-form-label">公告名称：</label>
      <div class="layui-input-block">
        <input type="text" id="title" name="title" lay-verify="required" class="layui-input" maxlength="30" value="${announcement.title}" readonly>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">通知内容：</label>
      <div class="layui-input-block" style="margin-bottom: 10px;min-height: 314px;">
        <script id="container" name="content" type="text/plain">
        </script>
      </div>
    </div>

  </div>
  </div>
</div>

<script type="text/javascript" src="${ctxPlugin}/lib/ueditor/1.4.3/ueditor.config.js"></script>
<script type="text/javascript" src="${ctxPlugin}/lib/ueditor/1.4.3/ueditor.all.js"></script>
<script type="text/javascript" src="${ctxPlugin}/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
<script src="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/layui/layui.js"></script>
  <script>
  var $;

  layui.use(['form','table'], function(){
	   var form = layui.form;
	   $ = layui.$;

      (function UEEdit() {
          window.UEDITOR_CONFIG.UEDITOR_HOME_URL = '${ctxPlugin}/lib/ueditor/1.4.3/';
          //防止图片过宽
          ue = UE.getEditor('container', {
              serverUrl: '${ctxPlugin}/lib/ueditor/1.4.3/jsp/controller.jsp',
              toolbars: [['bold', 'italic', 'underline', 'fontborder', 'forecolor', 'backcolor',
                  'fontfamily', 'fontsize', 'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify',
                  'simpleupload', 'insertimage','fullscreen']],
              autoHeightEnabled: false,
              autoFloatEnabled: false,
              elementPathEnabled: false,
              initialFrameHeight: 260,
              catcherUrlPrefix: '${commonStaticImgPath}',
              zIndex: 1000
          });
          ue.ready(function () {
              ue.setDisabled();
              $(this.container).click(function (e) {
                  e.stopPropagation();
              });
              // 解决悬浮问题
              if (UE.browser.ie && UE.browser.version <= 7) {
                  FixIe7Bug();
              }

              $.ajax({
                  url: '${ctx}/msg/center/show',
                  type: "post",
                  data: {id: '${id}'},
                  dataType: "json",
                  success: function (data) {
                      ue.setContent(data.html);

                      <c:if test="${!hasRead}">
                      $.ajax({
                          type: 'post',
                          data: {id: '${id}'},
                          url: "${ctx}/msg/center/markMsgAsRead",
                          success: function (data) {
                          }
                      });
                      </c:if>
                  }
              });
          });
      })();

  });
  </script>
</body>
</html>
