mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-14 17:35:50 +01:00
47 lines
1.6 KiB
HTML
47 lines
1.6 KiB
HTML
@(repository: service.RepositoryService.RepositoryInfo, content: String, enableWikiLink: Boolean, enableRefsLink: Boolean,
|
|
style: String = "", placeholder: String = "Leave a comment", elastic: Boolean = false)(implicit context: app.Context)
|
|
@import context._
|
|
@import view.helpers._
|
|
<div class="tabbable">
|
|
<ul class="nav nav-tabs">
|
|
<li class="active"><a href="#tab1" data-toggle="tab">Write</a></li>
|
|
<li><a href="#tab2" data-toggle="tab" id="preview">Preview</a></li>
|
|
@*
|
|
<li class="pull-right">
|
|
<a href="http://daringfireball.net/projects/markdown/syntax" target="_blank">Markdown Syntax Guide</a>
|
|
</li>
|
|
*@
|
|
</ul>
|
|
<div class="tab-content">
|
|
<div class="tab-pane active" id="tab1">
|
|
<span id="error-content" class="error"></span>
|
|
<textarea id="content" name="content"@if(style.nonEmpty){ style="@style"} placeholder="@placeholder">@content</textarea>
|
|
</div>
|
|
<div class="tab-pane" id="tab2">
|
|
<div class="markdown-body" id="preview-area">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<link href="@assets/google-code-prettify/prettify.css" type="text/css" rel="stylesheet"/>
|
|
<script src="@assets/google-code-prettify/prettify.js"></script>
|
|
<script>
|
|
$(function(){
|
|
@if(elastic){
|
|
$('#content').elastic();
|
|
}
|
|
|
|
$('#preview').click(function(){
|
|
$('#preview-area').html('<img src="@assets/common/images/indicator.gif"> Previewing...');
|
|
$.post('@url(repository)/_preview', {
|
|
content : $('#content').val(),
|
|
enableWikiLink : @enableWikiLink,
|
|
enableRefsLink : @enableRefsLink
|
|
}, function(data){
|
|
$('#preview-area').html(data);
|
|
prettyPrint();
|
|
});
|
|
});
|
|
});
|
|
</script>
|