Git Merge Request #349: Upgraded SimpleMDE to EasyMDE and added Codemirror. (merged)

Merging...

Merged

Something went wrong. Please, merge manually

Checking if merge is possible...

Something went wrong. Please, merge manually

Domi wants to merge 7 commits from /u/domark/allura/ to master, 2020-10-30

Commit Date  
[b563ee] (HEADmaster) by domark domark

- the browser's own spell checker will work now

2020-10-30 10:15:30 Tree
[78ecc5] by domark domark

deleted min-height: 60px styles. not needed anymore

2020-10-30 09:52:37 Tree
[2f63ae] by domark domark

- css changes are now in the 'markitup_sf.css' file
- easymde.min.css is now the origin version again
- the three buttons 'preview, fullscreen and guide' are now on the right side again

2020-10-30 09:08:33 Tree
[f1ccd9] by domark domark

LICENSES updated for EasyMDE instead of SimpleMDE

2020-10-30 08:24:46 Tree
[8d0654] by domark domark

fixed some missdisplayed easymde toolbar icons

2020-10-27 10:07:59 Tree
[f02f9e] by domark domark

simplemde toolbar speparators are now displayed correctly

2020-10-27 09:29:18 Tree
[e71138] by domark domark

upgraded SimpleMDE to EasyMDE

2020-10-27 09:12:29 Tree

Discussion

  • Dave Brondsema

    Dave Brondsema - 2020-10-29

    Thanks for this contribution! I'll be looking at it soon.

    We're you previously seeing weird behavior with it on mobile? Does this fix it?

     
    • Domi - 2020-10-29

      I guess it should fix it. Unfortunately I couldn't test it on mobile yet. I will do this asap.

       
      • Dave Brondsema

        Dave Brondsema - 2020-10-29

        That'd be great. I've heard on Android the old version sometimes duplicates words and stuff like that. But I've only been able to test on iphone and desktop browser emulators (which work fine). I have a colleague who can help with Android testing too.

         
  • Dave Brondsema

    Dave Brondsema - 2020-10-29

    My colleague confirms its a lot better on Android now :) So that'll take care of [#8260] I'd had been thinking about doing this upgrade very soon anyway because of the Android problems, so its great you've done it and are contributing it. I did find some changes because of the upgrade, I've listed them below. If you're able to take a look at them great. Otherwise I can help too, since I was thinking about this anyway.

    I see you made a few changes in easymde.min.css like added float:none and i.fa{float:none}.editor-toolbar. Those would be best in a separate css file like markitup_sf.css and keep the easymde file as the original. Then if easymde is upgraded in the future, we don't have to worry about your changes getting lost.

    The editing box is taller now. Allura sets min-height: 60px; in a few places in markitup_sf.css but those aren't working. It looks like EasyMDE has a minHeight setting which maybe is the better way to set it, and remove the min-height styles?

    The last 3 buttons are no longer aligned all the way to the right. I see in our CSS file a /* move these buttons to the right, they are a different type of button */ section to do that. I think all the fa-* selectors need to be updated. (Also some in the middle of the file?)

    I see there's more spellcheck options now, so It seems we can set inputStyle: 'contenteditable', and the browser's own spell checker will work now, and will fix [#7954]

    LICENSE and Allura/LICENSE should be updated for EasyMDE instead of SimpleMDE

    If I type @ to trigger username autocomplete, it doesn't work. The console says cm.showHint is not a function The existing code for this is in show-hint.js/.css (which probably should be updated to latest but that doesn't fix it). And our hook into that is CodeMirror.showHint(...

    I think related to that problem, codemirror.js wasn't needed as its own file in the past. It was bundled within SimpleMDE. I think that's probably still bundled in EasyMDE (it need its to work at all). But it's no longer exposed as a top-level CodeMirror variable like our code needs. You probably added the codemirror.js file to fix an error about CodeMirror variable not defined, which helps a bit, but then its not the same instance of CodeMirror that is used within EasyMDE which makes showHint error. I see there is an open issue https://github.com/Ionaru/easy-markdown-editor/issues/167 about including addons and https://github.com/Ionaru/easy-markdown-editor/pull/76 for exposing CodeMirror which I think might be what we want, but isn't merged.

    Thanks again, and like I said I'm quite interested in this so if you'd like me to tackle any parts (especially the last stuff about showHint/packaging) that'd be ok.

     

    Related

    Tickets: #7954
    Tickets: #8260

    • Domi - 2020-10-30

      Thank you, I will take a look at them. These are very good advices. I just started this upgrade for my own project and it was kinda hacky, but I thought it might help. Now I am very interested in doing it the right way.
      Javascript and Allura are kinda new to me, so if you tackle the last part (or any other) I'm totally fine with it.

       
      👍
      1
  • Dave Brondsema

    Dave Brondsema - 2020-10-30
    • Status: open --> merged
     
  • Dave Brondsema

    Dave Brondsema - 2020-10-30

    Thanks again for your contribution. I made a few more tweaks and customizations, and for the EasyMDE/CodeMirror packaging opened https://github.com/Ionaru/easy-markdown-editor/pull/263 and currently we have a custom build with that little tweak, hopefully it'll get merged into their next release.

     
    👍
    1

Log in to post a comment.