* Finish task #55844.
This commit is contained in:
@@ -527,11 +527,7 @@ class doc extends control
|
||||
if(!(defined('RUN_MODE') && RUN_MODE == 'api')) $this->locate($browseLink);
|
||||
}
|
||||
|
||||
if($doc->contentType == 'markdown')
|
||||
{
|
||||
$doc->content = commonModel::processMarkdown($doc->content);
|
||||
$doc->digest = commonModel::processMarkdown($doc->digest);
|
||||
}
|
||||
if($doc->contentType == 'markdown') $doc->digest = commonModel::processMarkdown($doc->digest);
|
||||
|
||||
/* Check priv when lib is product or project. */
|
||||
$lib = $this->doc->getLibByID($doc->lib);
|
||||
@@ -1001,8 +997,6 @@ class doc extends control
|
||||
|
||||
if($doc->contentType == 'markdown')
|
||||
{
|
||||
$doc->content = commonModel::processMarkdown($doc->content);
|
||||
$doc->digest = commonModel::processMarkdown($doc->digest);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
#content .title {max-width: 54%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
|
||||
#content .detail-content {padding-left: 10px;}
|
||||
#mainContent .scrollbar-hover {max-height: 2000px; overflow: scroll;}
|
||||
#content .editor-preview {background: #fff}
|
||||
#content .CodeMirror{border: none}
|
||||
#sidebar {width: 275px;}
|
||||
#sidebar>.cell {width: 100%;}
|
||||
#sidebar>.sidebar-toggle {left: 3px; right: auto;}
|
||||
|
||||
@@ -100,6 +100,10 @@
|
||||
echo "</div></div>";
|
||||
}
|
||||
}
|
||||
elseif($doc->contentType == 'markdown')
|
||||
{
|
||||
echo "<textarea id='markdownContent' /></textarea>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $doc->content;
|
||||
@@ -283,3 +287,16 @@
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php include '../../common/view/syntaxhighlighter.html.php';?>
|
||||
<?php if($doc->contentType == 'markdown'):?>
|
||||
<?php css::import($jsRoot . "markdown/simplemde.min.css");?>
|
||||
<?php js::import($jsRoot . 'markdown/simplemde.min.js'); ?>
|
||||
<?php js::set('markdownText', $doc->content);?>
|
||||
<script>
|
||||
$(function()
|
||||
{
|
||||
var simplemde = new SimpleMDE({element: $("#markdownContent")[0],toolbar:false, status: false});
|
||||
simplemde.value(markdownText);
|
||||
simplemde.togglePreview();
|
||||
})
|
||||
</script>
|
||||
<?php endif;?>
|
||||
|
||||
Reference in New Issue
Block a user