mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-22 16:21:26 +01:00
Media: Expose media grid frame via wp-media-grid-ready
trigger for easier customization.
Props soulseekah. Fixes #50185. Built from https://develop.svn.wordpress.org/trunk@47807 git-svn-id: http://core.svn.wordpress.org/trunk@47583 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
16a8128765
commit
45f7e68d54
@ -147,11 +147,14 @@
|
|||||||
if ( $mediaGridWrap.length && window.wp && window.wp.media ) {
|
if ( $mediaGridWrap.length && window.wp && window.wp.media ) {
|
||||||
settings = _wpMediaGridSettings;
|
settings = _wpMediaGridSettings;
|
||||||
|
|
||||||
window.wp.media({
|
var frame = window.wp.media({
|
||||||
frame: 'manage',
|
frame: 'manage',
|
||||||
container: $mediaGridWrap,
|
container: $mediaGridWrap,
|
||||||
library: settings.queryVars
|
library: settings.queryVars
|
||||||
}).open();
|
}).open();
|
||||||
|
|
||||||
|
// Fire a global ready event.
|
||||||
|
$mediaGridWrap.trigger( 'wp-media-grid-ready', frame );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevents form submission if no post has been selected.
|
// Prevents form submission if no post has been selected.
|
||||||
|
2
wp-admin/js/media.min.js
vendored
2
wp-admin/js/media.min.js
vendored
@ -1,2 +1,2 @@
|
|||||||
/*! This file is auto-generated */
|
/*! This file is auto-generated */
|
||||||
!function(s){window.findPosts={open:function(n,i){var e=s(".ui-find-overlay");return 0===e.length&&(s("body").append('<div class="ui-find-overlay"></div>'),findPosts.overlay()),e.show(),n&&i&&s("#affected").attr("name",n).val(i),s("#find-posts").show(),s("#find-posts-input").focus().keyup(function(n){27==n.which&&findPosts.close()}),findPosts.send(),!1},close:function(){s("#find-posts-response").empty(),s("#find-posts").hide(),s(".ui-find-overlay").hide()},overlay:function(){s(".ui-find-overlay").on("click",function(){findPosts.close()})},send:function(){var n={ps:s("#find-posts-input").val(),action:"find_posts",_ajax_nonce:s("#_ajax_nonce").val()},i=s(".find-box-search .spinner");i.addClass("is-active"),s.ajax(ajaxurl,{type:"POST",data:n,dataType:"json"}).always(function(){i.removeClass("is-active")}).done(function(n){n.success||s("#find-posts-response").text(attachMediaBoxL10n.error),s("#find-posts-response").html(n.data)}).fail(function(){s("#find-posts-response").text(attachMediaBoxL10n.error)})}},s(document).ready(function(){var n,i=s("#wp-media-grid");i.length&&window.wp&&window.wp.media&&(n=_wpMediaGridSettings,window.wp.media({frame:"manage",container:i,library:n.queryVars}).open()),s("#find-posts-submit").click(function(n){s('#find-posts-response input[type="radio"]:checked').length||n.preventDefault()}),s("#find-posts .find-box-search :input").keypress(function(n){if(13==n.which)return findPosts.send(),!1}),s("#find-posts-search").click(findPosts.send),s("#find-posts-close").click(findPosts.close),s("#doaction, #doaction2").click(function(i){s('select[name^="action"]').each(function(){var n=s(this).val();"attach"===n?(i.preventDefault(),findPosts.open()):"delete"===n&&(showNotice.warn()||i.preventDefault())})}),s(".find-box-inside").on("click","tr",function(){s(this).find(".found-radio input").prop("checked",!0)})})}(jQuery);
|
!function(s){window.findPosts={open:function(n,i){var e=s(".ui-find-overlay");return 0===e.length&&(s("body").append('<div class="ui-find-overlay"></div>'),findPosts.overlay()),e.show(),n&&i&&s("#affected").attr("name",n).val(i),s("#find-posts").show(),s("#find-posts-input").focus().keyup(function(n){27==n.which&&findPosts.close()}),findPosts.send(),!1},close:function(){s("#find-posts-response").empty(),s("#find-posts").hide(),s(".ui-find-overlay").hide()},overlay:function(){s(".ui-find-overlay").on("click",function(){findPosts.close()})},send:function(){var n={ps:s("#find-posts-input").val(),action:"find_posts",_ajax_nonce:s("#_ajax_nonce").val()},i=s(".find-box-search .spinner");i.addClass("is-active"),s.ajax(ajaxurl,{type:"POST",data:n,dataType:"json"}).always(function(){i.removeClass("is-active")}).done(function(n){n.success||s("#find-posts-response").text(attachMediaBoxL10n.error),s("#find-posts-response").html(n.data)}).fail(function(){s("#find-posts-response").text(attachMediaBoxL10n.error)})}},s(document).ready(function(){var n,i=s("#wp-media-grid");if(i.length&&window.wp&&window.wp.media){n=_wpMediaGridSettings;var e=window.wp.media({frame:"manage",container:i,library:n.queryVars}).open();i.trigger("wp-media-grid-ready",e)}s("#find-posts-submit").click(function(n){s('#find-posts-response input[type="radio"]:checked').length||n.preventDefault()}),s("#find-posts .find-box-search :input").keypress(function(n){if(13==n.which)return findPosts.send(),!1}),s("#find-posts-search").click(findPosts.send),s("#find-posts-close").click(findPosts.close),s("#doaction, #doaction2").click(function(i){s('select[name^="action"]').each(function(){var n=s(this).val();"attach"===n?(i.preventDefault(),findPosts.open()):"delete"===n&&(showNotice.warn()||i.preventDefault())})}),s(".find-box-inside").on("click","tr",function(){s(this).find(".found-radio input").prop("checked",!0)})})}(jQuery);
|
@ -13,7 +13,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.5-alpha-47802';
|
$wp_version = '5.5-alpha-47807';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user