Compare commits

...

10 Commits

Author SHA1 Message Date
Naoki Takezoe
976202be0a Update README.md 2017-12-07 01:15:51 +09:00
Naoki Takezoe
a07576525c Bump to 4.19.3 2017-12-06 14:41:48 +09:00
Naoki Takezoe
f9c3607370 Fix comment reply form behavior in the diff view (#1796) 2017-12-06 14:39:25 +09:00
Naoki Takezoe
7078f32d1c Fix diff class attribute in split mode 2017-12-06 14:39:19 +09:00
Naoki Takezoe
c51fd7a7cd Fix file uploading issue 2017-12-06 14:39:09 +09:00
Naoki Takezoe
8a8278906a Bump to 4.19.2 2017-12-03 05:28:49 +09:00
Naoki Takezoe
d15b3fb2f6 Modify id of "Test Hook" button 2017-12-03 05:20:32 +09:00
Naoki Takezoe
bcd92916ca Fix routing in CompositeScalatraFilter 2017-12-03 04:36:05 +09:00
Naoki Takezoe
810cbda123 Update README.md 2017-12-03 02:17:27 +09:00
Naoki Takezoe
fee7cebdf1 Update README.md 2017-12-03 02:16:57 +09:00
10 changed files with 94 additions and 54 deletions

View File

@@ -68,9 +68,25 @@ Support
- If you can't find same question and report, send it to [gitter room](https://gitter.im/gitbucket/gitbucket) before raising an issue.
- The highest priority of GitBucket is the ease of installation and API compatibility with GitHub, so your feature request might be rejected if they go against those principles.
What's New in 4.19.0 - 2 Dec 2017
What's New in 4.19.x
-------------
### 4.19.3 - 7 Dec 2017
- Fix file uploading bug
- Fix reply comment form behavior in the diff view
### 4.19.2 - 3 Dec 2017
- Fix routing bug in `CompositeScalatraFilter`
- Resolve id attribute collision in the web hook editing form
### 4.19.1 - 2 Dec 2017
- Update gitbucket-notifications-plugin because it had a version compatibility issue
### 4.19.0 - 2 Dec 2017
- [gitbucket-maven-repository-plugin](https://github.com/takezoe/gitbucket-maven-repository-plugin) is available
- Upgrade to Scalatra 2.6
- Improve layout of the system settings page

View File

@@ -3,7 +3,7 @@ import com.typesafe.sbt.pgp.PgpKeys._
val Organization = "io.github.gitbucket"
val Name = "gitbucket"
val GitBucketVersion = "4.19.1"
val GitBucketVersion = "4.19.3"
val ScalatraVersion = "2.6.1"
val JettyVersion = "9.4.7.v20170914"

View File

@@ -45,5 +45,7 @@ object GitBucketCoreModule extends Module("gitbucket-core",
new Version("4.17.0"),
new Version("4.18.0"),
new Version("4.19.0"),
new Version("4.19.1")
new Version("4.19.1"),
new Version("4.19.2"),
new Version("4.19.3")
)

View File

@@ -116,6 +116,7 @@ class FileUploadController extends ScalatraServlet with FileUploadSupport with R
case Some(file) if(mimeTypeChcker(file.name)) =>
defining(FileUtil.generateFileId){ fileId =>
f(file, fileId)
contentType = "text/plain"
Ok(fileId)
}
case _ => BadRequest()

View File

@@ -28,20 +28,30 @@ class CompositeScalatraFilter extends Filter {
}
override def doFilter(request: ServletRequest, response: ServletResponse, chain: FilterChain): Unit = {
val requestUri = request.asInstanceOf[HttpServletRequest].getRequestURI
val contextPath = request.getServletContext.getContextPath
val requestPath = request.asInstanceOf[HttpServletRequest].getRequestURI.substring(contextPath.length)
val checkPath = if(requestPath.endsWith("/")){
requestPath
} else {
requestPath + "/"
}
filters
.filter { case (_, path) =>
val start = path.replaceFirst("/\\*$", "/")
(requestUri + "/").startsWith(start)
}
.foreach { case (filter, _) =>
val mockChain = new MockFilterChain()
filter.doFilter(request, response, mockChain)
if(mockChain.continue == false){
return ()
if(!checkPath.startsWith("/upload/") && !checkPath.startsWith("/git/") && !checkPath.startsWith("/git-lfs/") &&
!checkPath.startsWith("/plugin-assets/") && !checkPath.startsWith("/console/")){
filters
.filter { case (_, path) =>
val start = path.replaceFirst("/\\*$", "/")
checkPath.startsWith(start)
}
}
.foreach { case (filter, _) =>
val mockChain = new MockFilterChain()
filter.doFilter(request, response, mockChain)
if(mockChain.continue == false){
return ()
}
}
}
chain.doFilter(request, response)
}
@@ -56,8 +66,8 @@ class MockFilterChain extends FilterChain {
}
}
class FilterChainFilter(chain: FilterChain) extends Filter {
override def init(filterConfig: FilterConfig): Unit = ()
override def destroy(): Unit = ()
override def doFilter(request: ServletRequest, response: ServletResponse, mockChain: FilterChain) = chain.doFilter(request, response)
}
//class FilterChainFilter(chain: FilterChain) extends Filter {
// override def init(filterConfig: FilterConfig): Unit = ()
// override def destroy(): Unit = ()
// override def doFilter(request: ServletRequest, response: ServletResponse, mockChain: FilterChain) = chain.doFilter(request, response)
//}

View File

@@ -232,7 +232,6 @@ $(function(){
var $this = $(this);
var $tr = $this.closest('tr');
var $check = $this.closest('table:not(.diff)').find('.toggle-notes');
//var url = '';
if (!$check.prop('checked')) {
$check.prop('checked', true).trigger('change');
}

View File

@@ -186,11 +186,7 @@ $(function(){
$content = $('#issueContent');
}
$.get(url,
{
dataType : 'html'
},
function(data){
$.get(url, { dataType : 'html' }, function(data){
$content.empty().html(data);
});
return false;
@@ -198,8 +194,7 @@ $(function(){
$('.issue-comment-box i.octicon-x').click(function(){
if(confirm('Are you sure you want to delete this?')) {
var id = $(this).closest('a').data('comment-id');
$.post('@helpers.url(repository)/issue_comments/delete/' + id,
function(data){
$.post('@helpers.url(repository)/issue_comments/delete/' + id, function(data){
if(data > 0) {
$('#comment-' + id).remove();
}
@@ -213,22 +208,24 @@ $(function(){
var url = '@helpers.url(repository)/commit_comments/_data/' + id;
var $content = $('.commit-commentContent-' + id, $(this).closest('.commit-comment-box'));
$.get(url,
{
dataType : 'html'
},
function(data){
$.get(url, { dataType : 'html' }, function(data){
$content.empty().html(data);
});
return false;
});
$(document).on('click', '.commit-comment-box i.octicon-x', function(){
if(confirm('Are you sure you want to delete this?')) {
var id = $(this).closest('a').data('comment-id');
$.post('@helpers.url(repository)/commit_comments/delete/' + id,
function(data){
if(data > 0) {
$('.commit-comment-' + id).closest('.not-diff').remove();
var comment = $('.commit-comment-' + id).closest('.not-diff');
if(comment.prev('.not-diff').length == 0){
comment.next('.not-diff').find('.reply-comment').remove();
}
comment.remove();
}
});
}
@@ -260,10 +257,7 @@ $(function(){
var $commentContent = $(ev.target).parents('div[class*=commit-commentContent-]'),
commentId = $commentContent.attr('class').match(/commit-commentContent-.+/)[0].replace(/commit-commentContent-/, ''),
checkboxes = $commentContent.find(':checkbox');
$.get('@helpers.url(repository)/commit_comments/_data/' + commentId,
{
dataType : 'html'
},
$.get('@helpers.url(repository)/commit_comments/_data/' + commentId, { dataType : 'html' },
function(responseContent){
$.ajax({
url: '@helpers.url(repository)/commit_comments/edit/' + commentId,
@@ -283,10 +277,7 @@ $(function(){
@if(issue.isDefined){
$('#issueContent').on('click', ':checkbox', function(ev){
var checkboxes = $('#issueContent :checkbox');
$.get('@helpers.url(repository)/issues/_data/@issue.get.issueId',
{
dataType : 'html'
},
$.get('@helpers.url(repository)/issues/_data/@issue.get.issueId', { dataType : 'html' },
function(responseContent){
$.ajax({
url: '@helpers.url(repository)/issues/edit/@issue.get.issueId',
@@ -304,10 +295,7 @@ $(function(){
var $commentContent = $(ev.target).parents('div[id^=commentContent-]'),
commentId = $commentContent.attr('id').replace(/commentContent-/, ''),
checkboxes = $commentContent.find(':checkbox');
$.get('@helpers.url(repository)/issue_comments/_data/' + commentId,
{
dataType : 'html'
},
$.get('@helpers.url(repository)/issue_comments/_data/' + commentId, { dataType : 'html' },
function(responseContent){
$.ajax({
url: '@helpers.url(repository)/issue_comments/edit/' + commentId,

View File

@@ -71,8 +71,19 @@
// Show reply comment form
var replyComment = $tr.prev().find('.reply-comment').closest('.not-diff').show();
replyComment.remove();
$tr.after(replyComment);
if(replyComment.length != 0){
replyComment.remove();
$tr.after(replyComment);
} else {
var $v = $('<div class="commit-comment-box reply-comment-box">')
.append($('<input type="text" class="form-control reply-comment" placeholder="Reply...">')
.data('filename', '@fileName')
.data('newline', @newLineNumber.getOrElse("undefined"))
.data('oldline', @oldLineNumber.getOrElse("undefined")));
var tmp = getInlineContainer();
tmp.children('td:last').html($v)
$tr.after(tmp);
}
$('#comment-list').append(data);
if (typeof $('#show-notes')[0] !== 'undefined' && !$('#show-notes')[0].checked) {
@@ -82,6 +93,19 @@
$('.btn-inline-comment').removeAttr('disabled');
$('#error-content', $form).html($.parseJSON(req.responseText).content);
});
})
});
function getInlineContainer() {
console.log(window.viewType);
if (window.viewType == 0) {
if(@newLineNumber.isDefined){
return $('<tr class="not-diff"><td colspan="2"></td><td colspan="2" class="comment-box-container"></td></tr>');
}
if(@oldLineNumber.isDefined){
return $('<tr class="not-diff"><td colspan="2" class="comment-box-container"></td><td colspan="2"></td></tr>');
}
}
return $('<tr class="not-diff"><td colspan="3" class="comment-box-container"></td></tr>');
}
</script>
}

View File

@@ -26,7 +26,7 @@
<input type="text" value="@webHook.url" class="form-control" style="display: inline; width: 500px; vertical-align: middle;" disabled />
<input type="hidden" value="@webHook.url" name="url" />
}
<button class="btn btn-default" id="test">Test Hook</button>
<button class="btn btn-default" id="test-hook">Test Hook</button>
</fieldset>
<fieldset class="form-group">
<label class="strong">Content type</label>
@@ -131,7 +131,7 @@ $(function(){
e.preventDefault();
$(this).tab('show');
});
$('#test').click(function(e){
$('#test-hook').click(function(e){
e.stopPropagation();
e.stopImmediatePropagation();
e.preventDefault();

View File

@@ -149,7 +149,7 @@ $.extend(JsDiffRender.prototype,{
$('<tr>').append(
lineNum('old',o.base, o.change),
$('<td class="body">').html(o.base ? baseTextDom(o.base): "").addClass(o.change),
lineNum('old',o.head, o.change),
lineNum('new',o.head, o.change),
$('<td class="body">').html(o.head ? headTextDom(o.head): "").addClass(o.change)
).appendTo(tbody);
break;
@@ -158,7 +158,7 @@ $.extend(JsDiffRender.prototype,{
$('<tr>').append(
lineNum('old',o.base, 'delete'),
$('<td class="body">').append(ld.base).addClass('delete'),
lineNum('old',o.head, 'insert'),
lineNum('new',o.head, 'insert'),
$('<td class="body">').append(ld.head).addClass('insert')
).appendTo(tbody);
break;
@@ -379,7 +379,7 @@ function string_score(string, word) {
strLength = string.length,
lWord = word.toUpperCase(),
wordLength = word.length;
return calc(zero, 0, 0, 0, 0, []);
function calc(score, startAt, skip, runningScore, i, matchingPositions){
if( i < wordLength) {