Media modal documentation:
Add some clarity to default values for controllers. Props ericlewis. See #28459. Built from https://develop.svn.wordpress.org/trunk@28675 git-svn-id: http://core.svn.wordpress.org/trunk@28493 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f769530af3
commit
5d89ee4b3b
|
@ -547,21 +547,22 @@
|
|||
media.controller.Library = media.controller.State.extend({
|
||||
defaults: {
|
||||
id: 'library',
|
||||
multiple: false, // false, 'add', 'reset'
|
||||
describe: false,
|
||||
toolbar: 'select',
|
||||
sidebar: 'settings',
|
||||
title: l10n.mediaLibraryTitle,
|
||||
// Selection defaults. @see media.model.Selection
|
||||
multiple: false,
|
||||
// Initial region modes.
|
||||
content: 'upload',
|
||||
router: 'browse',
|
||||
menu: 'default',
|
||||
router: 'browse',
|
||||
toolbar: 'select',
|
||||
// Attachments browser defaults. @see media.view.AttachmentsBrowser
|
||||
searchable: true,
|
||||
filterable: false,
|
||||
sortable: true,
|
||||
title: l10n.mediaLibraryTitle,
|
||||
|
||||
describe: false,
|
||||
// Uses a user setting to override the content mode.
|
||||
contentUserSetting: true,
|
||||
|
||||
// Sync the selection from the last state when 'multiple' matches.
|
||||
syncSelection: true
|
||||
},
|
||||
|
@ -755,14 +756,15 @@
|
|||
media.controller.ImageDetails = media.controller.State.extend({
|
||||
defaults: _.defaults({
|
||||
id: 'image-details',
|
||||
toolbar: 'image-details',
|
||||
title: l10n.imageDetailsTitle,
|
||||
// Initial region modes.
|
||||
content: 'image-details',
|
||||
menu: 'image-details',
|
||||
router: false,
|
||||
attachment: false,
|
||||
priority: 60,
|
||||
editing: false
|
||||
toolbar: 'image-details',
|
||||
|
||||
editing: false,
|
||||
priority: 60
|
||||
}, media.controller.Library.prototype.defaults ),
|
||||
|
||||
initialize: function( options ) {
|
||||
|
@ -786,18 +788,22 @@
|
|||
media.controller.GalleryEdit = media.controller.Library.extend({
|
||||
defaults: {
|
||||
id: 'gallery-edit',
|
||||
title: l10n.editGalleryTitle,
|
||||
// Selection defaults. @see media.model.Selection
|
||||
multiple: false,
|
||||
// Attachments browser defaults. @see media.view.AttachmentsBrowser
|
||||
searchable: false,
|
||||
sortable: true,
|
||||
// Initial region modes.
|
||||
content: 'browse',
|
||||
toolbar: 'gallery-edit',
|
||||
|
||||
describe: true,
|
||||
displaySettings: true,
|
||||
dragInfo: true,
|
||||
edge: 199,
|
||||
editing: false,
|
||||
sortable: true,
|
||||
searchable: false,
|
||||
toolbar: 'gallery-edit',
|
||||
content: 'browse',
|
||||
title: l10n.editGalleryTitle,
|
||||
priority: 60,
|
||||
dragInfo: true,
|
||||
displaySettings: true,
|
||||
|
||||
// Don't sync the selection, as the Edit Gallery library
|
||||
// *is* the selection.
|
||||
|
@ -881,13 +887,16 @@
|
|||
media.controller.GalleryAdd = media.controller.Library.extend({
|
||||
defaults: _.defaults({
|
||||
id: 'gallery-library',
|
||||
filterable: 'uploaded',
|
||||
title: l10n.addToGalleryTitle,
|
||||
// Selection defaults. @see media.model.Selection
|
||||
multiple: 'add',
|
||||
// Attachments browser defaults. @see media.view.AttachmentsBrowser
|
||||
filterable: 'uploaded',
|
||||
// Initial region modes.
|
||||
menu: 'gallery',
|
||||
toolbar: 'gallery-add',
|
||||
title: l10n.addToGalleryTitle,
|
||||
priority: 100,
|
||||
|
||||
priority: 100,
|
||||
// Don't sync the selection, as the Edit Gallery library
|
||||
// *is* the selection.
|
||||
syncSelection: false
|
||||
|
@ -935,15 +944,19 @@
|
|||
*/
|
||||
media.controller.CollectionEdit = media.controller.Library.extend({
|
||||
defaults: {
|
||||
// Selection defaults. @see media.model.Selection
|
||||
multiple: false,
|
||||
describe: true,
|
||||
edge: 199,
|
||||
editing: false,
|
||||
// Attachments browser defaults. @see media.view.AttachmentsBrowser
|
||||
sortable: true,
|
||||
searchable: false,
|
||||
// Region mode defaults.
|
||||
content: 'browse',
|
||||
priority: 60,
|
||||
|
||||
describe: true,
|
||||
dragInfo: true,
|
||||
edge: 199,
|
||||
editing: false,
|
||||
priority: 60,
|
||||
SettingsView: false,
|
||||
|
||||
// Don't sync the selection, as the Edit {Collection} library
|
||||
|
@ -1044,8 +1057,11 @@
|
|||
*/
|
||||
media.controller.CollectionAdd = media.controller.Library.extend({
|
||||
defaults: _.defaults( {
|
||||
filterable: 'uploaded',
|
||||
// Selection defaults. @see media.model.Selection
|
||||
multiple: 'add',
|
||||
// Attachments browser defaults. @see media.view.AttachmentsBrowser
|
||||
filterable: 'uploaded',
|
||||
|
||||
priority: 100,
|
||||
syncSelection: false
|
||||
}, media.controller.Library.prototype.defaults ),
|
||||
|
@ -1105,10 +1121,14 @@
|
|||
media.controller.FeaturedImage = media.controller.Library.extend({
|
||||
defaults: _.defaults({
|
||||
id: 'featured-image',
|
||||
filterable: 'uploaded',
|
||||
multiple: false,
|
||||
toolbar: 'featured-image',
|
||||
title: l10n.setFeaturedImageTitle,
|
||||
// Selection defaults. @see media.model.Selection
|
||||
multiple: false,
|
||||
// Attachments browser defaults. @see media.view.AttachmentsBrowser
|
||||
filterable: 'uploaded',
|
||||
// Region mode defaults.
|
||||
toolbar: 'featured-image',
|
||||
|
||||
priority: 60,
|
||||
syncSelection: true
|
||||
}, media.controller.Library.prototype.defaults ),
|
||||
|
@ -1186,10 +1206,14 @@
|
|||
media.controller.ReplaceImage = media.controller.Library.extend({
|
||||
defaults: _.defaults({
|
||||
id: 'replace-image',
|
||||
filterable: 'uploaded',
|
||||
multiple: false,
|
||||
toolbar: 'replace',
|
||||
title: l10n.replaceImageTitle,
|
||||
// Selection defaults. @see media.model.Selection
|
||||
multiple: false,
|
||||
// Attachments browser defaults. @see media.view.AttachmentsBrowser
|
||||
filterable: 'uploaded',
|
||||
// Region mode defaults.
|
||||
toolbar: 'replace',
|
||||
|
||||
priority: 60,
|
||||
syncSelection: true
|
||||
}, media.controller.Library.prototype.defaults ),
|
||||
|
@ -1251,11 +1275,13 @@
|
|||
media.controller.EditImage = media.controller.State.extend({
|
||||
defaults: {
|
||||
id: 'edit-image',
|
||||
url: '',
|
||||
title: l10n.editImage,
|
||||
// Region mode defaults.
|
||||
menu: false,
|
||||
toolbar: 'edit-image',
|
||||
title: l10n.editImage,
|
||||
content: 'edit-image'
|
||||
content: 'edit-image',
|
||||
|
||||
url: ''
|
||||
},
|
||||
|
||||
activate: function() {
|
||||
|
@ -1301,10 +1327,12 @@
|
|||
*/
|
||||
media.controller.MediaLibrary = media.controller.Library.extend({
|
||||
defaults: _.defaults({
|
||||
// Attachments browser defaults. @see media.view.AttachmentsBrowser
|
||||
filterable: 'uploaded',
|
||||
|
||||
displaySettings: false,
|
||||
priority: 80,
|
||||
syncSelection: false,
|
||||
displaySettings: false
|
||||
syncSelection: false
|
||||
}, media.controller.Library.prototype.defaults ),
|
||||
|
||||
initialize: function( options ) {
|
||||
|
@ -1334,14 +1362,15 @@
|
|||
media.controller.Embed = media.controller.State.extend({
|
||||
defaults: {
|
||||
id: 'embed',
|
||||
url: '',
|
||||
menu: 'default',
|
||||
content: 'embed',
|
||||
toolbar: 'main-embed',
|
||||
type: 'link',
|
||||
|
||||
title: l10n.insertFromUrlTitle,
|
||||
priority: 120
|
||||
// Region mode defaults.
|
||||
content: 'embed',
|
||||
menu: 'default',
|
||||
toolbar: 'main-embed',
|
||||
|
||||
priority: 120,
|
||||
type: 'link',
|
||||
url: ''
|
||||
},
|
||||
|
||||
// The amount of time used when debouncing the scan.
|
||||
|
@ -1447,9 +1476,11 @@
|
|||
defaults: {
|
||||
id: 'cropper',
|
||||
title: l10n.cropImage,
|
||||
// Region mode defaults.
|
||||
toolbar: 'crop',
|
||||
content: 'crop',
|
||||
router: false,
|
||||
|
||||
canSkipCrop: false
|
||||
},
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue