-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the Froala WYSIWYG Editor #863
Conversation
@saschaben can you enumerate all of the places this editor should be displayed? @saschaben / @dartajax please test the editing of a course objective title to get a feel for this thing and see if it will work for us. A heroku build should be available shortly to make it easy to try out. |
Editor needs to be in place for: Program objective (add new and edit) |
Hmm. Looks like it may be a little buggy. delimited lists don't work -- it adds an unnecessary UL tag which breaks them; ordered lists don't work and I can't tell why. Also: we will need to modify the UI display so that we are rendering any formatting in both edit AND non-edit modes, otherwise we run the high risk of making most entries with any real level of formatting unintelligible. |
Yes, please just test on course objective. The other editors may or may not appear, but I haven't hooked them up. |
"Show HTML" is blank after cut& paste from word. |
@saschaben please test again - you will need to run
meant as I wasn't able to get an extra UL tag to show up anywhere. |
The editor component does not yet pass actions back correctly so we have to use query to get the value out before we save.
New version of ember-froala allows for better binding of actions.
Added to course and session objective list titles and the session overview.
In order to make this work effectively I changed the pattern we were using for adding new objectives. Now only a single objective can be created. Using the +/- control.
fe260d0
to
5a9bdee
Compare
By default out lists have no style, this resets them closer to the browser default style.
This is ready for review |
I lied, not quite ready, needs some translations. |
OK, now we're ready for review. All translations in. |
//strip any possible HTML out of the text | ||
return text.replace(/(<([^>]+)>)/ig,""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems kinda hinky.
why not use jQuery here: http://api.jquery.com/text/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never occured to me actually. Good change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stopfstedt jquery.text() is for working with elements. We're working with a string passed from somewhere else like the DB. This would lead to something like:
return Ember.$("<div/>").html(text).text();
I'm not sure that isn't more confusing. This isn't a security step, its purely to easy in the display. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, forgot that you'll actually have to wrap your string in markup first.
that is more confusing.
let's go with your initial solution for now.
👍 |
Add the Froala WYSIWYG Editor
This seems to be our only choice for a relatively modern toolbar based editor which plays nicely with ember.
Before this is merged it needs to be added to and tested on:
Fixes #458