summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authora1012112796 <1012112796@qq.com>2021-03-01 00:48:29 +0800
committerGitHub <noreply@github.com>2021-02-28 16:48:29 +0000
commit5de76965a1f571444deee23410117b6d35996f1d (patch)
tree59a0fcda32a7a79d051c82ad26727b43588e8a32 /templates
parentdc081959dbf5aea99f975b79275d43efe681bc25 (diff)
downloadgitea-5de76965a1f571444deee23410117b6d35996f1d.tar.gz
gitea-5de76965a1f571444deee23410117b6d35996f1d.zip
add preview support for wiki editor when disable simpleMDE (#14757)
Signed-off-by: a1012112796 <1012112796@qq.com>
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/wiki/new.tmpl10
1 files changed, 6 insertions, 4 deletions
diff --git a/templates/repo/wiki/new.tmpl b/templates/repo/wiki/new.tmpl
index 06450a6ec4..6de6ef9a20 100644
--- a/templates/repo/wiki/new.tmpl
+++ b/templates/repo/wiki/new.tmpl
@@ -16,12 +16,14 @@
<div class="field {{if .Err_Title}}error{{end}}">
<input name="title" value="{{.title}}" autofocus required>
</div>
- <div class="ui top attached tabular menu previewtabs">
+ <div class="ui top attached tabular menu previewtabs" data-write="write" data-preview="preview">
<a class="active item" data-tab="write">{{.i18n.Tr "write"}}</a>
- <a class="item" data-tab="preview">{{.i18n.Tr "preview"}}</a>
+ <a class="item" data-tab="preview" data-url="{{$.Repository.APIURL}}/markdown" data-context="{{$.RepoLink}}">{{$.i18n.Tr "preview"}}</a>
</div>
- <div class="field">
- <textarea class="js-quick-submit" id="edit_area" name="content" data-id="wiki-{{.title}}" data-url="{{.Repository.APIURL}}/markdown" data-context="{{.RepoLink}}" required>{{if .PageIsWikiEdit}}{{.content}}{{else}}{{.i18n.Tr "repo.wiki.welcome"}}{{end}}</textarea>
+ <div class="field content" data-loading="{{.i18n.Tr "loading"}}">
+ <div class="ui bottom active tab" data-tab="write">
+ <textarea class="js-quick-submit" id="edit_area" name="content" data-id="wiki-{{.title}}" data-url="{{.Repository.APIURL}}/markdown" data-context="{{.RepoLink}}" required>{{if .PageIsWikiEdit}}{{.content}}{{else}}{{.i18n.Tr "repo.wiki.welcome"}}{{end}}</textarea>
+ </div>
</div>
<div class="field">
<input name="message" placeholder="{{.i18n.Tr "repo.wiki.default_commit_message"}}">