Give the inlineEditor widget a "raw value" option.
Review Request #4484 — Created Aug. 25, 2013 and submitted
Give the inlineEditor widget a "raw value" option. When we use the inline editor today, we take the contents of whichever element is set, strip out any HTML formatting (like links that we may have inserted), and then set that as the contents of the input widget. This is insufficient if we want to do things like format things with markdown. This change adds a couple options, hasRawValue and rawValue, to the widget. If these are not set, everything works as before. If hasRawValue is true, the contents of the rawValue option are used as the source text, rather than calling .text() on the element and stripping it.
Used this with both raw-value and normal inline editors. Saw that my original text was visible in the former, even after markdown changed things a lot, and that the latter behaved as before.
-
This is a review from Review Bot. Tool: Pyflakes Processed Files: Ignored Files: djblets/media/js/jquery.gravy.js
- Change Summary:
-
Update rawValue property when the editor saves, so callers don't have to do as much book-keeping
- Diff:
-
Revision 2 (+15 -3)
-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: Ignored Files: djblets/media/js/jquery.gravy.js