Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shortcut to save wiki page #4452

Merged
merged 2 commits into from
Jul 24, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion public/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ function initTeamSettings() {
function initWikiForm() {
var $editArea = $('.repository.wiki textarea#edit_area');
if ($editArea.length > 0) {
new SimpleMDE({
var simplemde = new SimpleMDE({
autoDownloadFontAwesome: false,
element: $editArea[0],
forceSync: true,
Expand Down Expand Up @@ -825,6 +825,7 @@ function initWikiForm() {
"link", "image", "table", "horizontal-rule", "|",
"clean-block", "preview", "fullscreen"]
})
$(simplemde.codemirror.getInputField()).addClass("js-quick-submit");
}
}

Expand Down
2 changes: 1 addition & 1 deletion templates/repo/wiki/new.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<input name="title" value="{{.title}}" autofocus required>
</div>
<div class="field">
<textarea id="edit_area" name="content" data-id="wiki-{{.title}}" data-url="{{AppSubUrl}}/api/v1/markdown" data-context="{{.RepoLink}}/wiki" required>{{if .PageIsWikiEdit}}{{.content}}{{else}}{{.i18n.Tr "repo.wiki.welcome"}}{{end}}</textarea>
<textarea class="js-quick-submit" id="edit_area" name="content" data-id="wiki-{{.title}}" data-url="{{AppSubUrl}}/api/v1/markdown" data-context="{{.RepoLink}}/wiki" required>{{if .PageIsWikiEdit}}{{.content}}{{else}}{{.i18n.Tr "repo.wiki.welcome"}}{{end}}</textarea>
</div>
<div class="field">
<input name="message" placeholder="{{.i18n.Tr "repo.wiki.default_commit_message"}}">
Expand Down