数据描述使用editorMD

This commit is contained in:
daiao 2018-02-09 10:35:28 +08:00
parent a54226a5e7
commit 691b59d856
1 changed files with 35 additions and 38 deletions

View File

@ -2,8 +2,6 @@
<%= javascript_include_tag '/editormd/lib/marked.min.js','/editormd/lib/prettify.min.js','/editormd/lib/raphael.min.js','/editormd/lib/underscore.min.js','/editormd/lib/sequence-diagram.min.js', <%= javascript_include_tag '/editormd/lib/marked.min.js','/editormd/lib/prettify.min.js','/editormd/lib/raphael.min.js','/editormd/lib/underscore.min.js','/editormd/lib/sequence-diagram.min.js',
'/editormd/lib/flowchart.min.js','/editormd/lib/jquery.flowchart.min.js','/editormd/editormd.js' %> '/editormd/lib/flowchart.min.js','/editormd/lib/jquery.flowchart.min.js','/editormd/editormd.js' %>
<div class="data_showdetail"> <div class="data_showdetail">
<!--<p id="notice"><%#= notice %></p>-->
<div class="detail_part"> <div class="detail_part">
<label>数据类别名称:</label> <label>数据类别名称:</label>
<%= @statistic.name %> <%= @statistic.name %>
@ -11,7 +9,9 @@
<div class="cl detail_part"> <div class="cl detail_part">
<label>描述:</label> <label>描述:</label>
<textarea readonly="readonly" class="detail_des"><%= @statistic.description %></textarea> <div id="statistic_description" style="width: 80%;">
<textarea class="detail_des fl" style="display: none;width: 85%"><%= @statistic.description %></textarea>
</div>
</div> </div>
<div class="detail_part"> <div class="detail_part">
<label>添加时间:</label> <label>添加时间:</label>
@ -25,7 +25,6 @@
<label>状态:</label> <label>状态:</label>
<%= @statistic.status %> <%= @statistic.status %>
</div> </div>
<%# 附件局部刷新 %> <%# 附件局部刷新 %>
<% if @attachments.present? %> <% if @attachments.present? %>
<div class="detail_part cl"> <div class="detail_part cl">
@ -43,8 +42,7 @@
</div> </div>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
editormd.loadKaTeX(function() { var taskPassMD = editormd.markdownToHTML("statistic_description", {
var taskPassMD = editormd.markdownToHTML("challenge_task_pass_show", {
htmlDecode: "style,script,iframe", // you can filter tags decode htmlDecode: "style,script,iframe", // you can filter tags decode
taskList: true, taskList: true,
tex: true, // 默认不解析 tex: true, // 默认不解析
@ -52,5 +50,4 @@
sequenceDiagram: true // 默认不解析 sequenceDiagram: true // 默认不解析
}); });
}); });
});
</script> </script>