Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

AccessibleEditor #76

Merged
merged 4 commits into from
Aug 15, 2018
Merged

AccessibleEditor #76

merged 4 commits into from
Aug 15, 2018

Conversation

Flameborn
Copy link
Contributor

This is just an initial commit, not ready to merge yet.

  • Add Editor to the settings screen, via a user.Editor field
  • 3 editor types: Default, Minimalistic (Accessible), and Minimalistic, without Javascript (just a textarea, no JS)

This implementation uses Showdown and Countable, both under MIT.

The templates will probably need some visual adjustment.

I am currently investigating why an oninput event will not fire on the MDE textarea.

@Flameborn
Copy link
Contributor Author

This should be ready for a review, and for a possible merge.

I'm not entirely satisfied with the elegance of this, but it definitely works, adding new editors should be also quite easy.

@recoilme
Copy link
Owner

check this please
https://github.com/recoilme/tgram/blob/master/routers/routers.go#L505
incrybmde has one \r\n for new line (classical markdown has \n\n i think)
it's ok for the new editor? how does it work with images? all ok?

@recoilme
Copy link
Owner

I am underwater right now, hope to merge it tomorrow

@Flameborn
Copy link
Contributor Author

Flameborn commented Aug 14, 2018

I've resolved the conflict from Master.

The editor is a standard textarea, so unless it has newline issues, things should work fine, at least they look all right in the live preview. The two divs, housing the stats and the live preview might be misaligned though.

Images are also handled by Typegram, since the form will post Markdown, unless you wish to receive HTML as the article body, which we can do easily.

We are not in a hurry, take your time, and we'll merge when you are ready.

@recoilme recoilme merged commit 28e9869 into recoilme:master Aug 15, 2018
@recoilme
Copy link
Owner

Code review:

no test for unregistered user:
Server recovery with err: template: header.html:31:5: executing "header" at <eq .editor 0>: error calling eq: invalid type for comparison

don't optimized code:
models.UserGet(host, username) on each request, its global hook- no requests 2 db pls here

comments use incrybmde - not tested, not implemented

looks ugly
screen shot 2018-08-15 at 10 45 17

preview not tested carefully - not mutch with the result (see #76 (comment))
preview:
screen shot 2018-08-15 at 10 50 54
result:
screen shot 2018-08-15 at 10 53 03

so i think -
add disable javascript - it will be the global option.

I want to think just add this option...
And in that case, all textareas will work like usual textareas, without ugly preview and anywhere
in comments, articles - everywhere..

Give me some time

@Flameborn
Copy link
Contributor Author

Flameborn commented Aug 15, 2018 via email

@recoilme
Copy link
Owner

i created branch https://github.com/recoilme/tgram/tree/editor
for playing with alternative editors (with some fixes) if you want to continue to play with it
But right now it looks absolutely not accessible for release, sorry for that(

And i added nojavascript option in the main branch, as some solution for visually impaired users and users who dont like javascript

They may use classic textarea now

I do not think that the possibility of previewing is so important but if you want to make it it should look beautiful and work correctly. For me, it's better not to do anything than do it badly. I'm sorry that I did not include your code, Robert in the release (It's too bad, but I do not have time right now and I'm not so good at the front end to try to bring this feature to the release. Maybe return to it later

@Flameborn
Copy link
Contributor Author

Thank you. I absolutely understand your reasoning, and I agree, you should not release something which does not meet Typegram standards.

The problem is that my JS and CSS knowledge is nonexistent, apart from the basics.

I personally do not need markdown preview, since I'm writing markdown for quite a long time now, but it is incredibly useful, along with the statistics, if you are a writer, because you can immediately see if you did something wrong, and keep track of your progress that way.

Thank you so much for adding the noJS option, it is very much appreciated. Hopefully, we can return to this later.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants