<%
#include "..\..\..\MarkdownLib.js_"
%>


<!doctype html>
<html>
<head>
  <meta charset="utf-8"/>
  <title>${curTable.UIDisplayName} Markdown</title>
  <link href="../lib/github-markdown.min.css" rel="stylesheet">
</head>
<body style="background: #fff;">

<div id="content" class="markdown-body">Loading...</div>

<br/>
<br/>

<div><strong><a id="aShow" href="javascript:showMarkText()">Show</a> Markdown Text</strong></div>
<textarea id="mdtext" style="height:400px;width:100%;display:none;" onkeyup="compile()">
<%
genMd(curTable);
genDmlImageData(curTable);
%>
</textarea>

<script src="../lib/marked.umd.js"></script>

<script>
function showMarkText(){
  document.getElementById("aShow").style.display="none";
  document.getElementById("mdtext").style.display="block";
}

var comileTimerId=null;
function compile(){
  if(comileTimerId)
    clearTimeout(comileTimerId);
  comileTimerId=setTimeout(compileEx, 800);
}
function compileEx(){
    var text = document.getElementById("mdtext").value;
    var html = marked.parse(text);
    document.getElementById("content").innerHTML = html;
}
compile();


</script>
</body>
</html>