新开分支整理代码:
1.帮助文档修改功能 2.帮助文档与上一版对比功能 3.单点问题解决 4.markdown帮助文档 Conflicts: src/main/resources/messages/message_en.properties src/main/resources/messages/message_ru.properties src/main/resources/messages/message_zh_CN.properties
This commit is contained in:
@@ -4,9 +4,10 @@
|
||||
<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(){
|
||||
|
||||
@@ -39,19 +40,119 @@ $(document).ready(function(){
|
||||
//隐藏没有分配父节点权限,却有子节点权限的叶子节点
|
||||
//$("#menuTree").children("li:not(:eq(0))").hide();
|
||||
});
|
||||
var converter = new showdown.Converter();//初始化showdown
|
||||
var helpHrefVal=null;//用于在editHelp页面使用
|
||||
var toolLang=null;//用于editorHelp页面初始化语言
|
||||
var markdown="";//用于editorHelp填充编辑器内容
|
||||
function showHelp(helpHref) {
|
||||
|
||||
$("#operation").html("");
|
||||
if(helpHref!=''){
|
||||
var lang = "${cookie.Language.value }".toLowerCase();
|
||||
if(lang=="" || lang.indexOf("en")!=-1) {
|
||||
|
||||
/* 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";
|
||||
}
|
||||
$(".help").load("${pageContext.request.contextPath}"+helpHref);
|
||||
toolLang=lang;
|
||||
helpHrefVal=helpHref;
|
||||
//$(".help").load("${pageContext.request.contextPath}"+helpHref+"?time="+new Date().getTime());
|
||||
var transStatus=-1;//传输状态标记
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "${pageContext.request.contextPath}/nis/sys/viewHelp",
|
||||
data:"helpHref="+encodeURIComponent(helpHref),
|
||||
dataType:"text",
|
||||
cache: false,
|
||||
async: false,
|
||||
success:function(data){
|
||||
var jsonobj=eval("("+data+")")
|
||||
markdown=jsonobj.fileComment;
|
||||
if(markdown==null||markdown==""){
|
||||
markdown="no data";
|
||||
}
|
||||
},
|
||||
error:function(data,textStatus){
|
||||
transStatus=textStatus;
|
||||
}
|
||||
})
|
||||
if(transStatus!=-1){
|
||||
markdown="no data";
|
||||
}
|
||||
|
||||
$(".help").html(converter.makeHtml(markdown));//将markdown格式文件转为html展示
|
||||
var permission="${fns:getUser().isAdmin() }";
|
||||
|
||||
if(permission!=null&&permission!=undefined&&permission=="true"){
|
||||
$("#operation").append('<button class="btn btn-default" id="editHelp" onclick="javascript:editHelp();"><spring:message code="edit"/></button>');
|
||||
|
||||
$("#operation").append('<button class="btn btn-default" id="historyHelp" onclick="javascript:compareToHistory();"><spring:message code="pre_version"/></button>');
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
var helpInfo=null;//保存加载的信息,用于在editHelp页面使用
|
||||
function editHelp(){
|
||||
helpInfo=null;
|
||||
$("#operation").html("");
|
||||
helpInfo=$(".help").html();
|
||||
$(".help").load("${pageContext.request.contextPath}/online-help/editHelp.html");
|
||||
|
||||
};
|
||||
var oldMarkdown="";
|
||||
function compareToHistory(){
|
||||
|
||||
if(helpHrefVal!=''){
|
||||
var helpHref=helpHrefVal;
|
||||
var lang = "${cookie.Language.value }".toLowerCase();
|
||||
var transStatus=-1;//传输状态标记
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "${pageContext.request.contextPath}/nis/sys/viewBakHelp",
|
||||
data:"helpHref="+encodeURIComponent(helpHref),
|
||||
dataType:"text",
|
||||
cache: false,
|
||||
async: false,
|
||||
success:function(data){
|
||||
var jsonobj=eval("("+data+")")
|
||||
oldMarkdown=jsonobj.backFileComment;
|
||||
if(oldMarkdown==null||oldMarkdown==""){
|
||||
oldMarkdown="no data";
|
||||
}
|
||||
},
|
||||
error:function(data,textStatus){
|
||||
transStatus=textStatus;
|
||||
}
|
||||
})
|
||||
if(transStatus!=-1){
|
||||
oldMarkdown="no data";
|
||||
}
|
||||
$("#history").html(converter.makeHtml(oldMarkdown));//将markdown格式文件转为html展示
|
||||
$("#rightNow").html($(".help").html());
|
||||
$(".help").html("");
|
||||
$(".help").html($("#editHelp-history-compare").html());
|
||||
|
||||
}
|
||||
}
|
||||
var count=0;
|
||||
function showSrcCode(){
|
||||
count++;
|
||||
if(count%2==1){
|
||||
$("#history").html("<textarea readonly=\"readonly\" style=\"width:100%;height:100%; border:0;background-color:transparent; color: #666464;overflow: hidden;\">"+oldMarkdown+"</textarea>");
|
||||
}else{
|
||||
$("#history").html(converter.makeHtml(oldMarkdown));//将markdown格式文件转为html展示
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
@@ -63,9 +164,26 @@ function showHelp(helpHref) {
|
||||
<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 id="operation"></div>
|
||||
<div class="col-md-10 help" >
|
||||
|
||||
</div>
|
||||
|
||||
<div id="editHelp-history-compare" style="display:none;">
|
||||
<div id="editHelp-history-compare" style="widows: ">
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading" style="text-align: right;">
|
||||
<button class="btn btn-default" onclick="javascript:showSrcCode();"><spring:message code="message_type"/></button>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div id="rightNow" style="border: 2px solid gray; width:49.5%;height: 740px;overflow: auto;float: left;"></div>
|
||||
<div id="history" style="border: 2px solid gray; width:49.5%;height: 740px;overflow: auto;float:right;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user