-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Media: Populate advanced editing with parsed media #2541
Conversation
getDefaultProps() { | ||
return { | ||
resetEditItem: () => {}, | ||
insertMedia: () => {} |
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.
I think it works well when we use noop
from lodash (or any standard noop). I like the idea of being able to quickly and easily grep for these kinds of things, plus if we all use the same one, it's just a single closure/function being generated. obviously this isn't a big deal
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.
I think it works well when we use
noop
from lodash (or any standard noop).
Yeah, I don't feel strongly either way, though I find it's nice to limit the dependencies, and this should become a common enough pattern for an empty function that I don't think it really harms readability.
@aduth I hope you don't mind the hit-and-run here, but I saw your PR without any comments and poked my head in. didn't see any concerning issues with the code but I left a couple comments. thanks for the work - the media system is really great IMHO |
I'm always appreciative of your reviews 😃 Apologies for the delay in response, as I've been out for the past two weeks.
Thanks for the kind words! |
e0abfba
to
25f05a6
Compare
Force pushed a rebase, including changing Marking as ready to merge, though not planning to merge immediately. |
25f05a6
to
cb8f8aa
Compare
So that markup insertion has access to editor instance
cb8f8aa
to
fd2e2f5
Compare
…utes Media: Populate advanced editing with parsed media
Related: #307, #2085
This pull request seeks to further progress advanced image editing by parsing the selected media item and adding the necessary behavior to update markup in the post editor after the user has chosen to save their changes.
This is very much a work-in-progress. As of now, the only expected behaviors are:
Note that this feature is feature-flagged, and is only available in a development environment. You can/should verify that these options are unavailable in all other environments.
Implementation notes:
The advanced media modal is no longer rendered by the
<PostEditor />
component, but instead by themedia/advanced
TinyMCE plugin. This is done so that the expectedinsertMedia
prop handler can be passed to the modal which, when called, replaces the current selection with the passed markup.Testing instructions: