diff --git a/src/main/twirl/gitbucket/core/issues/editcomment.scala.html b/src/main/twirl/gitbucket/core/issues/editcomment.scala.html
index 87a2a6b..2ba3545 100644
--- a/src/main/twirl/gitbucket/core/issues/editcomment.scala.html
+++ b/src/main/twirl/gitbucket/core/issues/editcomment.scala.html
@@ -1,9 +1,19 @@
@(content: String, commentId: Int,
repository: gitbucket.core.service.RepositoryService.RepositoryInfo)(implicit context: gitbucket.core.controller.Context)
-@gitbucket.core.helper.html.attached(repository, "issues"){
-
-}
+@gitbucket.core.helper.html.preview(
+ repository = repository,
+ content = content,
+ enableWikiLink = false,
+ enableRefsLink = true,
+ enableLineBreaks = true,
+ enableTaskList = true,
+ hasWritePermission = true,
+ completionContext = "issues",
+ style = "",
+ elastic = true,
+ tabIndex = 1
+)
@@ -17,13 +27,14 @@
};
$('#update-comment-@commentId').click(function(){
+ var content = $(this).parent().parent().find('textarea[name=content]').val();
$('#update-comment-@commentId, #cancel-comment-@commentId').attr('disabled', 'disabled');
$.ajax({
url: '@context.path/@repository.owner/@repository.name/issue_comments/edit/@commentId',
type: 'POST',
data: {
issueId : 0, // TODO
- content : $('#edit-content-@commentId').val()
+ content : content
}
}).done(
callback
diff --git a/src/main/twirl/gitbucket/core/issues/editissue.scala.html b/src/main/twirl/gitbucket/core/issues/editissue.scala.html
index 1fab57c..75ec49e 100644
--- a/src/main/twirl/gitbucket/core/issues/editissue.scala.html
+++ b/src/main/twirl/gitbucket/core/issues/editissue.scala.html
@@ -1,8 +1,18 @@
@(content: Option[String], issueId: Int,
repository: gitbucket.core.service.RepositoryService.RepositoryInfo)(implicit context: gitbucket.core.controller.Context)
-@gitbucket.core.helper.html.attached(repository, "issues"){
-
-}
+@gitbucket.core.helper.html.preview(
+ repository = repository,
+ content = content.getOrElse(""),
+ enableWikiLink = false,
+ enableRefsLink = true,
+ enableLineBreaks = true,
+ enableTaskList = true,
+ hasWritePermission = true,
+ completionContext = "issues",
+ style = "",
+ elastic = true,
+ tabIndex = 1
+)
@@ -16,13 +26,12 @@
};
$('#update-issue').click(function(){
+ var content = $(this).parent().parent().find('textarea[name=content]').val();
$('#update, #cancel').attr('disabled', 'disabled');
$.ajax({
url: '@context.path/@repository.owner/@repository.name/issues/edit/@issueId',
type: 'POST',
- data: {
- content : $('#edit-content').val()
- }
+ data: { content : content }
}).done(
callback
).fail(function(req) {
diff --git a/src/main/twirl/gitbucket/core/repo/editcomment.scala.html b/src/main/twirl/gitbucket/core/repo/editcomment.scala.html
index 88e740e..f00b111 100644
--- a/src/main/twirl/gitbucket/core/repo/editcomment.scala.html
+++ b/src/main/twirl/gitbucket/core/repo/editcomment.scala.html
@@ -1,9 +1,19 @@
@(content: String, commentId: Int,
repository: gitbucket.core.service.RepositoryService.RepositoryInfo)(implicit context: gitbucket.core.controller.Context)
-@gitbucket.core.helper.html.attached(repository, "issues"){
-
-}
+@gitbucket.core.helper.html.preview(
+ repository = repository,
+ content = content,
+ enableWikiLink = false,
+ enableRefsLink = true,
+ enableLineBreaks = true,
+ enableTaskList = true,
+ hasWritePermission = true,
+ completionContext = "issues",
+ style = "",
+ elastic = true,
+ tabIndex = 1
+)
@@ -19,13 +29,14 @@
}
$(document).on('click', '.update-comment-@commentId', function(){
+ var content = $(this).parent().parent().find('textarea[name=content]').val();
$box = $(this).closest('.commit-comment-box');
$('.update-comment-@commentId, .cancel-comment-@commentId', $box).attr('disabled', 'disabled');
$.ajax({
url: '@context.path/@repository.owner/@repository.name/commit_comments/edit/@commentId',
type: 'POST',
data: {
- content : $('#edit-content-@commentId', $box).val()
+ content : content
}
}).done(
curriedCallback($box)