mirror of
git://develop.git.wordpress.org/
synced 2025-01-17 04:48:25 +01:00
Move the built media JS files up a directory to their previous location and naming convention. This fidgets with part of [31373] and will maintain BC for those who were loading those files directly (not using the enqueue system).
Props iseulde, ocean90. Fixes #31912. git-svn-id: https://develop.svn.wordpress.org/trunk@32125 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
fbdbba9e01
commit
91143924cd
17
Gruntfile.js
17
Gruntfile.js
@ -4,7 +4,7 @@ module.exports = function(grunt) {
|
||||
SOURCE_DIR = 'src/',
|
||||
BUILD_DIR = 'build/',
|
||||
mediaConfig = {},
|
||||
mediaBuilds = ['audio-video', 'grid', 'models', 'views'];
|
||||
mediaBuilds = ['audiovideo', 'grid', 'models', 'views'];
|
||||
|
||||
// Load tasks.
|
||||
require('matchdep').filterDev(['grunt-*', '!grunt-legacy-util']).forEach( grunt.loadNpmTasks );
|
||||
@ -12,9 +12,9 @@ module.exports = function(grunt) {
|
||||
grunt.util = require('grunt-legacy-util');
|
||||
|
||||
mediaBuilds.forEach( function ( build ) {
|
||||
var path = SOURCE_DIR + 'wp-includes/js/media/';
|
||||
var path = SOURCE_DIR + 'wp-includes/js/media';
|
||||
mediaConfig[ build ] = { files : {} };
|
||||
mediaConfig[ build ].files[ path + build + '.js' ] = [ path + build + '.manifest.js' ];
|
||||
mediaConfig[ build ].files[ path + '-' + build + '.js' ] = [ path + '/' + build + '.manifest.js' ];
|
||||
} );
|
||||
|
||||
// Project configuration.
|
||||
@ -62,6 +62,7 @@ module.exports = function(grunt) {
|
||||
cwd: SOURCE_DIR,
|
||||
src: [
|
||||
'**',
|
||||
'!wp-includes/js/media/**',
|
||||
'!**/.{svn,git}/**', // Ignore version control directories.
|
||||
// Ignore unminified versions of external libs we don't ship:
|
||||
'!wp-includes/js/backbone.js',
|
||||
@ -272,12 +273,8 @@ module.exports = function(grunt) {
|
||||
options: {
|
||||
browserify: true
|
||||
},
|
||||
expand: true,
|
||||
cwd: SOURCE_DIR,
|
||||
src: [
|
||||
'wp-includes/js/media/**/*.js',
|
||||
'!wp-includes/js/media/*.js',
|
||||
'wp-includes/js/media/*.manifest.js'
|
||||
SOURCE_DIR + 'wp-includes/js/media/**/*.js'
|
||||
]
|
||||
},
|
||||
core: {
|
||||
@ -286,6 +283,8 @@ module.exports = function(grunt) {
|
||||
src: [
|
||||
'wp-admin/js/*.js',
|
||||
'wp-includes/js/*.js',
|
||||
// Built scripts.
|
||||
'!wp-includes/js/media-*',
|
||||
// WordPress scripts inside directories
|
||||
'wp-includes/js/jquery/jquery.table-hotkeys.js',
|
||||
'wp-includes/js/mediaelement/wp-mediaelement.js',
|
||||
@ -628,9 +627,7 @@ module.exports = function(grunt) {
|
||||
'rtl',
|
||||
'cssmin:rtl',
|
||||
'cssmin:colors',
|
||||
'browserify',
|
||||
'uglify:core',
|
||||
'uglify:media',
|
||||
'uglify:jqueryui',
|
||||
'concat:tinymce',
|
||||
'compress:tinymce',
|
||||
|
@ -694,16 +694,7 @@ $_old_files = array(
|
||||
'wp-includes/js/jquery/ui/jquery.ui.tabs.min.js',
|
||||
'wp-includes/js/jquery/ui/jquery.ui.tooltip.min.js',
|
||||
'wp-includes/js/jquery/ui/jquery.ui.widget.min.js',
|
||||
'wp-includes/js/tinymce/skins/wordpress/images/dashicon-no-alt.png',
|
||||
// 4.2
|
||||
'wp-includes/js/media-audiovideo.js',
|
||||
'wp-includes/js/media-audiovideo.min.js',
|
||||
'wp-includes/js/media-grid.js',
|
||||
'wp-includes/js/media-grid.min.js',
|
||||
'wp-includes/js/media-models.js',
|
||||
'wp-includes/js/media-models.min.js',
|
||||
'wp-includes/js/media-views.js',
|
||||
'wp-includes/js/media-views.min.js',
|
||||
'wp-includes/js/tinymce/skins/wordpress/images/dashicon-no-alt.png'
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -739,6 +739,7 @@
|
||||
margin-top: 11px;
|
||||
margin-right: 2%;
|
||||
max-width: 42%;
|
||||
max-width: -webkit-calc(48% - 12px);
|
||||
max-width: calc(48% - 12px);
|
||||
}
|
||||
|
||||
|
@ -410,7 +410,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
$scripts->add( 'accordion', "/wp-admin/js/accordion$suffix.js", array( 'jquery' ), false, 1 );
|
||||
|
||||
$scripts->add( 'shortcode', "/wp-includes/js/shortcode$suffix.js", array( 'underscore' ), false, 1 );
|
||||
$scripts->add( 'media-models', "/wp-includes/js/media/models$suffix.js", array( 'wp-backbone' ), false, 1 );
|
||||
$scripts->add( 'media-models', "/wp-includes/js/media-models$suffix.js", array( 'wp-backbone' ), false, 1 );
|
||||
did_action( 'init' ) && $scripts->localize( 'media-models', '_wpMediaModelsL10n', array(
|
||||
'settings' => array(
|
||||
'ajaxurl' => admin_url( 'admin-ajax.php', 'relative' ),
|
||||
@ -420,9 +420,9 @@ function wp_default_scripts( &$scripts ) {
|
||||
|
||||
// To enqueue media-views or media-editor, call wp_enqueue_media().
|
||||
// Both rely on numerous settings, styles, and templates to operate correctly.
|
||||
$scripts->add( 'media-views', "/wp-includes/js/media/views$suffix.js", array( 'utils', 'media-models', 'wp-plupload', 'jquery-ui-sortable', 'wp-mediaelement' ), false, 1 );
|
||||
$scripts->add( 'media-views', "/wp-includes/js/media-views$suffix.js", array( 'utils', 'media-models', 'wp-plupload', 'jquery-ui-sortable', 'wp-mediaelement' ), false, 1 );
|
||||
$scripts->add( 'media-editor', "/wp-includes/js/media-editor$suffix.js", array( 'shortcode', 'media-views' ), false, 1 );
|
||||
$scripts->add( 'media-audiovideo', "/wp-includes/js/media/audio-video$suffix.js", array( 'media-editor' ), false, 1 );
|
||||
$scripts->add( 'media-audiovideo', "/wp-includes/js/media-audiovideo$suffix.js", array( 'media-editor' ), false, 1 );
|
||||
$scripts->add( 'mce-view', "/wp-includes/js/mce-view$suffix.js", array( 'shortcode', 'media-models', 'media-audiovideo', 'wp-playlist' ), false, 1 );
|
||||
|
||||
if ( is_admin() ) {
|
||||
@ -556,7 +556,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
|
||||
$scripts->add( 'list-revisions', "/wp-includes/js/wp-list-revisions$suffix.js" );
|
||||
|
||||
$scripts->add( 'media-grid', "/wp-includes/js/media/grid$suffix.js", array( 'media-editor' ), false, 1 );
|
||||
$scripts->add( 'media-grid', "/wp-includes/js/media-grid$suffix.js", array( 'media-editor' ), false, 1 );
|
||||
$scripts->add( 'media', "/wp-admin/js/media$suffix.js", array( 'jquery' ), false, 1 );
|
||||
did_action( 'init' ) && $scripts->localize( 'media', 'attachMediaBoxL10n', array(
|
||||
'error' => __( 'An error has occurred. Please reload the page and try again.' ),
|
||||
|
Loading…
x
Reference in New Issue
Block a user