summaryrefslogtreecommitdiffstats
path: root/web_src/js/index.js
diff options
context:
space:
mode:
authora1012112796 <1012112796@qq.com>2021-02-23 04:17:51 +0800
committerGitHub <noreply@github.com>2021-02-22 21:17:51 +0100
commit5d2b7ba63958a4eee57c0a5300f20e9df6f32c37 (patch)
tree8d6506a35b41e616964b97899dafed40489af487 /web_src/js/index.js
parent7bf61a89d3e5f127556a4fa5099b2b6796dfc851 (diff)
downloadgitea-5d2b7ba63958a4eee57c0a5300f20e9df6f32c37.tar.gz
gitea-5d2b7ba63958a4eee57c0a5300f20e9df6f32c37.zip
Add EasyMDE support for release content editor (#14744)
* Add easyMDE(simpleMDE) support for release content editor Signed-off-by: a1012112796 <1012112796@qq.com>
Diffstat (limited to 'web_src/js/index.js')
-rw-r--r--web_src/js/index.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/web_src/js/index.js b/web_src/js/index.js
index 7bfe12e3ca..b65291a266 100644
--- a/web_src/js/index.js
+++ b/web_src/js/index.js
@@ -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,