fitzroyacademy / web-app

The main web app
0 stars 0 forks source link

Standardise and fix WYSIWYG editors #191

Closed willdayble closed 4 years ago

willdayble commented 4 years ago

Looking at http://fitz-dev.com:5000/course/fitzroy-academy/lessons/2/edit

See _lesson.html, it seems to have ugly <script> tags down the bottom of the file doing the wysiwyg stuff, should this all be in fit.js and whatnot?

This is probably a reason to check out how we're doing them all.

Maybe we need some standards:

  1. data-fit-wysiwyg-full = full wysiwyg text-editor with headers, links, quotes, image upload etc
  2. data-fit-wysiwyg-lite = Only bold/italic + links (no headers, quotes, etc)
  3. data-fit-wysiwyg-min = only carriage returns

I think that's it? We should probably chat this through I'm guessing lol.

willdayble commented 4 years ago

Or alternatively, separate for attr for options?

Yuffster commented 4 years ago

Alright, @willdayble, fresh template macro.

wysiwyg(input_name, content, toolbar_styles)

Everything but input_name is optional. You'll get the full toolbar if you leave out toolbar styles.

You have to wrap things in an empty form in course edit though until we can untangle all the gnarly autosave code (#194).

<form>
    {{ wysiwyg('course_summary', course.summary_html, ['bold', 'italic']) }}
</form>