GitHub comment enhancer v2.3.0 by jerone · Pull Request #49 · jerone/UserScripts

Expand Up @@ -12,7 +12,7 @@ // @updateURL https://github.com/jerone/UserScripts/raw/master/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js // @supportURL https://github.com/jerone/UserScripts/issues // @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW // @version 2.2.0 // @version 2.3.0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testing

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

123 abc

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// @grant none // @run-at document-end // @include https://github.com/*/*/issues Expand Down Expand Up @@ -777,6 +777,21 @@ return cleanUp(string); };
function getCommentTextarea(replyBtn) { var newComment = replyBtn; while (newComment && !newComment.classList.contains('js-quote-selection-container')) { newComment = newComment.parentNode; } if (newComment) { var lastElementChild = newComment.lastElementChild; lastElementChild.classList.add('open'); newComment = lastElementChild.querySelector(".comment-form-textarea"); } else { newComment = document.querySelector(".timeline-new-comment .comment-form-textarea"); } return newComment; }
function addReplyButtons() { Array.prototype.forEach.call(document.querySelectorAll(".comment"), function(comment) { var oldReply = comment.querySelector(".GithubCommentEnhancerReply"); Expand All @@ -785,8 +800,7 @@ }
var header = comment.querySelector(".timeline-comment-header"), actions = comment.querySelector(".timeline-comment-actions"), newComment = document.querySelector(".timeline-new-comment .comment-form-textarea"); actions = comment.querySelector(".timeline-comment-actions");
if (!header) { return; Expand All @@ -804,6 +818,8 @@ reply.addEventListener("click", function(e) { e.preventDefault();
var newComment = getCommentTextarea(this);
var timestamp = comment.querySelector(".timestamp");
var commentText = comment.querySelector(".comment-form-textarea"); Expand Down