Merge branch 'sgm_55844' into 'zentaopms_198'
* Finish task #55844. See merge request easycorp/zentaopms!3683
This commit is contained in:
@@ -527,12 +527,6 @@ 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);
|
||||
}
|
||||
|
||||
/* Check priv when lib is product or project. */
|
||||
$lib = $this->doc->getLibByID($doc->lib);
|
||||
$type = $lib->type;
|
||||
@@ -998,12 +992,6 @@ class doc extends control
|
||||
$doc->keywords = str_replace(",", ',', $doc->keywords);
|
||||
$doc->keywords = explode(',', $doc->keywords);
|
||||
}
|
||||
|
||||
if($doc->contentType == 'markdown')
|
||||
{
|
||||
$doc->content = commonModel::processMarkdown($doc->content);
|
||||
$doc->digest = commonModel::processMarkdown($doc->digest);
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($doc) and ($doc->type == 'text' || $doc->type == 'article'))
|
||||
|
||||
@@ -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