summaryrefslogtreecommitdiffstats
path: root/web_src/js
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-02-01 17:06:57 +0000
committerGitHub <noreply@github.com>2020-02-01 17:06:57 +0000
commitf8f6adc2a6ea3fe07fdbc80f2b3cafbb893e2a1f (patch)
treec72e74a6bf5c2aa0cdb61dc0805d3df5bd49ebf5 /web_src/js
parent6dcf1106285e066a6dc8dff74ef809fc24301097 (diff)
downloadgitea-f8f6adc2a6ea3fe07fdbc80f2b3cafbb893e2a1f.tar.gz
gitea-f8f6adc2a6ea3fe07fdbc80f2b3cafbb893e2a1f.zip
Add button to revert SimpleMDE to plain textarea (#10099)
Diffstat (limited to 'web_src/js')
-rw-r--r--web_src/js/index.js33
1 files changed, 30 insertions, 3 deletions
diff --git a/web_src/js/index.js b/web_src/js/index.js
index f634bb1135..cf628d8ee3 100644
--- a/web_src/js/index.js
+++ b/web_src/js/index.js
@@ -1369,7 +1369,16 @@ function initWikiForm() {
}, '|',
'unordered-list', 'ordered-list', '|',
'link', 'image', 'table', 'horizontal-rule', '|',
- 'clean-block', 'preview', 'fullscreen', 'side-by-side']
+ 'clean-block', 'preview', 'fullscreen', 'side-by-side', '|',
+ {
+ name: 'revert-to-textarea',
+ action(e) {
+ e.toTextArea();
+ },
+ className: 'fa fa-file',
+ title: 'Revert to simple textarea',
+ },
+ ]
});
$(simplemde.codemirror.getInputField()).addClass('js-quick-submit');
@@ -1473,7 +1482,16 @@ function setSimpleMDE($editArea) {
'code', 'quote', '|',
'unordered-list', 'ordered-list', '|',
'link', 'image', 'table', 'horizontal-rule', '|',
- 'clean-block', 'preview', 'fullscreen', 'side-by-side']
+ 'clean-block', 'preview', 'fullscreen', 'side-by-side', '|',
+ {
+ name: 'revert-to-textarea',
+ action(e) {
+ e.toTextArea();
+ },
+ className: 'fa fa-file',
+ title: 'Revert to simple textarea',
+ },
+ ]
});
return true;
@@ -1495,7 +1513,16 @@ function setCommentSimpleMDE($editArea) {
'code', 'quote', '|',
'unordered-list', 'ordered-list', '|',
'link', 'image', 'table', 'horizontal-rule', '|',
- 'clean-block']
+ 'clean-block', '|',
+ {
+ name: 'revert-to-textarea',
+ action(e) {
+ e.toTextArea();
+ },
+ className: 'fa fa-file',
+ title: 'Revert to simple textarea',
+ },
+ ]
});
simplemde.codemirror.setOption('extraKeys', {
Enter: () => {