mirror of
1
Fork 0

Make display of EasyMDE in UI optional to template

This commit adds EasyMDE field to combomarkdowneditor, as well as to all its calls.

(cherry picked from commit f5c7ccaeff)
This commit is contained in:
0ko 2024-03-31 09:19:40 +05:00 committed by GitHub
parent 7784a6c331
commit 4b0e8f227d
9 changed files with 12 additions and 1 deletions

View File

@ -241,6 +241,7 @@
"MarkdownPreviewContext" $.RepoLink
"TextareaName" "content"
"DropzoneParentContainer" ".ui.form"
"EasyMDE" true
)}}
{{if .IsAttachmentEnabled}}
<div class="field">

View File

@ -17,6 +17,7 @@
"TextareaPlaceholder" (ctx.Locale.Tr "repo.diff.comment.placeholder")
"DropzoneParentContainer" "form"
"DisableAutosize" "true"
"EasyMDE" true
)}}
{{if $.root.IsAttachmentEnabled}}

View File

@ -21,6 +21,7 @@
"TextareaName" "content"
"TextareaPlaceholder" (ctx.Locale.Tr "repo.diff.review.placeholder")
"DropzoneParentContainer" "form"
"EasyMDE" true
)}}
</div>
{{if .IsAttachmentEnabled}}

View File

@ -11,6 +11,7 @@
"TextareaContent" $textareaContent
"TextareaPlaceholder" (ctx.Locale.Tr "repo.diff.comment.placeholder")
"DropzoneParentContainer" "form, .ui.form"
"EasyMDE" true
)}}
</div>

View File

@ -13,6 +13,7 @@
"TextareaContent" .item.Attributes.value
"TextareaPlaceholder" .item.Attributes.placeholder
"DropzoneParentContainer" ".combo-editor-dropzone"
"EasyMDE" true
)}}
{{if .root.IsAttachmentEnabled}}

View File

@ -151,6 +151,7 @@
"MarkdownPreviewContext" .RepoLink
"TextareaName" "content"
"DropzoneParentContainer" ".ui.form"
"EasyMDE" true
)}}
</div>

View File

@ -57,6 +57,7 @@
"TextareaPlaceholder" (ctx.Locale.Tr "repo.release.message")
"TextareaAriaLabel" (ctx.Locale.Tr "repo.release.message")
"DropzoneParentContainer" "form"
"EasyMDE" true
)}}
</div>
{{range .attachments}}

View File

@ -29,6 +29,7 @@
"TextareaPlaceholder" (ctx.Locale.Tr "repo.wiki.page_content")
"TextareaAriaLabel" (ctx.Locale.Tr "repo.wiki.page_content")
"TextareaContent" $content
"EasyMDE" true
)}}
<div class="field tw-mt-4">

View File

@ -10,6 +10,7 @@ Template Attributes:
* TextareaAriaLabel: aria-label attribute for the textarea
* DropzoneParentContainer: container for file upload (leave it empty if no upload)
* DisableAutosize: whether to disable automatic height resizing
* EasyMDE: whether to display button for switching to legacy editor
*/}}
<div {{if .ContainerId}}id="{{.ContainerId}}"{{end}} class="combo-markdown-editor {{.ContainerClasses}}" data-dropzone-parent-container="{{.DropzoneParentContainer}}">
{{if .MarkdownPreviewUrl}}
@ -41,7 +42,9 @@ Template Attributes:
</div>
<div class="markdown-toolbar-group">
<button class="markdown-toolbar-button markdown-switch-monospace" role="switch" data-enable-text="{{ctx.Locale.Tr "editor.buttons.enable_monospace_font"}}" data-disable-text="{{ctx.Locale.Tr "editor.buttons.disable_monospace_font"}}">{{svg "octicon-typography"}}</button>
{{if .EasyMDE}}
<button class="markdown-toolbar-button markdown-switch-easymde" data-tooltip-content="{{ctx.Locale.Tr "editor.buttons.switch_to_legacy.tooltip"}}">{{svg "octicon-arrow-switch"}}</button>
{{end}}
</div>
</markdown-toolbar>
<text-expander keys=": @" suffix="">