Commit Graph

7 Commits

Author SHA1 Message Date
Scott Taylor
64e19e98a3 Use Math.round() instead of Math.floor() when determining page of attachments to query in wp.media.model.Query.sync.
This was causing an infinite loop of AJAX requests - so.... good catch!

Props Veritaserum.
Fixes #31116.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-10 22:54:28 +00:00
Scott Taylor
1235221921 Export the proper class in media/views/image-details.js
See #28510.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31374 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-09 23:46:28 +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