Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-inclu.../js
File: media-views.js
/******/ (() => { // webpackBootstrap
[0] Fix | Delete
/******/ var __webpack_modules__ = ({
[1] Fix | Delete
[2] Fix | Delete
/***/ 7145:
[3] Fix | Delete
/***/ ((module) => {
[4] Fix | Delete
[5] Fix | Delete
var Selection = wp.media.model.Selection,
[6] Fix | Delete
Library = wp.media.controller.Library,
[7] Fix | Delete
CollectionAdd;
[8] Fix | Delete
[9] Fix | Delete
/**
[10] Fix | Delete
* wp.media.controller.CollectionAdd
[11] Fix | Delete
*
[12] Fix | Delete
* A state for adding attachments to a collection (e.g. video playlist).
[13] Fix | Delete
*
[14] Fix | Delete
* @memberOf wp.media.controller
[15] Fix | Delete
*
[16] Fix | Delete
* @class
[17] Fix | Delete
* @augments wp.media.controller.Library
[18] Fix | Delete
* @augments wp.media.controller.State
[19] Fix | Delete
* @augments Backbone.Model
[20] Fix | Delete
*
[21] Fix | Delete
* @param {object} [attributes] The attributes hash passed to the state.
[22] Fix | Delete
* @param {string} [attributes.id=library] Unique identifier.
[23] Fix | Delete
* @param {string} attributes.title Title for the state. Displays in the frame's title region.
[24] Fix | Delete
* @param {boolean} [attributes.multiple=add] Whether multi-select is enabled. @todo 'add' doesn't seem do anything special, and gets used as a boolean.
[25] Fix | Delete
* @param {wp.media.model.Attachments} [attributes.library] The attachments collection to browse.
[26] Fix | Delete
* If one is not supplied, a collection of attachments of the specified type will be created.
[27] Fix | Delete
* @param {boolean|string} [attributes.filterable=uploaded] Whether the library is filterable, and if so what filters should be shown.
[28] Fix | Delete
* Accepts 'all', 'uploaded', or 'unattached'.
[29] Fix | Delete
* @param {string} [attributes.menu=gallery] Initial mode for the menu region.
[30] Fix | Delete
* @param {string} [attributes.content=upload] Initial mode for the content region.
[31] Fix | Delete
* Overridden by persistent user setting if 'contentUserSetting' is true.
[32] Fix | Delete
* @param {string} [attributes.router=browse] Initial mode for the router region.
[33] Fix | Delete
* @param {string} [attributes.toolbar=gallery-add] Initial mode for the toolbar region.
[34] Fix | Delete
* @param {boolean} [attributes.searchable=true] Whether the library is searchable.
[35] Fix | Delete
* @param {boolean} [attributes.sortable=true] Whether the Attachments should be sortable. Depends on the orderby property being set to menuOrder on the attachments collection.
[36] Fix | Delete
* @param {boolean} [attributes.autoSelect=true] Whether an uploaded attachment should be automatically added to the selection.
[37] Fix | Delete
* @param {boolean} [attributes.contentUserSetting=true] Whether the content region's mode should be set and persisted per user.
[38] Fix | Delete
* @param {int} [attributes.priority=100] The priority for the state link in the media menu.
[39] Fix | Delete
* @param {boolean} [attributes.syncSelection=false] Whether the Attachments selection should be persisted from the last state.
[40] Fix | Delete
* Defaults to false because for this state, because the library of the Edit Gallery state is the selection.
[41] Fix | Delete
* @param {string} attributes.type The collection's media type. (e.g. 'video').
[42] Fix | Delete
* @param {string} attributes.collectionType The collection type. (e.g. 'playlist').
[43] Fix | Delete
*/
[44] Fix | Delete
CollectionAdd = Library.extend(/** @lends wp.media.controller.CollectionAdd.prototype */{
[45] Fix | Delete
defaults: _.defaults( {
[46] Fix | Delete
// Selection defaults. @see media.model.Selection
[47] Fix | Delete
multiple: 'add',
[48] Fix | Delete
// Attachments browser defaults. @see media.view.AttachmentsBrowser
[49] Fix | Delete
filterable: 'uploaded',
[50] Fix | Delete
[51] Fix | Delete
priority: 100,
[52] Fix | Delete
syncSelection: false
[53] Fix | Delete
}, Library.prototype.defaults ),
[54] Fix | Delete
[55] Fix | Delete
/**
[56] Fix | Delete
* @since 3.9.0
[57] Fix | Delete
*/
[58] Fix | Delete
initialize: function() {
[59] Fix | Delete
var collectionType = this.get('collectionType');
[60] Fix | Delete
[61] Fix | Delete
if ( 'video' === this.get( 'type' ) ) {
[62] Fix | Delete
collectionType = 'video-' + collectionType;
[63] Fix | Delete
}
[64] Fix | Delete
[65] Fix | Delete
this.set( 'id', collectionType + '-library' );
[66] Fix | Delete
this.set( 'toolbar', collectionType + '-add' );
[67] Fix | Delete
this.set( 'menu', collectionType );
[68] Fix | Delete
[69] Fix | Delete
// If we haven't been provided a `library`, create a `Selection`.
[70] Fix | Delete
if ( ! this.get('library') ) {
[71] Fix | Delete
this.set( 'library', wp.media.query({ type: this.get('type') }) );
[72] Fix | Delete
}
[73] Fix | Delete
Library.prototype.initialize.apply( this, arguments );
[74] Fix | Delete
},
[75] Fix | Delete
[76] Fix | Delete
/**
[77] Fix | Delete
* @since 3.9.0
[78] Fix | Delete
*/
[79] Fix | Delete
activate: function() {
[80] Fix | Delete
var library = this.get('library'),
[81] Fix | Delete
editLibrary = this.get('editLibrary'),
[82] Fix | Delete
edit = this.frame.state( this.get('collectionType') + '-edit' ).get('library');
[83] Fix | Delete
[84] Fix | Delete
if ( editLibrary && editLibrary !== edit ) {
[85] Fix | Delete
library.unobserve( editLibrary );
[86] Fix | Delete
}
[87] Fix | Delete
[88] Fix | Delete
// Accepts attachments that exist in the original library and
[89] Fix | Delete
// that do not exist in gallery's library.
[90] Fix | Delete
library.validator = function( attachment ) {
[91] Fix | Delete
return !! this.mirroring.get( attachment.cid ) && ! edit.get( attachment.cid ) && Selection.prototype.validator.apply( this, arguments );
[92] Fix | Delete
};
[93] Fix | Delete
[94] Fix | Delete
/*
[95] Fix | Delete
* Reset the library to ensure that all attachments are re-added
[96] Fix | Delete
* to the collection. Do so silently, as calling `observe` will
[97] Fix | Delete
* trigger the `reset` event.
[98] Fix | Delete
*/
[99] Fix | Delete
library.reset( library.mirroring.models, { silent: true });
[100] Fix | Delete
library.observe( edit );
[101] Fix | Delete
this.set('editLibrary', edit);
[102] Fix | Delete
[103] Fix | Delete
Library.prototype.activate.apply( this, arguments );
[104] Fix | Delete
}
[105] Fix | Delete
});
[106] Fix | Delete
[107] Fix | Delete
module.exports = CollectionAdd;
[108] Fix | Delete
[109] Fix | Delete
[110] Fix | Delete
/***/ }),
[111] Fix | Delete
[112] Fix | Delete
/***/ 8612:
[113] Fix | Delete
/***/ ((module) => {
[114] Fix | Delete
[115] Fix | Delete
var Library = wp.media.controller.Library,
[116] Fix | Delete
l10n = wp.media.view.l10n,
[117] Fix | Delete
$ = jQuery,
[118] Fix | Delete
CollectionEdit;
[119] Fix | Delete
[120] Fix | Delete
/**
[121] Fix | Delete
* wp.media.controller.CollectionEdit
[122] Fix | Delete
*
[123] Fix | Delete
* A state for editing a collection, which is used by audio and video playlists,
[124] Fix | Delete
* and can be used for other collections.
[125] Fix | Delete
*
[126] Fix | Delete
* @memberOf wp.media.controller
[127] Fix | Delete
*
[128] Fix | Delete
* @class
[129] Fix | Delete
* @augments wp.media.controller.Library
[130] Fix | Delete
* @augments wp.media.controller.State
[131] Fix | Delete
* @augments Backbone.Model
[132] Fix | Delete
*
[133] Fix | Delete
* @param {object} [attributes] The attributes hash passed to the state.
[134] Fix | Delete
* @param {string} attributes.title Title for the state. Displays in the media menu and the frame's title region.
[135] Fix | Delete
* @param {wp.media.model.Attachments} [attributes.library] The attachments collection to edit.
[136] Fix | Delete
* If one is not supplied, an empty media.model.Selection collection is created.
[137] Fix | Delete
* @param {boolean} [attributes.multiple=false] Whether multi-select is enabled.
[138] Fix | Delete
* @param {string} [attributes.content=browse] Initial mode for the content region.
[139] Fix | Delete
* @param {string} attributes.menu Initial mode for the menu region. @todo this needs a better explanation.
[140] Fix | Delete
* @param {boolean} [attributes.searchable=false] Whether the library is searchable.
[141] Fix | Delete
* @param {boolean} [attributes.sortable=true] Whether the Attachments should be sortable. Depends on the orderby property being set to menuOrder on the attachments collection.
[142] Fix | Delete
* @param {boolean} [attributes.date=true] Whether to show the date filter in the browser's toolbar.
[143] Fix | Delete
* @param {boolean} [attributes.describe=true] Whether to offer UI to describe the attachments - e.g. captioning images in a gallery.
[144] Fix | Delete
* @param {boolean} [attributes.dragInfo=true] Whether to show instructional text about the attachments being sortable.
[145] Fix | Delete
* @param {boolean} [attributes.dragInfoText] Instructional text about the attachments being sortable.
[146] Fix | Delete
* @param {int} [attributes.idealColumnWidth=170] The ideal column width in pixels for attachments.
[147] Fix | Delete
* @param {boolean} [attributes.editing=false] Whether the gallery is being created, or editing an existing instance.
[148] Fix | Delete
* @param {int} [attributes.priority=60] The priority for the state link in the media menu.
[149] Fix | Delete
* @param {boolean} [attributes.syncSelection=false] Whether the Attachments selection should be persisted from the last state.
[150] Fix | Delete
* Defaults to false for this state, because the library passed in *is* the selection.
[151] Fix | Delete
* @param {view} [attributes.SettingsView] The view to edit the collection instance settings (e.g. Playlist settings with "Show tracklist" checkbox).
[152] Fix | Delete
* @param {view} [attributes.AttachmentView] The single `Attachment` view to be used in the `Attachments`.
[153] Fix | Delete
* If none supplied, defaults to wp.media.view.Attachment.EditLibrary.
[154] Fix | Delete
* @param {string} attributes.type The collection's media type. (e.g. 'video').
[155] Fix | Delete
* @param {string} attributes.collectionType The collection type. (e.g. 'playlist').
[156] Fix | Delete
*/
[157] Fix | Delete
CollectionEdit = Library.extend(/** @lends wp.media.controller.CollectionEdit.prototype */{
[158] Fix | Delete
defaults: {
[159] Fix | Delete
multiple: false,
[160] Fix | Delete
sortable: true,
[161] Fix | Delete
date: false,
[162] Fix | Delete
searchable: false,
[163] Fix | Delete
content: 'browse',
[164] Fix | Delete
describe: true,
[165] Fix | Delete
dragInfo: true,
[166] Fix | Delete
idealColumnWidth: 170,
[167] Fix | Delete
editing: false,
[168] Fix | Delete
priority: 60,
[169] Fix | Delete
SettingsView: false,
[170] Fix | Delete
syncSelection: false
[171] Fix | Delete
},
[172] Fix | Delete
[173] Fix | Delete
/**
[174] Fix | Delete
* @since 3.9.0
[175] Fix | Delete
*/
[176] Fix | Delete
initialize: function() {
[177] Fix | Delete
var collectionType = this.get('collectionType');
[178] Fix | Delete
[179] Fix | Delete
if ( 'video' === this.get( 'type' ) ) {
[180] Fix | Delete
collectionType = 'video-' + collectionType;
[181] Fix | Delete
}
[182] Fix | Delete
[183] Fix | Delete
this.set( 'id', collectionType + '-edit' );
[184] Fix | Delete
this.set( 'toolbar', collectionType + '-edit' );
[185] Fix | Delete
[186] Fix | Delete
// If we haven't been provided a `library`, create a `Selection`.
[187] Fix | Delete
if ( ! this.get('library') ) {
[188] Fix | Delete
this.set( 'library', new wp.media.model.Selection() );
[189] Fix | Delete
}
[190] Fix | Delete
// The single `Attachment` view to be used in the `Attachments` view.
[191] Fix | Delete
if ( ! this.get('AttachmentView') ) {
[192] Fix | Delete
this.set( 'AttachmentView', wp.media.view.Attachment.EditLibrary );
[193] Fix | Delete
}
[194] Fix | Delete
Library.prototype.initialize.apply( this, arguments );
[195] Fix | Delete
},
[196] Fix | Delete
[197] Fix | Delete
/**
[198] Fix | Delete
* @since 3.9.0
[199] Fix | Delete
*/
[200] Fix | Delete
activate: function() {
[201] Fix | Delete
var library = this.get('library');
[202] Fix | Delete
[203] Fix | Delete
// Limit the library to images only.
[204] Fix | Delete
library.props.set( 'type', this.get( 'type' ) );
[205] Fix | Delete
[206] Fix | Delete
// Watch for uploaded attachments.
[207] Fix | Delete
this.get('library').observe( wp.Uploader.queue );
[208] Fix | Delete
[209] Fix | Delete
this.frame.on( 'content:render:browse', this.renderSettings, this );
[210] Fix | Delete
[211] Fix | Delete
Library.prototype.activate.apply( this, arguments );
[212] Fix | Delete
},
[213] Fix | Delete
[214] Fix | Delete
/**
[215] Fix | Delete
* @since 3.9.0
[216] Fix | Delete
*/
[217] Fix | Delete
deactivate: function() {
[218] Fix | Delete
// Stop watching for uploaded attachments.
[219] Fix | Delete
this.get('library').unobserve( wp.Uploader.queue );
[220] Fix | Delete
[221] Fix | Delete
this.frame.off( 'content:render:browse', this.renderSettings, this );
[222] Fix | Delete
[223] Fix | Delete
Library.prototype.deactivate.apply( this, arguments );
[224] Fix | Delete
},
[225] Fix | Delete
[226] Fix | Delete
/**
[227] Fix | Delete
* Render the collection embed settings view in the browser sidebar.
[228] Fix | Delete
*
[229] Fix | Delete
* @todo This is against the pattern elsewhere in media. Typically the frame
[230] Fix | Delete
* is responsible for adding region mode callbacks. Explain.
[231] Fix | Delete
*
[232] Fix | Delete
* @since 3.9.0
[233] Fix | Delete
*
[234] Fix | Delete
* @param {wp.media.view.attachmentsBrowser} The attachments browser view.
[235] Fix | Delete
*/
[236] Fix | Delete
renderSettings: function( attachmentsBrowserView ) {
[237] Fix | Delete
var library = this.get('library'),
[238] Fix | Delete
collectionType = this.get('collectionType'),
[239] Fix | Delete
dragInfoText = this.get('dragInfoText'),
[240] Fix | Delete
SettingsView = this.get('SettingsView'),
[241] Fix | Delete
obj = {};
[242] Fix | Delete
[243] Fix | Delete
if ( ! library || ! attachmentsBrowserView ) {
[244] Fix | Delete
return;
[245] Fix | Delete
}
[246] Fix | Delete
[247] Fix | Delete
library[ collectionType ] = library[ collectionType ] || new Backbone.Model();
[248] Fix | Delete
[249] Fix | Delete
obj[ collectionType ] = new SettingsView({
[250] Fix | Delete
controller: this,
[251] Fix | Delete
model: library[ collectionType ],
[252] Fix | Delete
priority: 40
[253] Fix | Delete
});
[254] Fix | Delete
[255] Fix | Delete
attachmentsBrowserView.sidebar.set( obj );
[256] Fix | Delete
[257] Fix | Delete
if ( dragInfoText ) {
[258] Fix | Delete
attachmentsBrowserView.toolbar.set( 'dragInfo', new wp.media.View({
[259] Fix | Delete
el: $( '<div class="instructions">' + dragInfoText + '</div>' )[0],
[260] Fix | Delete
priority: -40
[261] Fix | Delete
}) );
[262] Fix | Delete
}
[263] Fix | Delete
[264] Fix | Delete
// Add the 'Reverse order' button to the toolbar.
[265] Fix | Delete
attachmentsBrowserView.toolbar.set( 'reverse', {
[266] Fix | Delete
text: l10n.reverseOrder,
[267] Fix | Delete
priority: 80,
[268] Fix | Delete
[269] Fix | Delete
click: function() {
[270] Fix | Delete
library.reset( library.toArray().reverse() );
[271] Fix | Delete
}
[272] Fix | Delete
});
[273] Fix | Delete
}
[274] Fix | Delete
});
[275] Fix | Delete
[276] Fix | Delete
module.exports = CollectionEdit;
[277] Fix | Delete
[278] Fix | Delete
[279] Fix | Delete
/***/ }),
[280] Fix | Delete
[281] Fix | Delete
/***/ 5422:
[282] Fix | Delete
/***/ ((module) => {
[283] Fix | Delete
[284] Fix | Delete
var l10n = wp.media.view.l10n,
[285] Fix | Delete
Cropper;
[286] Fix | Delete
[287] Fix | Delete
/**
[288] Fix | Delete
* wp.media.controller.Cropper
[289] Fix | Delete
*
[290] Fix | Delete
* A class for cropping an image when called from the header media customization panel.
[291] Fix | Delete
*
[292] Fix | Delete
* @memberOf wp.media.controller
[293] Fix | Delete
*
[294] Fix | Delete
* @class
[295] Fix | Delete
* @augments wp.media.controller.State
[296] Fix | Delete
* @augments Backbone.Model
[297] Fix | Delete
*/
[298] Fix | Delete
Cropper = wp.media.controller.State.extend(/** @lends wp.media.controller.Cropper.prototype */{
[299] Fix | Delete
defaults: {
[300] Fix | Delete
id: 'cropper',
[301] Fix | Delete
title: l10n.cropImage,
[302] Fix | Delete
// Region mode defaults.
[303] Fix | Delete
toolbar: 'crop',
[304] Fix | Delete
content: 'crop',
[305] Fix | Delete
router: false,
[306] Fix | Delete
canSkipCrop: false,
[307] Fix | Delete
[308] Fix | Delete
// Default doCrop Ajax arguments to allow the Customizer (for example) to inject state.
[309] Fix | Delete
doCropArgs: {}
[310] Fix | Delete
},
[311] Fix | Delete
[312] Fix | Delete
/**
[313] Fix | Delete
* Shows the crop image window when called from the Add new image button.
[314] Fix | Delete
*
[315] Fix | Delete
* @since 4.2.0
[316] Fix | Delete
*
[317] Fix | Delete
* @return {void}
[318] Fix | Delete
*/
[319] Fix | Delete
activate: function() {
[320] Fix | Delete
this.frame.on( 'content:create:crop', this.createCropContent, this );
[321] Fix | Delete
this.frame.on( 'close', this.removeCropper, this );
[322] Fix | Delete
this.set('selection', new Backbone.Collection(this.frame._selection.single));
[323] Fix | Delete
},
[324] Fix | Delete
[325] Fix | Delete
/**
[326] Fix | Delete
* Changes the state of the toolbar window to browse mode.
[327] Fix | Delete
*
[328] Fix | Delete
* @since 4.2.0
[329] Fix | Delete
*
[330] Fix | Delete
* @return {void}
[331] Fix | Delete
*/
[332] Fix | Delete
deactivate: function() {
[333] Fix | Delete
this.frame.toolbar.mode('browse');
[334] Fix | Delete
},
[335] Fix | Delete
[336] Fix | Delete
/**
[337] Fix | Delete
* Creates the crop image window.
[338] Fix | Delete
*
[339] Fix | Delete
* Initialized when clicking on the Select and Crop button.
[340] Fix | Delete
*
[341] Fix | Delete
* @since 4.2.0
[342] Fix | Delete
*
[343] Fix | Delete
* @fires crop window
[344] Fix | Delete
*
[345] Fix | Delete
* @return {void}
[346] Fix | Delete
*/
[347] Fix | Delete
createCropContent: function() {
[348] Fix | Delete
this.cropperView = new wp.media.view.Cropper({
[349] Fix | Delete
controller: this,
[350] Fix | Delete
attachment: this.get('selection').first()
[351] Fix | Delete
});
[352] Fix | Delete
this.cropperView.on('image-loaded', this.createCropToolbar, this);
[353] Fix | Delete
this.frame.content.set(this.cropperView);
[354] Fix | Delete
[355] Fix | Delete
},
[356] Fix | Delete
[357] Fix | Delete
/**
[358] Fix | Delete
* Removes the image selection and closes the cropping window.
[359] Fix | Delete
*
[360] Fix | Delete
* @since 4.2.0
[361] Fix | Delete
*
[362] Fix | Delete
* @return {void}
[363] Fix | Delete
*/
[364] Fix | Delete
removeCropper: function() {
[365] Fix | Delete
this.imgSelect.cancelSelection();
[366] Fix | Delete
this.imgSelect.setOptions({remove: true});
[367] Fix | Delete
this.imgSelect.update();
[368] Fix | Delete
this.cropperView.remove();
[369] Fix | Delete
},
[370] Fix | Delete
[371] Fix | Delete
/**
[372] Fix | Delete
* Checks if cropping can be skipped and creates crop toolbar accordingly.
[373] Fix | Delete
*
[374] Fix | Delete
* @since 4.2.0
[375] Fix | Delete
*
[376] Fix | Delete
* @return {void}
[377] Fix | Delete
*/
[378] Fix | Delete
createCropToolbar: function() {
[379] Fix | Delete
var canSkipCrop, toolbarOptions;
[380] Fix | Delete
[381] Fix | Delete
canSkipCrop = this.get('canSkipCrop') || false;
[382] Fix | Delete
[383] Fix | Delete
toolbarOptions = {
[384] Fix | Delete
controller: this.frame,
[385] Fix | Delete
items: {
[386] Fix | Delete
insert: {
[387] Fix | Delete
style: 'primary',
[388] Fix | Delete
text: l10n.cropImage,
[389] Fix | Delete
priority: 80,
[390] Fix | Delete
requires: { library: false, selection: false },
[391] Fix | Delete
[392] Fix | Delete
click: function() {
[393] Fix | Delete
var controller = this.controller,
[394] Fix | Delete
selection;
[395] Fix | Delete
[396] Fix | Delete
selection = controller.state().get('selection').first();
[397] Fix | Delete
selection.set({cropDetails: controller.state().imgSelect.getSelection()});
[398] Fix | Delete
[399] Fix | Delete
this.$el.text(l10n.cropping);
[400] Fix | Delete
this.$el.attr('disabled', true);
[401] Fix | Delete
[402] Fix | Delete
controller.state().doCrop( selection ).done( function( croppedImage ) {
[403] Fix | Delete
controller.trigger('cropped', croppedImage );
[404] Fix | Delete
controller.close();
[405] Fix | Delete
}).fail( function() {
[406] Fix | Delete
controller.trigger('content:error:crop');
[407] Fix | Delete
});
[408] Fix | Delete
}
[409] Fix | Delete
}
[410] Fix | Delete
}
[411] Fix | Delete
};
[412] Fix | Delete
[413] Fix | Delete
if ( canSkipCrop ) {
[414] Fix | Delete
_.extend( toolbarOptions.items, {
[415] Fix | Delete
skip: {
[416] Fix | Delete
style: 'secondary',
[417] Fix | Delete
text: l10n.skipCropping,
[418] Fix | Delete
priority: 70,
[419] Fix | Delete
requires: { library: false, selection: false },
[420] Fix | Delete
click: function() {
[421] Fix | Delete
var selection = this.controller.state().get('selection').first();
[422] Fix | Delete
this.controller.state().cropperView.remove();
[423] Fix | Delete
this.controller.trigger('skippedcrop', selection);
[424] Fix | Delete
this.controller.close();
[425] Fix | Delete
}
[426] Fix | Delete
}
[427] Fix | Delete
});
[428] Fix | Delete
}
[429] Fix | Delete
[430] Fix | Delete
this.frame.toolbar.set( new wp.media.view.Toolbar(toolbarOptions) );
[431] Fix | Delete
},
[432] Fix | Delete
[433] Fix | Delete
/**
[434] Fix | Delete
* Creates an object with the image attachment and crop properties.
[435] Fix | Delete
*
[436] Fix | Delete
* @since 4.2.0
[437] Fix | Delete
*
[438] Fix | Delete
* @return {$.promise} A jQuery promise with the custom header crop details.
[439] Fix | Delete
*/
[440] Fix | Delete
doCrop: function( attachment ) {
[441] Fix | Delete
return wp.ajax.post( 'custom-header-crop', _.extend(
[442] Fix | Delete
{},
[443] Fix | Delete
this.defaults.doCropArgs,
[444] Fix | Delete
{
[445] Fix | Delete
nonce: attachment.get( 'nonces' ).edit,
[446] Fix | Delete
id: attachment.get( 'id' ),
[447] Fix | Delete
cropDetails: attachment.get( 'cropDetails' )
[448] Fix | Delete
}
[449] Fix | Delete
) );
[450] Fix | Delete
}
[451] Fix | Delete
});
[452] Fix | Delete
[453] Fix | Delete
module.exports = Cropper;
[454] Fix | Delete
[455] Fix | Delete
[456] Fix | Delete
/***/ }),
[457] Fix | Delete
[458] Fix | Delete
/***/ 9660:
[459] Fix | Delete
/***/ ((module) => {
[460] Fix | Delete
[461] Fix | Delete
var Controller = wp.media.controller,
[462] Fix | Delete
CustomizeImageCropper;
[463] Fix | Delete
[464] Fix | Delete
/**
[465] Fix | Delete
* A state for cropping an image in the customizer.
[466] Fix | Delete
*
[467] Fix | Delete
* @since 4.3.0
[468] Fix | Delete
*
[469] Fix | Delete
* @constructs wp.media.controller.CustomizeImageCropper
[470] Fix | Delete
* @memberOf wp.media.controller
[471] Fix | Delete
* @augments wp.media.controller.CustomizeImageCropper.Cropper
[472] Fix | Delete
* @inheritDoc
[473] Fix | Delete
*/
[474] Fix | Delete
CustomizeImageCropper = Controller.Cropper.extend(/** @lends wp.media.controller.CustomizeImageCropper.prototype */{
[475] Fix | Delete
/**
[476] Fix | Delete
* Posts the crop details to the admin.
[477] Fix | Delete
*
[478] Fix | Delete
* Uses crop measurements when flexible in both directions.
[479] Fix | Delete
* Constrains flexible side based on image ratio and size of the fixed side.
[480] Fix | Delete
*
[481] Fix | Delete
* @since 4.3.0
[482] Fix | Delete
*
[483] Fix | Delete
* @param {Object} attachment The attachment to crop.
[484] Fix | Delete
*
[485] Fix | Delete
* @return {$.promise} A jQuery promise that represents the crop image request.
[486] Fix | Delete
*/
[487] Fix | Delete
doCrop: function( attachment ) {
[488] Fix | Delete
var cropDetails = attachment.get( 'cropDetails' ),
[489] Fix | Delete
control = this.get( 'control' ),
[490] Fix | Delete
ratio = cropDetails.width / cropDetails.height;
[491] Fix | Delete
[492] Fix | Delete
// Use crop measurements when flexible in both directions.
[493] Fix | Delete
if ( control.params.flex_width && control.params.flex_height ) {
[494] Fix | Delete
cropDetails.dst_width = cropDetails.width;
[495] Fix | Delete
cropDetails.dst_height = cropDetails.height;
[496] Fix | Delete
[497] Fix | Delete
// Constrain flexible side based on image ratio and size of the fixed side.
[498] Fix | Delete
} else {
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function