|
31 | 31 | }); |
32 | 32 | }; |
33 | 33 |
|
34 | | - var turndownService = new TurndownService({ headingStyle: 'atx', codeBlockStyle: 'fenced', hr: '***' }); |
| 34 | + var turndownService = new TurndownService({ |
| 35 | + headingStyle: 'atx', |
| 36 | + codeBlockStyle: 'fenced', |
| 37 | + hr: '***' |
| 38 | + }); |
35 | 39 | turndownService.use(turndownPluginGfm.gfm); |
36 | 40 | turndownService.use(turndownPluginGithubCodeSnippet); |
37 | 41 |
|
|
46 | 50 | inlineComment.classList.add("open"); |
47 | 51 | } |
48 | 52 |
|
49 | | - var textareas = newComment.querySelectorAll(":scope > :not(.last-review-thread) .comment-form-textarea"); |
| 53 | + var textareas = newComment.querySelectorAll(":scope > :not(.last-review-thread) .comment-form-textarea:not(.github-writer-ckeditor)"); |
50 | 54 | return textareas[textareas.length - 1]; |
51 | 55 | } |
52 | 56 |
|
|
120 | 124 |
|
121 | 125 | var newComment = getCommentTextarea(this); |
122 | 126 |
|
123 | | - var author = comment.querySelector(".author"); |
124 | | - var authorLink = location.origin + (author.getAttribute("href") || "/" + author.textContent); |
| 127 | + var author = comment.querySelector(".author"); |
| 128 | + var authorLink = location.origin + (author.getAttribute("href") || "/" + author.textContent); |
125 | 129 |
|
126 | 130 | var text = newComment.value.length > 0 ? "\n" : ""; |
127 | 131 | text += String.format('[**@{0}**]({1}) commented on [{2}]({3} "{4} - Replied by Github Reply Comments"):\n{5}\n\n', |
|
134 | 138 |
|
135 | 139 | newComment.value += text; |
136 | 140 | newComment.setSelectionRange(newComment.value.length, newComment.value.length); |
| 141 | + //newComment.closest('.previewable-comment-form').querySelector('.js-write-tab').click(); |
137 | 142 | newComment.focus(); |
| 143 | + |
| 144 | + // This will enable the "Comment" button, when there was no comment text yet. |
| 145 | + newComment.dispatchEvent(new CustomEvent('change', { |
| 146 | + bubbles: true, |
| 147 | + cancelable: false |
| 148 | + })); |
138 | 149 | }); |
139 | 150 |
|
140 | 151 | var svg = document.createElementNS("http://www.w3.org/2000/svg", "svg"); |
|
0 commit comments