Skip to content

Commit 1ed4323

Browse files
authored
Add button to revert SimpleMDE to plain textarea (#10099) (#10102)
1 parent 049af0d commit 1ed4323

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

web_src/js/index.js

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,7 +1362,16 @@ function initWikiForm() {
13621362
}, '|',
13631363
'unordered-list', 'ordered-list', '|',
13641364
'link', 'image', 'table', 'horizontal-rule', '|',
1365-
'clean-block', 'preview', 'fullscreen', 'side-by-side']
1365+
'clean-block', 'preview', 'fullscreen', 'side-by-side', '|',
1366+
{
1367+
name: 'revert-to-textarea',
1368+
action(e) {
1369+
e.toTextArea();
1370+
},
1371+
className: 'fa fa-file',
1372+
title: 'Revert to simple textarea',
1373+
},
1374+
]
13661375
});
13671376
$(simplemde.codemirror.getInputField()).addClass('js-quick-submit');
13681377

@@ -1466,7 +1475,16 @@ function setSimpleMDE($editArea) {
14661475
'code', 'quote', '|',
14671476
'unordered-list', 'ordered-list', '|',
14681477
'link', 'image', 'table', 'horizontal-rule', '|',
1469-
'clean-block', 'preview', 'fullscreen', 'side-by-side']
1478+
'clean-block', 'preview', 'fullscreen', 'side-by-side', '|',
1479+
{
1480+
name: 'revert-to-textarea',
1481+
action(e) {
1482+
e.toTextArea();
1483+
},
1484+
className: 'fa fa-file',
1485+
title: 'Revert to simple textarea',
1486+
},
1487+
]
14701488
});
14711489

14721490
return true;
@@ -1488,7 +1506,16 @@ function setCommentSimpleMDE($editArea) {
14881506
'code', 'quote', '|',
14891507
'unordered-list', 'ordered-list', '|',
14901508
'link', 'image', 'table', 'horizontal-rule', '|',
1491-
'clean-block']
1509+
'clean-block', '|',
1510+
{
1511+
name: 'revert-to-textarea',
1512+
action(e) {
1513+
e.toTextArea();
1514+
},
1515+
className: 'fa fa-file',
1516+
title: 'Revert to simple textarea',
1517+
},
1518+
]
14921519
});
14931520
simplemde.codemirror.setOption('extraKeys', {
14941521
Enter: () => {

0 commit comments

Comments
 (0)