[wp-trac] [WordPress Trac] #27016: Make placeholders/MCE views for Audio/Video shortcodes
WordPress Trac
noreply at wordpress.org
Tue Feb 25 19:07:08 UTC 2014
#27016: Make placeholders/MCE views for Audio/Video shortcodes
----------------------------+-------------------------
Reporter: wonderboymusic | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 3.9
Component: Media | Version: 3.6
Severity: normal | Resolution:
Keywords: has-patch | Focuses: javascript
----------------------------+-------------------------
Changes (by wonderboymusic):
* focuses: => javascript
Comment:
[attachment:27016.5.diff 27016.5.diff] gave me many headaches, but I think
it kind of rocks now:
* Introduces MVC for audio and video shortodes/placeholders
* Placeholders for audio and video are now clickable and editable in the
media modal
* The settings in the media modal map to new namespace defaults:
`wp.media.audio.defaults` and `wp.media.video.defaults`
* Piggybacking on @gcornes amazing work - allows you to replace the audio
or video in the media modal, it then updates your shortcode accordingly
* Adds the necessary back-and-forth in the TinyMCE `wpgallery` plugin,
which is where all of our media parsing is living
* Adds `media.model.PostVideo` and `media.model.PostAudio`
* Adds `media.controller.AudioDetails` and `media.controller.VideoDetails`
* Turns `media.controller.ReplaceImage` into a factory called
`media.controller.ReplaceMedia`
* Turns `media.view.MediaFrame.ImageDetails` into a factory called
`media.view.MediaFrame.MediaDetails`
* Turns `media.view.ImageDetails` into a factory called
`media.view.MediaDetails`
Without the factories, the amount of code duplication that would be
necessary is breathtaking.
The image manipulation @gcorne is doing is about 3 million times more
complicated than what I am doing - since it is altering existing HTML
inline in TinyMCE. The code I am introducing is pretty good boilerplate
for turning shortcodes into models into settings and back.
Will let this simmer for thoughts.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/27016#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list