1
0
Fork 0
forked from forgejo/forgejo

Add EasyMDE support for release content editor (#14744)

* Add easyMDE(simpleMDE) support for release content editor

Signed-off-by: a1012112796 <1012112796@qq.com>
This commit is contained in:
a1012112796 2021-02-23 04:17:51 +08:00 committed by GitHub
parent 7bf61a89d3
commit 5d2b7ba639
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 2 deletions

View file

@ -1734,6 +1734,20 @@ async function initEditor() {
});
}
function initReleaseEditor() {
const $editor = $('.repository.new.release .content-editor');
if ($editor.length === 0) {
return false;
}
const $textarea = $editor.find('textarea');
attachTribute($textarea.get(), {mentions: false, emoji: true});
const $files = $editor.parent().find('.files');
const $simplemde = setCommentSimpleMDE($textarea);
initCommentPreviewTab($editor);
initSimpleMDEImagePaste($simplemde, $files);
}
function initOrganization() {
if ($('.organization').length === 0) {
return;
@ -2653,6 +2667,7 @@ $(document).ready(async () => {
initTableSort();
initNotificationsTable();
initPullRequestMergeInstruction();
initReleaseEditor();
const routes = {
'div.user.settings': initUserSettings,