WordPress.org

Make WordPress Core

Changeset 31935


Ignore:
Timestamp:
03/31/2015 02:02:35 AM (5 years ago)
Author:
wonderboymusic
Message:

Let us pray to the gods of backwards compatibility:

  • The way that the JS modules for media are currently set up turns the existing global wp.media namespace into a read-only API, this is bad.
  • For the existing module implementation to work with plugins, those looking to override or extend a class would have to modify their own plugin to use browserify - we can't expect this to happen
  • Because the general way that plugins override media classes is via machete (resetting them to something else), we cannot use require( 'module' ) in the internal code for media modules

We CAN continue to use require( 'fun/js' ) in the manifests for media.

Future code/projects should carefully consider what is made to be public API. In 3.5, EVERYTHING was made public, so everything shall remain public.

See #31684, #28510.

Location:
trunk/src/wp-includes/js/media
Files:
84 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/media/audio-video.js

    r31625 r31935  
    346346 * @augments Backbone.View
    347347 */
    348 var MediaDetails = require( './media-details' ),
     348var MediaDetails = wp.media.view.MediaDetails,
    349349    AudioDetails;
    350350
     
    372372module.exports = AudioDetails;
    373373
    374 },{"./media-details":9}],6:[function(require,module,exports){
     374},{}],6:[function(require,module,exports){
    375375/*globals wp */
    376376
     
    390390var MediaDetails = wp.media.view.MediaFrame.MediaDetails,
    391391    MediaLibrary = wp.media.controller.MediaLibrary,
    392    
    393     AudioDetailsView = require( '../audio-details.js' ),
    394     AudioDetailsController = require( '../../controllers/audio-details.js' ),
     392
    395393    l10n = wp.media.view.l10n,
    396394    AudioDetails;
     
    409407
    410408    initialize: function( options ) {
    411         options.DetailsView = AudioDetailsView;
     409        options.DetailsView = wp.media.view.AudioDetails;
    412410        options.cancelText = l10n.audioDetailsCancel;
    413411        options.addText = l10n.audioAddSourceTitle;
     
    425423    createStates: function() {
    426424        this.states.add([
    427             new AudioDetailsController( {
     425            new wp.media.controller.AudioDetails( {
    428426                media: this.media
    429427            } ),
     
    452450module.exports = AudioDetails;
    453451
    454 },{"../../controllers/audio-details.js":2,"../audio-details.js":5}],7:[function(require,module,exports){
     452},{}],7:[function(require,module,exports){
    455453/*globals wp */
    456454
     
    467465 * @mixes wp.media.controller.StateMachine
    468466 */
    469 var View = wp.media.View,
    470     Toolbar = wp.media.view.Toolbar,
    471     Select = wp.media.view.MediaFrame.Select,
     467var Select = wp.media.view.MediaFrame.Select,
    472468    l10n = wp.media.view.l10n,
    473469    MediaDetails;
     
    532528                }
    533529            },
    534             separateCancel: new View({
     530            separateCancel: new wp.media.View({
    535531                className: 'separator',
    536532                priority: 40
     
    541537
    542538    setPrimaryButton: function(text, handler) {
    543         this.toolbar.set( new Toolbar({
     539        this.toolbar.set( new wp.media.view.Toolbar({
    544540            controller: this,
    545541            items: {
     
    604600var MediaDetails = wp.media.view.MediaFrame.MediaDetails,
    605601    MediaLibrary = wp.media.controller.MediaLibrary,
    606     VideoDetailsView = require( '../video-details.js' ),
    607     VideoDetailsController = require( '../../controllers/video-details.js' ),
    608602    l10n = wp.media.view.l10n,
    609603    VideoDetails;
     
    622616
    623617    initialize: function( options ) {
    624         options.DetailsView = VideoDetailsView;
     618        options.DetailsView = wp.media.view.VideoDetails;
    625619        options.cancelText = l10n.videoDetailsCancel;
    626620        options.addText = l10n.videoAddSourceTitle;
     
    640634    createStates: function() {
    641635        this.states.add([
    642             new VideoDetailsController({
     636            new wp.media.controller.VideoDetails({
    643637                media: this.media
    644638            }),
     
    725719module.exports = VideoDetails;
    726720
    727 },{"../../controllers/video-details.js":3,"../video-details.js":10}],9:[function(require,module,exports){
     721},{}],9:[function(require,module,exports){
    728722/*global wp, jQuery, _, MediaElementPlayer */
    729723
     
    907901 * @augments Backbone.View
    908902 */
    909 var MediaDetails = require( './media-details' ),
     903var MediaDetails = wp.media.view.MediaDetails,
    910904    VideoDetails;
    911905
     
    938932module.exports = VideoDetails;
    939933
    940 },{"./media-details":9}]},{},[1]);
     934},{}]},{},[1]);
  • trunk/src/wp-includes/js/media/controllers/collection-add.js

    r31491 r31935  
    3535 */
    3636var Selection = wp.media.model.Selection,
    37     Library = require( './library.js' ),
     37    Library = wp.media.controller.Library,
    3838    CollectionAdd;
    3939
  • trunk/src/wp-includes/js/media/controllers/collection-edit.js

    r31491 r31935  
    3535 * @param {string}                     attributes.collectionType         The collection type. (e.g. 'playlist').
    3636 */
    37 var Library = require( './library.js' ),
    38     View = require( '../views/view.js' ),
    39     EditLibraryView = require( '../views/attachment/edit-library.js' ),
     37var Library = wp.media.controller.Library,
    4038    l10n = wp.media.view.l10n,
    4139    $ = jQuery,
     
    7674        // The single `Attachment` view to be used in the `Attachments` view.
    7775        if ( ! this.get('AttachmentView') ) {
    78             this.set( 'AttachmentView', EditLibraryView );
     76            this.set( 'AttachmentView', wp.media.view.Attachment.EditLibrary );
    7977        }
    8078        Library.prototype.initialize.apply( this, arguments );
     
    142140
    143141        if ( dragInfoText ) {
    144             attachmentsBrowserView.toolbar.set( 'dragInfo', new View({
     142            attachmentsBrowserView.toolbar.set( 'dragInfo', new wp.media.View({
    145143                el: $( '<div class="instructions">' + dragInfoText + '</div>' )[0],
    146144                priority: -40
  • trunk/src/wp-includes/js/media/controllers/cropper.js

    r31491 r31935  
    1010 * @augments Backbone.Model
    1111 */
    12 var State = require( './state.js' ),
    13     ToolbarView = require( '../views/toolbar.js' ),
    14     CropperView = require( '../views/cropper.js' ),
    15     l10n = wp.media.view.l10n,
     12var l10n = wp.media.view.l10n,
    1613    Cropper;
    1714
    18 Cropper = State.extend({
     15Cropper = wp.media.controller.State.extend({
    1916    defaults: {
    2017        id:          'cropper',
     
    3936
    4037    createCropContent: function() {
    41         this.cropperView = new CropperView({
     38        this.cropperView = new wp.media.view.Cropper({
    4239            controller: this,
    4340            attachment: this.get('selection').first()
     
    105102        }
    106103
    107         this.frame.toolbar.set( new ToolbarView(toolbarOptions) );
     104        this.frame.toolbar.set( new wp.media.view.Toolbar(toolbarOptions) );
    108105    },
    109106
  • trunk/src/wp-includes/js/media/controllers/edit-attachment-metadata.js

    r31494 r31935  
    1010 * @augments Backbone.Model
    1111 */
    12 var State = wp.media.controller.State,
    13     l10n = wp.media.view.l10n,
     12var l10n = wp.media.view.l10n,
    1413    EditAttachmentMetadata;
    1514
    16 EditAttachmentMetadata = State.extend({
     15EditAttachmentMetadata = wp.media.controller.State.extend({
    1716    defaults: {
    1817        id:      'edit-attachment',
  • trunk/src/wp-includes/js/media/controllers/edit-image.js

    r31492 r31935  
    1919 * @param {string}                    [attributes.url]                Unused. @todo Consider removal.
    2020 */
    21 var State = require( './state.js' ),
    22     ToolbarView = require( '../views/toolbar.js' ),
    23     l10n = wp.media.view.l10n,
     21var l10n = wp.media.view.l10n,
    2422    EditImage;
    2523
    26 EditImage = State.extend({
     24EditImage = wp.media.controller.State.extend({
    2725    defaults: {
    2826        id:      'edit-image',
     
    5654            previous = lastState && lastState.id;
    5755
    58         frame.toolbar.set( new ToolbarView({
     56        frame.toolbar.set( new wp.media.view.Toolbar({
    5957            controller: frame,
    6058            items: {
  • trunk/src/wp-includes/js/media/controllers/embed.js

    r31618 r31935  
    2222 * @param {object} [attributes.metadata={}]           Properties of the embed, which will override attributes.url if set.
    2323 */
    24 var State = require( './state.js' ),
    25     l10n = wp.media.view.l10n,
     24var l10n = wp.media.view.l10n,
    2625    $ = Backbone.$,
    2726    Embed;
    2827
    29 Embed = State.extend({
     28Embed = wp.media.controller.State.extend({
    3029    defaults: {
    3130        id:       'embed',
  • trunk/src/wp-includes/js/media/controllers/featured-image.js

    r31491 r31935  
    3333 */
    3434var Attachment = wp.media.model.Attachment,
    35     Library = require( './library.js' ),
     35    Library = wp.media.controller.Library,
    3636    l10n = wp.media.view.l10n,
    3737    FeaturedImage;
  • trunk/src/wp-includes/js/media/controllers/gallery-add.js

    r31492 r31935  
    3333 */
    3434var Selection = wp.media.model.Selection,
    35     Library = require( './library.js' ),
     35    Library = wp.media.controller.Library,
    3636    l10n = wp.media.view.l10n,
    3737    GalleryAdd;
  • trunk/src/wp-includes/js/media/controllers/gallery-edit.js

    r31492 r31935  
    3232 *                                                                        If none supplied, defaults to wp.media.view.Attachment.EditLibrary.
    3333 */
    34 var Library = require( './library.js' ),
    35     EditLibraryView = require( '../views/attachment/edit-library.js' ),
    36     GallerySettingsView = require( '../views/settings/gallery.js' ),
     34var Library = wp.media.controller.Library,
    3735    l10n = wp.media.view.l10n,
    3836    GalleryEdit;
     
    6866        // The single `Attachment` view to be used in the `Attachments` view.
    6967        if ( ! this.get('AttachmentView') ) {
    70             this.set( 'AttachmentView', EditLibraryView );
     68            this.set( 'AttachmentView', wp.media.view.Attachment.EditLibrary );
    7169        }
    7270
     
    122120
    123121        browser.sidebar.set({
    124             gallery: new GallerySettingsView({
     122            gallery: new wp.media.view.Settings.Gallery({
    125123                controller: this,
    126124                model:      library.gallery,
  • trunk/src/wp-includes/js/media/controllers/image-details.js

    r31491 r31935  
    2525 *       however this may not do anything.
    2626 */
    27 var State = require( './state.js' ),
    28     Library = require( './library.js' ),
     27var State = wp.media.controller.State,
     28    Library = wp.media.controller.Library,
    2929    l10n = wp.media.view.l10n,
    3030    ImageDetails;
  • trunk/src/wp-includes/js/media/controllers/library.js

    r31491 r31935  
    3535 * @param {boolean}                         [attributes.syncSelection=true]      Whether the Attachments selection should be persisted from the last state.
    3636 */
    37 var selectionSync = require( '../utils/selection-sync.js' ),
    38     State = require( './state.js' ),
    39     l10n = wp.media.view.l10n,
     37var l10n = wp.media.view.l10n,
    4038    getUserSetting = window.getUserSetting,
    4139    setUserSetting = window.setUserSetting,
    4240    Library;
    4341
    44 Library = State.extend({
     42Library = wp.media.controller.State.extend({
    4543    defaults: {
    4644        id:                 'library',
     
    270268
    271269// Make selectionSync available on any Media Library state.
    272 _.extend( Library.prototype, selectionSync );
     270_.extend( Library.prototype, wp.media.selectionSync );
    273271
    274272module.exports = Library;
  • trunk/src/wp-includes/js/media/controllers/media-library.js

    r31491 r31935  
    99 * @augments Backbone.Model
    1010 */
    11 var Library = require( './library.js' ),
     11var Library = wp.media.controller.Library,
    1212    MediaLibrary;
    1313
  • trunk/src/wp-includes/js/media/controllers/replace-image.js

    r31491 r31935  
    3232 * @param {boolean}                    [attributes.syncSelection=true]      Whether the Attachments selection should be persisted from the last state.
    3333 */
    34 var Library = require( './library.js' ),
     34var Library = wp.media.controller.Library,
    3535    l10n = wp.media.view.l10n,
    3636    ReplaceImage;
  • trunk/src/wp-includes/js/media/grid.js

    r31618 r31935  
    1111 * @augments Backbone.Model
    1212 */
    13 var State = wp.media.controller.State,
    14     l10n = wp.media.view.l10n,
     13var l10n = wp.media.view.l10n,
    1514    EditAttachmentMetadata;
    1615
    17 EditAttachmentMetadata = State.extend({
     16EditAttachmentMetadata = wp.media.controller.State.extend({
    1817    defaults: {
    1918        id:      'edit-attachment',
     
    141140
    142141},{}],5:[function(require,module,exports){
     142/*globals wp */
     143
    143144/**
    144145 * wp.media.view.DeleteSelectedPermanentlyButton
     
    154155 */
    155156var Button = wp.media.view.Button,
    156     DeleteSelected = require( './delete-selected.js' ),
     157    DeleteSelected = wp.media.view.DeleteSelectedButton,
    157158    DeleteSelectedPermanently;
    158159
     
    187188module.exports = DeleteSelectedPermanently;
    188189
    189 },{"./delete-selected.js":6}],6:[function(require,module,exports){
     190},{}],6:[function(require,module,exports){
    190191/*globals wp */
    191192
     
    366367var Frame = wp.media.view.Frame,
    367368    MediaFrame = wp.media.view.MediaFrame,
    368     Modal = wp.media.view.Modal,
    369     AttachmentCompat = wp.media.view.AttachmentCompat,
    370     EditImageController = wp.media.controller.EditImage,
    371 
    372     EditAttachmentMetadata = require( '../../controllers/edit-attachment-metadata.js' ),
    373     TwoColumn = require( '../attachment/details-two-column.js' ),
    374     DetailsView = require( '../edit-image-details.js' ),
    375369
    376370    $ = jQuery,
     
    428422        // Initialize modal container view.
    429423        if ( this.options.modal ) {
    430             this.modal = new Modal({
     424            this.modal = new wp.media.view.Modal({
    431425                controller: this,
    432426                title:      this.options.title
     
    457451    createStates: function() {
    458452        this.states.add([
    459             new EditAttachmentMetadata( { model: this.model } )
     453            new wp.media.controller.EditAttachmentMetadata( { model: this.model } )
    460454        ]);
    461455    },
     
    468462     */
    469463    editMetadataMode: function( contentRegion ) {
    470         contentRegion.view = new TwoColumn({
     464        contentRegion.view = new wp.media.view.Attachment.Details.TwoColumn({
    471465            controller: this,
    472466            model:      this.model
     
    477471         * `attachment_fields_to_edit` filter.
    478472         */
    479         contentRegion.view.views.set( '.attachment-compat', new AttachmentCompat({
     473        contentRegion.view.views.set( '.attachment-compat', new wp.media.view.AttachmentCompat({
    480474            controller: this,
    481475            model:      this.model
     
    495489     */
    496490    editImageMode: function( contentRegion ) {
    497         var editImageController = new EditImageController( {
     491        var editImageController = new wp.media.controller.EditImage( {
    498492            model: this.model,
    499493            frame: this
     
    504498        editImageController._menu = function() {};
    505499
    506         contentRegion.view = new DetailsView( {
     500        contentRegion.view = new wp.media.view.EditImage.Details( {
    507501            model: this.model,
    508502            frame: this,
     
    597591module.exports = EditAttachments;
    598592
    599 },{"../../controllers/edit-attachment-metadata.js":1,"../attachment/details-two-column.js":4,"../edit-image-details.js":8}],10:[function(require,module,exports){
     593},{}],10:[function(require,module,exports){
    600594/*globals wp, _, Backbone */
    601595
     
    616610 */
    617611var MediaFrame = wp.media.view.MediaFrame,
    618     UploaderWindow = wp.media.view.UploaderWindow,
    619     AttachmentsBrowser = wp.media.view.AttachmentsBrowser,
    620612    Library = wp.media.controller.Library,
    621 
    622     Router = require( '../../routers/manage.js' ),
    623613
    624614    $ = Backbone.$,
     
    658648        // Initialize a window-wide uploader.
    659649        if ( this.options.uploader ) {
    660             this.uploader = new UploaderWindow({
     650            this.uploader = new wp.media.view.UploaderWindow({
    661651                controller: this,
    662652                uploader: {
     
    671661        }
    672662
    673         this.gridRouter = new Router();
     663        this.gridRouter = new wp.media.view.MediaFrame.Manage.Router();
    674664
    675665        // Call 'initialize' directly on the parent class.
     
    821811
    822812        // Browse our library of attachments.
    823         this.browserView = contentRegion.view = new AttachmentsBrowser({
     813        this.browserView = contentRegion.view = new wp.media.view.AttachmentsBrowser({
    824814            controller: this,
    825815            collection: state.get('library'),
     
    871861module.exports = Manage;
    872862
    873 },{"../../routers/manage.js":3}]},{},[2]);
     863},{}]},{},[2]);
  • trunk/src/wp-includes/js/media/models.js

    r31618 r31935  
    5959delete l10n.settings;
    6060
     61Attachment = media.model.Attachment = require( './models/attachment.js' );
    6162Attachments = media.model.Attachments = require( './models/attachments.js' );
    62 Attachment = media.model.Attachment = require( './models/attachment.js' );
    6363
    6464media.model.Query = require( './models/query.js' );
     
    380380     */
    381381    create: function( attrs ) {
    382         var Attachments = require( './attachments.js' );
     382        var Attachments = wp.media.model.Attachments;
    383383        return Attachments.all.push( attrs );
    384384    },
     
    395395     */
    396396    get: _.memoize( function( id, attachment ) {
    397         var Attachments = require( './attachments.js' );
     397        var Attachments = wp.media.model.Attachments;
    398398        return Attachments.all.push( attachment || { id: id } );
    399399    })
     
    402402module.exports = Attachment;
    403403
    404 },{"./attachments.js":3}],3:[function(require,module,exports){
     404},{}],3:[function(require,module,exports){
    405405/*globals wp, _, Backbone */
    406406
     
    427427 *
    428428 */
    429 var Attachment = require( './attachment.js' ),
    430     Attachments;
    431 
    432 Attachments = Backbone.Collection.extend({
     429var Attachments = Backbone.Collection.extend({
    433430    /**
    434431     * @type {wp.media.model.Attachment}
    435432     */
    436     model: Attachment,
     433    model: wp.media.model.Attachment,
    437434    /**
    438435     * @param {Array} [models=[]] Array of models used to populate the collection.
     
    772769            }
    773770
    774             attachment = Attachment.get( id );
     771            attachment = wp.media.model.Attachment.get( id );
    775772            newAttributes = attachment.parse( attrs, xhr );
    776773
     
    788785     */
    789786    _requery: function( refresh ) {
    790         var props, Query;
     787        var props;
    791788        if ( this.props.get('query') ) {
    792             Query = require( './query.js' );
    793789            props = this.props.toJSON();
    794790            props.cache = ( true !== refresh );
    795             this.mirror( Query.get( props ) );
     791            this.mirror( wp.media.model.Query.get( props ) );
    796792        }
    797793    },
     
    940936module.exports = Attachments;
    941937
    942 },{"./attachment.js":2,"./query.js":5}],4:[function(require,module,exports){
     938},{}],4:[function(require,module,exports){
    943939/*globals Backbone */
    944940
     
    956952 * @param {int} [attributes.attachment_id] ID of the attachment.
    957953 **/
    958 var Attachment = require( './attachment' ),
    959     PostImage;
    960 
    961 PostImage = Backbone.Model.extend({
     954var PostImage = Backbone.Model.extend({
    962955
    963956    initialize: function( attributes ) {
     957        var Attachment = wp.media.model.Attachment;
    964958        this.attachment = false;
    965959
     
    10981092module.exports = PostImage;
    10991093
    1100 },{"./attachment":2}],5:[function(require,module,exports){
     1094},{}],5:[function(require,module,exports){
    11011095/*globals wp, _ */
    11021096
     
    11181112 * @param {object} [options.args.posts_per_page]
    11191113 */
    1120 var Attachments = require( './attachments.js' ),
     1114var Attachments = wp.media.model.Attachments,
    11211115    Query;
    11221116
     
    14081402module.exports = Query;
    14091403
    1410 },{"./attachments.js":3}],6:[function(require,module,exports){
    1411 /*globals _ */
     1404},{}],6:[function(require,module,exports){
     1405/*globals wp, _ */
    14121406
    14131407/**
     
    14201414 * @augments Backbone.Collection
    14211415 */
    1422 var Attachments = require( './attachments.js' ),
     1416var Attachments = wp.media.model.Attachments,
    14231417    Selection;
    14241418
     
    15071501module.exports = Selection;
    15081502
    1509 },{"./attachments.js":3}]},{},[1]);
     1503},{}]},{},[1]);
  • trunk/src/wp-includes/js/media/models.manifest.js

    r31491 r31935  
    5858delete l10n.settings;
    5959
     60Attachment = media.model.Attachment = require( './models/attachment.js' );
    6061Attachments = media.model.Attachments = require( './models/attachments.js' );
    61 Attachment = media.model.Attachment = require( './models/attachment.js' );
    6262
    6363media.model.Query = require( './models/query.js' );
  • trunk/src/wp-includes/js/media/models/attachment.js

    r31618 r31935  
    146146     */
    147147    create: function( attrs ) {
    148         var Attachments = require( './attachments.js' );
     148        var Attachments = wp.media.model.Attachments;
    149149        return Attachments.all.push( attrs );
    150150    },
     
    161161     */
    162162    get: _.memoize( function( id, attachment ) {
    163         var Attachments = require( './attachments.js' );
     163        var Attachments = wp.media.model.Attachments;
    164164        return Attachments.all.push( attachment || { id: id } );
    165165    })
  • trunk/src/wp-includes/js/media/models/attachments.js

    r31491 r31935  
    2323 *
    2424 */
    25 var Attachment = require( './attachment.js' ),
    26     Attachments;
    27 
    28 Attachments = Backbone.Collection.extend({
     25var Attachments = Backbone.Collection.extend({
    2926    /**
    3027     * @type {wp.media.model.Attachment}
    3128     */
    32     model: Attachment,
     29    model: wp.media.model.Attachment,
    3330    /**
    3431     * @param {Array} [models=[]] Array of models used to populate the collection.
     
    368365            }
    369366
    370             attachment = Attachment.get( id );
     367            attachment = wp.media.model.Attachment.get( id );
    371368            newAttributes = attachment.parse( attrs, xhr );
    372369
     
    384381     */
    385382    _requery: function( refresh ) {
    386         var props, Query;
     383        var props;
    387384        if ( this.props.get('query') ) {
    388             Query = require( './query.js' );
    389385            props = this.props.toJSON();
    390386            props.cache = ( true !== refresh );
    391             this.mirror( Query.get( props ) );
     387            this.mirror( wp.media.model.Query.get( props ) );
    392388        }
    393389    },
  • trunk/src/wp-includes/js/media/models/post-image.js

    r31491 r31935  
    1414 * @param {int} [attributes.attachment_id] ID of the attachment.
    1515 **/
    16 var Attachment = require( './attachment' ),
    17     PostImage;
    18 
    19 PostImage = Backbone.Model.extend({
     16var PostImage = Backbone.Model.extend({
    2017
    2118    initialize: function( attributes ) {
     19        var Attachment = wp.media.model.Attachment;
    2220        this.attachment = false;
    2321
  • trunk/src/wp-includes/js/media/models/query.js

    r31491 r31935  
    1818 * @param {object} [options.args.posts_per_page]
    1919 */
    20 var Attachments = require( './attachments.js' ),
     20var Attachments = wp.media.model.Attachments,
    2121    Query;
    2222
  • trunk/src/wp-includes/js/media/models/selection.js

    r31491 r31935  
    1 /*globals _ */
     1/*globals wp, _ */
    22
    33/**
     
    1010 * @augments Backbone.Collection
    1111 */
    12 var Attachments = require( './attachments.js' ),
     12var Attachments = wp.media.model.Attachments,
    1313    Selection;
    1414
  • trunk/src/wp-includes/js/media/views.js

    r31690 r31935  
    3636 */
    3737var Selection = wp.media.model.Selection,
    38     Library = require( './library.js' ),
     38    Library = wp.media.controller.Library,
    3939    CollectionAdd;
    4040
     
    102102module.exports = CollectionAdd;
    103103
    104 },{"./library.js":10}],2:[function(require,module,exports){
     104},{}],2:[function(require,module,exports){
    105105/*globals wp, Backbone */
    106106
     
    139139 * @param {string}                     attributes.collectionType         The collection type. (e.g. 'playlist').
    140140 */
    141 var Library = require( './library.js' ),
    142     View = require( '../views/view.js' ),
    143     EditLibraryView = require( '../views/attachment/edit-library.js' ),
     141var Library = wp.media.controller.Library,
    144142    l10n = wp.media.view.l10n,
    145143    $ = jQuery,
     
    180178        // The single `Attachment` view to be used in the `Attachments` view.
    181179        if ( ! this.get('AttachmentView') ) {
    182             this.set( 'AttachmentView', EditLibraryView );
     180            this.set( 'AttachmentView', wp.media.view.Attachment.EditLibrary );
    183181        }
    184182        Library.prototype.initialize.apply( this, arguments );
     
    246244
    247245        if ( dragInfoText ) {
    248             attachmentsBrowserView.toolbar.set( 'dragInfo', new View({
     246            attachmentsBrowserView.toolbar.set( 'dragInfo', new wp.media.View({
    249247                el: $( '<div class="instructions">' + dragInfoText + '</div>' )[0],
    250248                priority: -40
     
    266264module.exports = CollectionEdit;
    267265
    268 },{"../views/attachment/edit-library.js":25,"../views/view.js":71,"./library.js":10}],3:[function(require,module,exports){
     266},{}],3:[function(require,module,exports){
    269267/*globals wp, _, Backbone */
    270268
     
    278276 * @augments Backbone.Model
    279277 */
    280 var State = require( './state.js' ),
    281     ToolbarView = require( '../views/toolbar.js' ),
    282     CropperView = require( '../views/cropper.js' ),
    283     l10n = wp.media.view.l10n,
     278var l10n = wp.media.view.l10n,
    284279    Cropper;
    285280
    286 Cropper = State.extend({
     281Cropper = wp.media.controller.State.extend({
    287282    defaults: {
    288283        id:          'cropper',
     
    307302
    308303    createCropContent: function() {
    309         this.cropperView = new CropperView({
     304        this.cropperView = new wp.media.view.Cropper({
    310305            controller: this,
    311306            attachment: this.get('selection').first()
     
    373368        }
    374369
    375         this.frame.toolbar.set( new ToolbarView(toolbarOptions) );
     370        this.frame.toolbar.set( new wp.media.view.Toolbar(toolbarOptions) );
    376371    },
    377372
     
    387382module.exports = Cropper;
    388383
    389 },{"../views/cropper.js":34,"../views/toolbar.js":63,"./state.js":15}],4:[function(require,module,exports){
     384},{}],4:[function(require,module,exports){
    390385/*globals wp */
    391386
     
    408403 * @param {string}                    [attributes.url]                Unused. @todo Consider removal.
    409404 */
    410 var State = require( './state.js' ),
    411     ToolbarView = require( '../views/toolbar.js' ),
    412     l10n = wp.media.view.l10n,
     405var l10n = wp.media.view.l10n,
    413406    EditImage;
    414407
    415 EditImage = State.extend({
     408EditImage = wp.media.controller.State.extend({
    416409    defaults: {
    417410        id:      'edit-image',
     
    445438            previous = lastState && lastState.id;
    446439
    447         frame.toolbar.set( new ToolbarView({
     440        frame.toolbar.set( new wp.media.view.Toolbar({
    448441            controller: frame,
    449442            items: {
     
    467460module.exports = EditImage;
    468461
    469 },{"../views/toolbar.js":63,"./state.js":15}],5:[function(require,module,exports){
     462},{}],5:[function(require,module,exports){
    470463/*globals wp, _, Backbone */
    471464
     
    491484 * @param {object} [attributes.metadata={}]           Properties of the embed, which will override attributes.url if set.
    492485 */
    493 var State = require( './state.js' ),
    494     l10n = wp.media.view.l10n,
     486var l10n = wp.media.view.l10n,
    495487    $ = Backbone.$,
    496488    Embed;
    497489
    498 Embed = State.extend({
     490Embed = wp.media.controller.State.extend({
    499491    defaults: {
    500492        id:       'embed',
     
    606598module.exports = Embed;
    607599
    608 },{"./state.js":15}],6:[function(require,module,exports){
     600},{}],6:[function(require,module,exports){
    609601/*globals wp, _ */
    610602
     
    641633 */
    642634var Attachment = wp.media.model.Attachment,
    643     Library = require( './library.js' ),
     635    Library = wp.media.controller.Library,
    644636    l10n = wp.media.view.l10n,
    645637    FeaturedImage;
     
    730722module.exports = FeaturedImage;
    731723
    732 },{"./library.js":10}],7:[function(require,module,exports){
     724},{}],7:[function(require,module,exports){
    733725/*globals wp, _ */
    734726
     
    765757 */
    766758var Selection = wp.media.model.Selection,
    767     Library = require( './library.js' ),
     759    Library = wp.media.controller.Library,
    768760    l10n = wp.media.view.l10n,
    769761    GalleryAdd;
     
    823815module.exports = GalleryAdd;
    824816
    825 },{"./library.js":10}],8:[function(require,module,exports){
     817},{}],8:[function(require,module,exports){
    826818/*globals wp */
    827819
     
    857849 *                                                                        If none supplied, defaults to wp.media.view.Attachment.EditLibrary.
    858850 */
    859 var Library = require( './library.js' ),
    860     EditLibraryView = require( '../views/attachment/edit-library.js' ),
    861     GallerySettingsView = require( '../views/settings/gallery.js' ),
     851var Library = wp.media.controller.Library,
    862852    l10n = wp.media.view.l10n,
    863853    GalleryEdit;
     
    893883        // The single `Attachment` view to be used in the `Attachments` view.
    894884        if ( ! this.get('AttachmentView') ) {
    895             this.set( 'AttachmentView', EditLibraryView );
     885            this.set( 'AttachmentView', wp.media.view.Attachment.EditLibrary );
    896886        }
    897887
     
    947937
    948938        browser.sidebar.set({
    949             gallery: new GallerySettingsView({
     939            gallery: new wp.media.view.Settings.Gallery({
    950940                controller: this,
    951941                model:      library.gallery,
     
    967957module.exports = GalleryEdit;
    968958
    969 },{"../views/attachment/edit-library.js":25,"../views/settings/gallery.js":59,"./library.js":10}],9:[function(require,module,exports){
     959},{}],9:[function(require,module,exports){
    970960/*globals wp, _ */
    971961
     
    994984 *       however this may not do anything.
    995985 */
    996 var State = require( './state.js' ),
    997     Library = require( './library.js' ),
     986var State = wp.media.controller.State,
     987    Library = wp.media.controller.Library,
    998988    l10n = wp.media.view.l10n,
    999989    ImageDetails;
     
    10311021module.exports = ImageDetails;
    10321022
    1033 },{"./library.js":10,"./state.js":15}],10:[function(require,module,exports){
     1023},{}],10:[function(require,module,exports){
    10341024/*globals wp, _, Backbone */
    10351025
     
    10681058 * @param {boolean}                         [attributes.syncSelection=true]      Whether the Attachments selection should be persisted from the last state.
    10691059 */
    1070 var selectionSync = require( '../utils/selection-sync.js' ),
    1071     State = require( './state.js' ),
    1072     l10n = wp.media.view.l10n,
     1060var l10n = wp.media.view.l10n,
    10731061    getUserSetting = window.getUserSetting,
    10741062    setUserSetting = window.setUserSetting,
    10751063    Library;
    10761064
    1077 Library = State.extend({
     1065Library = wp.media.controller.State.extend({
    10781066    defaults: {
    10791067        id:                 'library',
     
    13031291
    13041292// Make selectionSync available on any Media Library state.
    1305 _.extend( Library.prototype, selectionSync );
     1293_.extend( Library.prototype, wp.media.selectionSync );
    13061294
    13071295module.exports = Library;
    13081296
    1309 },{"../utils/selection-sync.js":16,"./state.js":15}],11:[function(require,module,exports){
     1297},{}],11:[function(require,module,exports){
    13101298/*globals wp, _ */
    13111299
     
    13181306 * @augments Backbone.Model
    13191307 */
    1320 var Library = require( './library.js' ),
     1308var Library = wp.media.controller.Library,
    13211309    MediaLibrary;
    13221310
     
    13591347module.exports = MediaLibrary;
    13601348
    1361 },{"./library.js":10}],12:[function(require,module,exports){
     1349},{}],12:[function(require,module,exports){
    13621350/*globals Backbone, _ */
    13631351
     
    15741562 * @param {boolean}                    [attributes.syncSelection=true]      Whether the Attachments selection should be persisted from the last state.
    15751563 */
    1576 var Library = require( './library.js' ),
     1564var Library = wp.media.controller.Library,
    15771565    l10n = wp.media.view.l10n,
    15781566    ReplaceImage;
     
    16501638module.exports = ReplaceImage;
    16511639
    1652 },{"./library.js":10}],14:[function(require,module,exports){
     1640},{}],14:[function(require,module,exports){
    16531641/*globals _, Backbone */
    16541642
     
    22492237 * @augments Backbone.View
    22502238 */
    2251 var View = require( './view.js' ),
     2239var View = wp.media.View,
    22522240    AttachmentCompat;
    22532241
     
    23232311module.exports = AttachmentCompat;
    23242312
    2325 },{"./view.js":71}],19:[function(require,module,exports){
     2313},{}],19:[function(require,module,exports){
    23262314/*globals _, jQuery */
    23272315
     
    23342322 * @augments Backbone.View
    23352323 */
    2336 var View = require( './view.js' ),
    2337     $ = jQuery,
     2324var $ = jQuery,
    23382325    AttachmentFilters;
    23392326
    2340 AttachmentFilters = View.extend({
     2327AttachmentFilters = wp.media.View.extend({
    23412328    tagName:   'select',
    23422329    className: 'attachment-filters',
     
    24032390module.exports = AttachmentFilters;
    24042391
    2405 },{"./view.js":71}],20:[function(require,module,exports){
     2392},{}],20:[function(require,module,exports){
    24062393/*globals wp */
    24072394
     
    24152402 * @augments Backbone.View
    24162403 */
    2417 var AttachmentFilters = require( '../attachment-filters.js' ),
    2418     l10n = wp.media.view.l10n,
     2404var l10n = wp.media.view.l10n,
    24192405    All;
    24202406
    2421 All = AttachmentFilters.extend({
     2407All = wp.media.view.AttachmentFilters.extend({
    24222408    createFilters: function() {
    24232409        var filters = {};
     
    24962482module.exports = All;
    24972483
    2498 },{"../attachment-filters.js":19}],21:[function(require,module,exports){
     2484},{}],21:[function(require,module,exports){
    24992485/*globals wp, _ */
    25002486
     
    25082494 * @augments Backbone.View
    25092495 */
    2510 var AttachmentFilters = require( '../attachment-filters.js' ),
    2511     l10n = wp.media.view.l10n,
     2496var l10n = wp.media.view.l10n,
    25122497    DateFilter;
    25132498
    2514 DateFilter = AttachmentFilters.extend({
     2499DateFilter = wp.media.view.AttachmentFilters.extend({
    25152500    id: 'media-attachment-date-filters',
    25162501
     
    25402525module.exports = DateFilter;
    25412526
    2542 },{"../attachment-filters.js":19}],22:[function(require,module,exports){
     2527},{}],22:[function(require,module,exports){
    25432528/*globals wp */
    25442529
     
    25522537 * @augments Backbone.View
    25532538 */
    2554 var AttachmentFilters = require( '../attachment-filters.js' ),
    2555     l10n = wp.media.view.l10n,
     2539var l10n = wp.media.view.l10n,
    25562540    Uploaded;
    25572541
    2558 Uploaded = AttachmentFilters.extend({
     2542Uploaded = wp.media.view.AttachmentFilters.extend({
    25592543    createFilters: function() {
    25602544        var type = this.model.get('type'),
     
    26022586module.exports = Uploaded;
    26032587
    2604 },{"../attachment-filters.js":19}],23:[function(require,module,exports){
     2588},{}],23:[function(require,module,exports){
    26052589/*globals wp, _, jQuery */
    26062590
     
    26132597 * @augments Backbone.View
    26142598 */
    2615 var View = require( './view.js' ),
     2599var View = wp.media.View,
    26162600    $ = jQuery,
    26172601    Attachment;
     
    31593143module.exports = Attachment;
    31603144
    3161 },{"./view.js":71}],24:[function(require,module,exports){
     3145},{}],24:[function(require,module,exports){
    31623146/*globals wp, _ */
    31633147
     
    31713155 * @augments Backbone.View
    31723156 */
    3173 var Attachment = require( '../attachment.js' ),
     3157var Attachment = wp.media.view.Attachment,
    31743158    l10n = wp.media.view.l10n,
    31753159    Details;
     
    33163300module.exports = Details;
    33173301
    3318 },{"../attachment.js":23}],25:[function(require,module,exports){
     3302},{}],25:[function(require,module,exports){
     3303/*globals wp */
     3304
    33193305/**
    33203306 * wp.media.view.Attachment.EditLibrary
     
    33263312 * @augments Backbone.View
    33273313 */
    3328 var Attachment = require( '../attachment.js' ),
    3329     EditLibrary;
    3330 
    3331 EditLibrary = Attachment.extend({
     3314var EditLibrary = wp.media.view.Attachment.extend({
    33323315    buttons: {
    33333316        close: true
     
    33373320module.exports = EditLibrary;
    33383321
    3339 },{"../attachment.js":23}],26:[function(require,module,exports){
     3322},{}],26:[function(require,module,exports){
     3323/*globals wp */
     3324
    33403325/**
    33413326 * wp.media.view.Attachments.EditSelection
     
    33483333 * @augments Backbone.View
    33493334 */
    3350 var Selection = require( './selection.js' ),
    3351     EditSelection;
    3352 
    3353 EditSelection = Selection.extend({
     3335var EditSelection = wp.media.view.Attachment.Selection.extend({
    33543336    buttons: {
    33553337        close: true
     
    33593341module.exports = EditSelection;
    33603342
    3361 },{"./selection.js":28}],27:[function(require,module,exports){
     3343},{}],27:[function(require,module,exports){
     3344/*globals wp */
     3345
    33623346/**
    33633347 * wp.media.view.Attachment.Library
     
    33693353 * @augments Backbone.View
    33703354 */
    3371 var Attachment = require( '../attachment.js' ),
    3372     Library;
    3373 
    3374 Library = Attachment.extend({
     3355var Library = wp.media.view.Attachment.extend({
    33753356    buttons: {
    33763357        check: true
     
    33803361module.exports = Library;
    33813362
    3382 },{"../attachment.js":23}],28:[function(require,module,exports){
     3363},{}],28:[function(require,module,exports){
     3364/*globals wp */
     3365
    33833366/**
    33843367 * wp.media.view.Attachment.Selection
     
    33903373 * @augments Backbone.View
    33913374 */
    3392 var Attachment = require( '../attachment.js' ),
    3393     Selection;
    3394 
    3395 Selection = Attachment.extend({
     3375var Selection = wp.media.view.Attachment.extend({
    33963376    className: 'attachment selection',
    33973377
     
    34053385module.exports = Selection;
    34063386
    3407 },{"../attachment.js":23}],29:[function(require,module,exports){
     3387},{}],29:[function(require,module,exports){
    34083388/*globals wp, _, jQuery */
    34093389
     
    34163396 * @augments Backbone.View
    34173397 */
    3418 var View = require( './view.js' ),
    3419     Attachment = require( './attachment.js' ),
     3398var View = wp.media.View,
    34203399    $ = jQuery,
    34213400    Attachments;
     
    34353414            refreshSensitivity: wp.media.isTouchDevice ? 300 : 200,
    34363415            refreshThreshold:   3,
    3437             AttachmentView:     Attachment,
     3416            AttachmentView:     wp.media.view.Attachment,
    34383417            sortable:           false,
    34393418            resize:             true,
     
    37073686module.exports = Attachments;
    37083687
    3709 },{"./attachment.js":23,"./view.js":71}],30:[function(require,module,exports){
     3688},{}],30:[function(require,module,exports){
    37103689/*globals wp, _, jQuery */
    37113690
     
    37303709 *                                              Accepts true, false, and 'errors'.
    37313710 */
    3732 var View = require( '../view.js' ),
    3733     Library = require( '../attachment/library.js' ),
    3734     Toolbar = require( '../toolbar.js' ),
    3735     Spinner = require( '../spinner.js' ),
    3736     Search = require( '../search.js' ),
    3737     Label = require( '../label.js' ),
    3738     Uploaded = require( '../attachment-filters/uploaded.js' ),
    3739     All = require( '../attachment-filters/all.js' ),
    3740     DateFilter = require( '../attachment-filters/date.js' ),
    3741     UploaderInline = require( '../uploader/inline.js' ),
    3742     Attachments = require( '../attachments.js' ),
    3743     Sidebar = require( '../sidebar.js' ),
    3744     UploaderStatus = require( '../uploader/status.js' ),
    3745     Details = require( '../attachment/details.js' ),
    3746     AttachmentCompat = require( '../attachment-compat.js' ),
    3747     AttachmentDisplay = require( '../settings/attachment-display.js' ),
     3711var View = wp.media.View,
    37483712    mediaTrash = wp.media.view.settings.mediaTrash,
    37493713    l10n = wp.media.view.l10n,
     
    37623726            display: false,
    37633727            sidebar: true,
    3764             AttachmentView: Library
     3728            AttachmentView: wp.media.view.Attachment.Library
    37653729        });
    37663730
     
    38133777        * @member {wp.media.view.Toolbar}
    38143778        */
    3815         this.toolbar = new Toolbar( toolbarOptions );
     3779        this.toolbar = new wp.media.view.Toolbar( toolbarOptions );
    38163780
    38173781        this.views.add( this.toolbar );
    38183782
    3819         this.toolbar.set( 'spinner', new Spinner({
     3783        this.toolbar.set( 'spinner', new wp.media.view.Spinner({
    38203784            priority: -60
    38213785        }) );
     
    38243788            // "Filters" will return a <select>, need to render
    38253789            // screen reader text before
    3826             this.toolbar.set( 'filtersLabel', new Label({
     3790            this.toolbar.set( 'filtersLabel', new wp.media.view.Label({
    38273791                value: l10n.filterByType,
    38283792                attributes: {
     
    38333797
    38343798            if ( 'uploaded' === this.options.filters ) {
    3835                 this.toolbar.set( 'filters', new Uploaded({
     3799                this.toolbar.set( 'filters', new wp.media.view.AttachmentFilters.Uploaded({
    38363800                    controller: this.controller,
    38373801                    model:      this.collection.props,
     
    38393803                }).render() );
    38403804            } else {
    3841                 Filters = new All({
     3805                Filters = new wp.media.view.AttachmentFilters.All({
    38423806                    controller: this.controller,
    38433807                    model:      this.collection.props,
     
    38643828
    38653829            // DateFilter is a <select>, screen reader text needs to be rendered before
    3866             this.toolbar.set( 'dateFilterLabel', new Label({
     3830            this.toolbar.set( 'dateFilterLabel', new wp.media.view.Label({
    38673831                value: l10n.filterByDate,
    38683832                attributes: {
     
    38713835                priority: -75
    38723836            }).render() );
    3873             this.toolbar.set( 'dateFilter', new DateFilter({
     3837            this.toolbar.set( 'dateFilter', new wp.media.view.DateFilter({
    38743838                controller: this.controller,
    38753839                model:      this.collection.props,
     
    39753939        } else if ( this.options.date ) {
    39763940            // DateFilter is a <select>, screen reader text needs to be rendered before
    3977             this.toolbar.set( 'dateFilterLabel', new Label({
     3941            this.toolbar.set( 'dateFilterLabel', new wp.media.view.Label({
    39783942                value: l10n.filterByDate,
    39793943                attributes: {
     
    39823946                priority: -75
    39833947            }).render() );
    3984             this.toolbar.set( 'dateFilter', new DateFilter({
     3948            this.toolbar.set( 'dateFilter', new wp.media.view.DateFilter({
    39853949                controller: this.controller,
    39863950                model:      this.collection.props,
     
    39913955        if ( this.options.search ) {
    39923956            // Search is an input, screen reader text needs to be rendered before
    3993             this.toolbar.set( 'searchLabel', new Label({
     3957            this.toolbar.set( 'searchLabel', new wp.media.view.Label({
    39943958                value: l10n.searchMediaLabel,
    39953959                attributes: {
     
    39983962                priority:   60
    39993963            }).render() );
    4000             this.toolbar.set( 'search', new Search({
     3964            this.toolbar.set( 'search', new wp.media.view.Search({
    40013965                controller: this.controller,
    40023966                model:      this.collection.props,
     
    40474011
    40484012    createUploader: function() {
    4049         this.uploader = new UploaderInline({
     4013        this.uploader = new wp.media.view.UploaderInline({
    40504014            controller: this.controller,
    40514015            status:     false,
     
    40674031
    40684032    createAttachments: function() {
    4069         this.attachments = new Attachments({
     4033        this.attachments = new wp.media.view.Attachments({
    40704034            controller:           this.controller,
    40714035            collection:           this.collection,
     
    41034067        var options = this.options,
    41044068            selection = options.selection,
    4105             sidebar = this.sidebar = new Sidebar({
     4069            sidebar = this.sidebar = new wp.media.view.Sidebar({
    41064070                controller: this.controller
    41074071            });
     
    41104074
    41114075        if ( this.controller.uploader ) {
    4112             sidebar.set( 'uploads', new UploaderStatus({
     4076            sidebar.set( 'uploads', new wp.media.view.UploaderStatus({
    41134077                controller: this.controller,
    41144078                priority:   40
     
    41284092            single = this.options.selection.single();
    41294093
    4130         sidebar.set( 'details', new Details({
     4094        sidebar.set( 'details', new wp.media.view.Attachment.Details({
    41314095            controller: this.controller,
    41324096            model:      single,
     
    41344098        }) );
    41354099
    4136         sidebar.set( 'compat', new AttachmentCompat({
     4100        sidebar.set( 'compat', new wp.media.view.AttachmentCompat({
    41374101            controller: this.controller,
    41384102            model:      single,
     
    41414105
    41424106        if ( this.options.display ) {
    4143             sidebar.set( 'display', new AttachmentDisplay({
     4107            sidebar.set( 'display', new wp.media.view.Settings.AttachmentDisplay({
    41444108                controller:   this.controller,
    41454109                model:        this.model.display( single ),
     
    41684132module.exports = AttachmentsBrowser;
    41694133
    4170 },{"../attachment-compat.js":18,"../attachment-filters/all.js":20,"../attachment-filters/date.js":21,"../attachment-filters/uploaded.js":22,"../attachment/details.js":24,"../attachment/library.js":27,"../attachments.js":29,"../label.js":47,"../search.js":55,"../settings/attachment-display.js":58,"../sidebar.js":61,"../spinner.js":62,"../toolbar.js":63,"../uploader/inline.js":67,"../uploader/status.js":69,"../view.js":71}],31:[function(require,module,exports){
    4171 /*globals _ */
     4134},{}],31:[function(require,module,exports){
     4135/*globals wp, _ */
    41724136
    41734137/**
     
    41804144 * @augments Backbone.View
    41814145 */
    4182 var Attachments = require( '../attachments.js' ),
    4183     AttachmentSelection = require( '../attachment/selection.js' ),
     4146var Attachments = wp.media.view.Attachments,
    41844147    Selection;
    41854148
     
    41924155
    41934156            // The single `Attachment` view to be used in the `Attachments` view.
    4194             AttachmentView: AttachmentSelection
     4157            AttachmentView: wp.media.view.Attachment.Selection
    41954158        });
    41964159        // Call 'initialize' directly on the parent class.
     
    42014164module.exports = Selection;
    42024165
    4203 },{"../attachment/selection.js":28,"../attachments.js":29}],32:[function(require,module,exports){
     4166},{}],32:[function(require,module,exports){
    42044167/*globals _, Backbone */
    42054168
     
    42124175 * @augments Backbone.View
    42134176 */
    4214 var View = require( './view.js' ),
    4215     Button = require( './button.js' ),
    4216     $ = Backbone.$,
     4177var $ = Backbone.$,
    42174178    ButtonGroup;
    42184179
    4219 ButtonGroup = View.extend({
     4180ButtonGroup = wp.media.View.extend({
    42204181    tagName:   'div',
    42214182    className: 'button-group button-large media-button-group',
     
    42294190                return button;
    42304191            } else {
    4231                 return new Button( button ).render();
     4192                return new wp.media.view.Button( button ).render();
    42324193            }
    42334194        });
     
    42514212module.exports = ButtonGroup;
    42524213
    4253 },{"./button.js":33,"./view.js":71}],33:[function(require,module,exports){
     4214},{}],33:[function(require,module,exports){
    42544215/*globals _, Backbone */
    42554216
     
    42624223 * @augments Backbone.View
    42634224 */
    4264 var View = require( './view.js' ),
    4265     Button;
    4266 
    4267 Button = View.extend({
     4225var Button = wp.media.View.extend({
    42684226    tagName:    'a',
    42694227    className:  'media-button',
     
    43424300module.exports = Button;
    43434301
    4344 },{"./view.js":71}],34:[function(require,module,exports){
     4302},{}],34:[function(require,module,exports){
    43454303/*globals wp, _, jQuery */
    43464304
     
    43594317 * @augments Backbone.View
    43604318 */
    4361 var View = require( './view.js' ),
    4362     UploaderStatusError = require( './uploader/status-error.js' ),
    4363     UploaderStatus = require( './uploader/status.js' ),
     4319var View = wp.media.View,
     4320    UploaderStatus = wp.media.view.UploaderStatus,
    43644321    l10n = wp.media.view.l10n,
    43654322    $ = jQuery,
     
    44034360        var filename = this.options.attachment.get('filename');
    44044361
    4405         this.views.add( '.upload-errors', new UploaderStatusError({
     4362        this.views.add( '.upload-errors', new wp.media.view.UploaderStatusError({
    44064363            filename: UploaderStatus.prototype.filename(filename),
    44074364            message: window._wpMediaViewsL10n.cropError
     
    44124369module.exports = Cropper;
    44134370
    4414 },{"./uploader/status-error.js":68,"./uploader/status.js":69,"./view.js":71}],35:[function(require,module,exports){
     4371},{}],35:[function(require,module,exports){
    44154372/*globals wp, _ */
    44164373
     
    44234380 * @augments Backbone.View
    44244381 */
    4425 var View = require( './view.js' ),
     4382var View = wp.media.View,
    44264383    EditImage;
    44274384
     
    44704427module.exports = EditImage;
    44714428
    4472 },{"./view.js":71}],36:[function(require,module,exports){
     4429},{}],36:[function(require,module,exports){
    44734430/**
    44744431 * wp.media.view.Embed
     
    44794436 * @augments Backbone.View
    44804437 */
    4481 var View = require( './view.js' ),
    4482     EmbedImage = require( './embed/image.js' ),
    4483     EmbedLink = require( './embed/link.js' ),
    4484     EmbedUrl = require( './embed/url.js' ),
    4485     Embed;
    4486 
    4487 Embed = View.extend({
     4438var Embed = wp.media.View.extend({
    44884439    className: 'media-embed',
    44894440
     
    44924443         * @member {wp.media.view.EmbedUrl}
    44934444         */
    4494         this.url = new EmbedUrl({
     4445        this.url = new wp.media.view.EmbedUrl({
    44954446            controller: this.controller,
    44964447            model:      this.model.props
     
    45194470
    45204471        if ( 'image' === type ) {
    4521             constructor = EmbedImage;
     4472            constructor = wp.media.view.EmbedImage;
    45224473        } else if ( 'link' === type ) {
    4523             constructor = EmbedLink;
     4474            constructor = wp.media.view.EmbedLink;
    45244475        } else {
    45254476            return;
     
    45404491module.exports = Embed;
    45414492
    4542 },{"./embed/image.js":37,"./embed/link.js":38,"./embed/url.js":39,"./view.js":71}],37:[function(require,module,exports){
     4493},{}],37:[function(require,module,exports){
    45434494/*globals wp */
    45444495
     
    45534504 * @augments Backbone.View
    45544505 */
    4555 var AttachmentDisplay = require( '../settings/attachment-display.js' ),
     4506var AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay,
    45564507    EmbedImage;
    45574508
     
    45754526module.exports = EmbedImage;
    45764527
    4577 },{"../settings/attachment-display.js":58}],38:[function(require,module,exports){
     4528},{}],38:[function(require,module,exports){
    45784529/*globals wp, _, jQuery */
    45794530
     
    45874538 * @augments Backbone.View
    45884539 */
    4589 var Settings = require( '../settings.js' ),
    4590     $ = jQuery,
     4540var $ = jQuery,
    45914541    EmbedLink;
    45924542
    4593 EmbedLink = Settings.extend({
     4543EmbedLink = wp.media.view.Settings.extend({
    45944544    className: 'embed-link-settings',
    45954545    template:  wp.template('embed-link-settings'),
     
    46824632module.exports = EmbedLink;
    46834633
    4684 },{"../settings.js":57}],39:[function(require,module,exports){
     4634},{}],39:[function(require,module,exports){
    46854635/*globals wp, _, jQuery */
    46864636
     
    46934643 * @augments Backbone.View
    46944644 */
    4695 var View = require( '../view.js' ),
     4645var View = wp.media.View,
    46964646    $ = jQuery,
    46974647    EmbedUrl;
     
    47634713module.exports = EmbedUrl;
    47644714
    4765 },{"../view.js":71}],40:[function(require,module,exports){
     4715},{}],40:[function(require,module,exports){
    47664716/**
    47674717 * wp.media.view.FocusManager
     
    47724722 * @augments Backbone.View
    47734723 */
    4774 var View = require( './view.js' ),
    4775     FocusManager;
    4776 
    4777 FocusManager = View.extend({
     4724var FocusManager = wp.media.View.extend({
    47784725
    47794726    events: {
     
    48124759module.exports = FocusManager;
    48134760
    4814 },{"./view.js":71}],41:[function(require,module,exports){
     4761},{}],41:[function(require,module,exports){
    48154762/*globals _, Backbone */
    48164763
     
    48304777 * @mixes wp.media.controller.StateMachine
    48314778 */
    4832 var StateMachine = require( '../controllers/state-machine.js' ),
    4833     State = require( '../controllers/state.js' ),
    4834     Region = require( '../controllers/region.js' ),
    4835     View = require( './view.js' ),
    4836     Frame;
    4837 
    4838 Frame = View.extend({
     4779var Frame = wp.media.View.extend({
    48394780    initialize: function() {
    48404781        _.defaults( this.options, {
     
    48524793        // Initialize regions.
    48534794        _.each( this.regions, function( region ) {
    4854             this[ region ] = new Region({
     4795            this[ region ] = new wp.media.controller.Region({
    48554796                view:     this,
    48564797                id:       region,
     
    48704811        // Create the default `states` collection.
    48714812        this.states = new Backbone.Collection( null, {
    4872             model: State
     4813            model: wp.media.controller.State
    48734814        });
    48744815
     
    49824923
    49834924// Make the `Frame` a `StateMachine`.
    4984 _.extend( Frame.prototype, StateMachine.prototype );
     4925_.extend( Frame.prototype, wp.media.controller.StateMachine.prototype );
    49854926
    49864927module.exports = Frame;
    49874928
    4988 },{"../controllers/region.js":12,"../controllers/state-machine.js":14,"../controllers/state.js":15,"./view.js":71}],42:[function(require,module,exports){
     4929},{}],42:[function(require,module,exports){
    49894930/*globals wp */
    49904931
     
    50044945 * @mixes wp.media.controller.StateMachine
    50054946 */
    5006 var Select = require( './select.js' ),
    5007     Toolbar = require( '../toolbar.js' ),
    5008     ImageDetailsController = require( '../../controllers/image-details.js' ),
    5009     ReplaceImageController = require( '../../controllers/replace-image.js' ),
    5010     EditImageController = require( '../../controllers/edit-image.js' ),
    5011     ImageDetailsView = require( '../image-details.js' ),
    5012     EditImageView = require( '../edit-image.js' ),
     4947var Select = wp.media.view.MediaFrame.Select,
    50134948    l10n = wp.media.view.l10n,
    50144949    ImageDetails;
     
    50444979    createStates: function() {
    50454980        this.states.add([
    5046             new ImageDetailsController({
     4981            new wp.media.controller.ImageDetails({
    50474982                image: this.image,
    50484983                editable: false
    50494984            }),
    5050             new ReplaceImageController({
     4985            new wp.media.controller.ReplaceImage({
    50514986                id: 'replace-image',
    50524987                library: wp.media.query( { type: 'image' } ),
     
    50584993                displaySettings: true
    50594994            }),
    5060             new EditImageController( {
     4995            new wp.media.controller.EditImage( {
    50614996                image: this.image,
    50624997                selection: this.options.selection
     
    50665001
    50675002    imageDetailsContent: function( options ) {
    5068         options.view = new ImageDetailsView({
     5003        options.view = new wp.media.view.ImageDetails({
    50695004            controller: this,
    50705005            model: this.state().image,
     
    50825017        }
    50835018
    5084         view = new EditImageView( { model: model, controller: this } ).render();
     5019        view = new wp.media.view.EditImage( { model: model, controller: this } ).render();
    50855020
    50865021        this.content.set( view );
     
    50925027
    50935028    renderImageDetailsToolbar: function() {
    5094         this.toolbar.set( new Toolbar({
     5029        this.toolbar.set( new wp.media.view.Toolbar({
    50955030            controller: this,
    50965031            items: {
     
    51245059            previous = lastState && lastState.id;
    51255060
    5126         this.toolbar.set( new Toolbar({
     5061        this.toolbar.set( new wp.media.view.Toolbar({
    51275062            controller: this,
    51285063            items: {
     
    51715106module.exports = ImageDetails;
    51725107
    5173 },{"../../controllers/edit-image.js":4,"../../controllers/image-details.js":9,"../../controllers/replace-image.js":13,"../edit-image.js":35,"../image-details.js":46,"../toolbar.js":63,"./select.js":44}],43:[function(require,module,exports){
     5108},{}],43:[function(require,module,exports){
    51745109/*globals wp, _ */
    51755110
     
    51885123 * @mixes wp.media.controller.StateMachine
    51895124 */
    5190 var View = require( '../view.js' ),
    5191     Select = require( './select.js' ),
    5192     Library = require( '../../controllers/library.js' ),
    5193     Embed = require( '../embed.js' ),
    5194     EditImage = require( '../edit-image.js' ),
    5195     EditSelection = require( '../attachment/edit-selection.js' ),
    5196     Toolbar = require( '../toolbar.js' ),
    5197     ToolbarEmbed = require( '../toolbar/embed.js' ),
    5198     PlaylistSettings = require( '../settings/playlist.js' ),
    5199     AttachmentsBrowser = require( '../attachments/browser.js' ),
    5200     SelectionView = require( '../selection.js' ),
    5201     EmbedController = require( '../../controllers/embed.js' ),
    5202     EditImageController = require( '../../controllers/edit-image.js' ),
    5203     GalleryEditController = require( '../../controllers/gallery-edit.js' ),
    5204     GalleryAddController = require( '../../controllers/gallery-add.js' ),
    5205     CollectionEditController = require( '../../controllers/collection-edit.js' ),
    5206     CollectionAddController = require( '../../controllers/collection-add.js' ),
    5207     FeaturedImageController = require( '../../controllers/featured-image.js' ),
     5125var Select = wp.media.view.MediaFrame.Select,
     5126    Library = wp.media.controller.Library,
    52085127    l10n = wp.media.view.l10n,
    52095128    Post;
     
    52795198
    52805199            // Embed states.
    5281             new EmbedController( { metadata: options.metadata } ),
    5282 
    5283             new EditImageController( { model: options.editImage } ),
     5200            new wp.media.controller.Embed( { metadata: options.metadata } ),
     5201
     5202            new wp.media.controller.EditImage( { model: options.editImage } ),
    52845203
    52855204            // Gallery states.
    5286             new GalleryEditController({
     5205            new wp.media.controller.GalleryEdit({
    52875206                library: options.selection,
    52885207                editing: options.editing,
     
    52905209            }),
    52915210
    5292             new GalleryAddController(),
     5211            new wp.media.controller.GalleryAdd(),
    52935212
    52945213            new Library({
     
    53075226
    53085227            // Playlist states.
    5309             new CollectionEditController({
     5228            new wp.media.controller.CollectionEdit({
    53105229                type: 'audio',
    53115230                collectionType: 'playlist',
    53125231                title:          l10n.editPlaylistTitle,
    5313                 SettingsView:   PlaylistSettings,
     5232                SettingsView:   wp.media.view.Settings.Playlist,
    53145233                library:        options.selection,
    53155234                editing:        options.editing,
     
    53195238            }),
    53205239
    5321             new CollectionAddController({
     5240            new wp.media.controller.CollectionAdd({
    53225241                type: 'audio',
    53235242                collectionType: 'playlist',
     
    53395258            }),
    53405259
    5341             new CollectionEditController({
     5260            new wp.media.controller.CollectionEdit({
    53425261                type: 'video',
    53435262                collectionType: 'playlist',
    53445263                title:          l10n.editVideoPlaylistTitle,
    5345                 SettingsView:   PlaylistSettings,
     5264                SettingsView:   wp.media.view.Settings.Playlist,
    53465265                library:        options.selection,
    53475266                editing:        options.editing,
     
    53515270            }),
    53525271
    5353             new CollectionAddController({
     5272            new wp.media.controller.CollectionAdd({
    53545273                type: 'video',
    53555274                collectionType: 'playlist',
     
    53595278
    53605279        if ( wp.media.view.settings.post.featuredImageId ) {
    5361             this.states.add( new FeaturedImageController() );
     5280            this.states.add( new wp.media.controller.FeaturedImage() );
    53625281        }
    53635282    },
     
    54465365    mainMenu: function( view ) {
    54475366        view.set({
    5448             'library-separator': new View({
     5367            'library-separator': new wp.media.View({
    54495368                className: 'separator',
    54505369                priority: 100
     
    54855404                }
    54865405            },
    5487             separateCancel: new View({
     5406            separateCancel: new wp.media.View({
    54885407                className: 'separator',
    54895408                priority: 40
     
    55095428                }
    55105429            },
    5511             separateCancel: new View({
     5430            separateCancel: new wp.media.View({
    55125431                className: 'separator',
    55135432                priority: 40
     
    55335452                }
    55345453            },
    5535             separateCancel: new View({
     5454            separateCancel: new wp.media.View({
    55365455                className: 'separator',
    55375456                priority: 40
     
    55425461    // Content
    55435462    embedContent: function() {
    5544         var view = new Embed({
     5463        var view = new wp.media.view.Embed({
    55455464            controller: this,
    55465465            model:      this.state()
     
    55595478            view;
    55605479
    5561         view = new AttachmentsBrowser({
     5480        view = new wp.media.view.AttachmentsBrowser({
    55625481            controller: this,
    55635482            collection: selection,
     
    55695488            dragInfo:   true,
    55705489
    5571             AttachmentView: EditSelection
     5490            AttachmentView: wp.media.view.Attachments.EditSelection
    55725491        }).render();
    55735492
     
    55905509    editImageContent: function() {
    55915510        var image = this.state().get('image'),
    5592             view = new EditImage( { model: image, controller: this } ).render();
     5511            view = new wp.media.view.EditImage( { model: image, controller: this } ).render();
    55935512
    55945513        this.content.set( view );
     
    56075526        var editable = this.state().get('editable');
    56085527
    5609         view.set( 'selection', new SelectionView({
     5528        view.set( 'selection', new wp.media.view.Selection({
    56105529            controller: this,
    56115530            collection: this.state().get('selection'),
     
    57485667
    57495668    mainEmbedToolbar: function( toolbar ) {
    5750         toolbar.view = new ToolbarEmbed({
     5669        toolbar.view = new wp.media.view.Toolbar.Embed({
    57515670            controller: this
    57525671        });
     
    57555674    galleryEditToolbar: function() {
    57565675        var editing = this.state().get('editing');
    5757         this.toolbar.set( new Toolbar({
     5676        this.toolbar.set( new wp.media.view.Toolbar({
    57585677            controller: this,
    57595678            items: {
     
    57845703
    57855704    galleryAddToolbar: function() {
    5786         this.toolbar.set( new Toolbar({
     5705        this.toolbar.set( new wp.media.view.Toolbar({
    57875706            controller: this,
    57885707            items: {
     
    58125731    playlistEditToolbar: function() {
    58135732        var editing = this.state().get('editing');
    5814         this.toolbar.set( new Toolbar({
     5733        this.toolbar.set( new wp.media.view.Toolbar({
    58155734            controller: this,
    58165735            items: {
     
    58415760
    58425761    playlistAddToolbar: function() {
    5843         this.toolbar.set( new Toolbar({
     5762        this.toolbar.set( new wp.media.view.Toolbar({
    58445763            controller: this,
    58455764            items: {
     
    58695788    videoPlaylistEditToolbar: function() {
    58705789        var editing = this.state().get('editing');
    5871         this.toolbar.set( new Toolbar({
     5790        this.toolbar.set( new wp.media.view.Toolbar({
    58725791            controller: this,
    58735792            items: {
     
    58985817
    58995818    videoPlaylistAddToolbar: function() {
    5900         this.toolbar.set( new Toolbar({
     5819        this.toolbar.set( new wp.media.view.Toolbar({
    59015820            controller: this,
    59025821            items: {
     
    59245843module.exports = Post;
    59255844
    5926 },{"../../controllers/collection-add.js":1,"../../controllers/collection-edit.js":2,"../../controllers/edit-image.js":4,"../../controllers/embed.js":5,"../../controllers/featured-image.js":6,"../../controllers/gallery-add.js":7,"../../controllers/gallery-edit.js":8,"../../controllers/library.js":10,"../attachment/edit-selection.js":26,"../attachments/browser.js":30,"../edit-image.js":35,"../embed.js":36,"../selection.js":56,"../settings/playlist.js":60,"../toolbar.js":63,"../toolbar/embed.js":64,"../view.js":71,"./select.js":44}],44:[function(require,module,exports){
     5845},{}],44:[function(require,module,exports){
    59275846/*globals wp, _ */
    59285847
     
    59415860 */
    59425861
    5943 var MediaFrame = require( '../media-frame.js' ),
    5944     Library = require( '../../controllers/library.js' ),
    5945     AttachmentsBrowser = require( '../attachments/browser.js' ),
    5946     UploaderInline = require( '../uploader/inline.js' ),
    5947     ToolbarSelect = require( '../toolbar/select.js' ),
     5862var MediaFrame = wp.media.view.MediaFrame,
    59485863    l10n = wp.media.view.l10n,
    59495864    Select;
     
    60035918        this.states.add([
    60045919            // Main states.
    6005             new Library({
     5920            new wp.media.controller.Library({
    60065921                library:   wp.media.query( options.library ),
    60075922                multiple:  options.multiple,
     
    60545969
    60555970        // Browse our library of attachments.
    6056         contentRegion.view = new AttachmentsBrowser({
     5971        contentRegion.view = new wp.media.view.AttachmentsBrowser({
    60575972            controller: this,
    60585973            collection: state.get('library'),
     
    60785993    uploadContent: function() {
    60795994        this.$el.removeClass( 'hide-toolbar' );
    6080         this.content.set( new UploaderInline({
     5995        this.content.set( new wp.media.view.UploaderInline({
    60815996            controller: this
    60825997        }) );
     
    60946009        options.controller = this;
    60956010
    6096         toolbar.view = new ToolbarSelect( options );
     6011        toolbar.view = new wp.media.view.Toolbar.Select( options );
    60976012    }
    60986013});
     
    61006015module.exports = Select;
    61016016
    6102 },{"../../controllers/library.js":10,"../attachments/browser.js":30,"../media-frame.js":48,"../toolbar/select.js":65,"../uploader/inline.js":67}],45:[function(require,module,exports){
     6017},{}],45:[function(require,module,exports){
    61036018/**
    61046019 * wp.media.view.Iframe
     
    61096024 * @augments Backbone.View
    61106025 */
    6111 var View = require( './view.js' ),
    6112     Iframe;
    6113 
    6114 Iframe = View.extend({
     6026var Iframe = wp.media.View.extend({
    61156027    className: 'media-iframe',
    61166028    /**
     
    61276039module.exports = Iframe;
    61286040
    6129 },{"./view.js":71}],46:[function(require,module,exports){
     6041},{}],46:[function(require,module,exports){
    61306042/*globals wp, _, jQuery */
    61316043
     
    61406052 * @augments Backbone.View
    61416053 */
    6142 var AttachmentDisplay = require( './settings/attachment-display.js' ),
     6054var AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay,
    61436055    $ = jQuery,
    61446056    ImageDetails;
     
    62976209module.exports = ImageDetails;
    62986210
    6299 },{"./settings/attachment-display.js":58}],47:[function(require,module,exports){
     6211},{}],47:[function(require,module,exports){
    63006212/**
    63016213 * wp.media.view.Label
     
    63066218 * @augments Backbone.View
    63076219 */
    6308 var View = require( './view.js' ),
    6309     Label;
    6310 
    6311 Label = View.extend({
     6220var Label = wp.media.View.extend({
    63126221    tagName: 'label',
    63136222    className: 'screen-reader-text',
     
    63266235module.exports = Label;
    63276236
    6328 },{"./view.js":71}],48:[function(require,module,exports){
     6237},{}],48:[function(require,module,exports){
    63296238/*globals wp, _, jQuery */
    63306239
     
    63416250 * @mixes wp.media.controller.StateMachine
    63426251 */
    6343 var View = require( './view.js' ),
    6344     Frame = require( './frame.js' ),
    6345     Modal = require( './modal.js' ),
    6346     UploaderWindow = require( './uploader/window.js' ),
    6347     Menu = require( './menu.js' ),
    6348     Toolbar = require( './toolbar.js' ),
    6349     Router = require( './router.js' ),
    6350     Iframe = require( './iframe.js' ),
     6252var Frame = wp.media.view.Frame,
    63516253    $ = jQuery,
    63526254    MediaFrame;
     
    63786280        // Initialize modal container view.
    63796281        if ( this.options.modal ) {
    6380             this.modal = new Modal({
     6282            this.modal = new wp.media.view.Modal({
    63816283                controller: this,
    63826284                title:      this.options.title
     
    63946296        // Initialize window-wide uploader.
    63956297        if ( this.options.uploader ) {
    6396             this.uploader = new UploaderWindow({
     6298            this.uploader = new wp.media.view.UploaderWindow({
    63976299                controller: this,
    63986300                uploader: {
     
    64356337     */
    64366338    createTitle: function( title ) {
    6437         title.view = new View({
     6339        title.view = new wp.media.View({
    64386340            controller: this,
    64396341            tagName: 'h1'
     
    64456347     */
    64466348    createMenu: function( menu ) {
    6447         menu.view = new Menu({
     6349        menu.view = new wp.media.view.Menu({
    64486350            controller: this
    64496351        });
     
    64596361     */
    64606362    createToolbar: function( toolbar ) {
    6461         toolbar.view = new Toolbar({
     6363        toolbar.view = new wp.media.view.Toolbar({
    64626364            controller: this
    64636365        });
     
    64686370     */
    64696371    createRouter: function( router ) {
    6470         router.view = new Router({
     6372        router.view = new wp.media.view.Router({
    64716373            controller: this
    64726374        });
     
    65156417    iframeContent: function( content ) {
    65166418        this.$el.addClass('hide-toolbar');
    6517         content.view = new Iframe({
     6419        content.view = new wp.media.view.Iframe({
    65186420            controller: this
    65196421        });
     
    65826484module.exports = MediaFrame;
    65836485
    6584 },{"./frame.js":41,"./iframe.js":45,"./menu.js":50,"./modal.js":51,"./router.js":54,"./toolbar.js":63,"./uploader/window.js":70,"./view.js":71}],49:[function(require,module,exports){
     6486},{}],49:[function(require,module,exports){
    65856487/*globals jQuery */
    65866488
     
    65936495 * @augments Backbone.View
    65946496 */
    6595 var View = require( './view.js' ),
    6596     $ = jQuery,
     6497var $ = jQuery,
    65976498    MenuItem;
    65986499
    6599 MenuItem = View.extend({
     6500MenuItem = wp.media.View.extend({
    66006501    tagName:   'a',
    66016502    className: 'media-menu-item',
     
    66576558module.exports = MenuItem;
    66586559
    6659 },{"./view.js":71}],50:[function(require,module,exports){
     6560},{}],50:[function(require,module,exports){
    66606561/**
    66616562 * wp.media.view.Menu
     
    66676568 * @augments Backbone.View
    66686569 */
    6669 var MenuItem = require( './menu-item.js' ),
    6670     PriorityList = require( './priority-list.js' ),
     6570var MenuItem = wp.media.view.MenuItem,
     6571    PriorityList = wp.media.view.PriorityList,
    66716572    Menu;
    66726573
     
    67746675module.exports = Menu;
    67756676
    6776 },{"./menu-item.js":49,"./priority-list.js":52}],51:[function(require,module,exports){
     6677},{}],51:[function(require,module,exports){
    67776678/*globals wp, _, jQuery */
    67786679
     
    67876688 * @augments Backbone.View
    67886689 */
    6789 var View = require( './view.js' ),
    6790     FocusManager = require( './focus-manager.js' ),
    6791     $ = jQuery,
     6690var $ = jQuery,
    67926691    Modal;
    67936692
    6794 Modal = View.extend({
     6693Modal = wp.media.View.extend({
    67956694    tagName:  'div',
    67966695    template: wp.template('media-modal'),
     
    68136712        });
    68146713
    6815         this.focusManager = new FocusManager({
     6714        this.focusManager = new wp.media.view.FocusManager({
    68166715            el: this.el
    68176716        });
     
    69916890module.exports = Modal;
    69926891
    6993 },{"./focus-manager.js":40,"./view.js":71}],52:[function(require,module,exports){
     6892},{}],52:[function(require,module,exports){
    69946893/*globals _, Backbone */
    69956894
     
    70026901 * @augments Backbone.View
    70036902 */
    7004 var View = require( './view.js' ),
    7005     PriorityList;
    7006 
    7007 PriorityList = View.extend({
     6903var PriorityList = wp.media.View.extend({
    70086904    tagName:   'div',
    70096905
     
    70876983     */
    70886984    toView: function( options ) {
    7089         return new View( options );
     6985        return new wp.media.View( options );
    70906986    }
    70916987});
     
    70936989module.exports = PriorityList;
    70946990
    7095 },{"./view.js":71}],53:[function(require,module,exports){
     6991},{}],53:[function(require,module,exports){
    70966992/**
    70976993 * wp.media.view.RouterItem
     
    71036999 * @augments Backbone.View
    71047000 */
    7105 var MenuItem = require( './menu-item.js' ),
    7106     RouterItem;
    7107 
    7108 RouterItem = MenuItem.extend({
     7001var RouterItem = wp.media.view.MenuItem.extend({
    71097002    /**
    71107003     * On click handler to activate the content region's corresponding mode.
     
    71207013module.exports = RouterItem;
    71217014
    7122 },{"./menu-item.js":49}],54:[function(require,module,exports){
     7015},{}],54:[function(require,module,exports){
     7016/*globals wp */
     7017
    71237018/**
    71247019 * wp.media.view.Router
     
    71317026 * @augments Backbone.View
    71327027 */
    7133 var Menu = require( './menu.js' ),
    7134     RouterItem = require( './router-item.js' ),
     7028var Menu = wp.media.view.Menu,
    71357029    Router;
    71367030
     
    71397033    className: 'media-router',
    71407034    property:  'contentMode',
    7141     ItemView:  RouterItem,
     7035    ItemView:  wp.media.view.RouterItem,
    71427036    region:    'router',
    71437037
     
    71587052module.exports = Router;
    71597053
    7160 },{"./menu.js":50,"./router-item.js":53}],55:[function(require,module,exports){
     7054},{}],55:[function(require,module,exports){
    71617055/*globals wp */
    71627056
     
    71697063 * @augments Backbone.View
    71707064 */
    7171 var View = require( './view.js' ),
    7172     l10n = wp.media.view.l10n,
     7065var l10n = wp.media.view.l10n,
    71737066    Search;
    71747067
    7175 Search = View.extend({
     7068Search = wp.media.View.extend({
    71767069    tagName:   'input',
    71777070    className: 'search',
     
    72097102module.exports = Search;
    72107103
    7211 },{"./view.js":71}],56:[function(require,module,exports){
     7104},{}],56:[function(require,module,exports){
    72127105/*globals wp, _, Backbone */
    72137106
     
    72207113 * @augments Backbone.View
    72217114 */
    7222 var View = require( './view.js' ),
    7223     AttachmentsSelection = require( './attachments/selection.js' ),
    7224     l10n = wp.media.view.l10n,
     7115var l10n = wp.media.view.l10n,
    72257116    Selection;
    72267117
    7227 Selection = View.extend({
     7118Selection = wp.media.View.extend({
    72287119    tagName:   'div',
    72297120    className: 'media-selection',
     
    72447135         * @member {wp.media.view.Attachments.Selection}
    72457136         */
    7246         this.attachments = new AttachmentsSelection({
     7137        this.attachments = new wp.media.view.Attachments.Selection({
    72477138            controller: this.controller,
    72487139            collection: this.collection,
     
    72967187module.exports = Selection;
    72977188
    7298 },{"./attachments/selection.js":31,"./view.js":71}],57:[function(require,module,exports){
     7189},{}],57:[function(require,module,exports){
    72997190/*globals _, Backbone */
    73007191
     
    73077198 * @augments Backbone.View
    73087199 */
    7309 var View = require( './view.js' ),
     7200var View = wp.media.View,
    73107201    $ = Backbone.$,
    73117202    Settings;
     
    74197310module.exports = Settings;
    74207311
    7421 },{"./view.js":71}],58:[function(require,module,exports){
     7312},{}],58:[function(require,module,exports){
    74227313/*globals wp, _ */
    74237314
     
    74317322 * @augments Backbone.View
    74327323 */
    7433 var Settings = require( '../settings.js' ),
     7324var Settings = wp.media.view.Settings,
    74347325    AttachmentDisplay;
    74357326
     
    75157406module.exports = AttachmentDisplay;
    75167407
    7517 },{"../settings.js":57}],59:[function(require,module,exports){
     7408},{}],59:[function(require,module,exports){
    75187409/*globals wp */
    75197410
     
    75277418 * @augments Backbone.View
    75287419 */
    7529 var Settings = require( '../settings.js' ),
    7530     Gallery;
    7531 
    7532 Gallery = Settings.extend({
     7420var Gallery = wp.media.view.Settings.extend({
    75337421    className: 'collection-settings gallery-settings',
    75347422    template:  wp.template('gallery-settings')
     
    75377425module.exports = Gallery;
    75387426
    7539 },{"../settings.js":57}],60:[function(require,module,exports){
     7427},{}],60:[function(require,module,exports){
    75407428/*globals wp */
    75417429
     
    75497437 * @augments Backbone.View
    75507438 */
    7551 var Settings = require( '../settings.js' ),
    7552     Playlist;
    7553 
    7554 Playlist = Settings.extend({
     7439var Playlist = wp.media.view.Settings.extend({
    75557440    className: 'collection-settings playlist-settings',
    75567441    template:  wp.template('playlist-settings')
     
    75597444module.exports = Playlist;
    75607445
    7561 },{"../settings.js":57}],61:[function(require,module,exports){
     7446},{}],61:[function(require,module,exports){
    75627447/**
    75637448 * wp.media.view.Sidebar
     
    75697454 * @augments Backbone.View
    75707455 */
    7571 var PriorityList = require( './priority-list.js' ),
    7572     Sidebar;
    7573 
    7574 Sidebar = PriorityList.extend({
     7456var Sidebar = wp.media.view.PriorityList.extend({
    75757457    className: 'media-sidebar'
    75767458});
     
    75787460module.exports = Sidebar;
    75797461
    7580 },{"./priority-list.js":52}],62:[function(require,module,exports){
     7462},{}],62:[function(require,module,exports){
    75817463/*globals _ */
    75827464
     
    75897471 * @augments Backbone.View
    75907472 */
    7591 var View = require( './view.js' ),
    7592     Spinner;
    7593 
    7594 Spinner = View.extend({
     7473var Spinner = wp.media.View.extend({
    75957474    tagName:   'span',
    75967475    className: 'spinner',
     
    76187497module.exports = Spinner;
    76197498
    7620 },{"./view.js":71}],63:[function(require,module,exports){
     7499},{}],63:[function(require,module,exports){
    76217500/*globals _, Backbone */
    76227501
     
    76327511 * @augments Backbone.View
    76337512 */
    7634 var View = require( './view.js' ),
    7635     Button = require( './button.js' ),
    7636     PriorityList = require( './priority-list.js' ),
     7513var View = wp.media.View,
    76377514    Toolbar;
    76387515
     
    76497526
    76507527        // The toolbar is composed of two `PriorityList` views.
    7651         this.primary   = new PriorityList();
    7652         this.secondary = new PriorityList();
     7528        this.primary   = new wp.media.view.PriorityList();
     7529        this.secondary = new wp.media.view.PriorityList();
    76537530        this.primary.$el.addClass('media-toolbar-primary search-form');
    76547531        this.secondary.$el.addClass('media-toolbar-secondary');
     
    77127589            if ( ! ( view instanceof Backbone.View ) ) {
    77137590                view.classes = [ 'media-button-' + id ].concat( view.classes || [] );
    7714                 view = new Button( view ).render();
     7591                view = new wp.media.view.Button( view ).render();
    77157592            }
    77167593
     
    77827659module.exports = Toolbar;
    77837660
    7784 },{"./button.js":33,"./priority-list.js":52,"./view.js":71}],64:[function(require,module,exports){
     7661},{}],64:[function(require,module,exports){
    77857662/*globals wp, _ */
    77867663
     
    77957672 * @augments Backbone.View
    77967673 */
    7797 var Select = require( './select.js' ),
     7674var Select = wp.media.view.Toolbar.Select,
    77987675    l10n = wp.media.view.l10n,
    77997676    Embed;
     
    78217698module.exports = Embed;
    78227699
    7823 },{"./select.js":65}],65:[function(require,module,exports){
     7700},{}],65:[function(require,module,exports){
    78247701/*globals wp, _ */
    78257702
     
    78337710 * @augments Backbone.View
    78347711 */
    7835 var Toolbar = require( '../toolbar.js' ),
     7712var Toolbar = wp.media.view.Toolbar,
    78367713    l10n = wp.media.view.l10n,
    78377714    Select;
     
    78937770module.exports = Select;
    78947771
    7895 },{"../toolbar.js":63}],66:[function(require,module,exports){
     7772},{}],66:[function(require,module,exports){
    78967773/*globals wp, _, jQuery */
    78977774
     
    79077784 * @augments Backbone.View
    79087785 */
    7909 var View = require( '../view.js' ),
     7786var View = wp.media.View,
    79107787    l10n = wp.media.view.l10n,
    79117788    $ = jQuery,
     
    81147991module.exports = EditorUploader;
    81157992
    8116 },{"../view.js":71}],67:[function(require,module,exports){
     7993},{}],67:[function(require,module,exports){
    81177994/*globals wp, _ */
    81187995
     
    81278004 * @augments Backbone.View
    81288005 */
    8129 var View = require( '../view.js' ),
    8130     UploaderStatus = require( './status.js' ),
     8006var View = wp.media.View,
    81318007    UploaderInline;
    81328008
     
    81568032
    81578033        if ( this.options.status ) {
    8158             this.views.set( '.upload-inline-status', new UploaderStatus({
     8034            this.views.set( '.upload-inline-status', new wp.media.view.UploaderStatus({
    81598035                controller: this.controller
    81608036            }) );
     
    82488124module.exports = UploaderInline;
    82498125
    8250 },{"../view.js":71,"./status.js":69}],68:[function(require,module,exports){
     8126},{}],68:[function(require,module,exports){
    82518127/*globals wp */
    82528128
     
    82598135 * @augments Backbone.View
    82608136 */
    8261 var View = require( '../view.js' ),
    8262     UploaderStatusError;
    8263 
    8264 UploaderStatusError = View.extend({
     8137var UploaderStatusError = wp.media.View.extend({
    82658138    className: 'upload-error',
    82668139    template:  wp.template('uploader-status-error')
     
    82698142module.exports = UploaderStatusError;
    82708143
    8271 },{"../view.js":71}],69:[function(require,module,exports){
     8144},{}],69:[function(require,module,exports){
    82728145/*globals wp, _ */
    82738146
     
    82828155 * @augments Backbone.View
    82838156 */
    8284 var View = require( '../view.js' ),
    8285     UploaderStatusError = require( './status-error.js' ),
     8157var View = wp.media.View,
    82868158    UploaderStatus;
    82878159
     
    83858257     */
    83868258    error: function( error ) {
    8387         this.views.add( '.upload-errors', new UploaderStatusError({
     8259        this.views.add( '.upload-errors', new wp.media.view.UploaderStatusError({
    83888260            filename: this.filename( error.get('file').name ),
    83898261            message:  error.get('message')
     
    84108282module.exports = UploaderStatus;
    84118283
    8412 },{"../view.js":71,"./status-error.js":68}],70:[function(require,module,exports){
     8284},{}],70:[function(require,module,exports){
    84138285/*globals wp, _, jQuery */
    84148286
     
    84298301 * @param {object} [options.uploader.params]
    84308302 */
    8431 var View = require( '../view.js' ),
    8432     $ = jQuery,
     8303var $ = jQuery,
    84338304    UploaderWindow;
    84348305
    8435 UploaderWindow = View.extend({
     8306UploaderWindow = wp.media.View.extend({
    84368307    tagName:   'div',
    84378308    className: 'uploader-window',
     
    85248395module.exports = UploaderWindow;
    85258396
    8526 },{"../view.js":71}],71:[function(require,module,exports){
     8397},{}],71:[function(require,module,exports){
    85278398/*globals wp */
    85288399
  • trunk/src/wp-includes/js/media/views/attachment-compat.js

    r31491 r31935  
    1111 * @augments Backbone.View
    1212 */
    13 var View = require( './view.js' ),
     13var View = wp.media.View,
    1414    AttachmentCompat;
    1515
  • trunk/src/wp-includes/js/media/views/attachment-filters.js

    r31492 r31935  
    99 * @augments Backbone.View
    1010 */
    11 var View = require( './view.js' ),
    12     $ = jQuery,
     11var $ = jQuery,
    1312    AttachmentFilters;
    1413
    15 AttachmentFilters = View.extend({
     14AttachmentFilters = wp.media.View.extend({
    1615    tagName:   'select',
    1716    className: 'attachment-filters',
  • trunk/src/wp-includes/js/media/views/attachment-filters/all.js

    r31492 r31935  
    1010 * @augments Backbone.View
    1111 */
    12 var AttachmentFilters = require( '../attachment-filters.js' ),
    13     l10n = wp.media.view.l10n,
     12var l10n = wp.media.view.l10n,
    1413    All;
    1514
    16 All = AttachmentFilters.extend({
     15All = wp.media.view.AttachmentFilters.extend({
    1716    createFilters: function() {
    1817        var filters = {};
  • trunk/src/wp-includes/js/media/views/attachment-filters/date.js

    r31491 r31935  
    1010 * @augments Backbone.View
    1111 */
    12 var AttachmentFilters = require( '../attachment-filters.js' ),
    13     l10n = wp.media.view.l10n,
     12var l10n = wp.media.view.l10n,
    1413    DateFilter;
    1514
    16 DateFilter = AttachmentFilters.extend({
     15DateFilter = wp.media.view.AttachmentFilters.extend({
    1716    id: 'media-attachment-date-filters',
    1817
  • trunk/src/wp-includes/js/media/views/attachment-filters/uploaded.js

    r31492 r31935  
    1010 * @augments Backbone.View
    1111 */
    12 var AttachmentFilters = require( '../attachment-filters.js' ),
    13     l10n = wp.media.view.l10n,
     12var l10n = wp.media.view.l10n,
    1413    Uploaded;
    1514
    16 Uploaded = AttachmentFilters.extend({
     15Uploaded = wp.media.view.AttachmentFilters.extend({
    1716    createFilters: function() {
    1817        var type = this.model.get('type'),
  • trunk/src/wp-includes/js/media/views/attachment.js

    r31619 r31935  
    99 * @augments Backbone.View
    1010 */
    11 var View = require( './view.js' ),
     11var View = wp.media.View,
    1212    $ = jQuery,
    1313    Attachment;
  • trunk/src/wp-includes/js/media/views/attachment/details.js

    r31619 r31935  
    1010 * @augments Backbone.View
    1111 */
    12 var Attachment = require( '../attachment.js' ),
     12var Attachment = wp.media.view.Attachment,
    1313    l10n = wp.media.view.l10n,
    1414    Details;
  • trunk/src/wp-includes/js/media/views/attachment/edit-library.js

    r31385 r31935  
     1/*globals wp */
     2
    13/**
    24 * wp.media.view.Attachment.EditLibrary
     
    810 * @augments Backbone.View
    911 */
    10 var Attachment = require( '../attachment.js' ),
    11     EditLibrary;
    12 
    13 EditLibrary = Attachment.extend({
     12var EditLibrary = wp.media.view.Attachment.extend({
    1413    buttons: {
    1514        close: true
  • trunk/src/wp-includes/js/media/views/attachment/edit-selection.js

    r31385 r31935  
     1/*globals wp */
     2
    13/**
    24 * wp.media.view.Attachments.EditSelection
     
    911 * @augments Backbone.View
    1012 */
    11 var Selection = require( './selection.js' ),
    12     EditSelection;
    13 
    14 EditSelection = Selection.extend({
     13var EditSelection = wp.media.view.Attachment.Selection.extend({
    1514    buttons: {
    1615        close: true
  • trunk/src/wp-includes/js/media/views/attachment/library.js

    r31385 r31935  
     1/*globals wp */
     2
    13/**
    24 * wp.media.view.Attachment.Library
     
    810 * @augments Backbone.View
    911 */
    10 var Attachment = require( '../attachment.js' ),
    11     Library;
    12 
    13 Library = Attachment.extend({
     12var Library = wp.media.view.Attachment.extend({
    1413    buttons: {
    1514        check: true
  • trunk/src/wp-includes/js/media/views/attachment/selection.js

    r31385 r31935  
     1/*globals wp */
     2
    13/**
    24 * wp.media.view.Attachment.Selection
     
    810 * @augments Backbone.View
    911 */
    10 var Attachment = require( '../attachment.js' ),
    11     Selection;
    12 
    13 Selection = Attachment.extend({
     12var Selection = wp.media.view.Attachment.extend({
    1413    className: 'attachment selection',
    1514
  • trunk/src/wp-includes/js/media/views/attachments.js

    r31492 r31935  
    99 * @augments Backbone.View
    1010 */
    11 var View = require( './view.js' ),
    12     Attachment = require( './attachment.js' ),
     11var View = wp.media.View,
    1312    $ = jQuery,
    1413    Attachments;
     
    2827            refreshSensitivity: wp.media.isTouchDevice ? 300 : 200,
    2928            refreshThreshold:   3,
    30             AttachmentView:     Attachment,
     29            AttachmentView:     wp.media.view.Attachment,
    3130            sortable:           false,
    3231            resize:             true,
  • trunk/src/wp-includes/js/media/views/attachments/browser.js

    r31491 r31935  
    2121 *                                              Accepts true, false, and 'errors'.
    2222 */
    23 var View = require( '../view.js' ),
    24     Library = require( '../attachment/library.js' ),
    25     Toolbar = require( '../toolbar.js' ),
    26     Spinner = require( '../spinner.js' ),
    27     Search = require( '../search.js' ),
    28     Label = require( '../label.js' ),
    29     Uploaded = require( '../attachment-filters/uploaded.js' ),
    30     All = require( '../attachment-filters/all.js' ),
    31     DateFilter = require( '../attachment-filters/date.js' ),
    32     UploaderInline = require( '../uploader/inline.js' ),
    33     Attachments = require( '../attachments.js' ),
    34     Sidebar = require( '../sidebar.js' ),
    35     UploaderStatus = require( '../uploader/status.js' ),
    36     Details = require( '../attachment/details.js' ),
    37     AttachmentCompat = require( '../attachment-compat.js' ),
    38     AttachmentDisplay = require( '../settings/attachment-display.js' ),
     23var View = wp.media.View,
    3924    mediaTrash = wp.media.view.settings.mediaTrash,
    4025    l10n = wp.media.view.l10n,
     
    5338            display: false,
    5439            sidebar: true,
    55             AttachmentView: Library
     40            AttachmentView: wp.media.view.Attachment.Library
    5641        });
    5742
     
    10489        * @member {wp.media.view.Toolbar}
    10590        */
    106         this.toolbar = new Toolbar( toolbarOptions );
     91        this.toolbar = new wp.media.view.Toolbar( toolbarOptions );
    10792
    10893        this.views.add( this.toolbar );
    10994
    110         this.toolbar.set( 'spinner', new Spinner({
     95        this.toolbar.set( 'spinner', new wp.media.view.Spinner({
    11196            priority: -60
    11297        }) );
     
    115100            // "Filters" will return a <select>, need to render
    116101            // screen reader text before
    117             this.toolbar.set( 'filtersLabel', new Label({
     102            this.toolbar.set( 'filtersLabel', new wp.media.view.Label({
    118103                value: l10n.filterByType,
    119104                attributes: {
     
    124109
    125110            if ( 'uploaded' === this.options.filters ) {
    126                 this.toolbar.set( 'filters', new Uploaded({
     111                this.toolbar.set( 'filters', new wp.media.view.AttachmentFilters.Uploaded({
    127112                    controller: this.controller,
    128113                    model:      this.collection.props,
     
    130115                }).render() );
    131116            } else {
    132                 Filters = new All({
     117                Filters = new wp.media.view.AttachmentFilters.All({
    133118                    controller: this.controller,
    134119                    model:      this.collection.props,
     
    155140
    156141            // DateFilter is a <select>, screen reader text needs to be rendered before
    157             this.toolbar.set( 'dateFilterLabel', new Label({
     142            this.toolbar.set( 'dateFilterLabel', new wp.media.view.Label({
    158143                value: l10n.filterByDate,
    159144                attributes: {
     
    162147                priority: -75
    163148            }).render() );
    164             this.toolbar.set( 'dateFilter', new DateFilter({
     149            this.toolbar.set( 'dateFilter', new wp.media.view.DateFilter({
    165150                controller: this.controller,
    166151                model:      this.collection.props,
     
    266251        } else if ( this.options.date ) {
    267252            // DateFilter is a <select>, screen reader text needs to be rendered before
    268             this.toolbar.set( 'dateFilterLabel', new Label({
     253            this.toolbar.set( 'dateFilterLabel', new wp.media.view.Label({
    269254                value: l10n.filterByDate,
    270255                attributes: {
     
    273258                priority: -75
    274259            }).render() );
    275             this.toolbar.set( 'dateFilter', new DateFilter({
     260            this.toolbar.set( 'dateFilter', new wp.media.view.DateFilter({
    276261                controller: this.controller,
    277262                model:      this.collection.props,
     
    282267        if ( this.options.search ) {
    283268            // Search is an input, screen reader text needs to be rendered before
    284             this.toolbar.set( 'searchLabel', new Label({
     269            this.toolbar.set( 'searchLabel', new wp.media.view.Label({
    285270                value: l10n.searchMediaLabel,
    286271                attributes: {
     
    289274                priority:   60
    290275            }).render() );
    291             this.toolbar.set( 'search', new Search({
     276            this.toolbar.set( 'search', new wp.media.view.Search({
    292277                controller: this.controller,
    293278                model:      this.collection.props,
     
    338323
    339324    createUploader: function() {
    340         this.uploader = new UploaderInline({
     325        this.uploader = new wp.media.view.UploaderInline({
    341326            controller: this.controller,
    342327            status:     false,
     
    358343
    359344    createAttachments: function() {
    360         this.attachments = new Attachments({
     345        this.attachments = new wp.media.view.Attachments({
    361346            controller:           this.controller,
    362347            collection:           this.collection,
     
    394379        var options = this.options,
    395380            selection = options.selection,
    396             sidebar = this.sidebar = new Sidebar({
     381            sidebar = this.sidebar = new wp.media.view.Sidebar({
    397382                controller: this.controller
    398383            });
     
    401386
    402387        if ( this.controller.uploader ) {
    403             sidebar.set( 'uploads', new UploaderStatus({
     388            sidebar.set( 'uploads', new wp.media.view.UploaderStatus({
    404389                controller: this.controller,
    405390                priority:   40
     
    419404            single = this.options.selection.single();
    420405
    421         sidebar.set( 'details', new Details({
     406        sidebar.set( 'details', new wp.media.view.Attachment.Details({
    422407            controller: this.controller,
    423408            model:      single,
     
    425410        }) );
    426411
    427         sidebar.set( 'compat', new AttachmentCompat({
     412        sidebar.set( 'compat', new wp.media.view.AttachmentCompat({
    428413            controller: this.controller,
    429414            model:      single,
     
    432417
    433418        if ( this.options.display ) {
    434             sidebar.set( 'display', new AttachmentDisplay({
     419            sidebar.set( 'display', new wp.media.view.Settings.AttachmentDisplay({
    435420                controller:   this.controller,
    436421                model:        this.model.display( single ),
  • trunk/src/wp-includes/js/media/views/attachments/selection.js

    r31491 r31935  
    1 /*globals _ */
     1/*globals wp, _ */
    22
    33/**
     
    1010 * @augments Backbone.View
    1111 */
    12 var Attachments = require( '../attachments.js' ),
    13     AttachmentSelection = require( '../attachment/selection.js' ),
     12var Attachments = wp.media.view.Attachments,
    1413    Selection;
    1514
     
    2221
    2322            // The single `Attachment` view to be used in the `Attachments` view.
    24             AttachmentView: AttachmentSelection
     23            AttachmentView: wp.media.view.Attachment.Selection
    2524        });
    2625        // Call 'initialize' directly on the parent class.
  • trunk/src/wp-includes/js/media/views/audio-details.js

    r31491 r31935  
    1212 * @augments Backbone.View
    1313 */
    14 var MediaDetails = require( './media-details' ),
     14var MediaDetails = wp.media.view.MediaDetails,
    1515    AudioDetails;
    1616
  • trunk/src/wp-includes/js/media/views/button-group.js

    r31618 r31935  
    99 * @augments Backbone.View
    1010 */
    11 var View = require( './view.js' ),
    12     Button = require( './button.js' ),
    13     $ = Backbone.$,
     11var $ = Backbone.$,
    1412    ButtonGroup;
    1513
    16 ButtonGroup = View.extend({
     14ButtonGroup = wp.media.View.extend({
    1715    tagName:   'div',
    1816    className: 'button-group button-large media-button-group',
     
    2624                return button;
    2725            } else {
    28                 return new Button( button ).render();
     26                return new wp.media.view.Button( button ).render();
    2927            }
    3028        });
  • trunk/src/wp-includes/js/media/views/button.js

    r31491 r31935  
    99 * @augments Backbone.View
    1010 */
    11 var View = require( './view.js' ),
    12     Button;
    13 
    14 Button = View.extend({
     11var Button = wp.media.View.extend({
    1512    tagName:    'a',
    1613    className:  'media-button',
  • trunk/src/wp-includes/js/media/views/button/delete-selected-permanently.js

    r31494 r31935  
     1/*globals wp */
     2
    13/**
    24 * wp.media.view.DeleteSelectedPermanentlyButton
     
    1214 */
    1315var Button = wp.media.view.Button,
    14     DeleteSelected = require( './delete-selected.js' ),
     16    DeleteSelected = wp.media.view.DeleteSelectedButton,
    1517    DeleteSelectedPermanently;
    1618
  • trunk/src/wp-includes/js/media/views/cropper.js

    r31491 r31935  
    1515 * @augments Backbone.View
    1616 */
    17 var View = require( './view.js' ),
    18     UploaderStatusError = require( './uploader/status-error.js' ),
    19     UploaderStatus = require( './uploader/status.js' ),
     17var View = wp.media.View,
     18    UploaderStatus = wp.media.view.UploaderStatus,
    2019    l10n = wp.media.view.l10n,
    2120    $ = jQuery,
     
    5958        var filename = this.options.attachment.get('filename');
    6059
    61         this.views.add( '.upload-errors', new UploaderStatusError({
     60        this.views.add( '.upload-errors', new wp.media.view.UploaderStatusError({
    6261            filename: UploaderStatus.prototype.filename(filename),
    6362            message: window._wpMediaViewsL10n.cropError
  • trunk/src/wp-includes/js/media/views/edit-image.js

    r31492 r31935  
    99 * @augments Backbone.View
    1010 */
    11 var View = require( './view.js' ),
     11var View = wp.media.View,
    1212    EditImage;
    1313
  • trunk/src/wp-includes/js/media/views/embed.js

    r31385 r31935  
    77 * @augments Backbone.View
    88 */
    9 var View = require( './view.js' ),
    10     EmbedImage = require( './embed/image.js' ),
    11     EmbedLink = require( './embed/link.js' ),
    12     EmbedUrl = require( './embed/url.js' ),
    13     Embed;
    14 
    15 Embed = View.extend({
     9var Embed = wp.media.View.extend({
    1610    className: 'media-embed',
    1711
     
    2014         * @member {wp.media.view.EmbedUrl}
    2115         */
    22         this.url = new EmbedUrl({
     16        this.url = new wp.media.view.EmbedUrl({
    2317            controller: this.controller,
    2418            model:      this.model.props
     
    4741
    4842        if ( 'image' === type ) {
    49             constructor = EmbedImage;
     43            constructor = wp.media.view.EmbedImage;
    5044        } else if ( 'link' === type ) {
    51             constructor = EmbedLink;
     45            constructor = wp.media.view.EmbedLink;
    5246        } else {
    5347            return;
  • trunk/src/wp-includes/js/media/views/embed/image.js

    r31492 r31935  
    1111 * @augments Backbone.View
    1212 */
    13 var AttachmentDisplay = require( '../settings/attachment-display.js' ),
     13var AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay,
    1414    EmbedImage;
    1515
  • trunk/src/wp-includes/js/media/views/embed/link.js

    r31690 r31935  
    1010 * @augments Backbone.View
    1111 */
    12 var Settings = require( '../settings.js' ),
    13     $ = jQuery,
     12var $ = jQuery,
    1413    EmbedLink;
    1514
    16 EmbedLink = Settings.extend({
     15EmbedLink = wp.media.view.Settings.extend({
    1716    className: 'embed-link-settings',
    1817    template:  wp.template('embed-link-settings'),
  • trunk/src/wp-includes/js/media/views/embed/url.js

    r31492 r31935  
    99 * @augments Backbone.View
    1010 */
    11 var View = require( '../view.js' ),
     11var View = wp.media.View,
    1212    $ = jQuery,
    1313    EmbedUrl;
  • trunk/src/wp-includes/js/media/views/focus-manager.js

    r31385 r31935  
    77 * @augments Backbone.View
    88 */
    9 var View = require( './view.js' ),
    10     FocusManager;
    11 
    12 FocusManager = View.extend({
     9var FocusManager = wp.media.View.extend({
    1310
    1411    events: {
  • trunk/src/wp-includes/js/media/views/frame.js

    r31491 r31935  
    1616 * @mixes wp.media.controller.StateMachine
    1717 */
    18 var StateMachine = require( '../controllers/state-machine.js' ),
    19     State = require( '../controllers/state.js' ),
    20     Region = require( '../controllers/region.js' ),
    21     View = require( './view.js' ),
    22     Frame;
    23 
    24 Frame = View.extend({
     18var Frame = wp.media.View.extend({
    2519    initialize: function() {
    2620        _.defaults( this.options, {
     
    3832        // Initialize regions.
    3933        _.each( this.regions, function( region ) {
    40             this[ region ] = new Region({
     34            this[ region ] = new wp.media.controller.Region({
    4135                view:     this,
    4236                id:       region,
     
    5650        // Create the default `states` collection.
    5751        this.states = new Backbone.Collection( null, {
    58             model: State
     52            model: wp.media.controller.State
    5953        });
    6054
     
    168162
    169163// Make the `Frame` a `StateMachine`.
    170 _.extend( Frame.prototype, StateMachine.prototype );
     164_.extend( Frame.prototype, wp.media.controller.StateMachine.prototype );
    171165
    172166module.exports = Frame;
  • trunk/src/wp-includes/js/media/views/frame/audio-details.js

    r31493 r31935  
    1616var MediaDetails = wp.media.view.MediaFrame.MediaDetails,
    1717    MediaLibrary = wp.media.controller.MediaLibrary,
    18    
    19     AudioDetailsView = require( '../audio-details.js' ),
    20     AudioDetailsController = require( '../../controllers/audio-details.js' ),
     18
    2119    l10n = wp.media.view.l10n,
    2220    AudioDetails;
     
    3533
    3634    initialize: function( options ) {
    37         options.DetailsView = AudioDetailsView;
     35        options.DetailsView = wp.media.view.AudioDetails;
    3836        options.cancelText = l10n.audioDetailsCancel;
    3937        options.addText = l10n.audioAddSourceTitle;
     
    5149    createStates: function() {
    5250        this.states.add([
    53             new AudioDetailsController( {
     51            new wp.media.controller.AudioDetails( {
    5452                media: this.media
    5553            } ),
  • trunk/src/wp-includes/js/media/views/frame/edit-attachments.js

    r31494 r31935  
    1919var Frame = wp.media.view.Frame,
    2020    MediaFrame = wp.media.view.MediaFrame,
    21     Modal = wp.media.view.Modal,
    22     AttachmentCompat = wp.media.view.AttachmentCompat,
    23     EditImageController = wp.media.controller.EditImage,
    24 
    25     EditAttachmentMetadata = require( '../../controllers/edit-attachment-metadata.js' ),
    26     TwoColumn = require( '../attachment/details-two-column.js' ),
    27     DetailsView = require( '../edit-image-details.js' ),
    2821
    2922    $ = jQuery,
     
    8174        // Initialize modal container view.
    8275        if ( this.options.modal ) {
    83             this.modal = new Modal({
     76            this.modal = new wp.media.view.Modal({
    8477                controller: this,
    8578                title:      this.options.title
     
    110103    createStates: function() {
    111104        this.states.add([
    112             new EditAttachmentMetadata( { model: this.model } )
     105            new wp.media.controller.EditAttachmentMetadata( { model: this.model } )
    113106        ]);
    114107    },
     
    121114     */
    122115    editMetadataMode: function( contentRegion ) {
    123         contentRegion.view = new TwoColumn({
     116        contentRegion.view = new wp.media.view.Attachment.Details.TwoColumn({
    124117            controller: this,
    125118            model:      this.model
     
    130123         * `attachment_fields_to_edit` filter.
    131124         */
    132         contentRegion.view.views.set( '.attachment-compat', new AttachmentCompat({
     125        contentRegion.view.views.set( '.attachment-compat', new wp.media.view.AttachmentCompat({
    133126            controller: this,
    134127            model:      this.model
     
    148141     */
    149142    editImageMode: function( contentRegion ) {
    150         var editImageController = new EditImageController( {
     143        var editImageController = new wp.media.controller.EditImage( {
    151144            model: this.model,
    152145            frame: this
     
    157150        editImageController._menu = function() {};
    158151
    159         contentRegion.view = new DetailsView( {
     152        contentRegion.view = new wp.media.view.EditImage.Details( {
    160153            model: this.model,
    161154            frame: this,
  • trunk/src/wp-includes/js/media/views/frame/image-details.js

    r31492 r31935  
    1616 * @mixes wp.media.controller.StateMachine
    1717 */
    18 var Select = require( './select.js' ),
    19     Toolbar = require( '../toolbar.js' ),
    20     ImageDetailsController = require( '../../controllers/image-details.js' ),
    21     ReplaceImageController = require( '../../controllers/replace-image.js' ),
    22     EditImageController = require( '../../controllers/edit-image.js' ),
    23     ImageDetailsView = require( '../image-details.js' ),
    24     EditImageView = require( '../edit-image.js' ),
     18var Select = wp.media.view.MediaFrame.Select,
    2519    l10n = wp.media.view.l10n,
    2620    ImageDetails;
     
    5650    createStates: function() {
    5751        this.states.add([
    58             new ImageDetailsController({
     52            new wp.media.controller.ImageDetails({
    5953                image: this.image,
    6054                editable: false
    6155            }),
    62             new ReplaceImageController({
     56            new wp.media.controller.ReplaceImage({
    6357                id: 'replace-image',
    6458                library: wp.media.query( { type: 'image' } ),
     
    7064                displaySettings: true
    7165            }),
    72             new EditImageController( {
     66            new wp.media.controller.EditImage( {
    7367                image: this.image,
    7468                selection: this.options.selection
     
    7872
    7973    imageDetailsContent: function( options ) {
    80         options.view = new ImageDetailsView({
     74        options.view = new wp.media.view.ImageDetails({
    8175            controller: this,
    8276            model: this.state().image,
     
    9488        }
    9589
    96         view = new EditImageView( { model: model, controller: this } ).render();
     90        view = new wp.media.view.EditImage( { model: model, controller: this } ).render();
    9791
    9892        this.content.set( view );
     
    10498
    10599    renderImageDetailsToolbar: function() {
    106         this.toolbar.set( new Toolbar({
     100        this.toolbar.set( new wp.media.view.Toolbar({
    107101            controller: this,
    108102            items: {
     
    136130            previous = lastState && lastState.id;
    137131
    138         this.toolbar.set( new Toolbar({
     132        this.toolbar.set( new wp.media.view.Toolbar({
    139133            controller: this,
    140134            items: {
  • trunk/src/wp-includes/js/media/views/frame/manage.js

    r31618 r31935  
    1717 */
    1818var MediaFrame = wp.media.view.MediaFrame,
    19     UploaderWindow = wp.media.view.UploaderWindow,
    20     AttachmentsBrowser = wp.media.view.AttachmentsBrowser,
    2119    Library = wp.media.controller.Library,
    22 
    23     Router = require( '../../routers/manage.js' ),
    2420
    2521    $ = Backbone.$,
     
    5955        // Initialize a window-wide uploader.
    6056        if ( this.options.uploader ) {
    61             this.uploader = new UploaderWindow({
     57            this.uploader = new wp.media.view.UploaderWindow({
    6258                controller: this,
    6359                uploader: {
     
    7268        }
    7369
    74         this.gridRouter = new Router();
     70        this.gridRouter = new wp.media.view.MediaFrame.Manage.Router();
    7571
    7672        // Call 'initialize' directly on the parent class.
     
    222218
    223219        // Browse our library of attachments.
    224         this.browserView = contentRegion.view = new AttachmentsBrowser({
     220        this.browserView = contentRegion.view = new wp.media.view.AttachmentsBrowser({
    225221            controller: this,
    226222            collection: state.get('library'),
  • trunk/src/wp-includes/js/media/views/frame/media-details.js

    r31493 r31935  
    1313 * @mixes wp.media.controller.StateMachine
    1414 */
    15 var View = wp.media.View,
    16     Toolbar = wp.media.view.Toolbar,
    17     Select = wp.media.view.MediaFrame.Select,
     15var Select = wp.media.view.MediaFrame.Select,
    1816    l10n = wp.media.view.l10n,
    1917    MediaDetails;
     
    7876                }
    7977            },
    80             separateCancel: new View({
     78            separateCancel: new wp.media.View({
    8179                className: 'separator',
    8280                priority: 40
     
    8785
    8886    setPrimaryButton: function(text, handler) {
    89         this.toolbar.set( new Toolbar({
     87        this.toolbar.set( new wp.media.view.Toolbar({
    9088            controller: this,
    9189            items: {
  • trunk/src/wp-includes/js/media/views/frame/post.js

    r31491 r31935  
    1515 * @mixes wp.media.controller.StateMachine
    1616 */
    17 var View = require( '../view.js' ),
    18     Select = require( './select.js' ),
    19     Library = require( '../../controllers/library.js' ),
    20     Embed = require( '../embed.js' ),
    21     EditImage = require( '../edit-image.js' ),
    22     EditSelection = require( '../attachment/edit-selection.js' ),
    23     Toolbar = require( '../toolbar.js' ),
    24     ToolbarEmbed = require( '../toolbar/embed.js' ),
    25     PlaylistSettings = require( '../settings/playlist.js' ),
    26     AttachmentsBrowser = require( '../attachments/browser.js' ),
    27     SelectionView = require( '../selection.js' ),
    28     EmbedController = require( '../../controllers/embed.js' ),
    29     EditImageController = require( '../../controllers/edit-image.js' ),
    30     GalleryEditController = require( '../../controllers/gallery-edit.js' ),
    31     GalleryAddController = require( '../../controllers/gallery-add.js' ),
    32     CollectionEditController = require( '../../controllers/collection-edit.js' ),
    33     CollectionAddController = require( '../../controllers/collection-add.js' ),
    34     FeaturedImageController = require( '../../controllers/featured-image.js' ),
     17var Select = wp.media.view.MediaFrame.Select,
     18    Library = wp.media.controller.Library,
    3519    l10n = wp.media.view.l10n,
    3620    Post;
     
    10690
    10791            // Embed states.
    108             new EmbedController( { metadata: options.metadata } ),
    109 
    110             new EditImageController( { model: options.editImage } ),
     92            new wp.media.controller.Embed( { metadata: options.metadata } ),
     93
     94            new wp.media.controller.EditImage( { model: options.editImage } ),
    11195
    11296            // Gallery states.
    113             new GalleryEditController({
     97            new wp.media.controller.GalleryEdit({
    11498                library: options.selection,
    11599                editing: options.editing,
     
    117101            }),
    118102
    119             new GalleryAddController(),
     103            new wp.media.controller.GalleryAdd(),
    120104
    121105            new Library({
     
    134118
    135119            // Playlist states.
    136             new CollectionEditController({
     120            new wp.media.controller.CollectionEdit({
    137121                type: 'audio',
    138122                collectionType: 'playlist',
    139123                title:          l10n.editPlaylistTitle,
    140                 SettingsView:   PlaylistSettings,
     124                SettingsView:   wp.media.view.Settings.Playlist,
    141125                library:        options.selection,
    142126                editing:        options.editing,
     
    146130            }),
    147131
    148             new CollectionAddController({
     132            new wp.media.controller.CollectionAdd({
    149133                type: 'audio',
    150134                collectionType: 'playlist',
     
    166150            }),
    167151
    168             new CollectionEditController({
     152            new wp.media.controller.CollectionEdit({
    169153                type: 'video',
    170154                collectionType: 'playlist',
    171155                title:          l10n.editVideoPlaylistTitle,
    172                 SettingsView:   PlaylistSettings,
     156                SettingsView:   wp.media.view.Settings.Playlist,
    173157                library:        options.selection,
    174158                editing:        options.editing,
     
    178162            }),
    179163
    180             new CollectionAddController({
     164            new wp.media.controller.CollectionAdd({
    181165                type: 'video',
    182166                collectionType: 'playlist',
     
    186170
    187171        if ( wp.media.view.settings.post.featuredImageId ) {
    188             this.states.add( new FeaturedImageController() );
     172            this.states.add( new wp.media.controller.FeaturedImage() );
    189173        }
    190174    },
     
    273257    mainMenu: function( view ) {
    274258        view.set({
    275             'library-separator': new View({
     259            'library-separator': new wp.media.View({
    276260                className: 'separator',
    277261                priority: 100
     
    312296                }
    313297            },
    314             separateCancel: new View({
     298            separateCancel: new wp.media.View({
    315299                className: 'separator',
    316300                priority: 40
     
    336320                }
    337321            },
    338             separateCancel: new View({
     322            separateCancel: new wp.media.View({
    339323                className: 'separator',
    340324                priority: 40
     
    360344                }
    361345            },
    362             separateCancel: new View({
     346            separateCancel: new wp.media.View({
    363347                className: 'separator',
    364348                priority: 40
     
    369353    // Content
    370354    embedContent: function() {
    371         var view = new Embed({
     355        var view = new wp.media.view.Embed({
    372356            controller: this,
    373357            model:      this.state()
     
    386370            view;
    387371
    388         view = new AttachmentsBrowser({
     372        view = new wp.media.view.AttachmentsBrowser({
    389373            controller: this,
    390374            collection: selection,
     
    396380            dragInfo:   true,
    397381
    398             AttachmentView: EditSelection
     382            AttachmentView: wp.media.view.Attachments.EditSelection
    399383        }).render();
    400384
     
    417401    editImageContent: function() {
    418402        var image = this.state().get('image'),
    419             view = new EditImage( { model: image, controller: this } ).render();
     403            view = new wp.media.view.EditImage( { model: image, controller: this } ).render();
    420404
    421405        this.content.set( view );
     
    434418        var editable = this.state().get('editable');
    435419
    436         view.set( 'selection', new SelectionView({
     420        view.set( 'selection', new wp.media.view.Selection({
    437421            controller: this,
    438422            collection: this.state().get('selection'),
     
    575559
    576560    mainEmbedToolbar: function( toolbar ) {
    577         toolbar.view = new ToolbarEmbed({
     561        toolbar.view = new wp.media.view.Toolbar.Embed({
    578562            controller: this
    579563        });
     
    582566    galleryEditToolbar: function() {
    583567        var editing = this.state().get('editing');
    584         this.toolbar.set( new Toolbar({
     568        this.toolbar.set( new wp.media.view.Toolbar({
    585569            controller: this,
    586570            items: {
     
    611595
    612596    galleryAddToolbar: function() {
    613         this.toolbar.set( new Toolbar({
     597        this.toolbar.set( new wp.media.view.Toolbar({
    614598            controller: this,
    615599            items: {
     
    639623    playlistEditToolbar: function() {
    640624        var editing = this.state().get('editing');
    641         this.toolbar.set( new Toolbar({
     625        this.toolbar.set( new wp.media.view.Toolbar({
    642626            controller: this,
    643627            items: {
     
    668652
    669653    playlistAddToolbar: function() {
    670         this.toolbar.set( new Toolbar({
     654        this.toolbar.set( new wp.media.view.Toolbar({
    671655            controller: this,
    672656            items: {
     
    696680    videoPlaylistEditToolbar: function() {
    697681        var editing = this.state().get('editing');
    698         this.toolbar.set( new Toolbar({
     682        this.toolbar.set( new wp.media.view.Toolbar({
    699683            controller: this,
    700684            items: {
     
    725709
    726710    videoPlaylistAddToolbar: function() {
    727         this.toolbar.set( new Toolbar({
     711        this.toolbar.set( new wp.media.view.Toolbar({
    728712            controller: this,
    729713            items: {
  • trunk/src/wp-includes/js/media/views/frame/select.js

    r31491 r31935  
    1515 */
    1616
    17 var MediaFrame = require( '../media-frame.js' ),
    18     Library = require( '../../controllers/library.js' ),
    19     AttachmentsBrowser = require( '../attachments/browser.js' ),
    20     UploaderInline = require( '../uploader/inline.js' ),
    21     ToolbarSelect = require( '../toolbar/select.js' ),
     17var MediaFrame = wp.media.view.MediaFrame,
    2218    l10n = wp.media.view.l10n,
    2319    Select;
     
    7773        this.states.add([
    7874            // Main states.
    79             new Library({
     75            new wp.media.controller.Library({
    8076                library:   wp.media.query( options.library ),
    8177                multiple:  options.multiple,
     
    128124
    129125        // Browse our library of attachments.
    130         contentRegion.view = new AttachmentsBrowser({
     126        contentRegion.view = new wp.media.view.AttachmentsBrowser({
    131127            controller: this,
    132128            collection: state.get('library'),
     
    152148    uploadContent: function() {
    153149        this.$el.removeClass( 'hide-toolbar' );
    154         this.content.set( new UploaderInline({
     150        this.content.set( new wp.media.view.UploaderInline({
    155151            controller: this
    156152        }) );
     
    168164        options.controller = this;
    169165
    170         toolbar.view = new ToolbarSelect( options );
     166        toolbar.view = new wp.media.view.Toolbar.Select( options );
    171167    }
    172168});
  • trunk/src/wp-includes/js/media/views/frame/video-details.js

    r31493 r31935  
    1616var MediaDetails = wp.media.view.MediaFrame.MediaDetails,
    1717    MediaLibrary = wp.media.controller.MediaLibrary,
    18     VideoDetailsView = require( '../video-details.js' ),
    19     VideoDetailsController = require( '../../controllers/video-details.js' ),
    2018    l10n = wp.media.view.l10n,
    2119    VideoDetails;
     
    3432
    3533    initialize: function( options ) {
    36         options.DetailsView = VideoDetailsView;
     34        options.DetailsView = wp.media.view.VideoDetails;
    3735        options.cancelText = l10n.videoDetailsCancel;
    3836        options.addText = l10n.videoAddSourceTitle;
     
    5250    createStates: function() {
    5351        this.states.add([
    54             new VideoDetailsController({
     52            new wp.media.controller.VideoDetails({
    5553                media: this.media
    5654            }),
  • trunk/src/wp-includes/js/media/views/iframe.js

    r31385 r31935  
    77 * @augments Backbone.View
    88 */
    9 var View = require( './view.js' ),
    10     Iframe;
    11 
    12 Iframe = View.extend({
     9var Iframe = wp.media.View.extend({
    1310    className: 'media-iframe',
    1411    /**
  • trunk/src/wp-includes/js/media/views/image-details.js

    r31492 r31935  
    1111 * @augments Backbone.View
    1212 */
    13 var AttachmentDisplay = require( './settings/attachment-display.js' ),
     13var AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay,
    1414    $ = jQuery,
    1515    ImageDetails;
  • trunk/src/wp-includes/js/media/views/label.js

    r31492 r31935  
    77 * @augments Backbone.View
    88 */
    9 var View = require( './view.js' ),
    10     Label;
    11 
    12 Label = View.extend({
     9var Label = wp.media.View.extend({
    1310    tagName: 'label',
    1411    className: 'screen-reader-text',
  • trunk/src/wp-includes/js/media/views/media-frame.js

    r31491 r31935  
    1313 * @mixes wp.media.controller.StateMachine
    1414 */
    15 var View = require( './view.js' ),
    16     Frame = require( './frame.js' ),
    17     Modal = require( './modal.js' ),
    18     UploaderWindow = require( './uploader/window.js' ),
    19     Menu = require( './menu.js' ),
    20     Toolbar = require( './toolbar.js' ),
    21     Router = require( './router.js' ),
    22     Iframe = require( './iframe.js' ),
     15var Frame = wp.media.view.Frame,
    2316    $ = jQuery,
    2417    MediaFrame;
     
    5043        // Initialize modal container view.
    5144        if ( this.options.modal ) {
    52             this.modal = new Modal({
     45            this.modal = new wp.media.view.Modal({
    5346                controller: this,
    5447                title:      this.options.title
     
    6659        // Initialize window-wide uploader.
    6760        if ( this.options.uploader ) {
    68             this.uploader = new UploaderWindow({
     61            this.uploader = new wp.media.view.UploaderWindow({
    6962                controller: this,
    7063                uploader: {
     
    107100     */
    108101    createTitle: function( title ) {
    109         title.view = new View({
     102        title.view = new wp.media.View({
    110103            controller: this,
    111104            tagName: 'h1'
     
    117110     */
    118111    createMenu: function( menu ) {
    119         menu.view = new Menu({
     112        menu.view = new wp.media.view.Menu({
    120113            controller: this
    121114        });
     
    131124     */
    132125    createToolbar: function( toolbar ) {
    133         toolbar.view = new Toolbar({
     126        toolbar.view = new wp.media.view.Toolbar({
    134127            controller: this
    135128        });
     
    140133     */
    141134    createRouter: function( router ) {
    142         router.view = new Router({
     135        router.view = new wp.media.view.Router({
    143136            controller: this
    144137        });
     
    187180    iframeContent: function( content ) {
    188181        this.$el.addClass('hide-toolbar');
    189         content.view = new Iframe({
     182        content.view = new wp.media.view.Iframe({
    190183            controller: this
    191184        });
  • trunk/src/wp-includes/js/media/views/menu-item.js

    r31492 r31935  
    99 * @augments Backbone.View
    1010 */
    11 var View = require( './view.js' ),
    12     $ = jQuery,
     11var $ = jQuery,
    1312    MenuItem;
    1413
    15 MenuItem = View.extend({
     14MenuItem = wp.media.View.extend({
    1615    tagName:   'a',
    1716    className: 'media-menu-item',
  • trunk/src/wp-includes/js/media/views/menu.js

    r31385 r31935  
    88 * @augments Backbone.View
    99 */
    10 var MenuItem = require( './menu-item.js' ),
    11     PriorityList = require( './priority-list.js' ),
     10var MenuItem = wp.media.view.MenuItem,
     11    PriorityList = wp.media.view.PriorityList,
    1212    Menu;
    1313
  • trunk/src/wp-includes/js/media/views/modal.js

    r31492 r31935  
    1111 * @augments Backbone.View
    1212 */
    13 var View = require( './view.js' ),
    14     FocusManager = require( './focus-manager.js' ),
    15     $ = jQuery,
     13var $ = jQuery,
    1614    Modal;
    1715
    18 Modal = View.extend({
     16Modal = wp.media.View.extend({
    1917    tagName:  'div',
    2018    template: wp.template('media-modal'),
     
    3735        });
    3836
    39         this.focusManager = new FocusManager({
     37        this.focusManager = new wp.media.view.FocusManager({
    4038            el: this.el
    4139        });
  • trunk/src/wp-includes/js/media/views/priority-list.js

    r31491 r31935  
    99 * @augments Backbone.View
    1010 */
    11 var View = require( './view.js' ),
    12     PriorityList;
    13 
    14 PriorityList = View.extend({
     11var PriorityList = wp.media.View.extend({
    1512    tagName:   'div',
    1613
     
    9491     */
    9592    toView: function( options ) {
    96         return new View( options );
     93        return new wp.media.View( options );
    9794    }
    9895});
  • trunk/src/wp-includes/js/media/views/router-item.js

    r31385 r31935  
    88 * @augments Backbone.View
    99 */
    10 var MenuItem = require( './menu-item.js' ),
    11     RouterItem;
    12 
    13 RouterItem = MenuItem.extend({
     10var RouterItem = wp.media.view.MenuItem.extend({
    1411    /**
    1512     * On click handler to activate the content region's corresponding mode.
  • trunk/src/wp-includes/js/media/views/router.js

    r31385 r31935  
     1/*globals wp */
     2
    13/**
    24 * wp.media.view.Router
     
    911 * @augments Backbone.View
    1012 */
    11 var Menu = require( './menu.js' ),
    12     RouterItem = require( './router-item.js' ),
     13var Menu = wp.media.view.Menu,
    1314    Router;
    1415
     
    1718    className: 'media-router',
    1819    property:  'contentMode',
    19     ItemView:  RouterItem,
     20    ItemView:  wp.media.view.RouterItem,
    2021    region:    'router',
    2122
  • trunk/src/wp-includes/js/media/views/search.js

    r31492 r31935  
    99 * @augments Backbone.View
    1010 */
    11 var View = require( './view.js' ),
    12     l10n = wp.media.view.l10n,
     11var l10n = wp.media.view.l10n,
    1312    Search;
    1413
    15 Search = View.extend({
     14Search = wp.media.View.extend({
    1615    tagName:   'input',
    1716    className: 'search',
  • trunk/src/wp-includes/js/media/views/selection.js

    r31491 r31935  
    99 * @augments Backbone.View
    1010 */
    11 var View = require( './view.js' ),
    12     AttachmentsSelection = require( './attachments/selection.js' ),
    13     l10n = wp.media.view.l10n,
     11var l10n = wp.media.view.l10n,
    1412    Selection;
    1513
    16 Selection = View.extend({
     14Selection = wp.media.View.extend({
    1715    tagName:   'div',
    1816    className: 'media-selection',
     
    3331         * @member {wp.media.view.Attachments.Selection}
    3432         */
    35         this.attachments = new AttachmentsSelection({
     33        this.attachments = new wp.media.view.Attachments.Selection({
    3634            controller: this.controller,
    3735            collection: this.collection,
  • trunk/src/wp-includes/js/media/views/settings.js

    r31618 r31935  
    99 * @augments Backbone.View
    1010 */
    11 var View = require( './view.js' ),
     11var View = wp.media.View,
    1212    $ = Backbone.$,
    1313    Settings;
  • trunk/src/wp-includes/js/media/views/settings/attachment-display.js

    r31491 r31935  
    1010 * @augments Backbone.View
    1111 */
    12 var Settings = require( '../settings.js' ),
     12var Settings = wp.media.view.Settings,
    1313    AttachmentDisplay;
    1414
  • trunk/src/wp-includes/js/media/views/settings/gallery.js

    r31492 r31935  
    1010 * @augments Backbone.View
    1111 */
    12 var Settings = require( '../settings.js' ),
    13     Gallery;
    14 
    15 Gallery = Settings.extend({
     12var Gallery = wp.media.view.Settings.extend({
    1613    className: 'collection-settings gallery-settings',
    1714    template:  wp.template('gallery-settings')
  • trunk/src/wp-includes/js/media/views/settings/playlist.js

    r31492 r31935  
    1010 * @augments Backbone.View
    1111 */
    12 var Settings = require( '../settings.js' ),
    13     Playlist;
    14 
    15 Playlist = Settings.extend({
     12var Playlist = wp.media.view.Settings.extend({
    1613    className: 'collection-settings playlist-settings',
    1714    template:  wp.template('playlist-settings')
  • trunk/src/wp-includes/js/media/views/sidebar.js

    r31385 r31935  
    88 * @augments Backbone.View
    99 */
    10 var PriorityList = require( './priority-list.js' ),
    11     Sidebar;
    12 
    13 Sidebar = PriorityList.extend({
     10var Sidebar = wp.media.view.PriorityList.extend({
    1411    className: 'media-sidebar'
    1512});
  • trunk/src/wp-includes/js/media/views/spinner.js

    r31491 r31935  
    99 * @augments Backbone.View
    1010 */
    11 var View = require( './view.js' ),
    12     Spinner;
    13 
    14 Spinner = View.extend({
     11var Spinner = wp.media.View.extend({
    1512    tagName:   'span',
    1613    className: 'spinner',
  • trunk/src/wp-includes/js/media/views/toolbar.js

    r31491 r31935  
    1212 * @augments Backbone.View
    1313 */
    14 var View = require( './view.js' ),
    15     Button = require( './button.js' ),
    16     PriorityList = require( './priority-list.js' ),
     14var View = wp.media.View,
    1715    Toolbar;
    1816
     
    2927
    3028        // The toolbar is composed of two `PriorityList` views.
    31         this.primary   = new PriorityList();
    32         this.secondary = new PriorityList();
     29        this.primary   = new wp.media.view.PriorityList();
     30        this.secondary = new wp.media.view.PriorityList();
    3331        this.primary.$el.addClass('media-toolbar-primary search-form');
    3432        this.secondary.$el.addClass('media-toolbar-secondary');
     
    9290            if ( ! ( view instanceof Backbone.View ) ) {
    9391                view.classes = [ 'media-button-' + id ].concat( view.classes || [] );
    94                 view = new Button( view ).render();
     92                view = new wp.media.view.Button( view ).render();
    9593            }
    9694
  • trunk/src/wp-includes/js/media/views/toolbar/embed.js

    r31491 r31935  
    1111 * @augments Backbone.View
    1212 */
    13 var Select = require( './select.js' ),
     13var Select = wp.media.view.Toolbar.Select,
    1414    l10n = wp.media.view.l10n,
    1515    Embed;
  • trunk/src/wp-includes/js/media/views/toolbar/select.js

    r31491 r31935  
    1010 * @augments Backbone.View
    1111 */
    12 var Toolbar = require( '../toolbar.js' ),
     12var Toolbar = wp.media.view.Toolbar,
    1313    l10n = wp.media.view.l10n,
    1414    Select;
  • trunk/src/wp-includes/js/media/views/uploader/editor.js

    r31491 r31935  
    1212 * @augments Backbone.View
    1313 */
    14 var View = require( '../view.js' ),
     14var View = wp.media.View,
    1515    l10n = wp.media.view.l10n,
    1616    $ = jQuery,
  • trunk/src/wp-includes/js/media/views/uploader/inline.js

    r31491 r31935  
    1111 * @augments Backbone.View
    1212 */
    13 var View = require( '../view.js' ),
    14     UploaderStatus = require( './status.js' ),
     13var View = wp.media.View,
    1514    UploaderInline;
    1615
     
    4039
    4140        if ( this.options.status ) {
    42             this.views.set( '.upload-inline-status', new UploaderStatus({
     41            this.views.set( '.upload-inline-status', new wp.media.view.UploaderStatus({
    4342                controller: this.controller
    4443            }) );
  • trunk/src/wp-includes/js/media/views/uploader/status-error.js

    r31492 r31935  
    99 * @augments Backbone.View
    1010 */
    11 var View = require( '../view.js' ),
    12     UploaderStatusError;
    13 
    14 UploaderStatusError = View.extend({
     11var UploaderStatusError = wp.media.View.extend({
    1512    className: 'upload-error',
    1613    template:  wp.template('uploader-status-error')
  • trunk/src/wp-includes/js/media/views/uploader/status.js

    r31491 r31935  
    1111 * @augments Backbone.View
    1212 */
    13 var View = require( '../view.js' ),
    14     UploaderStatusError = require( './status-error.js' ),
     13var View = wp.media.View,
    1514    UploaderStatus;
    1615
     
    114113     */
    115114    error: function( error ) {
    116         this.views.add( '.upload-errors', new UploaderStatusError({
     115        this.views.add( '.upload-errors', new wp.media.view.UploaderStatusError({
    117116            filename: this.filename( error.get('file').name ),
    118117            message:  error.get('message')
  • trunk/src/wp-includes/js/media/views/uploader/window.js

    r31491 r31935  
    1717 * @param {object} [options.uploader.params]
    1818 */
    19 var View = require( '../view.js' ),
    20     $ = jQuery,
     19var $ = jQuery,
    2120    UploaderWindow;
    2221
    23 UploaderWindow = View.extend({
     22UploaderWindow = wp.media.View.extend({
    2423    tagName:   'div',
    2524    className: 'uploader-window',
  • trunk/src/wp-includes/js/media/views/video-details.js

    r31491 r31935  
    1212 * @augments Backbone.View
    1313 */
    14 var MediaDetails = require( './media-details' ),
     14var MediaDetails = wp.media.view.MediaDetails,
    1515    VideoDetails;
    1616
Note: See TracChangeset for help on using the changeset viewer.