5 ändrade filer med 119 tillägg och 86 borttagningar
Delad Vy
Diff Options
-
18app/controllers/BoardApp.java
-
83app/views/board/partial_comments.scala.html
-
1app/views/board/view.scala.html
-
48app/views/issue/view.scala.html
-
55public/javascripts/common/yona.SubComment.js
@ -0,0 +1,55 @@ |
|||
$(function(){ |
|||
// timeline label text color adjusting
|
|||
$(".event > .label").each(function() { |
|||
var $this = $(this); |
|||
$this.removeClass("dimgray white") |
|||
.addClass($yobi.getContrastColor($this.css('background-color'))) |
|||
}); |
|||
|
|||
// Releated with one line sub-comment feature
|
|||
$(".add-a-comment").on("click", function(e){ |
|||
var parent = $(this).parents(".comment"); |
|||
|
|||
// Show input form
|
|||
parent.find(".child-comment-input-form").toggle(); |
|||
|
|||
parent.find("textarea").on('keypress', function(e) { |
|||
// Enter to submit
|
|||
if ((e.keyCode || e.which) === 13) { |
|||
$(this).parents('form').submit(); |
|||
return false; |
|||
} |
|||
}).on('keyup', function(e) { |
|||
// Cancel input
|
|||
if ((e.keyCode || e.which) === 27) { |
|||
$(".child-comment-input-form").css("display", "none").css("visibility", "hidden"); |
|||
$(".add-a-comment").show(); |
|||
} |
|||
}).focus(); |
|||
}); |
|||
|
|||
$(".comment").on("mouseenter tab", function () { |
|||
$(this).find(".add-a-comment").fadeIn(300); |
|||
}).on("mouseleave", function () { |
|||
$(this).find(".add-a-comment").fadeOut(300); |
|||
}); |
|||
|
|||
// Releated with one line sub-comment feature
|
|||
$(".subcomment-author").each(function addAuthorToLastParagraphOfOnelineComment(index, el){ |
|||
// append Author and addtionals to mardkown rendered contents
|
|||
var $el = $(el); |
|||
// Remove spaces
|
|||
var trimmed = $el.html().replace(/\s\s+/g, ' '); |
|||
// Find parent element
|
|||
var $closest = $el.closest('.contents'); |
|||
var normalTextRenderedParagraph = $closest.find('p').last(); |
|||
|
|||
// Remove unused author and addtional text
|
|||
$el.remove(); |
|||
if(normalTextRenderedParagraph.length === 0){ |
|||
$closest.append(trimmed); |
|||
} else { |
|||
normalTextRenderedParagraph.append(trimmed); |
|||
} |
|||
}); |
|||
}); |
Skriv
Förhandsgranska
Laddar…
Avbryt
Spara