Changeset 31379 for trunk/src/wp-includes/js/media/grid.js
- Timestamp:
- 02/09/2015 04:13:38 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/media/grid.js
r31373 r31379 108 108 109 109 module.exports = EditImage; 110 },{"../views/toolbar.js": 50,"./state.js":6}],3:[function(require,module,exports){110 },{"../views/toolbar.js":46,"./state.js":6}],3:[function(require,module,exports){ 111 111 /*globals _, wp, Backbone, getUserSetting, setUserSetting */ 112 112 … … 146 146 */ 147 147 var selectionSync = require( '../utils/selection-sync.js' ), 148 Selection = require( '../models/selection.js' ),149 148 State = require( './state.js' ), 150 149 l10n = wp.media.view.l10n, … … 191 190 } 192 191 193 this.set( 'selection', new Selection( null, {192 this.set( 'selection', new wp.media.model.Selection( null, { 194 193 multiple: this.get('multiple'), 195 194 props: props … … 382 381 383 382 module.exports = Library; 384 },{"../ models/selection.js":11,"../utils/selection-sync.js":13,"./state.js":6}],4:[function(require,module,exports){383 },{"../utils/selection-sync.js":9,"./state.js":6}],4:[function(require,module,exports){ 385 384 /*globals _, Backbone */ 386 385 … … 945 944 946 945 }(wp)); 947 },{"./controllers/edit-attachment-metadata.js":1,"./routers/manage.js":12,"./views/attachment/details-two-column.js":20,"./views/button/delete-selected-permanently.js":26,"./views/button/delete-selected.js":27,"./views/button/select-mode-toggle.js":28,"./views/edit-image-details.js":29,"./views/frame/edit-attachments.js":33,"./views/frame/manage.js":34}],8:[function(require,module,exports){ 948 /*globals jQuery, Backbone, _, wp */ 949 950 /** 951 * wp.media.model.Attachment 952 * 953 * @class 954 * @augments Backbone.Model 955 */ 956 var $ = jQuery, 957 Attachment; 958 959 Attachment = Backbone.Model.extend({ 960 /** 961 * Triggered when attachment details change 962 * Overrides Backbone.Model.sync 963 * 964 * @param {string} method 965 * @param {wp.media.model.Attachment} model 966 * @param {Object} [options={}] 967 * 968 * @returns {Promise} 969 */ 970 sync: function( method, model, options ) { 971 // If the attachment does not yet have an `id`, return an instantly 972 // rejected promise. Otherwise, all of our requests will fail. 973 if ( _.isUndefined( this.id ) ) { 974 return $.Deferred().rejectWith( this ).promise(); 975 } 976 977 // Overload the `read` request so Attachment.fetch() functions correctly. 978 if ( 'read' === method ) { 979 options = options || {}; 980 options.context = this; 981 options.data = _.extend( options.data || {}, { 982 action: 'get-attachment', 983 id: this.id 984 }); 985 return wp.media.ajax( options ); 986 987 // Overload the `update` request so properties can be saved. 988 } else if ( 'update' === method ) { 989 // If we do not have the necessary nonce, fail immeditately. 990 if ( ! this.get('nonces') || ! this.get('nonces').update ) { 991 return $.Deferred().rejectWith( this ).promise(); 992 } 993 994 options = options || {}; 995 options.context = this; 996 997 // Set the action and ID. 998 options.data = _.extend( options.data || {}, { 999 action: 'save-attachment', 1000 id: this.id, 1001 nonce: this.get('nonces').update, 1002 post_id: wp.media.model.settings.post.id 1003 }); 1004 1005 // Record the values of the changed attributes. 1006 if ( model.hasChanged() ) { 1007 options.data.changes = {}; 1008 1009 _.each( model.changed, function( value, key ) { 1010 options.data.changes[ key ] = this.get( key ); 1011 }, this ); 1012 } 1013 1014 return wp.media.ajax( options ); 1015 1016 // Overload the `delete` request so attachments can be removed. 1017 // This will permanently delete an attachment. 1018 } else if ( 'delete' === method ) { 1019 options = options || {}; 1020 1021 if ( ! options.wait ) { 1022 this.destroyed = true; 1023 } 1024 1025 options.context = this; 1026 options.data = _.extend( options.data || {}, { 1027 action: 'delete-post', 1028 id: this.id, 1029 _wpnonce: this.get('nonces')['delete'] 1030 }); 1031 1032 return wp.media.ajax( options ).done( function() { 1033 this.destroyed = true; 1034 }).fail( function() { 1035 this.destroyed = false; 1036 }); 1037 1038 // Otherwise, fall back to `Backbone.sync()`. 1039 } else { 1040 /** 1041 * Call `sync` directly on Backbone.Model 1042 */ 1043 return Backbone.Model.prototype.sync.apply( this, arguments ); 1044 } 1045 }, 1046 /** 1047 * Convert date strings into Date objects. 1048 * 1049 * @param {Object} resp The raw response object, typically returned by fetch() 1050 * @returns {Object} The modified response object, which is the attributes hash 1051 * to be set on the model. 1052 */ 1053 parse: function( resp ) { 1054 if ( ! resp ) { 1055 return resp; 1056 } 1057 1058 resp.date = new Date( resp.date ); 1059 resp.modified = new Date( resp.modified ); 1060 return resp; 1061 }, 1062 /** 1063 * @param {Object} data The properties to be saved. 1064 * @param {Object} options Sync options. e.g. patch, wait, success, error. 1065 * 1066 * @this Backbone.Model 1067 * 1068 * @returns {Promise} 1069 */ 1070 saveCompat: function( data, options ) { 1071 var model = this; 1072 1073 // If we do not have the necessary nonce, fail immeditately. 1074 if ( ! this.get('nonces') || ! this.get('nonces').update ) { 1075 return $.Deferred().rejectWith( this ).promise(); 1076 } 1077 1078 return media.post( 'save-attachment-compat', _.defaults({ 1079 id: this.id, 1080 nonce: this.get('nonces').update, 1081 post_id: wp.media.model.settings.post.id 1082 }, data ) ).done( function( resp, status, xhr ) { 1083 model.set( model.parse( resp, xhr ), options ); 1084 }); 1085 } 1086 }, { 1087 /** 1088 * Create a new model on the static 'all' attachments collection and return it. 1089 * 1090 * @static 1091 * @param {Object} attrs 1092 * @returns {wp.media.model.Attachment} 1093 */ 1094 create: function( attrs ) { 1095 var Attachments = require( './attachments.js' ); 1096 return Attachments.all.push( attrs ); 1097 }, 1098 /** 1099 * Create a new model on the static 'all' attachments collection and return it. 1100 * 1101 * If this function has already been called for the id, 1102 * it returns the specified attachment. 1103 * 1104 * @static 1105 * @param {string} id A string used to identify a model. 1106 * @param {Backbone.Model|undefined} attachment 1107 * @returns {wp.media.model.Attachment} 1108 */ 1109 get: _.memoize( function( id, attachment ) { 1110 var Attachments = require( './attachments.js' ); 1111 return Attachments.all.push( attachment || { id: id } ); 1112 }) 1113 }); 1114 1115 module.exports = Attachment; 1116 },{"./attachments.js":9}],9:[function(require,module,exports){ 1117 /*globals jQuery, Backbone, _, wp */ 1118 1119 /** 1120 * wp.media.model.Attachments 1121 * 1122 * A collection of attachments. 1123 * 1124 * This collection has no persistence with the server without supplying 1125 * 'options.props.query = true', which will mirror the collection 1126 * to an Attachments Query collection - @see wp.media.model.Attachments.mirror(). 1127 * 1128 * @class 1129 * @augments Backbone.Collection 1130 * 1131 * @param {array} [models] Models to initialize with the collection. 1132 * @param {object} [options] Options hash for the collection. 1133 * @param {string} [options.props] Options hash for the initial query properties. 1134 * @param {string} [options.props.order] Initial order (ASC or DESC) for the collection. 1135 * @param {string} [options.props.orderby] Initial attribute key to order the collection by. 1136 * @param {string} [options.props.query] Whether the collection is linked to an attachments query. 1137 * @param {string} [options.observe] 1138 * @param {string} [options.filters] 1139 * 1140 */ 1141 var Attachment = require( './attachment.js' ), 1142 Attachments; 1143 1144 Attachments = Backbone.Collection.extend({ 1145 /** 1146 * @type {wp.media.model.Attachment} 1147 */ 1148 model: Attachment, 1149 /** 1150 * @param {Array} [models=[]] Array of models used to populate the collection. 1151 * @param {Object} [options={}] 1152 */ 1153 initialize: function( models, options ) { 1154 options = options || {}; 1155 1156 this.props = new Backbone.Model(); 1157 this.filters = options.filters || {}; 1158 1159 // Bind default `change` events to the `props` model. 1160 this.props.on( 'change', this._changeFilteredProps, this ); 1161 1162 this.props.on( 'change:order', this._changeOrder, this ); 1163 this.props.on( 'change:orderby', this._changeOrderby, this ); 1164 this.props.on( 'change:query', this._changeQuery, this ); 1165 1166 this.props.set( _.defaults( options.props || {} ) ); 1167 1168 if ( options.observe ) { 1169 this.observe( options.observe ); 1170 } 1171 }, 1172 /** 1173 * Sort the collection when the order attribute changes. 1174 * 1175 * @access private 1176 */ 1177 _changeOrder: function() { 1178 if ( this.comparator ) { 1179 this.sort(); 1180 } 1181 }, 1182 /** 1183 * Set the default comparator only when the `orderby` property is set. 1184 * 1185 * @access private 1186 * 1187 * @param {Backbone.Model} model 1188 * @param {string} orderby 1189 */ 1190 _changeOrderby: function( model, orderby ) { 1191 // If a different comparator is defined, bail. 1192 if ( this.comparator && this.comparator !== Attachments.comparator ) { 1193 return; 1194 } 1195 1196 if ( orderby && 'post__in' !== orderby ) { 1197 this.comparator = Attachments.comparator; 1198 } else { 1199 delete this.comparator; 1200 } 1201 }, 1202 /** 1203 * If the `query` property is set to true, query the server using 1204 * the `props` values, and sync the results to this collection. 1205 * 1206 * @access private 1207 * 1208 * @param {Backbone.Model} model 1209 * @param {Boolean} query 1210 */ 1211 _changeQuery: function( model, query ) { 1212 if ( query ) { 1213 this.props.on( 'change', this._requery, this ); 1214 this._requery(); 1215 } else { 1216 this.props.off( 'change', this._requery, this ); 1217 } 1218 }, 1219 /** 1220 * @access private 1221 * 1222 * @param {Backbone.Model} model 1223 */ 1224 _changeFilteredProps: function( model ) { 1225 // If this is a query, updating the collection will be handled by 1226 // `this._requery()`. 1227 if ( this.props.get('query') ) { 1228 return; 1229 } 1230 1231 var changed = _.chain( model.changed ).map( function( t, prop ) { 1232 var filter = Attachments.filters[ prop ], 1233 term = model.get( prop ); 1234 1235 if ( ! filter ) { 1236 return; 1237 } 1238 1239 if ( term && ! this.filters[ prop ] ) { 1240 this.filters[ prop ] = filter; 1241 } else if ( ! term && this.filters[ prop ] === filter ) { 1242 delete this.filters[ prop ]; 1243 } else { 1244 return; 1245 } 1246 1247 // Record the change. 1248 return true; 1249 }, this ).any().value(); 1250 1251 if ( ! changed ) { 1252 return; 1253 } 1254 1255 // If no `Attachments` model is provided to source the searches 1256 // from, then automatically generate a source from the existing 1257 // models. 1258 if ( ! this._source ) { 1259 this._source = new Attachments( this.models ); 1260 } 1261 1262 this.reset( this._source.filter( this.validator, this ) ); 1263 }, 1264 1265 validateDestroyed: false, 1266 /** 1267 * Checks whether an attachment is valid. 1268 * 1269 * @param {wp.media.model.Attachment} attachment 1270 * @returns {Boolean} 1271 */ 1272 validator: function( attachment ) { 1273 if ( ! this.validateDestroyed && attachment.destroyed ) { 1274 return false; 1275 } 1276 return _.all( this.filters, function( filter ) { 1277 return !! filter.call( this, attachment ); 1278 }, this ); 1279 }, 1280 /** 1281 * Add or remove an attachment to the collection depending on its validity. 1282 * 1283 * @param {wp.media.model.Attachment} attachment 1284 * @param {Object} options 1285 * @returns {wp.media.model.Attachments} Returns itself to allow chaining 1286 */ 1287 validate: function( attachment, options ) { 1288 var valid = this.validator( attachment ), 1289 hasAttachment = !! this.get( attachment.cid ); 1290 1291 if ( ! valid && hasAttachment ) { 1292 this.remove( attachment, options ); 1293 } else if ( valid && ! hasAttachment ) { 1294 this.add( attachment, options ); 1295 } 1296 1297 return this; 1298 }, 1299 1300 /** 1301 * Add or remove all attachments from another collection depending on each one's validity. 1302 * 1303 * @param {wp.media.model.Attachments} attachments 1304 * @param {object} [options={}] 1305 * 1306 * @fires wp.media.model.Attachments#reset 1307 * 1308 * @returns {wp.media.model.Attachments} Returns itself to allow chaining 1309 */ 1310 validateAll: function( attachments, options ) { 1311 options = options || {}; 1312 1313 _.each( attachments.models, function( attachment ) { 1314 this.validate( attachment, { silent: true }); 1315 }, this ); 1316 1317 if ( ! options.silent ) { 1318 this.trigger( 'reset', this, options ); 1319 } 1320 return this; 1321 }, 1322 /** 1323 * Start observing another attachments collection change events 1324 * and replicate them on this collection. 1325 * 1326 * @param {wp.media.model.Attachments} The attachments collection to observe. 1327 * @returns {wp.media.model.Attachments} Returns itself to allow chaining. 1328 */ 1329 observe: function( attachments ) { 1330 this.observers = this.observers || []; 1331 this.observers.push( attachments ); 1332 1333 attachments.on( 'add change remove', this._validateHandler, this ); 1334 attachments.on( 'reset', this._validateAllHandler, this ); 1335 this.validateAll( attachments ); 1336 return this; 1337 }, 1338 /** 1339 * Stop replicating collection change events from another attachments collection. 1340 * 1341 * @param {wp.media.model.Attachments} The attachments collection to stop observing. 1342 * @returns {wp.media.model.Attachments} Returns itself to allow chaining 1343 */ 1344 unobserve: function( attachments ) { 1345 if ( attachments ) { 1346 attachments.off( null, null, this ); 1347 this.observers = _.without( this.observers, attachments ); 1348 1349 } else { 1350 _.each( this.observers, function( attachments ) { 1351 attachments.off( null, null, this ); 1352 }, this ); 1353 delete this.observers; 1354 } 1355 1356 return this; 1357 }, 1358 /** 1359 * @access private 1360 * 1361 * @param {wp.media.model.Attachments} attachment 1362 * @param {wp.media.model.Attachments} attachments 1363 * @param {Object} options 1364 * 1365 * @returns {wp.media.model.Attachments} Returns itself to allow chaining 1366 */ 1367 _validateHandler: function( attachment, attachments, options ) { 1368 // If we're not mirroring this `attachments` collection, 1369 // only retain the `silent` option. 1370 options = attachments === this.mirroring ? options : { 1371 silent: options && options.silent 1372 }; 1373 1374 return this.validate( attachment, options ); 1375 }, 1376 /** 1377 * @access private 1378 * 1379 * @param {wp.media.model.Attachments} attachments 1380 * @param {Object} options 1381 * @returns {wp.media.model.Attachments} Returns itself to allow chaining 1382 */ 1383 _validateAllHandler: function( attachments, options ) { 1384 return this.validateAll( attachments, options ); 1385 }, 1386 /** 1387 * Start mirroring another attachments collection, clearing out any models already 1388 * in the collection. 1389 * 1390 * @param {wp.media.model.Attachments} The attachments collection to mirror. 1391 * @returns {wp.media.model.Attachments} Returns itself to allow chaining 1392 */ 1393 mirror: function( attachments ) { 1394 if ( this.mirroring && this.mirroring === attachments ) { 1395 return this; 1396 } 1397 1398 this.unmirror(); 1399 this.mirroring = attachments; 1400 1401 // Clear the collection silently. A `reset` event will be fired 1402 // when `observe()` calls `validateAll()`. 1403 this.reset( [], { silent: true } ); 1404 this.observe( attachments ); 1405 1406 return this; 1407 }, 1408 /** 1409 * Stop mirroring another attachments collection. 1410 */ 1411 unmirror: function() { 1412 if ( ! this.mirroring ) { 1413 return; 1414 } 1415 1416 this.unobserve( this.mirroring ); 1417 delete this.mirroring; 1418 }, 1419 /** 1420 * Retrive more attachments from the server for the collection. 1421 * 1422 * Only works if the collection is mirroring a Query Attachments collection, 1423 * and forwards to its `more` method. This collection class doesn't have 1424 * server persistence by itself. 1425 * 1426 * @param {object} options 1427 * @returns {Promise} 1428 */ 1429 more: function( options ) { 1430 var deferred = jQuery.Deferred(), 1431 mirroring = this.mirroring, 1432 attachments = this; 1433 1434 if ( ! mirroring || ! mirroring.more ) { 1435 return deferred.resolveWith( this ).promise(); 1436 } 1437 // If we're mirroring another collection, forward `more` to 1438 // the mirrored collection. Account for a race condition by 1439 // checking if we're still mirroring that collection when 1440 // the request resolves. 1441 mirroring.more( options ).done( function() { 1442 if ( this === attachments.mirroring ) 1443 deferred.resolveWith( this ); 1444 }); 1445 1446 return deferred.promise(); 1447 }, 1448 /** 1449 * Whether there are more attachments that haven't been sync'd from the server 1450 * that match the collection's query. 1451 * 1452 * Only works if the collection is mirroring a Query Attachments collection, 1453 * and forwards to its `hasMore` method. This collection class doesn't have 1454 * server persistence by itself. 1455 * 1456 * @returns {boolean} 1457 */ 1458 hasMore: function() { 1459 return this.mirroring ? this.mirroring.hasMore() : false; 1460 }, 1461 /** 1462 * A custom AJAX-response parser. 1463 * 1464 * See trac ticket #24753 1465 * 1466 * @param {Object|Array} resp The raw response Object/Array. 1467 * @param {Object} xhr 1468 * @returns {Array} The array of model attributes to be added to the collection 1469 */ 1470 parse: function( resp, xhr ) { 1471 if ( ! _.isArray( resp ) ) { 1472 resp = [resp]; 1473 } 1474 1475 return _.map( resp, function( attrs ) { 1476 var id, attachment, newAttributes; 1477 1478 if ( attrs instanceof Backbone.Model ) { 1479 id = attrs.get( 'id' ); 1480 attrs = attrs.attributes; 1481 } else { 1482 id = attrs.id; 1483 } 1484 1485 attachment = Attachment.get( id ); 1486 newAttributes = attachment.parse( attrs, xhr ); 1487 1488 if ( ! _.isEqual( attachment.attributes, newAttributes ) ) { 1489 attachment.set( newAttributes ); 1490 } 1491 1492 return attachment; 1493 }); 1494 }, 1495 /** 1496 * If the collection is a query, create and mirror an Attachments Query collection. 1497 * 1498 * @access private 1499 */ 1500 _requery: function( refresh ) { 1501 var props, Query; 1502 if ( this.props.get('query') ) { 1503 Query = require( './query.js' ); 1504 props = this.props.toJSON(); 1505 props.cache = ( true !== refresh ); 1506 this.mirror( Query.get( props ) ); 1507 } 1508 }, 1509 /** 1510 * If this collection is sorted by `menuOrder`, recalculates and saves 1511 * the menu order to the database. 1512 * 1513 * @returns {undefined|Promise} 1514 */ 1515 saveMenuOrder: function() { 1516 if ( 'menuOrder' !== this.props.get('orderby') ) { 1517 return; 1518 } 1519 1520 // Removes any uploading attachments, updates each attachment's 1521 // menu order, and returns an object with an { id: menuOrder } 1522 // mapping to pass to the request. 1523 var attachments = this.chain().filter( function( attachment ) { 1524 return ! _.isUndefined( attachment.id ); 1525 }).map( function( attachment, index ) { 1526 // Indices start at 1. 1527 index = index + 1; 1528 attachment.set( 'menuOrder', index ); 1529 return [ attachment.id, index ]; 1530 }).object().value(); 1531 1532 if ( _.isEmpty( attachments ) ) { 1533 return; 1534 } 1535 1536 return wp.media.post( 'save-attachment-order', { 1537 nonce: wp.media.model.settings.post.nonce, 1538 post_id: wp.media.model.settings.post.id, 1539 attachments: attachments 1540 }); 1541 } 1542 }, { 1543 /** 1544 * A function to compare two attachment models in an attachments collection. 1545 * 1546 * Used as the default comparator for instances of wp.media.model.Attachments 1547 * and its subclasses. @see wp.media.model.Attachments._changeOrderby(). 1548 * 1549 * @static 1550 * 1551 * @param {Backbone.Model} a 1552 * @param {Backbone.Model} b 1553 * @param {Object} options 1554 * @returns {Number} -1 if the first model should come before the second, 1555 * 0 if they are of the same rank and 1556 * 1 if the first model should come after. 1557 */ 1558 comparator: function( a, b, options ) { 1559 var key = this.props.get('orderby'), 1560 order = this.props.get('order') || 'DESC', 1561 ac = a.cid, 1562 bc = b.cid; 1563 1564 a = a.get( key ); 1565 b = b.get( key ); 1566 1567 if ( 'date' === key || 'modified' === key ) { 1568 a = a || new Date(); 1569 b = b || new Date(); 1570 } 1571 1572 // If `options.ties` is set, don't enforce the `cid` tiebreaker. 1573 if ( options && options.ties ) { 1574 ac = bc = null; 1575 } 1576 1577 return ( 'DESC' === order ) ? wp.media.compare( a, b, ac, bc ) : wp.media.compare( b, a, bc, ac ); 1578 }, 1579 /** 1580 * @namespace 1581 */ 1582 filters: { 1583 /** 1584 * @static 1585 * Note that this client-side searching is *not* equivalent 1586 * to our server-side searching. 1587 * 1588 * @param {wp.media.model.Attachment} attachment 1589 * 1590 * @this wp.media.model.Attachments 1591 * 1592 * @returns {Boolean} 1593 */ 1594 search: function( attachment ) { 1595 if ( ! this.props.get('search') ) { 1596 return true; 1597 } 1598 1599 return _.any(['title','filename','description','caption','name'], function( key ) { 1600 var value = attachment.get( key ); 1601 return value && -1 !== value.search( this.props.get('search') ); 1602 }, this ); 1603 }, 1604 /** 1605 * @static 1606 * @param {wp.media.model.Attachment} attachment 1607 * 1608 * @this wp.media.model.Attachments 1609 * 1610 * @returns {Boolean} 1611 */ 1612 type: function( attachment ) { 1613 var type = this.props.get('type'); 1614 return ! type || -1 !== type.indexOf( attachment.get('type') ); 1615 }, 1616 /** 1617 * @static 1618 * @param {wp.media.model.Attachment} attachment 1619 * 1620 * @this wp.media.model.Attachments 1621 * 1622 * @returns {Boolean} 1623 */ 1624 uploadedTo: function( attachment ) { 1625 var uploadedTo = this.props.get('uploadedTo'); 1626 if ( _.isUndefined( uploadedTo ) ) { 1627 return true; 1628 } 1629 1630 return uploadedTo === attachment.get('uploadedTo'); 1631 }, 1632 /** 1633 * @static 1634 * @param {wp.media.model.Attachment} attachment 1635 * 1636 * @this wp.media.model.Attachments 1637 * 1638 * @returns {Boolean} 1639 */ 1640 status: function( attachment ) { 1641 var status = this.props.get('status'); 1642 if ( _.isUndefined( status ) ) { 1643 return true; 1644 } 1645 1646 return status === attachment.get('status'); 1647 } 1648 } 1649 }); 1650 1651 module.exports = Attachments; 1652 },{"./attachment.js":8,"./query.js":10}],10:[function(require,module,exports){ 1653 /*globals jQuery, _, wp */ 1654 1655 /** 1656 * wp.media.model.Query 1657 * 1658 * A collection of attachments that match the supplied query arguments. 1659 * 1660 * Note: Do NOT change this.args after the query has been initialized. 1661 * Things will break. 1662 * 1663 * @class 1664 * @augments wp.media.model.Attachments 1665 * @augments Backbone.Collection 1666 * 1667 * @param {array} [models] Models to initialize with the collection. 1668 * @param {object} [options] Options hash. 1669 * @param {object} [options.args] Attachments query arguments. 1670 * @param {object} [options.args.posts_per_page] 1671 */ 1672 var Attachments = require( './attachments.js' ), 1673 Query; 1674 1675 Query = Attachments.extend({ 1676 /** 1677 * @global wp.Uploader 1678 * 1679 * @param {array} [models=[]] Array of initial models to populate the collection. 1680 * @param {object} [options={}] 1681 */ 1682 initialize: function( models, options ) { 1683 var allowed; 1684 1685 options = options || {}; 1686 Attachments.prototype.initialize.apply( this, arguments ); 1687 1688 this.args = options.args; 1689 this._hasMore = true; 1690 this.created = new Date(); 1691 1692 this.filters.order = function( attachment ) { 1693 var orderby = this.props.get('orderby'), 1694 order = this.props.get('order'); 1695 1696 if ( ! this.comparator ) { 1697 return true; 1698 } 1699 1700 // We want any items that can be placed before the last 1701 // item in the set. If we add any items after the last 1702 // item, then we can't guarantee the set is complete. 1703 if ( this.length ) { 1704 return 1 !== this.comparator( attachment, this.last(), { ties: true }); 1705 1706 // Handle the case where there are no items yet and 1707 // we're sorting for recent items. In that case, we want 1708 // changes that occurred after we created the query. 1709 } else if ( 'DESC' === order && ( 'date' === orderby || 'modified' === orderby ) ) { 1710 return attachment.get( orderby ) >= this.created; 1711 1712 // If we're sorting by menu order and we have no items, 1713 // accept any items that have the default menu order (0). 1714 } else if ( 'ASC' === order && 'menuOrder' === orderby ) { 1715 return attachment.get( orderby ) === 0; 1716 } 1717 1718 // Otherwise, we don't want any items yet. 1719 return false; 1720 }; 1721 1722 // Observe the central `wp.Uploader.queue` collection to watch for 1723 // new matches for the query. 1724 // 1725 // Only observe when a limited number of query args are set. There 1726 // are no filters for other properties, so observing will result in 1727 // false positives in those queries. 1728 allowed = [ 's', 'order', 'orderby', 'posts_per_page', 'post_mime_type', 'post_parent' ]; 1729 if ( wp.Uploader && _( this.args ).chain().keys().difference( allowed ).isEmpty().value() ) { 1730 this.observe( wp.Uploader.queue ); 1731 } 1732 }, 1733 /** 1734 * Whether there are more attachments that haven't been sync'd from the server 1735 * that match the collection's query. 1736 * 1737 * @returns {boolean} 1738 */ 1739 hasMore: function() { 1740 return this._hasMore; 1741 }, 1742 /** 1743 * Fetch more attachments from the server for the collection. 1744 * 1745 * @param {object} [options={}] 1746 * @returns {Promise} 1747 */ 1748 more: function( options ) { 1749 var query = this; 1750 1751 // If there is already a request pending, return early with the Deferred object. 1752 if ( this._more && 'pending' === this._more.state() ) { 1753 return this._more; 1754 } 1755 1756 if ( ! this.hasMore() ) { 1757 return jQuery.Deferred().resolveWith( this ).promise(); 1758 } 1759 1760 options = options || {}; 1761 options.remove = false; 1762 1763 return this._more = this.fetch( options ).done( function( resp ) { 1764 if ( _.isEmpty( resp ) || -1 === this.args.posts_per_page || resp.length < this.args.posts_per_page ) { 1765 query._hasMore = false; 1766 } 1767 }); 1768 }, 1769 /** 1770 * Overrides Backbone.Collection.sync 1771 * Overrides wp.media.model.Attachments.sync 1772 * 1773 * @param {String} method 1774 * @param {Backbone.Model} model 1775 * @param {Object} [options={}] 1776 * @returns {Promise} 1777 */ 1778 sync: function( method, model, options ) { 1779 var args, fallback; 1780 1781 // Overload the read method so Attachment.fetch() functions correctly. 1782 if ( 'read' === method ) { 1783 options = options || {}; 1784 options.context = this; 1785 options.data = _.extend( options.data || {}, { 1786 action: 'query-attachments', 1787 post_id: wp.media.model.settings.post.id 1788 }); 1789 1790 // Clone the args so manipulation is non-destructive. 1791 args = _.clone( this.args ); 1792 1793 // Determine which page to query. 1794 if ( -1 !== args.posts_per_page ) { 1795 args.paged = Math.floor( this.length / args.posts_per_page ) + 1; 1796 } 1797 1798 options.data.query = args; 1799 return wp.media.ajax( options ); 1800 1801 // Otherwise, fall back to Backbone.sync() 1802 } else { 1803 /** 1804 * Call wp.media.model.Attachments.sync or Backbone.sync 1805 */ 1806 fallback = Attachments.prototype.sync ? Attachments.prototype : Backbone; 1807 return fallback.sync.apply( this, arguments ); 1808 } 1809 } 1810 }, { 1811 /** 1812 * @readonly 1813 */ 1814 defaultProps: { 1815 orderby: 'date', 1816 order: 'DESC' 1817 }, 1818 /** 1819 * @readonly 1820 */ 1821 defaultArgs: { 1822 posts_per_page: 40 1823 }, 1824 /** 1825 * @readonly 1826 */ 1827 orderby: { 1828 allowed: [ 'name', 'author', 'date', 'title', 'modified', 'uploadedTo', 'id', 'post__in', 'menuOrder' ], 1829 /** 1830 * A map of JavaScript orderby values to their WP_Query equivalents. 1831 * @type {Object} 1832 */ 1833 valuemap: { 1834 'id': 'ID', 1835 'uploadedTo': 'parent', 1836 'menuOrder': 'menu_order ID' 1837 } 1838 }, 1839 /** 1840 * A map of JavaScript query properties to their WP_Query equivalents. 1841 * 1842 * @readonly 1843 */ 1844 propmap: { 1845 'search': 's', 1846 'type': 'post_mime_type', 1847 'perPage': 'posts_per_page', 1848 'menuOrder': 'menu_order', 1849 'uploadedTo': 'post_parent', 1850 'status': 'post_status', 1851 'include': 'post__in', 1852 'exclude': 'post__not_in' 1853 }, 1854 /** 1855 * Creates and returns an Attachments Query collection given the properties. 1856 * 1857 * Caches query objects and reuses where possible. 1858 * 1859 * @static 1860 * @method 1861 * 1862 * @param {object} [props] 1863 * @param {Object} [props.cache=true] Whether to use the query cache or not. 1864 * @param {Object} [props.order] 1865 * @param {Object} [props.orderby] 1866 * @param {Object} [props.include] 1867 * @param {Object} [props.exclude] 1868 * @param {Object} [props.s] 1869 * @param {Object} [props.post_mime_type] 1870 * @param {Object} [props.posts_per_page] 1871 * @param {Object} [props.menu_order] 1872 * @param {Object} [props.post_parent] 1873 * @param {Object} [props.post_status] 1874 * @param {Object} [options] 1875 * 1876 * @returns {wp.media.model.Query} A new Attachments Query collection. 1877 */ 1878 get: (function(){ 1879 /** 1880 * @static 1881 * @type Array 1882 */ 1883 var queries = []; 1884 1885 /** 1886 * @returns {Query} 1887 */ 1888 return function( props, options ) { 1889 var args = {}, 1890 orderby = Query.orderby, 1891 defaults = Query.defaultProps, 1892 query, 1893 cache = !! props.cache || _.isUndefined( props.cache ); 1894 1895 // Remove the `query` property. This isn't linked to a query, 1896 // this *is* the query. 1897 delete props.query; 1898 delete props.cache; 1899 1900 // Fill default args. 1901 _.defaults( props, defaults ); 1902 1903 // Normalize the order. 1904 props.order = props.order.toUpperCase(); 1905 if ( 'DESC' !== props.order && 'ASC' !== props.order ) { 1906 props.order = defaults.order.toUpperCase(); 1907 } 1908 1909 // Ensure we have a valid orderby value. 1910 if ( ! _.contains( orderby.allowed, props.orderby ) ) { 1911 props.orderby = defaults.orderby; 1912 } 1913 1914 _.each( [ 'include', 'exclude' ], function( prop ) { 1915 if ( props[ prop ] && ! _.isArray( props[ prop ] ) ) { 1916 props[ prop ] = [ props[ prop ] ]; 1917 } 1918 } ); 1919 1920 // Generate the query `args` object. 1921 // Correct any differing property names. 1922 _.each( props, function( value, prop ) { 1923 if ( _.isNull( value ) ) { 1924 return; 1925 } 1926 1927 args[ Query.propmap[ prop ] || prop ] = value; 1928 }); 1929 1930 // Fill any other default query args. 1931 _.defaults( args, Query.defaultArgs ); 1932 1933 // `props.orderby` does not always map directly to `args.orderby`. 1934 // Substitute exceptions specified in orderby.keymap. 1935 args.orderby = orderby.valuemap[ props.orderby ] || props.orderby; 1936 1937 // Search the query cache for a matching query. 1938 if ( cache ) { 1939 query = _.find( queries, function( query ) { 1940 return _.isEqual( query.args, args ); 1941 }); 1942 } else { 1943 queries = []; 1944 } 1945 1946 // Otherwise, create a new query and add it to the cache. 1947 if ( ! query ) { 1948 query = new Query( [], _.extend( options || {}, { 1949 props: props, 1950 args: args 1951 } ) ); 1952 queries.push( query ); 1953 } 1954 1955 return query; 1956 }; 1957 }()) 1958 }); 1959 1960 module.exports = Query; 1961 },{"./attachments.js":9}],11:[function(require,module,exports){ 1962 /*globals _ */ 1963 1964 /** 1965 * wp.media.model.Selection 1966 * 1967 * A selection of attachments. 1968 * 1969 * @class 1970 * @augments wp.media.model.Attachments 1971 * @augments Backbone.Collection 1972 */ 1973 var Attachments = require( './attachments.js' ), 1974 Selection; 1975 1976 Selection = Attachments.extend({ 1977 /** 1978 * Refresh the `single` model whenever the selection changes. 1979 * Binds `single` instead of using the context argument to ensure 1980 * it receives no parameters. 1981 * 1982 * @param {Array} [models=[]] Array of models used to populate the collection. 1983 * @param {Object} [options={}] 1984 */ 1985 initialize: function( models, options ) { 1986 /** 1987 * call 'initialize' directly on the parent class 1988 */ 1989 Attachments.prototype.initialize.apply( this, arguments ); 1990 this.multiple = options && options.multiple; 1991 1992 this.on( 'add remove reset', _.bind( this.single, this, false ) ); 1993 }, 1994 1995 /** 1996 * If the workflow does not support multi-select, clear out the selection 1997 * before adding a new attachment to it. 1998 * 1999 * @param {Array} models 2000 * @param {Object} options 2001 * @returns {wp.media.model.Attachment[]} 2002 */ 2003 add: function( models, options ) { 2004 if ( ! this.multiple ) { 2005 this.remove( this.models ); 2006 } 2007 /** 2008 * call 'add' directly on the parent class 2009 */ 2010 return Attachments.prototype.add.call( this, models, options ); 2011 }, 2012 2013 /** 2014 * Fired when toggling (clicking on) an attachment in the modal. 2015 * 2016 * @param {undefined|boolean|wp.media.model.Attachment} model 2017 * 2018 * @fires wp.media.model.Selection#selection:single 2019 * @fires wp.media.model.Selection#selection:unsingle 2020 * 2021 * @returns {Backbone.Model} 2022 */ 2023 single: function( model ) { 2024 var previous = this._single; 2025 2026 // If a `model` is provided, use it as the single model. 2027 if ( model ) { 2028 this._single = model; 2029 } 2030 // If the single model isn't in the selection, remove it. 2031 if ( this._single && ! this.get( this._single.cid ) ) { 2032 delete this._single; 2033 } 2034 2035 this._single = this._single || this.last(); 2036 2037 // If single has changed, fire an event. 2038 if ( this._single !== previous ) { 2039 if ( previous ) { 2040 previous.trigger( 'selection:unsingle', previous, this ); 2041 2042 // If the model was already removed, trigger the collection 2043 // event manually. 2044 if ( ! this.get( previous.cid ) ) { 2045 this.trigger( 'selection:unsingle', previous, this ); 2046 } 2047 } 2048 if ( this._single ) { 2049 this._single.trigger( 'selection:single', this._single, this ); 2050 } 2051 } 2052 2053 // Return the single model, or the last model as a fallback. 2054 return this._single; 2055 } 2056 }); 2057 2058 module.exports = Selection; 2059 },{"./attachments.js":9}],12:[function(require,module,exports){ 946 },{"./controllers/edit-attachment-metadata.js":1,"./routers/manage.js":8,"./views/attachment/details-two-column.js":16,"./views/button/delete-selected-permanently.js":22,"./views/button/delete-selected.js":23,"./views/button/select-mode-toggle.js":24,"./views/edit-image-details.js":25,"./views/frame/edit-attachments.js":29,"./views/frame/manage.js":30}],8:[function(require,module,exports){ 2060 947 /*globals jQuery, Backbone */ 2061 948 … … 2104 991 2105 992 module.exports = Router; 2106 },{}], 13:[function(require,module,exports){993 },{}],9:[function(require,module,exports){ 2107 994 /*globals _ */ 2108 995 … … 2171 1058 2172 1059 module.exports = selectionSync; 2173 },{}],1 4:[function(require,module,exports){1060 },{}],10:[function(require,module,exports){ 2174 1061 /*globals _ */ 2175 1062 … … 2257 1144 2258 1145 module.exports = AttachmentCompat; 2259 },{"./view.js":5 5}],15:[function(require,module,exports){1146 },{"./view.js":51}],11:[function(require,module,exports){ 2260 1147 /*globals _, jQuery */ 2261 1148 … … 2336 1223 2337 1224 module.exports = AttachmentFilters; 2338 },{"./view.js":5 5}],16:[function(require,module,exports){1225 },{"./view.js":51}],12:[function(require,module,exports){ 2339 1226 /*globals _, wp */ 2340 1227 … … 2428 1315 2429 1316 module.exports = All; 2430 },{"../attachment-filters.js":1 5}],17:[function(require,module,exports){1317 },{"../attachment-filters.js":11}],13:[function(require,module,exports){ 2431 1318 /*globals _, wp */ 2432 1319 … … 2471 1358 2472 1359 module.exports = DateFilter; 2473 },{"../attachment-filters.js":1 5}],18:[function(require,module,exports){1360 },{"../attachment-filters.js":11}],14:[function(require,module,exports){ 2474 1361 /*globals wp */ 2475 1362 … … 2532 1419 2533 1420 module.exports = Uploaded; 2534 },{"../attachment-filters.js":1 5}],19:[function(require,module,exports){1421 },{"../attachment-filters.js":11}],15:[function(require,module,exports){ 2535 1422 /*globals _, wp, jQuery */ 2536 1423 … … 3087 1974 3088 1975 module.exports = Attachment; 3089 },{"./view.js":5 5}],20:[function(require,module,exports){1976 },{"./view.js":51}],16:[function(require,module,exports){ 3090 1977 /*globals wp */ 3091 1978 … … 3130 2017 3131 2018 module.exports = TwoColumn; 3132 },{"../media-details.js":3 7,"./details.js":21}],21:[function(require,module,exports){2019 },{"../media-details.js":33,"./details.js":17}],17:[function(require,module,exports){ 3133 2020 /*globals _, wp */ 3134 2021 … … 3271 2158 3272 2159 module.exports = Details; 3273 },{"../attachment.js":1 9}],22:[function(require,module,exports){2160 },{"../attachment.js":15}],18:[function(require,module,exports){ 3274 2161 /** 3275 2162 * wp.media.view.Attachment.Library … … 3291 2178 3292 2179 module.exports = Library; 3293 },{"../attachment.js":1 9}],23:[function(require,module,exports){2180 },{"../attachment.js":15}],19:[function(require,module,exports){ 3294 2181 /*globals _, wp, jQuery */ 3295 2182 … … 3592 2479 3593 2480 module.exports = Attachments; 3594 },{"./attachment.js":1 9,"./view.js":55}],24:[function(require,module,exports){2481 },{"./attachment.js":15,"./view.js":51}],20:[function(require,module,exports){ 3595 2482 /*globals _, wp, jQuery */ 3596 2483 … … 4052 2939 4053 2940 module.exports = AttachmentsBrowser; 4054 },{"../attachment-compat.js":1 4,"../attachment-filters/all.js":16,"../attachment-filters/date.js":17,"../attachment-filters/uploaded.js":18,"../attachment/details.js":21,"../attachment/library.js":22,"../attachments.js":23,"../label.js":36,"../search.js":45,"../settings/attachment-display.js":47,"../sidebar.js":48,"../spinner.js":49,"../toolbar.js":50,"../uploader/inline.js":51,"../uploader/status.js":53,"../view.js":55}],25:[function(require,module,exports){2941 },{"../attachment-compat.js":10,"../attachment-filters/all.js":12,"../attachment-filters/date.js":13,"../attachment-filters/uploaded.js":14,"../attachment/details.js":17,"../attachment/library.js":18,"../attachments.js":19,"../label.js":32,"../search.js":41,"../settings/attachment-display.js":43,"../sidebar.js":44,"../spinner.js":45,"../toolbar.js":46,"../uploader/inline.js":47,"../uploader/status.js":49,"../view.js":51}],21:[function(require,module,exports){ 4055 2942 /*globals _, Backbone */ 4056 2943 … … 4142 3029 4143 3030 module.exports = Button; 4144 },{"./view.js":5 5}],26:[function(require,module,exports){3031 },{"./view.js":51}],22:[function(require,module,exports){ 4145 3032 /** 4146 3033 * When MEDIA_TRASH is true, a button that handles bulk Delete Permanently logic … … 4186 3073 4187 3074 module.exports = DeleteSelectedPermanently; 4188 },{"../button.js":2 5,"./delete-selected.js":27}],27:[function(require,module,exports){3075 },{"../button.js":21,"./delete-selected.js":23}],23:[function(require,module,exports){ 4189 3076 /*globals wp */ 4190 3077 … … 4238 3125 4239 3126 module.exports = DeleteSelected; 4240 },{"../button.js":2 5}],28:[function(require,module,exports){3127 },{"../button.js":21}],24:[function(require,module,exports){ 4241 3128 /*globals wp */ 4242 3129 … … 4294 3181 4295 3182 module.exports = SelectModeToggle; 4296 },{"../button.js":2 5}],29:[function(require,module,exports){3183 },{"../button.js":21}],25:[function(require,module,exports){ 4297 3184 var View = require( './view.js' ), 4298 3185 EditImage = require( './edit-image.js' ), … … 4321 3208 4322 3209 module.exports = Details; 4323 },{"./edit-image.js": 30,"./view.js":55}],30:[function(require,module,exports){3210 },{"./edit-image.js":26,"./view.js":51}],26:[function(require,module,exports){ 4324 3211 /*globals _, wp */ 4325 3212 … … 4376 3263 4377 3264 module.exports = EditImage; 4378 },{"./view.js":5 5}],31:[function(require,module,exports){3265 },{"./view.js":51}],27:[function(require,module,exports){ 4379 3266 /** 4380 3267 * wp.media.view.FocusManager … … 4424 3311 4425 3312 module.exports = FocusManager; 4426 },{"./view.js":5 5}],32:[function(require,module,exports){3313 },{"./view.js":51}],28:[function(require,module,exports){ 4427 3314 /*globals _, Backbone */ 4428 3315 … … 4597 3484 4598 3485 module.exports = Frame; 4599 },{"../controllers/region.js":4,"../controllers/state-machine.js":5,"../controllers/state.js":6,"./view.js":5 5}],33:[function(require,module,exports){3486 },{"../controllers/region.js":4,"../controllers/state-machine.js":5,"../controllers/state.js":6,"./view.js":51}],29:[function(require,module,exports){ 4600 3487 /*globals _, wp, jQuery */ 4601 3488 … … 4846 3733 4847 3734 module.exports = EditAttachments; 4848 },{"../../controllers/edit-attachment-metadata.js":1,"../../controllers/edit-image.js":2,"../attachment-compat.js":1 4,"../attachment/details-two-column.js":20,"../edit-image-details.js":29,"../frame.js":32,"../media-frame.js":38,"../modal.js":41}],34:[function(require,module,exports){3735 },{"../../controllers/edit-attachment-metadata.js":1,"../../controllers/edit-image.js":2,"../attachment-compat.js":10,"../attachment/details-two-column.js":16,"../edit-image-details.js":25,"../frame.js":28,"../media-frame.js":34,"../modal.js":37}],30:[function(require,module,exports){ 4849 3736 /*globals _, Backbone, wp, jQuery */ 4850 3737 … … 5094 3981 5095 3982 module.exports = Manage; 5096 },{"../../controllers/library.js":3,"../../routers/manage.js": 12,"../attachments/browser.js":24,"../media-frame.js":38,"../uploader/window.js":54}],35:[function(require,module,exports){3983 },{"../../controllers/library.js":3,"../../routers/manage.js":8,"../attachments/browser.js":20,"../media-frame.js":34,"../uploader/window.js":50}],31:[function(require,module,exports){ 5097 3984 /** 5098 3985 * wp.media.view.Iframe … … 5120 4007 5121 4008 module.exports = Iframe; 5122 },{"./view.js":5 5}],36:[function(require,module,exports){4009 },{"./view.js":51}],32:[function(require,module,exports){ 5123 4010 /** 5124 4011 * @class … … 5146 4033 5147 4034 module.exports = Label; 5148 },{"./view.js":5 5}],37:[function(require,module,exports){4035 },{"./view.js":51}],33:[function(require,module,exports){ 5149 4036 /*globals _, wp, jQuery */ 5150 4037 … … 5298 4185 5299 4186 module.exports = MediaDetails; 5300 },{"./settings/attachment-display.js":4 7}],38:[function(require,module,exports){4187 },{"./settings/attachment-display.js":43}],34:[function(require,module,exports){ 5301 4188 /*globals _, wp, jQuery */ 5302 4189 … … 5553 4440 5554 4441 module.exports = MediaFrame; 5555 },{"./frame.js": 32,"./iframe.js":35,"./menu.js":40,"./modal.js":41,"./router.js":44,"./toolbar.js":50,"./uploader/window.js":54,"./view.js":55}],39:[function(require,module,exports){4442 },{"./frame.js":28,"./iframe.js":31,"./menu.js":36,"./modal.js":37,"./router.js":40,"./toolbar.js":46,"./uploader/window.js":50,"./view.js":51}],35:[function(require,module,exports){ 5556 4443 /*globals wp, jQuery */ 5557 4444 … … 5627 4514 5628 4515 module.exports = MenuItem; 5629 },{"./view.js":5 5}],40:[function(require,module,exports){4516 },{"./view.js":51}],36:[function(require,module,exports){ 5630 4517 /** 5631 4518 * wp.media.view.Menu … … 5743 4630 5744 4631 module.exports = Menu; 5745 },{"./menu-item.js":3 9,"./priority-list.js":42}],41:[function(require,module,exports){4632 },{"./menu-item.js":35,"./priority-list.js":38}],37:[function(require,module,exports){ 5746 4633 /*globals _, wp, jQuery */ 5747 4634 … … 5959 4846 5960 4847 module.exports = Modal; 5961 },{"./focus-manager.js": 31,"./view.js":55}],42:[function(require,module,exports){4848 },{"./focus-manager.js":27,"./view.js":51}],38:[function(require,module,exports){ 5962 4849 /*globals _, Backbone */ 5963 4850 … … 6060 4947 6061 4948 module.exports = PriorityList; 6062 },{"./view.js":5 5}],43:[function(require,module,exports){4949 },{"./view.js":51}],39:[function(require,module,exports){ 6063 4950 /** 6064 4951 * wp.media.view.RouterItem … … 6086 4973 6087 4974 module.exports = RouterItem; 6088 },{"./menu-item.js":3 9}],44:[function(require,module,exports){4975 },{"./menu-item.js":35}],40:[function(require,module,exports){ 6089 4976 /** 6090 4977 * wp.media.view.Router … … 6123 5010 6124 5011 module.exports = Router; 6125 },{"./menu.js": 40,"./router-item.js":43}],45:[function(require,module,exports){5012 },{"./menu.js":36,"./router-item.js":39}],41:[function(require,module,exports){ 6126 5013 /*globals wp */ 6127 5014 … … 6173 5060 6174 5061 module.exports = Search; 6175 },{"./view.js":5 5}],46:[function(require,module,exports){5062 },{"./view.js":51}],42:[function(require,module,exports){ 6176 5063 /*globals _, Backbone, jQuery */ 6177 5064 … … 6295 5182 6296 5183 module.exports = Settings; 6297 },{"./view.js":5 5}],47:[function(require,module,exports){5184 },{"./view.js":51}],43:[function(require,module,exports){ 6298 5185 /*globals _, wp */ 6299 5186 … … 6390 5277 6391 5278 module.exports = AttachmentDisplay; 6392 },{"../settings.js":4 6}],48:[function(require,module,exports){5279 },{"../settings.js":42}],44:[function(require,module,exports){ 6393 5280 /** 6394 5281 * wp.media.view.Sidebar … … 6408 5295 6409 5296 module.exports = Sidebar; 6410 },{"./priority-list.js": 42}],49:[function(require,module,exports){5297 },{"./priority-list.js":38}],45:[function(require,module,exports){ 6411 5298 /*globals _, wp */ 6412 5299 … … 6447 5334 6448 5335 module.exports = Spinner; 6449 },{"./view.js":5 5}],50:[function(require,module,exports){5336 },{"./view.js":51}],46:[function(require,module,exports){ 6450 5337 /*globals Backbone, _ */ 6451 5338 … … 6610 5497 6611 5498 module.exports = Toolbar; 6612 },{"./button.js":2 5,"./priority-list.js":42,"./view.js":55}],51:[function(require,module,exports){5499 },{"./button.js":21,"./priority-list.js":38,"./view.js":51}],47:[function(require,module,exports){ 6613 5500 /*globals _, wp */ 6614 5501 … … 6743 5630 6744 5631 module.exports = UploaderInline; 6745 },{"../view.js":5 5,"./status.js":53}],52:[function(require,module,exports){5632 },{"../view.js":51,"./status.js":49}],48:[function(require,module,exports){ 6746 5633 /*globals wp */ 6747 5634 … … 6763 5650 6764 5651 module.exports = UploaderStatusError; 6765 },{"../view.js":5 5}],53:[function(require,module,exports){5652 },{"../view.js":51}],49:[function(require,module,exports){ 6766 5653 /*globals _, wp */ 6767 5654 … … 6903 5790 6904 5791 module.exports = UploaderStatus; 6905 },{"../view.js":5 5,"./status-error.js":52}],54:[function(require,module,exports){5792 },{"../view.js":51,"./status-error.js":48}],50:[function(require,module,exports){ 6906 5793 /*globals _, wp, jQuery */ 6907 5794 … … 7016 5903 7017 5904 module.exports = UploaderWindow; 7018 },{"../view.js":5 5}],55:[function(require,module,exports){5905 },{"../view.js":51}],51:[function(require,module,exports){ 7019 5906 /*globals wp */ 7020 5907
Note: See TracChangeset
for help on using the changeset viewer.