<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[28675] trunk/src/wp-includes/js/media-views.js: Media modal documentation:</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/28675">28675</a></dd>
<dt>Author</dt> <dd>wonderboymusic</dd>
<dt>Date</dt> <dd>2014-06-05 14:53:44 +0000 (Thu, 05 Jun 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Media modal documentation:

Add some clarity to default values for controllers.

Props ericlewis.
See <a href="http://core.trac.wordpress.org/ticket/28459">#28459</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesjsmediaviewsjs">trunk/src/wp-includes/js/media-views.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesjsmediaviewsjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/media-views.js (28674 => 28675)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/media-views.js  2014-06-05 14:08:11 UTC (rev 28674)
+++ trunk/src/wp-includes/js/media-views.js     2014-06-05 14:53:44 UTC (rev 28675)
</span><span class="lines">@@ -546,24 +546,25 @@
</span><span class="cx">   */
</span><span class="cx">  media.controller.Library = media.controller.State.extend({
</span><span class="cx">          defaults: {
</span><del>-                       id:         'library',
-                       multiple:   false, // false, 'add', 'reset'
-                       describe:   false,
-                       toolbar:    'select',
-                       sidebar:    'settings',
-                       content:    'upload',
-                       router:     'browse',
-                       menu:       'default',
-                       searchable: true,
-                       filterable: false,
-                       sortable:   true,
-                       title:      l10n.mediaLibraryTitle,
</del><ins>+                        id:                 'library',
+                       title:              l10n.mediaLibraryTitle,
+                       // Selection defaults. @see media.model.Selection
+                       multiple:           false,
+                       // Initial region modes.
+                       content:            'upload',
+                       menu:               'default',
+                       router:             'browse',
+                       toolbar:            'select',
+                       // Attachments browser defaults. @see media.view.AttachmentsBrowser
+                       searchable:         true,
+                       filterable:         false,
+                       sortable:           true,
</ins><span class="cx"> 
</span><ins>+                       describe:           false,
</ins><span class="cx">                   // Uses a user setting to override the content mode.
</span><span class="cx">                  contentUserSetting: true,
</span><del>-
</del><span class="cx">                   // Sync the selection from the last state when 'multiple' matches.
</span><del>-                       syncSelection: true
</del><ins>+                        syncSelection:      true
</ins><span class="cx">           },
</span><span class="cx"> 
</span><span class="cx">          /**
</span><span class="lines">@@ -754,15 +755,16 @@
</span><span class="cx">   */
</span><span class="cx">  media.controller.ImageDetails = media.controller.State.extend({
</span><span class="cx">          defaults: _.defaults({
</span><del>-                       id: 'image-details',
-                       toolbar: 'image-details',
-                       title: l10n.imageDetailsTitle,
-                       content: 'image-details',
-                       menu: 'image-details',
-                       router: false,
-                       attachment: false,
-                       priority: 60,
-                       editing: false
</del><ins>+                        id:       'image-details',
+                       title:    l10n.imageDetailsTitle,
+                       // Initial region modes.
+                       content:  'image-details',
+                       menu:     'image-details',
+                       router:   false,
+                       toolbar:  'image-details',
+
+                       editing:  false,
+                       priority: 60
</ins><span class="cx">           }, media.controller.Library.prototype.defaults ),
</span><span class="cx"> 
</span><span class="cx">          initialize: function( options ) {
</span><span class="lines">@@ -786,18 +788,22 @@
</span><span class="cx">  media.controller.GalleryEdit = media.controller.Library.extend({
</span><span class="cx">          defaults: {
</span><span class="cx">                  id:              'gallery-edit',
</span><ins>+                       title:           l10n.editGalleryTitle,
+                       // Selection defaults. @see media.model.Selection
</ins><span class="cx">                   multiple:        false,
</span><ins>+                       // Attachments browser defaults. @see media.view.AttachmentsBrowser
+                       searchable:      false,
+                       sortable:        true,
+                       // Initial region modes.
+                       content:         'browse',
+                       toolbar:         'gallery-edit',
+
</ins><span class="cx">                   describe:        true,
</span><ins>+                       displaySettings: true,
+                       dragInfo:        true,
</ins><span class="cx">                   edge:            199,
</span><span class="cx">                  editing:         false,
</span><del>-                       sortable:        true,
-                       searchable:      false,
-                       toolbar:         'gallery-edit',
-                       content:         'browse',
-                       title:           l10n.editGalleryTitle,
</del><span class="cx">                   priority:        60,
</span><del>-                       dragInfo:        true,
-                       displaySettings: true,
</del><span class="cx"> 
</span><span class="cx">                  // Don't sync the selection, as the Edit Gallery library
</span><span class="cx">                  // *is* the selection.
</span><span class="lines">@@ -880,14 +886,17 @@
</span><span class="cx">   */
</span><span class="cx">  media.controller.GalleryAdd = media.controller.Library.extend({
</span><span class="cx">          defaults: _.defaults({
</span><del>-                       id:           'gallery-library',
-                       filterable:   'uploaded',
-                       multiple:     'add',
-                       menu:         'gallery',
-                       toolbar:      'gallery-add',
-                       title:        l10n.addToGalleryTitle,
-                       priority:     100,
</del><ins>+                        id:            'gallery-library',
+                       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',
</ins><span class="cx"> 
</span><ins>+                       priority:      100,
</ins><span class="cx">                   // Don't sync the selection, as the Edit Gallery library
</span><span class="cx">                  // *is* the selection.
</span><span class="cx">                  syncSelection: false
</span><span class="lines">@@ -935,15 +944,19 @@
</span><span class="cx">   */
</span><span class="cx">  media.controller.CollectionEdit = media.controller.Library.extend({
</span><span class="cx">          defaults: {
</span><ins>+                       // Selection defaults. @see media.model.Selection
</ins><span class="cx">                   multiple:     false,
</span><ins>+                       // Attachments browser defaults. @see media.view.AttachmentsBrowser
+                       sortable:     true,
+                       searchable:   false,
+                       // Region mode defaults.
+                       content:      'browse',
+
</ins><span class="cx">                   describe:     true,
</span><ins>+                       dragInfo:     true,
</ins><span class="cx">                   edge:         199,
</span><span class="cx">                  editing:      false,
</span><del>-                       sortable:     true,
-                       searchable:   false,
-                       content:      'browse',
</del><span class="cx">                   priority:     60,
</span><del>-                       dragInfo:     true,
</del><span class="cx">                   SettingsView: false,
</span><span class="cx"> 
</span><span class="cx">                  // Don't sync the selection, as the Edit {Collection} library
</span><span class="lines">@@ -1044,8 +1057,11 @@
</span><span class="cx">   */
</span><span class="cx">  media.controller.CollectionAdd = media.controller.Library.extend({
</span><span class="cx">          defaults: _.defaults( {
</span><ins>+                       // Selection defaults. @see media.model.Selection
+                       multiple:      'add',
+                       // Attachments browser defaults. @see media.view.AttachmentsBrowser
</ins><span class="cx">                   filterable:    'uploaded',
</span><del>-                       multiple:      'add',
</del><ins>+
</ins><span class="cx">                   priority:      100,
</span><span class="cx">                  syncSelection: false
</span><span class="cx">          }, media.controller.Library.prototype.defaults ),
</span><span class="lines">@@ -1104,12 +1120,16 @@
</span><span class="cx">   */
</span><span class="cx">  media.controller.FeaturedImage = media.controller.Library.extend({
</span><span class="cx">          defaults: _.defaults({
</span><del>-                       id:         'featured-image',
-                       filterable: 'uploaded',
-                       multiple:   false,
-                       toolbar:    'featured-image',
-                       title:      l10n.setFeaturedImageTitle,
-                       priority:   60,
</del><ins>+                        id:            '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,
</ins><span class="cx">                   syncSelection: true
</span><span class="cx">          }, media.controller.Library.prototype.defaults ),
</span><span class="cx"> 
</span><span class="lines">@@ -1185,12 +1205,16 @@
</span><span class="cx">   */
</span><span class="cx">  media.controller.ReplaceImage = media.controller.Library.extend({
</span><span class="cx">          defaults: _.defaults({
</span><del>-                       id:         'replace-image',
-                       filterable: 'uploaded',
-                       multiple:   false,
-                       toolbar:    'replace',
-                       title:      l10n.replaceImageTitle,
-                       priority:   60,
</del><ins>+                        id:            'replace-image',
+                       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,
</ins><span class="cx">                   syncSelection: true
</span><span class="cx">          }, media.controller.Library.prototype.defaults ),
</span><span class="cx"> 
</span><span class="lines">@@ -1250,12 +1274,14 @@
</span><span class="cx">   */
</span><span class="cx">  media.controller.EditImage = media.controller.State.extend({
</span><span class="cx">          defaults: {
</span><del>-                       id: 'edit-image',
-                       url: '',
-                       menu: false,
</del><ins>+                        id:      'edit-image',
+                       title:   l10n.editImage,
+                       // Region mode defaults.
+                       menu:    false,
</ins><span class="cx">                   toolbar: 'edit-image',
</span><del>-                       title: l10n.editImage,
-                       content: 'edit-image'
</del><ins>+                        content: 'edit-image',
+
+                       url:     ''
</ins><span class="cx">           },
</span><span class="cx"> 
</span><span class="cx">          activate: function() {
</span><span class="lines">@@ -1301,10 +1327,12 @@
</span><span class="cx">   */
</span><span class="cx">  media.controller.MediaLibrary = media.controller.Library.extend({
</span><span class="cx">          defaults: _.defaults({
</span><del>-                       filterable: 'uploaded',
-                       priority:   80,
-                       syncSelection: false,
-                       displaySettings: false
</del><ins>+                        // Attachments browser defaults. @see media.view.AttachmentsBrowser
+                       filterable:      'uploaded',
+
+                       displaySettings: false,
+                       priority:        80,
+                       syncSelection:   false
</ins><span class="cx">           }, media.controller.Library.prototype.defaults ),
</span><span class="cx"> 
</span><span class="cx">          initialize: function( options ) {
</span><span class="lines">@@ -1333,15 +1361,16 @@
</span><span class="cx">   */
</span><span class="cx">  media.controller.Embed = media.controller.State.extend({
</span><span class="cx">          defaults: {
</span><del>-                       id:      'embed',
-                       url:     '',
-                       menu:    'default',
-                       content: 'embed',
-                       toolbar: 'main-embed',
-                       type:    'link',
</del><ins>+                        id:       'embed',
+                       title:    l10n.insertFromUrlTitle,
+                       // Region mode defaults.
+                       content:  'embed',
+                       menu:     'default',
+                       toolbar:  'main-embed',
</ins><span class="cx"> 
</span><del>-                       title:    l10n.insertFromUrlTitle,
-                       priority: 120
</del><ins>+                        priority: 120,
+                       type:     'link',
+                       url:      ''
</ins><span class="cx">           },
</span><span class="cx"> 
</span><span class="cx">          // The amount of time used when debouncing the scan.
</span><span class="lines">@@ -1445,11 +1474,13 @@
</span><span class="cx">   */
</span><span class="cx">  media.controller.Cropper = media.controller.State.extend({
</span><span class="cx">          defaults: {
</span><del>-                       id: 'cropper',
-                       title: l10n.cropImage,
-                       toolbar: 'crop',
-                       content: 'crop',
-                       router: false,
</del><ins>+                        id:          'cropper',
+                       title:       l10n.cropImage,
+                       // Region mode defaults.
+                       toolbar:     'crop',
+                       content:     'crop',
+                       router:      false,
+
</ins><span class="cx">                   canSkipCrop: false
</span><span class="cx">          },
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>