Make WordPress Core

Ticket #28459: 28459.diff

File 28459.diff, 8.3 KB (added by ericlewis, 12 years ago)
  • src/wp-includes/js/media-views.js

    diff --git a/src/wp-includes/js/media-views.js b/src/wp-includes/js/media-views.js
    index 26fe39d..6611864 100644
    a b  
    546546         */
    547547        media.controller.Library = media.controller.State.extend({
    548548                defaults: {
    549                         id:         'library',
    550                         multiple:   false, // false, 'add', 'reset'
    551                         describe:   false,
    552                         toolbar:    'select',
    553                         sidebar:    'settings',
    554                         content:    'upload',
    555                         router:     'browse',
    556                         menu:       'default',
    557                         searchable: true,
    558                         filterable: false,
    559                         sortable:   true,
    560                         title:      l10n.mediaLibraryTitle,
    561 
     549                        id:                 'library',
     550                        title:              l10n.mediaLibraryTitle,
     551                        // Selection defaults. @see media.model.Selection
     552                        multiple:           false,
     553                        // Initial region modes.
     554                        content:            'upload',
     555                        menu:               'default',
     556                        router:             'browse',
     557                        toolbar:            'select',
     558                        // Attachments browser defaults. @see media.view.AttachmentsBrowser
     559                        searchable:         true,
     560                        filterable:         false,
     561                        sortable:           true,
    562562                        // Uses a user setting to override the content mode.
    563563                        contentUserSetting: true,
    564 
    565564                        // Sync the selection from the last state when 'multiple' matches.
    566                         syncSelection: true
     565                        syncSelection:      true
    567566                },
    568567
    569568                /**
     
    754753         */
    755754        media.controller.ImageDetails = media.controller.State.extend({
    756755                defaults: _.defaults({
    757                         id: 'image-details',
    758                         toolbar: 'image-details',
    759                         title: l10n.imageDetailsTitle,
    760                         content: 'image-details',
    761                         menu: 'image-details',
    762                         router: false,
    763                         attachment: false,
    764                         priority: 60,
    765                         editing: false
     756                        id:       'image-details',
     757                        title:    l10n.imageDetailsTitle,
     758                        // Initial region modes.
     759                        content:  'image-details',
     760                        menu:     'image-details',
     761                        router:   false,
     762                        toolbar:  'image-details',
     763
     764                        editing:  false,
     765                        priority: 60
    766766                }, media.controller.Library.prototype.defaults ),
    767767
    768768                initialize: function( options ) {
     
    786786        media.controller.GalleryEdit = media.controller.Library.extend({
    787787                defaults: {
    788788                        id:              'gallery-edit',
     789                        title:           l10n.editGalleryTitle,
     790                        // Selection defaults. @see media.model.Selection
    789791                        multiple:        false,
    790                         describe:        true,
    791                         edge:            199,
    792                         editing:         false,
    793                         sortable:        true,
     792                        // Attachments browser defaults. @see media.view.AttachmentsBrowser
    794793                        searchable:      false,
    795                         toolbar:         'gallery-edit',
     794                        sortable:        true,
     795                        // Initial region modes.
    796796                        content:         'browse',
    797                         title:           l10n.editGalleryTitle,
    798                         priority:        60,
    799                         dragInfo:        true,
     797                        toolbar:         'gallery-edit',
     798
    800799                        displaySettings: true,
     800                        dragInfo:        true,
     801                        edge:            199,
     802                        editing:         false,
     803                        priority:        60,
    801804
    802805                        // Don't sync the selection, as the Edit Gallery library
    803806                        // *is* the selection.
     
    880883         */
    881884        media.controller.GalleryAdd = media.controller.Library.extend({
    882885                defaults: _.defaults({
    883                         id:           'gallery-library',
    884                         filterable:   'uploaded',
    885                         multiple:     'add',
    886                         menu:         'gallery',
    887                         toolbar:      'gallery-add',
    888                         title:        l10n.addToGalleryTitle,
    889                         priority:     100,
     886                        id:            'gallery-library',
     887                        title:         l10n.addToGalleryTitle,
     888                        // Selection defaults. @see media.model.Selection
     889                        multiple:      'add',
     890                        // Attachments browser defaults. @see media.view.AttachmentsBrowser
     891                        filterable:    'uploaded',
     892                        // Initial region modes.
     893                        menu:          'gallery',
     894                        toolbar:       'gallery-add',
    890895
     896                        priority:      100,
    891897                        // Don't sync the selection, as the Edit Gallery library
    892898                        // *is* the selection.
    893899                        syncSelection: false
     
    935941         */
    936942        media.controller.CollectionEdit = media.controller.Library.extend({
    937943                defaults: {
     944                        // Selection defaults. @see media.model.Selection
    938945                        multiple:     false,
    939                         describe:     true,
    940                         edge:         199,
    941                         editing:      false,
     946                        // Attachments browser defaults. @see media.view.AttachmentsBrowser
    942947                        sortable:     true,
    943948                        searchable:   false,
     949                        // Region mode defaults.
    944950                        content:      'browse',
    945                         priority:     60,
     951
    946952                        dragInfo:     true,
     953                        edge:         199,
     954                        editing:      false,
     955                        priority:     60,
    947956                        SettingsView: false,
    948957
    949958                        // Don't sync the selection, as the Edit {Collection} library
     
    10441053         */
    10451054        media.controller.CollectionAdd = media.controller.Library.extend({
    10461055                defaults: _.defaults( {
    1047                         filterable:    'uploaded',
     1056                        // Selection defaults. @see media.model.Selection
    10481057                        multiple:      'add',
     1058                        // Attachments browser defaults. @see media.view.AttachmentsBrowser
     1059                        filterable:    'uploaded',
     1060
    10491061                        priority:      100,
    10501062                        syncSelection: false
    10511063                }, media.controller.Library.prototype.defaults ),
     
    11041116         */
    11051117        media.controller.FeaturedImage = media.controller.Library.extend({
    11061118                defaults: _.defaults({
    1107                         id:         'featured-image',
    1108                         filterable: 'uploaded',
    1109                         multiple:   false,
    1110                         toolbar:    'featured-image',
    1111                         title:      l10n.setFeaturedImageTitle,
    1112                         priority:   60,
     1119                        id:            'featured-image',
     1120                        title:         l10n.setFeaturedImageTitle,
     1121                        // Selection defaults. @see media.model.Selection
     1122                        multiple:      false,
     1123                        // Attachments browser defaults. @see media.view.AttachmentsBrowser
     1124                        filterable:    'uploaded',
     1125                        // Region mode defaults.
     1126                        toolbar:       'featured-image',
     1127
     1128                        priority:      60,
    11131129                        syncSelection: true
    11141130                }, media.controller.Library.prototype.defaults ),
    11151131
     
    11851201         */
    11861202        media.controller.ReplaceImage = media.controller.Library.extend({
    11871203                defaults: _.defaults({
    1188                         id:         'replace-image',
    1189                         filterable: 'uploaded',
    1190                         multiple:   false,
    1191                         toolbar:    'replace',
    1192                         title:      l10n.replaceImageTitle,
    1193                         priority:   60,
     1204                        id:            'replace-image',
     1205                        title:         l10n.replaceImageTitle,
     1206                        // Selection defaults. @see media.model.Selection
     1207                        multiple:      false,
     1208                        // Attachments browser defaults. @see media.view.AttachmentsBrowser
     1209                        filterable:    'uploaded',
     1210                        // Region mode defaults.
     1211                        toolbar:       'replace',
     1212
     1213                        priority:      60,
    11941214                        syncSelection: true
    11951215                }, media.controller.Library.prototype.defaults ),
    11961216
     
    12501270         */
    12511271        media.controller.EditImage = media.controller.State.extend({
    12521272                defaults: {
    1253                         id: 'edit-image',
    1254                         url: '',
    1255                         menu: false,
     1273                        id:      'edit-image',
     1274                        title:   l10n.editImage,
     1275                        // Region mode defaults.
     1276                        menu:    false,
    12561277                        toolbar: 'edit-image',
    1257                         title: l10n.editImage,
    1258                         content: 'edit-image'
     1278                        content: 'edit-image',
     1279
     1280                        url:     ''
    12591281                },
    12601282
    12611283                activate: function() {
     
    13011323         */
    13021324        media.controller.MediaLibrary = media.controller.Library.extend({
    13031325                defaults: _.defaults({
    1304                         filterable: 'uploaded',
    1305                         priority:   80,
    1306                         syncSelection: false,
    1307                         displaySettings: false
     1326                        // Attachments browser defaults. @see media.view.AttachmentsBrowser
     1327                        filterable:      'uploaded',
     1328
     1329                        displaySettings: false,
     1330                        priority:        80,
     1331                        syncSelection:   false
    13081332                }, media.controller.Library.prototype.defaults ),
    13091333
    13101334                initialize: function( options ) {
     
    13331357         */
    13341358        media.controller.Embed = media.controller.State.extend({
    13351359                defaults: {
    1336                         id:      'embed',
    1337                         url:     '',
    1338                         menu:    'default',
    1339                         content: 'embed',
    1340                         toolbar: 'main-embed',
    1341                         type:    'link',
    1342 
     1360                        id:       'embed',
    13431361                        title:    l10n.insertFromUrlTitle,
    1344                         priority: 120
     1362                        // Region mode defaults.
     1363                        content:  'embed',
     1364                        menu:     'default',
     1365                        toolbar:  'main-embed',
     1366
     1367                        priority: 120,
     1368                        type:     'link',
     1369                        url:      ''
    13451370                },
    13461371
    13471372                // The amount of time used when debouncing the scan.
     
    14451470         */
    14461471        media.controller.Cropper = media.controller.State.extend({
    14471472                defaults: {
    1448                         id: 'cropper',
    1449                         title: l10n.cropImage,
    1450                         toolbar: 'crop',
    1451                         content: 'crop',
    1452                         router: false,
     1473                        id:          'cropper',
     1474                        title:       l10n.cropImage,
     1475                        // Region mode defaults.
     1476                        toolbar:     'crop',
     1477                        content:     'crop',
     1478                        router:      false,
     1479
    14531480                        canSkipCrop: false
    14541481                },
    14551482
     
    44914518                                });
    44924519
    44934520                        options.buttons  = this.buttons;
    4494                         options.describe = this.controller.state().get('describe');
    44954521
    44964522                        if ( 'image' === options.type ) {
    44974523                                options.size = this.imageSize();