Edit File by line
/home/barbar84/public_h.../wp-inclu.../js/dist
File: media-utils.js
this["wp"] = this["wp"] || {}; this["wp"]["mediaUtils"] =
[0] Fix | Delete
/******/ (function(modules) { // webpackBootstrap
[1] Fix | Delete
/******/ // The module cache
[2] Fix | Delete
/******/ var installedModules = {};
[3] Fix | Delete
/******/
[4] Fix | Delete
/******/ // The require function
[5] Fix | Delete
/******/ function __webpack_require__(moduleId) {
[6] Fix | Delete
/******/
[7] Fix | Delete
/******/ // Check if module is in cache
[8] Fix | Delete
/******/ if(installedModules[moduleId]) {
[9] Fix | Delete
/******/ return installedModules[moduleId].exports;
[10] Fix | Delete
/******/ }
[11] Fix | Delete
/******/ // Create a new module (and put it into the cache)
[12] Fix | Delete
/******/ var module = installedModules[moduleId] = {
[13] Fix | Delete
/******/ i: moduleId,
[14] Fix | Delete
/******/ l: false,
[15] Fix | Delete
/******/ exports: {}
[16] Fix | Delete
/******/ };
[17] Fix | Delete
/******/
[18] Fix | Delete
/******/ // Execute the module function
[19] Fix | Delete
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
[20] Fix | Delete
/******/
[21] Fix | Delete
/******/ // Flag the module as loaded
[22] Fix | Delete
/******/ module.l = true;
[23] Fix | Delete
/******/
[24] Fix | Delete
/******/ // Return the exports of the module
[25] Fix | Delete
/******/ return module.exports;
[26] Fix | Delete
/******/ }
[27] Fix | Delete
/******/
[28] Fix | Delete
/******/
[29] Fix | Delete
/******/ // expose the modules object (__webpack_modules__)
[30] Fix | Delete
/******/ __webpack_require__.m = modules;
[31] Fix | Delete
/******/
[32] Fix | Delete
/******/ // expose the module cache
[33] Fix | Delete
/******/ __webpack_require__.c = installedModules;
[34] Fix | Delete
/******/
[35] Fix | Delete
/******/ // define getter function for harmony exports
[36] Fix | Delete
/******/ __webpack_require__.d = function(exports, name, getter) {
[37] Fix | Delete
/******/ if(!__webpack_require__.o(exports, name)) {
[38] Fix | Delete
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
[39] Fix | Delete
/******/ }
[40] Fix | Delete
/******/ };
[41] Fix | Delete
/******/
[42] Fix | Delete
/******/ // define __esModule on exports
[43] Fix | Delete
/******/ __webpack_require__.r = function(exports) {
[44] Fix | Delete
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
[45] Fix | Delete
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
[46] Fix | Delete
/******/ }
[47] Fix | Delete
/******/ Object.defineProperty(exports, '__esModule', { value: true });
[48] Fix | Delete
/******/ };
[49] Fix | Delete
/******/
[50] Fix | Delete
/******/ // create a fake namespace object
[51] Fix | Delete
/******/ // mode & 1: value is a module id, require it
[52] Fix | Delete
/******/ // mode & 2: merge all properties of value into the ns
[53] Fix | Delete
/******/ // mode & 4: return value when already ns object
[54] Fix | Delete
/******/ // mode & 8|1: behave like require
[55] Fix | Delete
/******/ __webpack_require__.t = function(value, mode) {
[56] Fix | Delete
/******/ if(mode & 1) value = __webpack_require__(value);
[57] Fix | Delete
/******/ if(mode & 8) return value;
[58] Fix | Delete
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
[59] Fix | Delete
/******/ var ns = Object.create(null);
[60] Fix | Delete
/******/ __webpack_require__.r(ns);
[61] Fix | Delete
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
[62] Fix | Delete
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
[63] Fix | Delete
/******/ return ns;
[64] Fix | Delete
/******/ };
[65] Fix | Delete
/******/
[66] Fix | Delete
/******/ // getDefaultExport function for compatibility with non-harmony modules
[67] Fix | Delete
/******/ __webpack_require__.n = function(module) {
[68] Fix | Delete
/******/ var getter = module && module.__esModule ?
[69] Fix | Delete
/******/ function getDefault() { return module['default']; } :
[70] Fix | Delete
/******/ function getModuleExports() { return module; };
[71] Fix | Delete
/******/ __webpack_require__.d(getter, 'a', getter);
[72] Fix | Delete
/******/ return getter;
[73] Fix | Delete
/******/ };
[74] Fix | Delete
/******/
[75] Fix | Delete
/******/ // Object.prototype.hasOwnProperty.call
[76] Fix | Delete
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
[77] Fix | Delete
/******/
[78] Fix | Delete
/******/ // __webpack_public_path__
[79] Fix | Delete
/******/ __webpack_require__.p = "";
[80] Fix | Delete
/******/
[81] Fix | Delete
/******/
[82] Fix | Delete
/******/ // Load entry module and return exports
[83] Fix | Delete
/******/ return __webpack_require__(__webpack_require__.s = "Lb+8");
[84] Fix | Delete
/******/ })
[85] Fix | Delete
/************************************************************************/
[86] Fix | Delete
/******/ ({
[87] Fix | Delete
[88] Fix | Delete
/***/ "1OyB":
[89] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[90] Fix | Delete
[91] Fix | Delete
"use strict";
[92] Fix | Delete
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _classCallCheck; });
[93] Fix | Delete
function _classCallCheck(instance, Constructor) {
[94] Fix | Delete
if (!(instance instanceof Constructor)) {
[95] Fix | Delete
throw new TypeError("Cannot call a class as a function");
[96] Fix | Delete
}
[97] Fix | Delete
}
[98] Fix | Delete
[99] Fix | Delete
/***/ }),
[100] Fix | Delete
[101] Fix | Delete
/***/ "25BE":
[102] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[103] Fix | Delete
[104] Fix | Delete
"use strict";
[105] Fix | Delete
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; });
[106] Fix | Delete
function _iterableToArray(iter) {
[107] Fix | Delete
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
[108] Fix | Delete
}
[109] Fix | Delete
[110] Fix | Delete
/***/ }),
[111] Fix | Delete
[112] Fix | Delete
/***/ "BsWD":
[113] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[114] Fix | Delete
[115] Fix | Delete
"use strict";
[116] Fix | Delete
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _unsupportedIterableToArray; });
[117] Fix | Delete
/* harmony import */ var _babel_runtime_helpers_esm_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("a3WO");
[118] Fix | Delete
[119] Fix | Delete
function _unsupportedIterableToArray(o, minLen) {
[120] Fix | Delete
if (!o) return;
[121] Fix | Delete
if (typeof o === "string") return Object(_babel_runtime_helpers_esm_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
[122] Fix | Delete
var n = Object.prototype.toString.call(o).slice(8, -1);
[123] Fix | Delete
if (n === "Object" && o.constructor) n = o.constructor.name;
[124] Fix | Delete
if (n === "Map" || n === "Set") return Array.from(o);
[125] Fix | Delete
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Object(_babel_runtime_helpers_esm_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
[126] Fix | Delete
}
[127] Fix | Delete
[128] Fix | Delete
/***/ }),
[129] Fix | Delete
[130] Fix | Delete
/***/ "DSFK":
[131] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[132] Fix | Delete
[133] Fix | Delete
"use strict";
[134] Fix | Delete
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayWithHoles; });
[135] Fix | Delete
function _arrayWithHoles(arr) {
[136] Fix | Delete
if (Array.isArray(arr)) return arr;
[137] Fix | Delete
}
[138] Fix | Delete
[139] Fix | Delete
/***/ }),
[140] Fix | Delete
[141] Fix | Delete
/***/ "GRId":
[142] Fix | Delete
/***/ (function(module, exports) {
[143] Fix | Delete
[144] Fix | Delete
(function() { module.exports = window["wp"]["element"]; }());
[145] Fix | Delete
[146] Fix | Delete
/***/ }),
[147] Fix | Delete
[148] Fix | Delete
/***/ "HaE+":
[149] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[150] Fix | Delete
[151] Fix | Delete
"use strict";
[152] Fix | Delete
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _asyncToGenerator; });
[153] Fix | Delete
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
[154] Fix | Delete
try {
[155] Fix | Delete
var info = gen[key](arg);
[156] Fix | Delete
var value = info.value;
[157] Fix | Delete
} catch (error) {
[158] Fix | Delete
reject(error);
[159] Fix | Delete
return;
[160] Fix | Delete
}
[161] Fix | Delete
[162] Fix | Delete
if (info.done) {
[163] Fix | Delete
resolve(value);
[164] Fix | Delete
} else {
[165] Fix | Delete
Promise.resolve(value).then(_next, _throw);
[166] Fix | Delete
}
[167] Fix | Delete
}
[168] Fix | Delete
[169] Fix | Delete
function _asyncToGenerator(fn) {
[170] Fix | Delete
return function () {
[171] Fix | Delete
var self = this,
[172] Fix | Delete
args = arguments;
[173] Fix | Delete
return new Promise(function (resolve, reject) {
[174] Fix | Delete
var gen = fn.apply(self, args);
[175] Fix | Delete
[176] Fix | Delete
function _next(value) {
[177] Fix | Delete
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
[178] Fix | Delete
}
[179] Fix | Delete
[180] Fix | Delete
function _throw(err) {
[181] Fix | Delete
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
[182] Fix | Delete
}
[183] Fix | Delete
[184] Fix | Delete
_next(undefined);
[185] Fix | Delete
});
[186] Fix | Delete
};
[187] Fix | Delete
}
[188] Fix | Delete
[189] Fix | Delete
/***/ }),
[190] Fix | Delete
[191] Fix | Delete
/***/ "JX7q":
[192] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[193] Fix | Delete
[194] Fix | Delete
"use strict";
[195] Fix | Delete
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _assertThisInitialized; });
[196] Fix | Delete
function _assertThisInitialized(self) {
[197] Fix | Delete
if (self === void 0) {
[198] Fix | Delete
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
[199] Fix | Delete
}
[200] Fix | Delete
[201] Fix | Delete
return self;
[202] Fix | Delete
}
[203] Fix | Delete
[204] Fix | Delete
/***/ }),
[205] Fix | Delete
[206] Fix | Delete
/***/ "Ji7U":
[207] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[208] Fix | Delete
[209] Fix | Delete
"use strict";
[210] Fix | Delete
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _inherits; });
[211] Fix | Delete
/* harmony import */ var _babel_runtime_helpers_esm_setPrototypeOf__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("s4An");
[212] Fix | Delete
[213] Fix | Delete
function _inherits(subClass, superClass) {
[214] Fix | Delete
if (typeof superClass !== "function" && superClass !== null) {
[215] Fix | Delete
throw new TypeError("Super expression must either be null or a function");
[216] Fix | Delete
}
[217] Fix | Delete
[218] Fix | Delete
subClass.prototype = Object.create(superClass && superClass.prototype, {
[219] Fix | Delete
constructor: {
[220] Fix | Delete
value: subClass,
[221] Fix | Delete
writable: true,
[222] Fix | Delete
configurable: true
[223] Fix | Delete
}
[224] Fix | Delete
});
[225] Fix | Delete
if (superClass) Object(_babel_runtime_helpers_esm_setPrototypeOf__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(subClass, superClass);
[226] Fix | Delete
}
[227] Fix | Delete
[228] Fix | Delete
/***/ }),
[229] Fix | Delete
[230] Fix | Delete
/***/ "KQm4":
[231] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[232] Fix | Delete
[233] Fix | Delete
"use strict";
[234] Fix | Delete
[235] Fix | Delete
// EXPORTS
[236] Fix | Delete
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _toConsumableArray; });
[237] Fix | Delete
[238] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
[239] Fix | Delete
var arrayLikeToArray = __webpack_require__("a3WO");
[240] Fix | Delete
[241] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
[242] Fix | Delete
[243] Fix | Delete
function _arrayWithoutHoles(arr) {
[244] Fix | Delete
if (Array.isArray(arr)) return Object(arrayLikeToArray["a" /* default */])(arr);
[245] Fix | Delete
}
[246] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
[247] Fix | Delete
var iterableToArray = __webpack_require__("25BE");
[248] Fix | Delete
[249] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
[250] Fix | Delete
var unsupportedIterableToArray = __webpack_require__("BsWD");
[251] Fix | Delete
[252] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
[253] Fix | Delete
function _nonIterableSpread() {
[254] Fix | Delete
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
[255] Fix | Delete
}
[256] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
[257] Fix | Delete
[258] Fix | Delete
[259] Fix | Delete
[260] Fix | Delete
[261] Fix | Delete
function _toConsumableArray(arr) {
[262] Fix | Delete
return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || Object(unsupportedIterableToArray["a" /* default */])(arr) || _nonIterableSpread();
[263] Fix | Delete
}
[264] Fix | Delete
[265] Fix | Delete
/***/ }),
[266] Fix | Delete
[267] Fix | Delete
/***/ "Lb+8":
[268] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[269] Fix | Delete
[270] Fix | Delete
"use strict";
[271] Fix | Delete
// ESM COMPAT FLAG
[272] Fix | Delete
__webpack_require__.r(__webpack_exports__);
[273] Fix | Delete
[274] Fix | Delete
// EXPORTS
[275] Fix | Delete
__webpack_require__.d(__webpack_exports__, "MediaUpload", function() { return /* reexport */ media_upload; });
[276] Fix | Delete
__webpack_require__.d(__webpack_exports__, "uploadMedia", function() { return /* reexport */ uploadMedia; });
[277] Fix | Delete
[278] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
[279] Fix | Delete
var classCallCheck = __webpack_require__("1OyB");
[280] Fix | Delete
[281] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
[282] Fix | Delete
var createClass = __webpack_require__("vuIU");
[283] Fix | Delete
[284] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
[285] Fix | Delete
var assertThisInitialized = __webpack_require__("JX7q");
[286] Fix | Delete
[287] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
[288] Fix | Delete
var inherits = __webpack_require__("Ji7U");
[289] Fix | Delete
[290] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
[291] Fix | Delete
var possibleConstructorReturn = __webpack_require__("md7G");
[292] Fix | Delete
[293] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
[294] Fix | Delete
var getPrototypeOf = __webpack_require__("foSv");
[295] Fix | Delete
[296] Fix | Delete
// EXTERNAL MODULE: external "lodash"
[297] Fix | Delete
var external_lodash_ = __webpack_require__("YLtl");
[298] Fix | Delete
[299] Fix | Delete
// EXTERNAL MODULE: external ["wp","element"]
[300] Fix | Delete
var external_wp_element_ = __webpack_require__("GRId");
[301] Fix | Delete
[302] Fix | Delete
// EXTERNAL MODULE: external ["wp","i18n"]
[303] Fix | Delete
var external_wp_i18n_ = __webpack_require__("l3Sj");
[304] Fix | Delete
[305] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/media-utils/build-module/components/media-upload/index.js
[306] Fix | Delete
[307] Fix | Delete
[308] Fix | Delete
[309] Fix | Delete
[310] Fix | Delete
[311] Fix | Delete
[312] Fix | Delete
[313] Fix | Delete
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; }
[314] Fix | Delete
[315] Fix | Delete
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
[316] Fix | Delete
[317] Fix | Delete
/**
[318] Fix | Delete
* External dependencies
[319] Fix | Delete
*/
[320] Fix | Delete
[321] Fix | Delete
/**
[322] Fix | Delete
* WordPress dependencies
[323] Fix | Delete
*/
[324] Fix | Delete
[325] Fix | Delete
[326] Fix | Delete
[327] Fix | Delete
var _window = window,
[328] Fix | Delete
wp = _window.wp;
[329] Fix | Delete
var DEFAULT_EMPTY_GALLERY = [];
[330] Fix | Delete
/**
[331] Fix | Delete
* Prepares the Featured Image toolbars and frames.
[332] Fix | Delete
*
[333] Fix | Delete
* @return {wp.media.view.MediaFrame.Select} The default media workflow.
[334] Fix | Delete
*/
[335] Fix | Delete
[336] Fix | Delete
var getFeaturedImageMediaFrame = function getFeaturedImageMediaFrame() {
[337] Fix | Delete
return wp.media.view.MediaFrame.Select.extend({
[338] Fix | Delete
/**
[339] Fix | Delete
* Enables the Set Featured Image Button.
[340] Fix | Delete
*
[341] Fix | Delete
* @param {Object} toolbar toolbar for featured image state
[342] Fix | Delete
* @return {void}
[343] Fix | Delete
*/
[344] Fix | Delete
featuredImageToolbar: function featuredImageToolbar(toolbar) {
[345] Fix | Delete
this.createSelectToolbar(toolbar, {
[346] Fix | Delete
text: wp.media.view.l10n.setFeaturedImage,
[347] Fix | Delete
state: this.options.state
[348] Fix | Delete
});
[349] Fix | Delete
},
[350] Fix | Delete
[351] Fix | Delete
/**
[352] Fix | Delete
* Handle the edit state requirements of selected media item.
[353] Fix | Delete
*
[354] Fix | Delete
* @return {void}
[355] Fix | Delete
*/
[356] Fix | Delete
editState: function editState() {
[357] Fix | Delete
var selection = this.state('featured-image').get('selection');
[358] Fix | Delete
var view = new wp.media.view.EditImage({
[359] Fix | Delete
model: selection.single(),
[360] Fix | Delete
controller: this
[361] Fix | Delete
}).render(); // Set the view to the EditImage frame using the selected image.
[362] Fix | Delete
[363] Fix | Delete
this.content.set(view); // After bringing in the frame, load the actual editor via an ajax call.
[364] Fix | Delete
[365] Fix | Delete
view.loadEditor();
[366] Fix | Delete
},
[367] Fix | Delete
[368] Fix | Delete
/**
[369] Fix | Delete
* Create the default states.
[370] Fix | Delete
*
[371] Fix | Delete
* @return {void}
[372] Fix | Delete
*/
[373] Fix | Delete
createStates: function createStates() {
[374] Fix | Delete
this.on('toolbar:create:featured-image', this.featuredImageToolbar, this);
[375] Fix | Delete
this.on('content:render:edit-image', this.editState, this);
[376] Fix | Delete
this.states.add([new wp.media.controller.FeaturedImage(), new wp.media.controller.EditImage({
[377] Fix | Delete
model: this.options.editImage
[378] Fix | Delete
})]);
[379] Fix | Delete
}
[380] Fix | Delete
});
[381] Fix | Delete
};
[382] Fix | Delete
/**
[383] Fix | Delete
* Prepares the Gallery toolbars and frames.
[384] Fix | Delete
*
[385] Fix | Delete
* @return {wp.media.view.MediaFrame.Post} The default media workflow.
[386] Fix | Delete
*/
[387] Fix | Delete
[388] Fix | Delete
[389] Fix | Delete
var media_upload_getGalleryDetailsMediaFrame = function getGalleryDetailsMediaFrame() {
[390] Fix | Delete
/**
[391] Fix | Delete
* Custom gallery details frame.
[392] Fix | Delete
*
[393] Fix | Delete
* @see https://github.com/xwp/wp-core-media-widgets/blob/905edbccfc2a623b73a93dac803c5335519d7837/wp-admin/js/widgets/media-gallery-widget.js
[394] Fix | Delete
* @class GalleryDetailsMediaFrame
[395] Fix | Delete
* @class
[396] Fix | Delete
*/
[397] Fix | Delete
return wp.media.view.MediaFrame.Post.extend({
[398] Fix | Delete
/**
[399] Fix | Delete
* Set up gallery toolbar.
[400] Fix | Delete
*
[401] Fix | Delete
* @return {void}
[402] Fix | Delete
*/
[403] Fix | Delete
galleryToolbar: function galleryToolbar() {
[404] Fix | Delete
var editing = this.state().get('editing');
[405] Fix | Delete
this.toolbar.set(new wp.media.view.Toolbar({
[406] Fix | Delete
controller: this,
[407] Fix | Delete
items: {
[408] Fix | Delete
insert: {
[409] Fix | Delete
style: 'primary',
[410] Fix | Delete
text: editing ? wp.media.view.l10n.updateGallery : wp.media.view.l10n.insertGallery,
[411] Fix | Delete
priority: 80,
[412] Fix | Delete
requires: {
[413] Fix | Delete
library: true
[414] Fix | Delete
},
[415] Fix | Delete
[416] Fix | Delete
/**
[417] Fix | Delete
* @fires wp.media.controller.State#update
[418] Fix | Delete
*/
[419] Fix | Delete
click: function click() {
[420] Fix | Delete
var controller = this.controller,
[421] Fix | Delete
state = controller.state();
[422] Fix | Delete
controller.close();
[423] Fix | Delete
state.trigger('update', state.get('library')); // Restore and reset the default state.
[424] Fix | Delete
[425] Fix | Delete
controller.setState(controller.options.state);
[426] Fix | Delete
controller.reset();
[427] Fix | Delete
}
[428] Fix | Delete
}
[429] Fix | Delete
}
[430] Fix | Delete
}));
[431] Fix | Delete
},
[432] Fix | Delete
[433] Fix | Delete
/**
[434] Fix | Delete
* Handle the edit state requirements of selected media item.
[435] Fix | Delete
*
[436] Fix | Delete
* @return {void}
[437] Fix | Delete
*/
[438] Fix | Delete
editState: function editState() {
[439] Fix | Delete
var selection = this.state('gallery').get('selection');
[440] Fix | Delete
var view = new wp.media.view.EditImage({
[441] Fix | Delete
model: selection.single(),
[442] Fix | Delete
controller: this
[443] Fix | Delete
}).render(); // Set the view to the EditImage frame using the selected image.
[444] Fix | Delete
[445] Fix | Delete
this.content.set(view); // After bringing in the frame, load the actual editor via an ajax call.
[446] Fix | Delete
[447] Fix | Delete
view.loadEditor();
[448] Fix | Delete
},
[449] Fix | Delete
[450] Fix | Delete
/**
[451] Fix | Delete
* Create the default states.
[452] Fix | Delete
*
[453] Fix | Delete
* @return {void}
[454] Fix | Delete
*/
[455] Fix | Delete
createStates: function createStates() {
[456] Fix | Delete
this.on('toolbar:create:main-gallery', this.galleryToolbar, this);
[457] Fix | Delete
this.on('content:render:edit-image', this.editState, this);
[458] Fix | Delete
this.states.add([new wp.media.controller.Library({
[459] Fix | Delete
id: 'gallery',
[460] Fix | Delete
title: wp.media.view.l10n.createGalleryTitle,
[461] Fix | Delete
priority: 40,
[462] Fix | Delete
toolbar: 'main-gallery',
[463] Fix | Delete
filterable: 'uploaded',
[464] Fix | Delete
multiple: 'add',
[465] Fix | Delete
editable: false,
[466] Fix | Delete
library: wp.media.query(Object(external_lodash_["defaults"])({
[467] Fix | Delete
type: 'image'
[468] Fix | Delete
}, this.options.library))
[469] Fix | Delete
}), new wp.media.controller.EditImage({
[470] Fix | Delete
model: this.options.editImage
[471] Fix | Delete
}), new wp.media.controller.GalleryEdit({
[472] Fix | Delete
library: this.options.selection,
[473] Fix | Delete
editing: this.options.editing,
[474] Fix | Delete
menu: 'gallery',
[475] Fix | Delete
displaySettings: false,
[476] Fix | Delete
multiple: true
[477] Fix | Delete
}), new wp.media.controller.GalleryAdd()]);
[478] Fix | Delete
}
[479] Fix | Delete
});
[480] Fix | Delete
}; // the media library image object contains numerous attributes
[481] Fix | Delete
// we only need this set to display the image in the library
[482] Fix | Delete
[483] Fix | Delete
[484] Fix | Delete
var media_upload_slimImageObject = function slimImageObject(img) {
[485] Fix | Delete
var attrSet = ['sizes', 'mime', 'type', 'subtype', 'id', 'url', 'alt', 'link', 'caption'];
[486] Fix | Delete
return Object(external_lodash_["pick"])(img, attrSet);
[487] Fix | Delete
};
[488] Fix | Delete
[489] Fix | Delete
var getAttachmentsCollection = function getAttachmentsCollection(ids) {
[490] Fix | Delete
return wp.media.query({
[491] Fix | Delete
order: 'ASC',
[492] Fix | Delete
orderby: 'post__in',
[493] Fix | Delete
post__in: ids,
[494] Fix | Delete
posts_per_page: -1,
[495] Fix | Delete
query: true,
[496] Fix | Delete
type: 'image'
[497] Fix | Delete
});
[498] Fix | Delete
};
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function