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:
parent
7784a6c331
commit
4b0e8f227d
9 changed files with 12 additions and 1 deletions
|
@ -241,6 +241,7 @@
|
|||
"MarkdownPreviewContext" $.RepoLink
|
||||
"TextareaName" "content"
|
||||
"DropzoneParentContainer" ".ui.form"
|
||||
"EasyMDE" true
|
||||
)}}
|
||||
{{if .IsAttachmentEnabled}}
|
||||
<div class="field">
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
"TextareaPlaceholder" (ctx.Locale.Tr "repo.diff.comment.placeholder")
|
||||
"DropzoneParentContainer" "form"
|
||||
"DisableAutosize" "true"
|
||||
"EasyMDE" true
|
||||
)}}
|
||||
|
||||
{{if $.root.IsAttachmentEnabled}}
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
"TextareaName" "content"
|
||||
"TextareaPlaceholder" (ctx.Locale.Tr "repo.diff.review.placeholder")
|
||||
"DropzoneParentContainer" "form"
|
||||
"EasyMDE" true
|
||||
)}}
|
||||
</div>
|
||||
{{if .IsAttachmentEnabled}}
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
"TextareaContent" $textareaContent
|
||||
"TextareaPlaceholder" (ctx.Locale.Tr "repo.diff.comment.placeholder")
|
||||
"DropzoneParentContainer" "form, .ui.form"
|
||||
"EasyMDE" true
|
||||
)}}
|
||||
</div>
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
"TextareaContent" .item.Attributes.value
|
||||
"TextareaPlaceholder" .item.Attributes.placeholder
|
||||
"DropzoneParentContainer" ".combo-editor-dropzone"
|
||||
"EasyMDE" true
|
||||
)}}
|
||||
|
||||
{{if .root.IsAttachmentEnabled}}
|
||||
|
|
|
@ -151,6 +151,7 @@
|
|||
"MarkdownPreviewContext" .RepoLink
|
||||
"TextareaName" "content"
|
||||
"DropzoneParentContainer" ".ui.form"
|
||||
"EasyMDE" true
|
||||
)}}
|
||||
</div>
|
||||
|
||||
|
|
|
@ -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}}
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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="">
|
||||
|
|
Loading…
Reference in a new issue