WIP: Replace easymde with textarea #15394

Draft
silverwind wants to merge 1 commits from silverwind/textarea into main
silverwind commented 2021-04-10 20:04:08 +00:00 (Migrated from github.com)

WIP on the easymde replacement. Basically it rips out EasyMDE without much second thought. Issue commenting works but other things may be broken.

TODOs:

  • Fix up loose ends, quote reply, image paste, etc
  • Replace Tribute with something better, remove RequireTribute
  • Finish style removal, remove _editor.less
  • Add toolbar when editing markdown files in the repo
  • Fix review textarea
  • Re-Implement fullscreen side-by-side (maybe for another PR)

Fixes https://github.com/go-gitea/gitea/issues/10729 and a probably 30 other issues.

image
WIP on the easymde replacement. Basically it rips out EasyMDE without much second thought. Issue commenting works but other things may be broken. TODOs: - [ ] Fix up loose ends, quote reply, image paste, etc - [ ] Replace Tribute with something better, remove `RequireTribute` - [ ] Finish style removal, remove _editor.less - [ ] Add toolbar when editing markdown files in the repo - [ ] Fix review textarea - [ ] Re-Implement fullscreen side-by-side (maybe for another PR) Fixes https://github.com/go-gitea/gitea/issues/10729 and a probably 30 other issues. <img width="748" alt="image" src="https://user-images.githubusercontent.com/115237/114283072-31472100-9a48-11eb-8bca-a8fb2001e7f9.png">
delvh reviewed 2021-10-16 22:50:03 +00:00
@ -0,0 +74,4 @@
function initCtrlEnterSubmit(el) {
el.addEventListener('keydown', (e) => {
if (((e.ctrlKey && !e.altKey) || e.metaKey) && (e.keyCode === 13 || e.keyCode === 10)) {
Contributor

What is keycode 10? I think 13 is Enter, but what is 10?

What is keycode 10? I think 13 is Enter, but what is 10?
Contributor

Nice merge conflict! 😆

Nice merge conflict! :laughing:
Contributor

Why explicitly not a review textarea?
Because there would be some confusion as to what a "Ctrl+Submit" should do there?

Why explicitly not a review textarea? Because there would be some confusion as to what a "Ctrl+Submit" should do there?
Contributor

I have tried to come up with a suggestion on my own but failed due to missing jquery knowledge, so here in plain text for you to figure out:
Don't use only the first element. Use all of the available textareas. That way you can ensure that one exists as well as that all are converted to a markdown editor.

I have tried to come up with a suggestion on my own but failed due to missing jquery knowledge, so here in plain text for you to figure out: Don't use only the first element. Use all of the available textareas. That way you can ensure that one exists as well as that all are converted to a markdown editor.
@ -1253,4 +1166,3 @@
autoSimpleMDE.codemirror.refresh();
$(this).parent().hide();
});
}
Contributor

See above.

See above.
Contributor

And again.

And again.
Contributor

This one is tricky, however. Ideas?

This one is tricky, however. Ideas?
Contributor

I would not assume that we will always have only one textarea.

I would not assume that we will always have only one textarea.
wxiaoguang reviewed 2021-10-17 04:33:17 +00:00
@ -0,0 +74,4 @@
function initCtrlEnterSubmit(el) {
el.addEventListener('keydown', (e) => {
if (((e.ctrlKey && !e.altKey) || e.metaKey) && (e.keyCode === 13 || e.keyCode === 10)) {

You can google it. 13/10 is a CR/LF problem in history.

https://bugs.chromium.org/p/chromium/issues/detail?id=79407

You can google it. 13/10 is a CR/LF problem in history. https://bugs.chromium.org/p/chromium/issues/detail?id=79407
This repo is archived. You cannot comment on pull requests.
No reviewers
No Milestone
No project
No Assignees
3 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: lunny/gitea#15394
No description provided.