Commit Graph

9 Commits

Author SHA1 Message Date
Scott Taylor
a5478d7adb Let us pray to the gods of backwards compatibility:
* The way that the JS modules for media are currently set up turns the existing global `wp.media` namespace into a read-only API, this is bad.
* For the existing module implementation to work with plugins, those looking to override or extend a class would have to modify their own plugin to use `browserify` - we can't expect this to happen
* Because the general way that plugins override media classes is via machete (resetting them to something else), we cannot use `require( 'module' )` in the internal code for media modules

We CAN continue to use `require( 'fun/js' )` in the manifests for media. 

Future code/projects should carefully consider what is made to be public API. In 3.5, EVERYTHING was made public, so everything shall remain public.

See #31684, #28510.

Built from https://develop.svn.wordpress.org/trunk@31935


git-svn-id: http://core.svn.wordpress.org/trunk@31914 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-31 02:03:29 +00:00
Scott Taylor
ae85d506e6 When editing/viewing the details of a [video] shortcode that has Vimeo as its source, and Froogaloop has not already been lazy-loaded, check the details of the state's model for the video src, instead of the HTML element.
See #29267.

Built from https://develop.svn.wordpress.org/trunk@31625


git-svn-id: http://core.svn.wordpress.org/trunk@31606 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-05 16:15:25 +00:00
Scott Taylor
7b8cdd61fd Make sure the audio-video build does not load files from the views build.
See #28510.

Built from https://develop.svn.wordpress.org/trunk@31493


git-svn-id: http://core.svn.wordpress.org/trunk@31474 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-22 08:29:25 +00:00
Scott Taylor
6848035d1a Restore the changes I made in [31016] for chromeless Vimeo that were missed in [31373].
Make sure that the build file for `grid` doesn't load `views/media-details.js`, it already exists in the `audio-video` build.

See #29267, #28510.

Built from https://develop.svn.wordpress.org/trunk@31487


git-svn-id: http://core.svn.wordpress.org/trunk@31468 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-22 05:38:27 +00:00
Scott Taylor
586ff8676a After [31386], this needs to happen in audio-video.manifest.js.
See #31058.

Built from https://develop.svn.wordpress.org/trunk@31387


git-svn-id: http://core.svn.wordpress.org/trunk@31368 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-09 18:45:26 +00:00
Scott Taylor
b191013198 Media JS files:
* In media manifests, ditch IIFEs and global injection, these get dynamically scoped via Browserify
* Remove the `debug` option from `browserify:media`
* Add `jshint:media` to `jshint:corejs`
* Add a trailing newline to all new module files

Props iseulde.
See #28510.

Built from https://develop.svn.wordpress.org/trunk@31385


git-svn-id: http://core.svn.wordpress.org/trunk@31366 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-09 16:01:29 +00:00
Scott Taylor
ef12a2cc8c Bind this at calltime instead of letting self spill down into closures.
See #28510.

Built from https://develop.svn.wordpress.org/trunk@31380


git-svn-id: http://core.svn.wordpress.org/trunk@31361 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-09 04:45:28 +00:00
Scott Taylor
308ae4c887 Make sure that media/views.js doesn't load Models that already exist in media/models.js.
See #28510.

Built from https://develop.svn.wordpress.org/trunk@31379


git-svn-id: http://core.svn.wordpress.org/trunk@31360 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-09 04:14:26 +00:00
Scott Taylor
d568679946 Split the media JS files into modules:
* Add a new folder in `wp-includes/js`, `media`
* Create manifest files for `views`, `models`, `grid`, and `audio-video`
* Make `browserify` an `npm` dependency
* Add Grunt tasks for `browserify` and `uglify:media` on `build` and `watch`
* Update the paths loaded for media files in `script-loader`
* All new files were created using `svn cp` from their original location

Please run `npm install`. While developing media JS, you must run `grunt watch`.

See #28510.

Built from https://develop.svn.wordpress.org/trunk@31373


git-svn-id: http://core.svn.wordpress.org/trunk@31354 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-09 00:43:50 +00:00