This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
k18-ntcs-web-ntc/src/main/webapp/WEB-INF/views/help.jsp
2019-01-27 11:02:55 +08:00

124 lines
4.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<html>
<head>
<title></title>
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/global/plugins/editor.md-master/css/editormd.css" />
<link href="${pageContext.request.contextPath}/static/global/plugins/jquery-ztree/3.5.12/css/zTreeStyle/zTreeStyle.min.css" rel="stylesheet" type="text/css"/>
<script src="${pageContext.request.contextPath}/static/global/plugins/jquery-ztree/3.5.12/js/jquery.ztree.all-3.5.min.js" type="text/javascript"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/global/plugins/showdown-master/dist/showdown.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var setting = {check:{enable:false,nocheckInherit:true},view:{selectedMulti:false},
data:{simpleData:{enable:true}},callback:{onClick:function(event, treeId, treeNode){
showHelp(treeNode.helpHref);
}}};
// 用户-菜单
var zNodes=[
<c:forEach items="${menuList}" var="menu">
{
id:"${menu.id}",
helpHref:"${menu.menuBg}",
pId:"${not empty menu.parent.id?menu.parent.id:0}",
name:"<c:if test='${not empty menu.parent.id}'><spring:message code="${menu.code}"/></c:if><c:if test='${empty menu.parent.id}'><spring:message code='permission_list'/></c:if>"
},
</c:forEach>];
// 初始化树结构
var tree = $.fn.zTree.init($("#menuTree"), setting, zNodes);
// 不选择父节点
//tree.setting.check.chkboxType = { "Y" : "ps", "N" : "s" };
// 默认选择节点
/* var ids = "${role.menuIds}".split(",");
for(var i=0; i<ids.length; i++) {
var node = tree.getNodeByParam("id", ids[i]);
try{tree.checkNode(node, true, false);}catch(e){}
} */
// 默认展开全部节点
tree.expandAll(true);
//隐藏没有分配父节点权限,却有子节点权限的叶子节点
//$("#menuTree").children("li:not(:eq(0))").hide();
});
var helpHrefVal=null;//用于在editHelp页面使用
var toolLang=null;//用于editorHelp页面初始化语言
var markdown="";//用于editorHelp填充编辑器内容
function showHelp(helpHref) {
var editBtn=$("#editHelp");
if(editBtn!=null&&editBtn!=undefined){
editBtn.remove();
}
if(helpHref!=''){
var lang = "${cookie.Language.value }".toLowerCase();
/* if(lang=="" || lang.indexOf("en")!=-1) {
helpHref += ".html";
}else if(lang.indexOf("cn")!=-1) {
helpHref += ".html";
}else if(lang.indexOf("ru")!=-1) {
helpHref += ".html";
} */
if(lang=="" || lang.indexOf("en")!=-1) {
helpHref += ".md";
}else if(lang.indexOf("cn")!=-1) {
helpHref += ".md";
}else if(lang.indexOf("ru")!=-1) {
helpHref += ".md";
}
toolLang=lang;
helpHrefVal=helpHref;
//$(".help").load("${pageContext.request.contextPath}"+helpHref+"?time="+new Date().getTime());
markdown = $.ajax({
type:"get",
url: "${pageContext.request.contextPath}"+helpHref,
dataType:"text",
cache: false,
async: false
}).responseText;
var converter = new showdown.Converter();//初始化showdown
$(".help").html(converter.makeHtml(markdown));//将markdown格式文件转为html展示
var permission="${fns:getUser().isAdmin() }";
if(permission!=null&&permission!=undefined&&permission=="true"){
$("#menuTree").parent().after('<button class="btn btn-default" id="editHelp" onclick="javascript:editHelp();"><spring:message code="edit"/></button>');
}
}
};
var helpInfo=null;//保存加载的信息用于在editHelp页面使用
function editHelp(){
helpInfo=null;
var editBtn=$("#editHelp");
if(editBtn!=null&&editBtn!=undefined){
editBtn.remove();
}
helpInfo=$(".help").html();
$(".help").load("${pageContext.request.contextPath}/online-help/editHelp.html");
};
</script>
</head>
<body>
<div class="page-content">
<h3 class="page-title">
<spring:message code="${online_help }"></spring:message>
</h3>
<div class="row">
<div class="col-md-2">
<div id="menuTree" class="ztree" style="margin-top:3px;float:left;"></div>
</div>
<div class="col-md-10 help" >
</div>
</div>
</div>
</body>
</html>