Changeset 31935
- Timestamp:
- 03/31/2015 02:02:35 AM (10 years ago)
- 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 346 346 * @augments Backbone.View 347 347 */ 348 var MediaDetails = require( './media-details' ),348 var MediaDetails = wp.media.view.MediaDetails, 349 349 AudioDetails; 350 350 … … 372 372 module.exports = AudioDetails; 373 373 374 },{ "./media-details":9}],6:[function(require,module,exports){374 },{}],6:[function(require,module,exports){ 375 375 /*globals wp */ 376 376 … … 390 390 var MediaDetails = wp.media.view.MediaFrame.MediaDetails, 391 391 MediaLibrary = wp.media.controller.MediaLibrary, 392 393 AudioDetailsView = require( '../audio-details.js' ), 394 AudioDetailsController = require( '../../controllers/audio-details.js' ), 392 395 393 l10n = wp.media.view.l10n, 396 394 AudioDetails; … … 409 407 410 408 initialize: function( options ) { 411 options.DetailsView = AudioDetailsView;409 options.DetailsView = wp.media.view.AudioDetails; 412 410 options.cancelText = l10n.audioDetailsCancel; 413 411 options.addText = l10n.audioAddSourceTitle; … … 425 423 createStates: function() { 426 424 this.states.add([ 427 new AudioDetailsController( {425 new wp.media.controller.AudioDetails( { 428 426 media: this.media 429 427 } ), … … 452 450 module.exports = AudioDetails; 453 451 454 },{ "../../controllers/audio-details.js":2,"../audio-details.js":5}],7:[function(require,module,exports){452 },{}],7:[function(require,module,exports){ 455 453 /*globals wp */ 456 454 … … 467 465 * @mixes wp.media.controller.StateMachine 468 466 */ 469 var View = wp.media.View, 470 Toolbar = wp.media.view.Toolbar, 471 Select = wp.media.view.MediaFrame.Select, 467 var Select = wp.media.view.MediaFrame.Select, 472 468 l10n = wp.media.view.l10n, 473 469 MediaDetails; … … 532 528 } 533 529 }, 534 separateCancel: new View({530 separateCancel: new wp.media.View({ 535 531 className: 'separator', 536 532 priority: 40 … … 541 537 542 538 setPrimaryButton: function(text, handler) { 543 this.toolbar.set( new Toolbar({539 this.toolbar.set( new wp.media.view.Toolbar({ 544 540 controller: this, 545 541 items: { … … 604 600 var MediaDetails = wp.media.view.MediaFrame.MediaDetails, 605 601 MediaLibrary = wp.media.controller.MediaLibrary, 606 VideoDetailsView = require( '../video-details.js' ),607 VideoDetailsController = require( '../../controllers/video-details.js' ),608 602 l10n = wp.media.view.l10n, 609 603 VideoDetails; … … 622 616 623 617 initialize: function( options ) { 624 options.DetailsView = VideoDetailsView;618 options.DetailsView = wp.media.view.VideoDetails; 625 619 options.cancelText = l10n.videoDetailsCancel; 626 620 options.addText = l10n.videoAddSourceTitle; … … 640 634 createStates: function() { 641 635 this.states.add([ 642 new VideoDetailsController({636 new wp.media.controller.VideoDetails({ 643 637 media: this.media 644 638 }), … … 725 719 module.exports = VideoDetails; 726 720 727 },{ "../../controllers/video-details.js":3,"../video-details.js":10}],9:[function(require,module,exports){721 },{}],9:[function(require,module,exports){ 728 722 /*global wp, jQuery, _, MediaElementPlayer */ 729 723 … … 907 901 * @augments Backbone.View 908 902 */ 909 var MediaDetails = require( './media-details' ),903 var MediaDetails = wp.media.view.MediaDetails, 910 904 VideoDetails; 911 905 … … 938 932 module.exports = VideoDetails; 939 933 940 },{ "./media-details":9}]},{},[1]);934 },{}]},{},[1]); -
trunk/src/wp-includes/js/media/controllers/collection-add.js
r31491 r31935 35 35 */ 36 36 var Selection = wp.media.model.Selection, 37 Library = require( './library.js' ),37 Library = wp.media.controller.Library, 38 38 CollectionAdd; 39 39 -
trunk/src/wp-includes/js/media/controllers/collection-edit.js
r31491 r31935 35 35 * @param {string} attributes.collectionType The collection type. (e.g. 'playlist'). 36 36 */ 37 var Library = require( './library.js' ), 38 View = require( '../views/view.js' ), 39 EditLibraryView = require( '../views/attachment/edit-library.js' ), 37 var Library = wp.media.controller.Library, 40 38 l10n = wp.media.view.l10n, 41 39 $ = jQuery, … … 76 74 // The single `Attachment` view to be used in the `Attachments` view. 77 75 if ( ! this.get('AttachmentView') ) { 78 this.set( 'AttachmentView', EditLibraryView);76 this.set( 'AttachmentView', wp.media.view.Attachment.EditLibrary ); 79 77 } 80 78 Library.prototype.initialize.apply( this, arguments ); … … 142 140 143 141 if ( dragInfoText ) { 144 attachmentsBrowserView.toolbar.set( 'dragInfo', new View({142 attachmentsBrowserView.toolbar.set( 'dragInfo', new wp.media.View({ 145 143 el: $( '<div class="instructions">' + dragInfoText + '</div>' )[0], 146 144 priority: -40 -
trunk/src/wp-includes/js/media/controllers/cropper.js
r31491 r31935 10 10 * @augments Backbone.Model 11 11 */ 12 var State = require( './state.js' ), 13 ToolbarView = require( '../views/toolbar.js' ), 14 CropperView = require( '../views/cropper.js' ), 15 l10n = wp.media.view.l10n, 12 var l10n = wp.media.view.l10n, 16 13 Cropper; 17 14 18 Cropper = State.extend({15 Cropper = wp.media.controller.State.extend({ 19 16 defaults: { 20 17 id: 'cropper', … … 39 36 40 37 createCropContent: function() { 41 this.cropperView = new CropperView({38 this.cropperView = new wp.media.view.Cropper({ 42 39 controller: this, 43 40 attachment: this.get('selection').first() … … 105 102 } 106 103 107 this.frame.toolbar.set( new ToolbarView(toolbarOptions) );104 this.frame.toolbar.set( new wp.media.view.Toolbar(toolbarOptions) ); 108 105 }, 109 106 -
trunk/src/wp-includes/js/media/controllers/edit-attachment-metadata.js
r31494 r31935 10 10 * @augments Backbone.Model 11 11 */ 12 var State = wp.media.controller.State, 13 l10n = wp.media.view.l10n, 12 var l10n = wp.media.view.l10n, 14 13 EditAttachmentMetadata; 15 14 16 EditAttachmentMetadata = State.extend({15 EditAttachmentMetadata = wp.media.controller.State.extend({ 17 16 defaults: { 18 17 id: 'edit-attachment', -
trunk/src/wp-includes/js/media/controllers/edit-image.js
r31492 r31935 19 19 * @param {string} [attributes.url] Unused. @todo Consider removal. 20 20 */ 21 var State = require( './state.js' ), 22 ToolbarView = require( '../views/toolbar.js' ), 23 l10n = wp.media.view.l10n, 21 var l10n = wp.media.view.l10n, 24 22 EditImage; 25 23 26 EditImage = State.extend({24 EditImage = wp.media.controller.State.extend({ 27 25 defaults: { 28 26 id: 'edit-image', … … 56 54 previous = lastState && lastState.id; 57 55 58 frame.toolbar.set( new ToolbarView({56 frame.toolbar.set( new wp.media.view.Toolbar({ 59 57 controller: frame, 60 58 items: { -
trunk/src/wp-includes/js/media/controllers/embed.js
r31618 r31935 22 22 * @param {object} [attributes.metadata={}] Properties of the embed, which will override attributes.url if set. 23 23 */ 24 var State = require( './state.js' ), 25 l10n = wp.media.view.l10n, 24 var l10n = wp.media.view.l10n, 26 25 $ = Backbone.$, 27 26 Embed; 28 27 29 Embed = State.extend({28 Embed = wp.media.controller.State.extend({ 30 29 defaults: { 31 30 id: 'embed', -
trunk/src/wp-includes/js/media/controllers/featured-image.js
r31491 r31935 33 33 */ 34 34 var Attachment = wp.media.model.Attachment, 35 Library = require( './library.js' ),35 Library = wp.media.controller.Library, 36 36 l10n = wp.media.view.l10n, 37 37 FeaturedImage; -
trunk/src/wp-includes/js/media/controllers/gallery-add.js
r31492 r31935 33 33 */ 34 34 var Selection = wp.media.model.Selection, 35 Library = require( './library.js' ),35 Library = wp.media.controller.Library, 36 36 l10n = wp.media.view.l10n, 37 37 GalleryAdd; -
trunk/src/wp-includes/js/media/controllers/gallery-edit.js
r31492 r31935 32 32 * If none supplied, defaults to wp.media.view.Attachment.EditLibrary. 33 33 */ 34 var Library = require( './library.js' ), 35 EditLibraryView = require( '../views/attachment/edit-library.js' ), 36 GallerySettingsView = require( '../views/settings/gallery.js' ), 34 var Library = wp.media.controller.Library, 37 35 l10n = wp.media.view.l10n, 38 36 GalleryEdit; … … 68 66 // The single `Attachment` view to be used in the `Attachments` view. 69 67 if ( ! this.get('AttachmentView') ) { 70 this.set( 'AttachmentView', EditLibraryView);68 this.set( 'AttachmentView', wp.media.view.Attachment.EditLibrary ); 71 69 } 72 70 … … 122 120 123 121 browser.sidebar.set({ 124 gallery: new GallerySettingsView({122 gallery: new wp.media.view.Settings.Gallery({ 125 123 controller: this, 126 124 model: library.gallery, -
trunk/src/wp-includes/js/media/controllers/image-details.js
r31491 r31935 25 25 * however this may not do anything. 26 26 */ 27 var State = require( './state.js' ),28 Library = require( './library.js' ),27 var State = wp.media.controller.State, 28 Library = wp.media.controller.Library, 29 29 l10n = wp.media.view.l10n, 30 30 ImageDetails; -
trunk/src/wp-includes/js/media/controllers/library.js
r31491 r31935 35 35 * @param {boolean} [attributes.syncSelection=true] Whether the Attachments selection should be persisted from the last state. 36 36 */ 37 var selectionSync = require( '../utils/selection-sync.js' ), 38 State = require( './state.js' ), 39 l10n = wp.media.view.l10n, 37 var l10n = wp.media.view.l10n, 40 38 getUserSetting = window.getUserSetting, 41 39 setUserSetting = window.setUserSetting, 42 40 Library; 43 41 44 Library = State.extend({42 Library = wp.media.controller.State.extend({ 45 43 defaults: { 46 44 id: 'library', … … 270 268 271 269 // Make selectionSync available on any Media Library state. 272 _.extend( Library.prototype, selectionSync );270 _.extend( Library.prototype, wp.media.selectionSync ); 273 271 274 272 module.exports = Library; -
trunk/src/wp-includes/js/media/controllers/media-library.js
r31491 r31935 9 9 * @augments Backbone.Model 10 10 */ 11 var Library = require( './library.js' ),11 var Library = wp.media.controller.Library, 12 12 MediaLibrary; 13 13 -
trunk/src/wp-includes/js/media/controllers/replace-image.js
r31491 r31935 32 32 * @param {boolean} [attributes.syncSelection=true] Whether the Attachments selection should be persisted from the last state. 33 33 */ 34 var Library = require( './library.js' ),34 var Library = wp.media.controller.Library, 35 35 l10n = wp.media.view.l10n, 36 36 ReplaceImage; -
trunk/src/wp-includes/js/media/grid.js
r31618 r31935 11 11 * @augments Backbone.Model 12 12 */ 13 var State = wp.media.controller.State, 14 l10n = wp.media.view.l10n, 13 var l10n = wp.media.view.l10n, 15 14 EditAttachmentMetadata; 16 15 17 EditAttachmentMetadata = State.extend({16 EditAttachmentMetadata = wp.media.controller.State.extend({ 18 17 defaults: { 19 18 id: 'edit-attachment', … … 141 140 142 141 },{}],5:[function(require,module,exports){ 142 /*globals wp */ 143 143 144 /** 144 145 * wp.media.view.DeleteSelectedPermanentlyButton … … 154 155 */ 155 156 var Button = wp.media.view.Button, 156 DeleteSelected = require( './delete-selected.js' ),157 DeleteSelected = wp.media.view.DeleteSelectedButton, 157 158 DeleteSelectedPermanently; 158 159 … … 187 188 module.exports = DeleteSelectedPermanently; 188 189 189 },{ "./delete-selected.js":6}],6:[function(require,module,exports){190 },{}],6:[function(require,module,exports){ 190 191 /*globals wp */ 191 192 … … 366 367 var Frame = wp.media.view.Frame, 367 368 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' ),375 369 376 370 $ = jQuery, … … 428 422 // Initialize modal container view. 429 423 if ( this.options.modal ) { 430 this.modal = new Modal({424 this.modal = new wp.media.view.Modal({ 431 425 controller: this, 432 426 title: this.options.title … … 457 451 createStates: function() { 458 452 this.states.add([ 459 new EditAttachmentMetadata( { model: this.model } )453 new wp.media.controller.EditAttachmentMetadata( { model: this.model } ) 460 454 ]); 461 455 }, … … 468 462 */ 469 463 editMetadataMode: function( contentRegion ) { 470 contentRegion.view = new TwoColumn({464 contentRegion.view = new wp.media.view.Attachment.Details.TwoColumn({ 471 465 controller: this, 472 466 model: this.model … … 477 471 * `attachment_fields_to_edit` filter. 478 472 */ 479 contentRegion.view.views.set( '.attachment-compat', new AttachmentCompat({473 contentRegion.view.views.set( '.attachment-compat', new wp.media.view.AttachmentCompat({ 480 474 controller: this, 481 475 model: this.model … … 495 489 */ 496 490 editImageMode: function( contentRegion ) { 497 var editImageController = new EditImageController( {491 var editImageController = new wp.media.controller.EditImage( { 498 492 model: this.model, 499 493 frame: this … … 504 498 editImageController._menu = function() {}; 505 499 506 contentRegion.view = new DetailsView( {500 contentRegion.view = new wp.media.view.EditImage.Details( { 507 501 model: this.model, 508 502 frame: this, … … 597 591 module.exports = EditAttachments; 598 592 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){ 600 594 /*globals wp, _, Backbone */ 601 595 … … 616 610 */ 617 611 var MediaFrame = wp.media.view.MediaFrame, 618 UploaderWindow = wp.media.view.UploaderWindow,619 AttachmentsBrowser = wp.media.view.AttachmentsBrowser,620 612 Library = wp.media.controller.Library, 621 622 Router = require( '../../routers/manage.js' ),623 613 624 614 $ = Backbone.$, … … 658 648 // Initialize a window-wide uploader. 659 649 if ( this.options.uploader ) { 660 this.uploader = new UploaderWindow({650 this.uploader = new wp.media.view.UploaderWindow({ 661 651 controller: this, 662 652 uploader: { … … 671 661 } 672 662 673 this.gridRouter = new Router();663 this.gridRouter = new wp.media.view.MediaFrame.Manage.Router(); 674 664 675 665 // Call 'initialize' directly on the parent class. … … 821 811 822 812 // Browse our library of attachments. 823 this.browserView = contentRegion.view = new AttachmentsBrowser({813 this.browserView = contentRegion.view = new wp.media.view.AttachmentsBrowser({ 824 814 controller: this, 825 815 collection: state.get('library'), … … 871 861 module.exports = Manage; 872 862 873 },{ "../../routers/manage.js":3}]},{},[2]);863 },{}]},{},[2]); -
trunk/src/wp-includes/js/media/models.js
r31618 r31935 59 59 delete l10n.settings; 60 60 61 Attachment = media.model.Attachment = require( './models/attachment.js' ); 61 62 Attachments = media.model.Attachments = require( './models/attachments.js' ); 62 Attachment = media.model.Attachment = require( './models/attachment.js' );63 63 64 64 media.model.Query = require( './models/query.js' ); … … 380 380 */ 381 381 create: function( attrs ) { 382 var Attachments = require( './attachments.js' );382 var Attachments = wp.media.model.Attachments; 383 383 return Attachments.all.push( attrs ); 384 384 }, … … 395 395 */ 396 396 get: _.memoize( function( id, attachment ) { 397 var Attachments = require( './attachments.js' );397 var Attachments = wp.media.model.Attachments; 398 398 return Attachments.all.push( attachment || { id: id } ); 399 399 }) … … 402 402 module.exports = Attachment; 403 403 404 },{ "./attachments.js":3}],3:[function(require,module,exports){404 },{}],3:[function(require,module,exports){ 405 405 /*globals wp, _, Backbone */ 406 406 … … 427 427 * 428 428 */ 429 var Attachment = require( './attachment.js' ), 430 Attachments; 431 432 Attachments = Backbone.Collection.extend({ 429 var Attachments = Backbone.Collection.extend({ 433 430 /** 434 431 * @type {wp.media.model.Attachment} 435 432 */ 436 model: Attachment,433 model: wp.media.model.Attachment, 437 434 /** 438 435 * @param {Array} [models=[]] Array of models used to populate the collection. … … 772 769 } 773 770 774 attachment = Attachment.get( id );771 attachment = wp.media.model.Attachment.get( id ); 775 772 newAttributes = attachment.parse( attrs, xhr ); 776 773 … … 788 785 */ 789 786 _requery: function( refresh ) { 790 var props , Query;787 var props; 791 788 if ( this.props.get('query') ) { 792 Query = require( './query.js' );793 789 props = this.props.toJSON(); 794 790 props.cache = ( true !== refresh ); 795 this.mirror( Query.get( props ) );791 this.mirror( wp.media.model.Query.get( props ) ); 796 792 } 797 793 }, … … 940 936 module.exports = Attachments; 941 937 942 },{ "./attachment.js":2,"./query.js":5}],4:[function(require,module,exports){938 },{}],4:[function(require,module,exports){ 943 939 /*globals Backbone */ 944 940 … … 956 952 * @param {int} [attributes.attachment_id] ID of the attachment. 957 953 **/ 958 var Attachment = require( './attachment' ), 959 PostImage; 960 961 PostImage = Backbone.Model.extend({ 954 var PostImage = Backbone.Model.extend({ 962 955 963 956 initialize: function( attributes ) { 957 var Attachment = wp.media.model.Attachment; 964 958 this.attachment = false; 965 959 … … 1098 1092 module.exports = PostImage; 1099 1093 1100 },{ "./attachment":2}],5:[function(require,module,exports){1094 },{}],5:[function(require,module,exports){ 1101 1095 /*globals wp, _ */ 1102 1096 … … 1118 1112 * @param {object} [options.args.posts_per_page] 1119 1113 */ 1120 var Attachments = require( './attachments.js' ),1114 var Attachments = wp.media.model.Attachments, 1121 1115 Query; 1122 1116 … … 1408 1402 module.exports = Query; 1409 1403 1410 },{ "./attachments.js":3}],6:[function(require,module,exports){1411 /*globals _ */1404 },{}],6:[function(require,module,exports){ 1405 /*globals wp, _ */ 1412 1406 1413 1407 /** … … 1420 1414 * @augments Backbone.Collection 1421 1415 */ 1422 var Attachments = require( './attachments.js' ),1416 var Attachments = wp.media.model.Attachments, 1423 1417 Selection; 1424 1418 … … 1507 1501 module.exports = Selection; 1508 1502 1509 },{ "./attachments.js":3}]},{},[1]);1503 },{}]},{},[1]); -
trunk/src/wp-includes/js/media/models.manifest.js
r31491 r31935 58 58 delete l10n.settings; 59 59 60 Attachment = media.model.Attachment = require( './models/attachment.js' ); 60 61 Attachments = media.model.Attachments = require( './models/attachments.js' ); 61 Attachment = media.model.Attachment = require( './models/attachment.js' );62 62 63 63 media.model.Query = require( './models/query.js' ); -
trunk/src/wp-includes/js/media/models/attachment.js
r31618 r31935 146 146 */ 147 147 create: function( attrs ) { 148 var Attachments = require( './attachments.js' );148 var Attachments = wp.media.model.Attachments; 149 149 return Attachments.all.push( attrs ); 150 150 }, … … 161 161 */ 162 162 get: _.memoize( function( id, attachment ) { 163 var Attachments = require( './attachments.js' );163 var Attachments = wp.media.model.Attachments; 164 164 return Attachments.all.push( attachment || { id: id } ); 165 165 }) -
trunk/src/wp-includes/js/media/models/attachments.js
r31491 r31935 23 23 * 24 24 */ 25 var Attachment = require( './attachment.js' ), 26 Attachments; 27 28 Attachments = Backbone.Collection.extend({ 25 var Attachments = Backbone.Collection.extend({ 29 26 /** 30 27 * @type {wp.media.model.Attachment} 31 28 */ 32 model: Attachment,29 model: wp.media.model.Attachment, 33 30 /** 34 31 * @param {Array} [models=[]] Array of models used to populate the collection. … … 368 365 } 369 366 370 attachment = Attachment.get( id );367 attachment = wp.media.model.Attachment.get( id ); 371 368 newAttributes = attachment.parse( attrs, xhr ); 372 369 … … 384 381 */ 385 382 _requery: function( refresh ) { 386 var props , Query;383 var props; 387 384 if ( this.props.get('query') ) { 388 Query = require( './query.js' );389 385 props = this.props.toJSON(); 390 386 props.cache = ( true !== refresh ); 391 this.mirror( Query.get( props ) );387 this.mirror( wp.media.model.Query.get( props ) ); 392 388 } 393 389 }, -
trunk/src/wp-includes/js/media/models/post-image.js
r31491 r31935 14 14 * @param {int} [attributes.attachment_id] ID of the attachment. 15 15 **/ 16 var Attachment = require( './attachment' ), 17 PostImage; 18 19 PostImage = Backbone.Model.extend({ 16 var PostImage = Backbone.Model.extend({ 20 17 21 18 initialize: function( attributes ) { 19 var Attachment = wp.media.model.Attachment; 22 20 this.attachment = false; 23 21 -
trunk/src/wp-includes/js/media/models/query.js
r31491 r31935 18 18 * @param {object} [options.args.posts_per_page] 19 19 */ 20 var Attachments = require( './attachments.js' ),20 var Attachments = wp.media.model.Attachments, 21 21 Query; 22 22 -
trunk/src/wp-includes/js/media/models/selection.js
r31491 r31935 1 /*globals _ */1 /*globals wp, _ */ 2 2 3 3 /** … … 10 10 * @augments Backbone.Collection 11 11 */ 12 var Attachments = require( './attachments.js' ),12 var Attachments = wp.media.model.Attachments, 13 13 Selection; 14 14 -
trunk/src/wp-includes/js/media/views.js
r31690 r31935 36 36 */ 37 37 var Selection = wp.media.model.Selection, 38 Library = require( './library.js' ),38 Library = wp.media.controller.Library, 39 39 CollectionAdd; 40 40 … … 102 102 module.exports = CollectionAdd; 103 103 104 },{ "./library.js":10}],2:[function(require,module,exports){104 },{}],2:[function(require,module,exports){ 105 105 /*globals wp, Backbone */ 106 106 … … 139 139 * @param {string} attributes.collectionType The collection type. (e.g. 'playlist'). 140 140 */ 141 var Library = require( './library.js' ), 142 View = require( '../views/view.js' ), 143 EditLibraryView = require( '../views/attachment/edit-library.js' ), 141 var Library = wp.media.controller.Library, 144 142 l10n = wp.media.view.l10n, 145 143 $ = jQuery, … … 180 178 // The single `Attachment` view to be used in the `Attachments` view. 181 179 if ( ! this.get('AttachmentView') ) { 182 this.set( 'AttachmentView', EditLibraryView);180 this.set( 'AttachmentView', wp.media.view.Attachment.EditLibrary ); 183 181 } 184 182 Library.prototype.initialize.apply( this, arguments ); … … 246 244 247 245 if ( dragInfoText ) { 248 attachmentsBrowserView.toolbar.set( 'dragInfo', new View({246 attachmentsBrowserView.toolbar.set( 'dragInfo', new wp.media.View({ 249 247 el: $( '<div class="instructions">' + dragInfoText + '</div>' )[0], 250 248 priority: -40 … … 266 264 module.exports = CollectionEdit; 267 265 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){ 269 267 /*globals wp, _, Backbone */ 270 268 … … 278 276 * @augments Backbone.Model 279 277 */ 280 var State = require( './state.js' ), 281 ToolbarView = require( '../views/toolbar.js' ), 282 CropperView = require( '../views/cropper.js' ), 283 l10n = wp.media.view.l10n, 278 var l10n = wp.media.view.l10n, 284 279 Cropper; 285 280 286 Cropper = State.extend({281 Cropper = wp.media.controller.State.extend({ 287 282 defaults: { 288 283 id: 'cropper', … … 307 302 308 303 createCropContent: function() { 309 this.cropperView = new CropperView({304 this.cropperView = new wp.media.view.Cropper({ 310 305 controller: this, 311 306 attachment: this.get('selection').first() … … 373 368 } 374 369 375 this.frame.toolbar.set( new ToolbarView(toolbarOptions) );370 this.frame.toolbar.set( new wp.media.view.Toolbar(toolbarOptions) ); 376 371 }, 377 372 … … 387 382 module.exports = Cropper; 388 383 389 },{ "../views/cropper.js":34,"../views/toolbar.js":63,"./state.js":15}],4:[function(require,module,exports){384 },{}],4:[function(require,module,exports){ 390 385 /*globals wp */ 391 386 … … 408 403 * @param {string} [attributes.url] Unused. @todo Consider removal. 409 404 */ 410 var State = require( './state.js' ), 411 ToolbarView = require( '../views/toolbar.js' ), 412 l10n = wp.media.view.l10n, 405 var l10n = wp.media.view.l10n, 413 406 EditImage; 414 407 415 EditImage = State.extend({408 EditImage = wp.media.controller.State.extend({ 416 409 defaults: { 417 410 id: 'edit-image', … … 445 438 previous = lastState && lastState.id; 446 439 447 frame.toolbar.set( new ToolbarView({440 frame.toolbar.set( new wp.media.view.Toolbar({ 448 441 controller: frame, 449 442 items: { … … 467 460 module.exports = EditImage; 468 461 469 },{ "../views/toolbar.js":63,"./state.js":15}],5:[function(require,module,exports){462 },{}],5:[function(require,module,exports){ 470 463 /*globals wp, _, Backbone */ 471 464 … … 491 484 * @param {object} [attributes.metadata={}] Properties of the embed, which will override attributes.url if set. 492 485 */ 493 var State = require( './state.js' ), 494 l10n = wp.media.view.l10n, 486 var l10n = wp.media.view.l10n, 495 487 $ = Backbone.$, 496 488 Embed; 497 489 498 Embed = State.extend({490 Embed = wp.media.controller.State.extend({ 499 491 defaults: { 500 492 id: 'embed', … … 606 598 module.exports = Embed; 607 599 608 },{ "./state.js":15}],6:[function(require,module,exports){600 },{}],6:[function(require,module,exports){ 609 601 /*globals wp, _ */ 610 602 … … 641 633 */ 642 634 var Attachment = wp.media.model.Attachment, 643 Library = require( './library.js' ),635 Library = wp.media.controller.Library, 644 636 l10n = wp.media.view.l10n, 645 637 FeaturedImage; … … 730 722 module.exports = FeaturedImage; 731 723 732 },{ "./library.js":10}],7:[function(require,module,exports){724 },{}],7:[function(require,module,exports){ 733 725 /*globals wp, _ */ 734 726 … … 765 757 */ 766 758 var Selection = wp.media.model.Selection, 767 Library = require( './library.js' ),759 Library = wp.media.controller.Library, 768 760 l10n = wp.media.view.l10n, 769 761 GalleryAdd; … … 823 815 module.exports = GalleryAdd; 824 816 825 },{ "./library.js":10}],8:[function(require,module,exports){817 },{}],8:[function(require,module,exports){ 826 818 /*globals wp */ 827 819 … … 857 849 * If none supplied, defaults to wp.media.view.Attachment.EditLibrary. 858 850 */ 859 var Library = require( './library.js' ), 860 EditLibraryView = require( '../views/attachment/edit-library.js' ), 861 GallerySettingsView = require( '../views/settings/gallery.js' ), 851 var Library = wp.media.controller.Library, 862 852 l10n = wp.media.view.l10n, 863 853 GalleryEdit; … … 893 883 // The single `Attachment` view to be used in the `Attachments` view. 894 884 if ( ! this.get('AttachmentView') ) { 895 this.set( 'AttachmentView', EditLibraryView);885 this.set( 'AttachmentView', wp.media.view.Attachment.EditLibrary ); 896 886 } 897 887 … … 947 937 948 938 browser.sidebar.set({ 949 gallery: new GallerySettingsView({939 gallery: new wp.media.view.Settings.Gallery({ 950 940 controller: this, 951 941 model: library.gallery, … … 967 957 module.exports = GalleryEdit; 968 958 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){ 970 960 /*globals wp, _ */ 971 961 … … 994 984 * however this may not do anything. 995 985 */ 996 var State = require( './state.js' ),997 Library = require( './library.js' ),986 var State = wp.media.controller.State, 987 Library = wp.media.controller.Library, 998 988 l10n = wp.media.view.l10n, 999 989 ImageDetails; … … 1031 1021 module.exports = ImageDetails; 1032 1022 1033 },{ "./library.js":10,"./state.js":15}],10:[function(require,module,exports){1023 },{}],10:[function(require,module,exports){ 1034 1024 /*globals wp, _, Backbone */ 1035 1025 … … 1068 1058 * @param {boolean} [attributes.syncSelection=true] Whether the Attachments selection should be persisted from the last state. 1069 1059 */ 1070 var selectionSync = require( '../utils/selection-sync.js' ), 1071 State = require( './state.js' ), 1072 l10n = wp.media.view.l10n, 1060 var l10n = wp.media.view.l10n, 1073 1061 getUserSetting = window.getUserSetting, 1074 1062 setUserSetting = window.setUserSetting, 1075 1063 Library; 1076 1064 1077 Library = State.extend({1065 Library = wp.media.controller.State.extend({ 1078 1066 defaults: { 1079 1067 id: 'library', … … 1303 1291 1304 1292 // Make selectionSync available on any Media Library state. 1305 _.extend( Library.prototype, selectionSync );1293 _.extend( Library.prototype, wp.media.selectionSync ); 1306 1294 1307 1295 module.exports = Library; 1308 1296 1309 },{ "../utils/selection-sync.js":16,"./state.js":15}],11:[function(require,module,exports){1297 },{}],11:[function(require,module,exports){ 1310 1298 /*globals wp, _ */ 1311 1299 … … 1318 1306 * @augments Backbone.Model 1319 1307 */ 1320 var Library = require( './library.js' ),1308 var Library = wp.media.controller.Library, 1321 1309 MediaLibrary; 1322 1310 … … 1359 1347 module.exports = MediaLibrary; 1360 1348 1361 },{ "./library.js":10}],12:[function(require,module,exports){1349 },{}],12:[function(require,module,exports){ 1362 1350 /*globals Backbone, _ */ 1363 1351 … … 1574 1562 * @param {boolean} [attributes.syncSelection=true] Whether the Attachments selection should be persisted from the last state. 1575 1563 */ 1576 var Library = require( './library.js' ),1564 var Library = wp.media.controller.Library, 1577 1565 l10n = wp.media.view.l10n, 1578 1566 ReplaceImage; … … 1650 1638 module.exports = ReplaceImage; 1651 1639 1652 },{ "./library.js":10}],14:[function(require,module,exports){1640 },{}],14:[function(require,module,exports){ 1653 1641 /*globals _, Backbone */ 1654 1642 … … 2249 2237 * @augments Backbone.View 2250 2238 */ 2251 var View = require( './view.js' ),2239 var View = wp.media.View, 2252 2240 AttachmentCompat; 2253 2241 … … 2323 2311 module.exports = AttachmentCompat; 2324 2312 2325 },{ "./view.js":71}],19:[function(require,module,exports){2313 },{}],19:[function(require,module,exports){ 2326 2314 /*globals _, jQuery */ 2327 2315 … … 2334 2322 * @augments Backbone.View 2335 2323 */ 2336 var View = require( './view.js' ), 2337 $ = jQuery, 2324 var $ = jQuery, 2338 2325 AttachmentFilters; 2339 2326 2340 AttachmentFilters = View.extend({2327 AttachmentFilters = wp.media.View.extend({ 2341 2328 tagName: 'select', 2342 2329 className: 'attachment-filters', … … 2403 2390 module.exports = AttachmentFilters; 2404 2391 2405 },{ "./view.js":71}],20:[function(require,module,exports){2392 },{}],20:[function(require,module,exports){ 2406 2393 /*globals wp */ 2407 2394 … … 2415 2402 * @augments Backbone.View 2416 2403 */ 2417 var AttachmentFilters = require( '../attachment-filters.js' ), 2418 l10n = wp.media.view.l10n, 2404 var l10n = wp.media.view.l10n, 2419 2405 All; 2420 2406 2421 All = AttachmentFilters.extend({2407 All = wp.media.view.AttachmentFilters.extend({ 2422 2408 createFilters: function() { 2423 2409 var filters = {}; … … 2496 2482 module.exports = All; 2497 2483 2498 },{ "../attachment-filters.js":19}],21:[function(require,module,exports){2484 },{}],21:[function(require,module,exports){ 2499 2485 /*globals wp, _ */ 2500 2486 … … 2508 2494 * @augments Backbone.View 2509 2495 */ 2510 var AttachmentFilters = require( '../attachment-filters.js' ), 2511 l10n = wp.media.view.l10n, 2496 var l10n = wp.media.view.l10n, 2512 2497 DateFilter; 2513 2498 2514 DateFilter = AttachmentFilters.extend({2499 DateFilter = wp.media.view.AttachmentFilters.extend({ 2515 2500 id: 'media-attachment-date-filters', 2516 2501 … … 2540 2525 module.exports = DateFilter; 2541 2526 2542 },{ "../attachment-filters.js":19}],22:[function(require,module,exports){2527 },{}],22:[function(require,module,exports){ 2543 2528 /*globals wp */ 2544 2529 … … 2552 2537 * @augments Backbone.View 2553 2538 */ 2554 var AttachmentFilters = require( '../attachment-filters.js' ), 2555 l10n = wp.media.view.l10n, 2539 var l10n = wp.media.view.l10n, 2556 2540 Uploaded; 2557 2541 2558 Uploaded = AttachmentFilters.extend({2542 Uploaded = wp.media.view.AttachmentFilters.extend({ 2559 2543 createFilters: function() { 2560 2544 var type = this.model.get('type'), … … 2602 2586 module.exports = Uploaded; 2603 2587 2604 },{ "../attachment-filters.js":19}],23:[function(require,module,exports){2588 },{}],23:[function(require,module,exports){ 2605 2589 /*globals wp, _, jQuery */ 2606 2590 … … 2613 2597 * @augments Backbone.View 2614 2598 */ 2615 var View = require( './view.js' ),2599 var View = wp.media.View, 2616 2600 $ = jQuery, 2617 2601 Attachment; … … 3159 3143 module.exports = Attachment; 3160 3144 3161 },{ "./view.js":71}],24:[function(require,module,exports){3145 },{}],24:[function(require,module,exports){ 3162 3146 /*globals wp, _ */ 3163 3147 … … 3171 3155 * @augments Backbone.View 3172 3156 */ 3173 var Attachment = require( '../attachment.js' ),3157 var Attachment = wp.media.view.Attachment, 3174 3158 l10n = wp.media.view.l10n, 3175 3159 Details; … … 3316 3300 module.exports = Details; 3317 3301 3318 },{"../attachment.js":23}],25:[function(require,module,exports){ 3302 },{}],25:[function(require,module,exports){ 3303 /*globals wp */ 3304 3319 3305 /** 3320 3306 * wp.media.view.Attachment.EditLibrary … … 3326 3312 * @augments Backbone.View 3327 3313 */ 3328 var Attachment = require( '../attachment.js' ), 3329 EditLibrary; 3330 3331 EditLibrary = Attachment.extend({ 3314 var EditLibrary = wp.media.view.Attachment.extend({ 3332 3315 buttons: { 3333 3316 close: true … … 3337 3320 module.exports = EditLibrary; 3338 3321 3339 },{"../attachment.js":23}],26:[function(require,module,exports){ 3322 },{}],26:[function(require,module,exports){ 3323 /*globals wp */ 3324 3340 3325 /** 3341 3326 * wp.media.view.Attachments.EditSelection … … 3348 3333 * @augments Backbone.View 3349 3334 */ 3350 var Selection = require( './selection.js' ), 3351 EditSelection; 3352 3353 EditSelection = Selection.extend({ 3335 var EditSelection = wp.media.view.Attachment.Selection.extend({ 3354 3336 buttons: { 3355 3337 close: true … … 3359 3341 module.exports = EditSelection; 3360 3342 3361 },{"./selection.js":28}],27:[function(require,module,exports){ 3343 },{}],27:[function(require,module,exports){ 3344 /*globals wp */ 3345 3362 3346 /** 3363 3347 * wp.media.view.Attachment.Library … … 3369 3353 * @augments Backbone.View 3370 3354 */ 3371 var Attachment = require( '../attachment.js' ), 3372 Library; 3373 3374 Library = Attachment.extend({ 3355 var Library = wp.media.view.Attachment.extend({ 3375 3356 buttons: { 3376 3357 check: true … … 3380 3361 module.exports = Library; 3381 3362 3382 },{"../attachment.js":23}],28:[function(require,module,exports){ 3363 },{}],28:[function(require,module,exports){ 3364 /*globals wp */ 3365 3383 3366 /** 3384 3367 * wp.media.view.Attachment.Selection … … 3390 3373 * @augments Backbone.View 3391 3374 */ 3392 var Attachment = require( '../attachment.js' ), 3393 Selection; 3394 3395 Selection = Attachment.extend({ 3375 var Selection = wp.media.view.Attachment.extend({ 3396 3376 className: 'attachment selection', 3397 3377 … … 3405 3385 module.exports = Selection; 3406 3386 3407 },{ "../attachment.js":23}],29:[function(require,module,exports){3387 },{}],29:[function(require,module,exports){ 3408 3388 /*globals wp, _, jQuery */ 3409 3389 … … 3416 3396 * @augments Backbone.View 3417 3397 */ 3418 var View = require( './view.js' ), 3419 Attachment = require( './attachment.js' ), 3398 var View = wp.media.View, 3420 3399 $ = jQuery, 3421 3400 Attachments; … … 3435 3414 refreshSensitivity: wp.media.isTouchDevice ? 300 : 200, 3436 3415 refreshThreshold: 3, 3437 AttachmentView: Attachment,3416 AttachmentView: wp.media.view.Attachment, 3438 3417 sortable: false, 3439 3418 resize: true, … … 3707 3686 module.exports = Attachments; 3708 3687 3709 },{ "./attachment.js":23,"./view.js":71}],30:[function(require,module,exports){3688 },{}],30:[function(require,module,exports){ 3710 3689 /*globals wp, _, jQuery */ 3711 3690 … … 3730 3709 * Accepts true, false, and 'errors'. 3731 3710 */ 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' ), 3711 var View = wp.media.View, 3748 3712 mediaTrash = wp.media.view.settings.mediaTrash, 3749 3713 l10n = wp.media.view.l10n, … … 3762 3726 display: false, 3763 3727 sidebar: true, 3764 AttachmentView: Library3728 AttachmentView: wp.media.view.Attachment.Library 3765 3729 }); 3766 3730 … … 3813 3777 * @member {wp.media.view.Toolbar} 3814 3778 */ 3815 this.toolbar = new Toolbar( toolbarOptions );3779 this.toolbar = new wp.media.view.Toolbar( toolbarOptions ); 3816 3780 3817 3781 this.views.add( this.toolbar ); 3818 3782 3819 this.toolbar.set( 'spinner', new Spinner({3783 this.toolbar.set( 'spinner', new wp.media.view.Spinner({ 3820 3784 priority: -60 3821 3785 }) ); … … 3824 3788 // "Filters" will return a <select>, need to render 3825 3789 // screen reader text before 3826 this.toolbar.set( 'filtersLabel', new Label({3790 this.toolbar.set( 'filtersLabel', new wp.media.view.Label({ 3827 3791 value: l10n.filterByType, 3828 3792 attributes: { … … 3833 3797 3834 3798 if ( 'uploaded' === this.options.filters ) { 3835 this.toolbar.set( 'filters', new Uploaded({3799 this.toolbar.set( 'filters', new wp.media.view.AttachmentFilters.Uploaded({ 3836 3800 controller: this.controller, 3837 3801 model: this.collection.props, … … 3839 3803 }).render() ); 3840 3804 } else { 3841 Filters = new All({3805 Filters = new wp.media.view.AttachmentFilters.All({ 3842 3806 controller: this.controller, 3843 3807 model: this.collection.props, … … 3864 3828 3865 3829 // 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({ 3867 3831 value: l10n.filterByDate, 3868 3832 attributes: { … … 3871 3835 priority: -75 3872 3836 }).render() ); 3873 this.toolbar.set( 'dateFilter', new DateFilter({3837 this.toolbar.set( 'dateFilter', new wp.media.view.DateFilter({ 3874 3838 controller: this.controller, 3875 3839 model: this.collection.props, … … 3975 3939 } else if ( this.options.date ) { 3976 3940 // 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({ 3978 3942 value: l10n.filterByDate, 3979 3943 attributes: { … … 3982 3946 priority: -75 3983 3947 }).render() ); 3984 this.toolbar.set( 'dateFilter', new DateFilter({3948 this.toolbar.set( 'dateFilter', new wp.media.view.DateFilter({ 3985 3949 controller: this.controller, 3986 3950 model: this.collection.props, … … 3991 3955 if ( this.options.search ) { 3992 3956 // 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({ 3994 3958 value: l10n.searchMediaLabel, 3995 3959 attributes: { … … 3998 3962 priority: 60 3999 3963 }).render() ); 4000 this.toolbar.set( 'search', new Search({3964 this.toolbar.set( 'search', new wp.media.view.Search({ 4001 3965 controller: this.controller, 4002 3966 model: this.collection.props, … … 4047 4011 4048 4012 createUploader: function() { 4049 this.uploader = new UploaderInline({4013 this.uploader = new wp.media.view.UploaderInline({ 4050 4014 controller: this.controller, 4051 4015 status: false, … … 4067 4031 4068 4032 createAttachments: function() { 4069 this.attachments = new Attachments({4033 this.attachments = new wp.media.view.Attachments({ 4070 4034 controller: this.controller, 4071 4035 collection: this.collection, … … 4103 4067 var options = this.options, 4104 4068 selection = options.selection, 4105 sidebar = this.sidebar = new Sidebar({4069 sidebar = this.sidebar = new wp.media.view.Sidebar({ 4106 4070 controller: this.controller 4107 4071 }); … … 4110 4074 4111 4075 if ( this.controller.uploader ) { 4112 sidebar.set( 'uploads', new UploaderStatus({4076 sidebar.set( 'uploads', new wp.media.view.UploaderStatus({ 4113 4077 controller: this.controller, 4114 4078 priority: 40 … … 4128 4092 single = this.options.selection.single(); 4129 4093 4130 sidebar.set( 'details', new Details({4094 sidebar.set( 'details', new wp.media.view.Attachment.Details({ 4131 4095 controller: this.controller, 4132 4096 model: single, … … 4134 4098 }) ); 4135 4099 4136 sidebar.set( 'compat', new AttachmentCompat({4100 sidebar.set( 'compat', new wp.media.view.AttachmentCompat({ 4137 4101 controller: this.controller, 4138 4102 model: single, … … 4141 4105 4142 4106 if ( this.options.display ) { 4143 sidebar.set( 'display', new AttachmentDisplay({4107 sidebar.set( 'display', new wp.media.view.Settings.AttachmentDisplay({ 4144 4108 controller: this.controller, 4145 4109 model: this.model.display( single ), … … 4168 4132 module.exports = AttachmentsBrowser; 4169 4133 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, _ */ 4172 4136 4173 4137 /** … … 4180 4144 * @augments Backbone.View 4181 4145 */ 4182 var Attachments = require( '../attachments.js' ), 4183 AttachmentSelection = require( '../attachment/selection.js' ), 4146 var Attachments = wp.media.view.Attachments, 4184 4147 Selection; 4185 4148 … … 4192 4155 4193 4156 // The single `Attachment` view to be used in the `Attachments` view. 4194 AttachmentView: AttachmentSelection4157 AttachmentView: wp.media.view.Attachment.Selection 4195 4158 }); 4196 4159 // Call 'initialize' directly on the parent class. … … 4201 4164 module.exports = Selection; 4202 4165 4203 },{ "../attachment/selection.js":28,"../attachments.js":29}],32:[function(require,module,exports){4166 },{}],32:[function(require,module,exports){ 4204 4167 /*globals _, Backbone */ 4205 4168 … … 4212 4175 * @augments Backbone.View 4213 4176 */ 4214 var View = require( './view.js' ), 4215 Button = require( './button.js' ), 4216 $ = Backbone.$, 4177 var $ = Backbone.$, 4217 4178 ButtonGroup; 4218 4179 4219 ButtonGroup = View.extend({4180 ButtonGroup = wp.media.View.extend({ 4220 4181 tagName: 'div', 4221 4182 className: 'button-group button-large media-button-group', … … 4229 4190 return button; 4230 4191 } else { 4231 return new Button( button ).render();4192 return new wp.media.view.Button( button ).render(); 4232 4193 } 4233 4194 }); … … 4251 4212 module.exports = ButtonGroup; 4252 4213 4253 },{ "./button.js":33,"./view.js":71}],33:[function(require,module,exports){4214 },{}],33:[function(require,module,exports){ 4254 4215 /*globals _, Backbone */ 4255 4216 … … 4262 4223 * @augments Backbone.View 4263 4224 */ 4264 var View = require( './view.js' ), 4265 Button; 4266 4267 Button = View.extend({ 4225 var Button = wp.media.View.extend({ 4268 4226 tagName: 'a', 4269 4227 className: 'media-button', … … 4342 4300 module.exports = Button; 4343 4301 4344 },{ "./view.js":71}],34:[function(require,module,exports){4302 },{}],34:[function(require,module,exports){ 4345 4303 /*globals wp, _, jQuery */ 4346 4304 … … 4359 4317 * @augments Backbone.View 4360 4318 */ 4361 var View = require( './view.js' ), 4362 UploaderStatusError = require( './uploader/status-error.js' ), 4363 UploaderStatus = require( './uploader/status.js' ), 4319 var View = wp.media.View, 4320 UploaderStatus = wp.media.view.UploaderStatus, 4364 4321 l10n = wp.media.view.l10n, 4365 4322 $ = jQuery, … … 4403 4360 var filename = this.options.attachment.get('filename'); 4404 4361 4405 this.views.add( '.upload-errors', new UploaderStatusError({4362 this.views.add( '.upload-errors', new wp.media.view.UploaderStatusError({ 4406 4363 filename: UploaderStatus.prototype.filename(filename), 4407 4364 message: window._wpMediaViewsL10n.cropError … … 4412 4369 module.exports = Cropper; 4413 4370 4414 },{ "./uploader/status-error.js":68,"./uploader/status.js":69,"./view.js":71}],35:[function(require,module,exports){4371 },{}],35:[function(require,module,exports){ 4415 4372 /*globals wp, _ */ 4416 4373 … … 4423 4380 * @augments Backbone.View 4424 4381 */ 4425 var View = require( './view.js' ),4382 var View = wp.media.View, 4426 4383 EditImage; 4427 4384 … … 4470 4427 module.exports = EditImage; 4471 4428 4472 },{ "./view.js":71}],36:[function(require,module,exports){4429 },{}],36:[function(require,module,exports){ 4473 4430 /** 4474 4431 * wp.media.view.Embed … … 4479 4436 * @augments Backbone.View 4480 4437 */ 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({ 4438 var Embed = wp.media.View.extend({ 4488 4439 className: 'media-embed', 4489 4440 … … 4492 4443 * @member {wp.media.view.EmbedUrl} 4493 4444 */ 4494 this.url = new EmbedUrl({4445 this.url = new wp.media.view.EmbedUrl({ 4495 4446 controller: this.controller, 4496 4447 model: this.model.props … … 4519 4470 4520 4471 if ( 'image' === type ) { 4521 constructor = EmbedImage;4472 constructor = wp.media.view.EmbedImage; 4522 4473 } else if ( 'link' === type ) { 4523 constructor = EmbedLink;4474 constructor = wp.media.view.EmbedLink; 4524 4475 } else { 4525 4476 return; … … 4540 4491 module.exports = Embed; 4541 4492 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){ 4543 4494 /*globals wp */ 4544 4495 … … 4553 4504 * @augments Backbone.View 4554 4505 */ 4555 var AttachmentDisplay = require( '../settings/attachment-display.js' ),4506 var AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay, 4556 4507 EmbedImage; 4557 4508 … … 4575 4526 module.exports = EmbedImage; 4576 4527 4577 },{ "../settings/attachment-display.js":58}],38:[function(require,module,exports){4528 },{}],38:[function(require,module,exports){ 4578 4529 /*globals wp, _, jQuery */ 4579 4530 … … 4587 4538 * @augments Backbone.View 4588 4539 */ 4589 var Settings = require( '../settings.js' ), 4590 $ = jQuery, 4540 var $ = jQuery, 4591 4541 EmbedLink; 4592 4542 4593 EmbedLink = Settings.extend({4543 EmbedLink = wp.media.view.Settings.extend({ 4594 4544 className: 'embed-link-settings', 4595 4545 template: wp.template('embed-link-settings'), … … 4682 4632 module.exports = EmbedLink; 4683 4633 4684 },{ "../settings.js":57}],39:[function(require,module,exports){4634 },{}],39:[function(require,module,exports){ 4685 4635 /*globals wp, _, jQuery */ 4686 4636 … … 4693 4643 * @augments Backbone.View 4694 4644 */ 4695 var View = require( '../view.js' ),4645 var View = wp.media.View, 4696 4646 $ = jQuery, 4697 4647 EmbedUrl; … … 4763 4713 module.exports = EmbedUrl; 4764 4714 4765 },{ "../view.js":71}],40:[function(require,module,exports){4715 },{}],40:[function(require,module,exports){ 4766 4716 /** 4767 4717 * wp.media.view.FocusManager … … 4772 4722 * @augments Backbone.View 4773 4723 */ 4774 var View = require( './view.js' ), 4775 FocusManager; 4776 4777 FocusManager = View.extend({ 4724 var FocusManager = wp.media.View.extend({ 4778 4725 4779 4726 events: { … … 4812 4759 module.exports = FocusManager; 4813 4760 4814 },{ "./view.js":71}],41:[function(require,module,exports){4761 },{}],41:[function(require,module,exports){ 4815 4762 /*globals _, Backbone */ 4816 4763 … … 4830 4777 * @mixes wp.media.controller.StateMachine 4831 4778 */ 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({ 4779 var Frame = wp.media.View.extend({ 4839 4780 initialize: function() { 4840 4781 _.defaults( this.options, { … … 4852 4793 // Initialize regions. 4853 4794 _.each( this.regions, function( region ) { 4854 this[ region ] = new Region({4795 this[ region ] = new wp.media.controller.Region({ 4855 4796 view: this, 4856 4797 id: region, … … 4870 4811 // Create the default `states` collection. 4871 4812 this.states = new Backbone.Collection( null, { 4872 model: State4813 model: wp.media.controller.State 4873 4814 }); 4874 4815 … … 4982 4923 4983 4924 // Make the `Frame` a `StateMachine`. 4984 _.extend( Frame.prototype, StateMachine.prototype );4925 _.extend( Frame.prototype, wp.media.controller.StateMachine.prototype ); 4985 4926 4986 4927 module.exports = Frame; 4987 4928 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){ 4989 4930 /*globals wp */ 4990 4931 … … 5004 4945 * @mixes wp.media.controller.StateMachine 5005 4946 */ 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' ), 4947 var Select = wp.media.view.MediaFrame.Select, 5013 4948 l10n = wp.media.view.l10n, 5014 4949 ImageDetails; … … 5044 4979 createStates: function() { 5045 4980 this.states.add([ 5046 new ImageDetailsController({4981 new wp.media.controller.ImageDetails({ 5047 4982 image: this.image, 5048 4983 editable: false 5049 4984 }), 5050 new ReplaceImageController({4985 new wp.media.controller.ReplaceImage({ 5051 4986 id: 'replace-image', 5052 4987 library: wp.media.query( { type: 'image' } ), … … 5058 4993 displaySettings: true 5059 4994 }), 5060 new EditImageController( {4995 new wp.media.controller.EditImage( { 5061 4996 image: this.image, 5062 4997 selection: this.options.selection … … 5066 5001 5067 5002 imageDetailsContent: function( options ) { 5068 options.view = new ImageDetailsView({5003 options.view = new wp.media.view.ImageDetails({ 5069 5004 controller: this, 5070 5005 model: this.state().image, … … 5082 5017 } 5083 5018 5084 view = new EditImageView( { model: model, controller: this } ).render();5019 view = new wp.media.view.EditImage( { model: model, controller: this } ).render(); 5085 5020 5086 5021 this.content.set( view ); … … 5092 5027 5093 5028 renderImageDetailsToolbar: function() { 5094 this.toolbar.set( new Toolbar({5029 this.toolbar.set( new wp.media.view.Toolbar({ 5095 5030 controller: this, 5096 5031 items: { … … 5124 5059 previous = lastState && lastState.id; 5125 5060 5126 this.toolbar.set( new Toolbar({5061 this.toolbar.set( new wp.media.view.Toolbar({ 5127 5062 controller: this, 5128 5063 items: { … … 5171 5106 module.exports = ImageDetails; 5172 5107 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){ 5174 5109 /*globals wp, _ */ 5175 5110 … … 5188 5123 * @mixes wp.media.controller.StateMachine 5189 5124 */ 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' ), 5125 var Select = wp.media.view.MediaFrame.Select, 5126 Library = wp.media.controller.Library, 5208 5127 l10n = wp.media.view.l10n, 5209 5128 Post; … … 5279 5198 5280 5199 // 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 } ), 5284 5203 5285 5204 // Gallery states. 5286 new GalleryEditController({5205 new wp.media.controller.GalleryEdit({ 5287 5206 library: options.selection, 5288 5207 editing: options.editing, … … 5290 5209 }), 5291 5210 5292 new GalleryAddController(),5211 new wp.media.controller.GalleryAdd(), 5293 5212 5294 5213 new Library({ … … 5307 5226 5308 5227 // Playlist states. 5309 new CollectionEditController({5228 new wp.media.controller.CollectionEdit({ 5310 5229 type: 'audio', 5311 5230 collectionType: 'playlist', 5312 5231 title: l10n.editPlaylistTitle, 5313 SettingsView: PlaylistSettings,5232 SettingsView: wp.media.view.Settings.Playlist, 5314 5233 library: options.selection, 5315 5234 editing: options.editing, … … 5319 5238 }), 5320 5239 5321 new CollectionAddController({5240 new wp.media.controller.CollectionAdd({ 5322 5241 type: 'audio', 5323 5242 collectionType: 'playlist', … … 5339 5258 }), 5340 5259 5341 new CollectionEditController({5260 new wp.media.controller.CollectionEdit({ 5342 5261 type: 'video', 5343 5262 collectionType: 'playlist', 5344 5263 title: l10n.editVideoPlaylistTitle, 5345 SettingsView: PlaylistSettings,5264 SettingsView: wp.media.view.Settings.Playlist, 5346 5265 library: options.selection, 5347 5266 editing: options.editing, … … 5351 5270 }), 5352 5271 5353 new CollectionAddController({5272 new wp.media.controller.CollectionAdd({ 5354 5273 type: 'video', 5355 5274 collectionType: 'playlist', … … 5359 5278 5360 5279 if ( wp.media.view.settings.post.featuredImageId ) { 5361 this.states.add( new FeaturedImageController() );5280 this.states.add( new wp.media.controller.FeaturedImage() ); 5362 5281 } 5363 5282 }, … … 5446 5365 mainMenu: function( view ) { 5447 5366 view.set({ 5448 'library-separator': new View({5367 'library-separator': new wp.media.View({ 5449 5368 className: 'separator', 5450 5369 priority: 100 … … 5485 5404 } 5486 5405 }, 5487 separateCancel: new View({5406 separateCancel: new wp.media.View({ 5488 5407 className: 'separator', 5489 5408 priority: 40 … … 5509 5428 } 5510 5429 }, 5511 separateCancel: new View({5430 separateCancel: new wp.media.View({ 5512 5431 className: 'separator', 5513 5432 priority: 40 … … 5533 5452 } 5534 5453 }, 5535 separateCancel: new View({5454 separateCancel: new wp.media.View({ 5536 5455 className: 'separator', 5537 5456 priority: 40 … … 5542 5461 // Content 5543 5462 embedContent: function() { 5544 var view = new Embed({5463 var view = new wp.media.view.Embed({ 5545 5464 controller: this, 5546 5465 model: this.state() … … 5559 5478 view; 5560 5479 5561 view = new AttachmentsBrowser({5480 view = new wp.media.view.AttachmentsBrowser({ 5562 5481 controller: this, 5563 5482 collection: selection, … … 5569 5488 dragInfo: true, 5570 5489 5571 AttachmentView: EditSelection5490 AttachmentView: wp.media.view.Attachments.EditSelection 5572 5491 }).render(); 5573 5492 … … 5590 5509 editImageContent: function() { 5591 5510 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(); 5593 5512 5594 5513 this.content.set( view ); … … 5607 5526 var editable = this.state().get('editable'); 5608 5527 5609 view.set( 'selection', new SelectionView({5528 view.set( 'selection', new wp.media.view.Selection({ 5610 5529 controller: this, 5611 5530 collection: this.state().get('selection'), … … 5748 5667 5749 5668 mainEmbedToolbar: function( toolbar ) { 5750 toolbar.view = new ToolbarEmbed({5669 toolbar.view = new wp.media.view.Toolbar.Embed({ 5751 5670 controller: this 5752 5671 }); … … 5755 5674 galleryEditToolbar: function() { 5756 5675 var editing = this.state().get('editing'); 5757 this.toolbar.set( new Toolbar({5676 this.toolbar.set( new wp.media.view.Toolbar({ 5758 5677 controller: this, 5759 5678 items: { … … 5784 5703 5785 5704 galleryAddToolbar: function() { 5786 this.toolbar.set( new Toolbar({5705 this.toolbar.set( new wp.media.view.Toolbar({ 5787 5706 controller: this, 5788 5707 items: { … … 5812 5731 playlistEditToolbar: function() { 5813 5732 var editing = this.state().get('editing'); 5814 this.toolbar.set( new Toolbar({5733 this.toolbar.set( new wp.media.view.Toolbar({ 5815 5734 controller: this, 5816 5735 items: { … … 5841 5760 5842 5761 playlistAddToolbar: function() { 5843 this.toolbar.set( new Toolbar({5762 this.toolbar.set( new wp.media.view.Toolbar({ 5844 5763 controller: this, 5845 5764 items: { … … 5869 5788 videoPlaylistEditToolbar: function() { 5870 5789 var editing = this.state().get('editing'); 5871 this.toolbar.set( new Toolbar({5790 this.toolbar.set( new wp.media.view.Toolbar({ 5872 5791 controller: this, 5873 5792 items: { … … 5898 5817 5899 5818 videoPlaylistAddToolbar: function() { 5900 this.toolbar.set( new Toolbar({5819 this.toolbar.set( new wp.media.view.Toolbar({ 5901 5820 controller: this, 5902 5821 items: { … … 5924 5843 module.exports = Post; 5925 5844 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){ 5927 5846 /*globals wp, _ */ 5928 5847 … … 5941 5860 */ 5942 5861 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' ), 5862 var MediaFrame = wp.media.view.MediaFrame, 5948 5863 l10n = wp.media.view.l10n, 5949 5864 Select; … … 6003 5918 this.states.add([ 6004 5919 // Main states. 6005 new Library({5920 new wp.media.controller.Library({ 6006 5921 library: wp.media.query( options.library ), 6007 5922 multiple: options.multiple, … … 6054 5969 6055 5970 // Browse our library of attachments. 6056 contentRegion.view = new AttachmentsBrowser({5971 contentRegion.view = new wp.media.view.AttachmentsBrowser({ 6057 5972 controller: this, 6058 5973 collection: state.get('library'), … … 6078 5993 uploadContent: function() { 6079 5994 this.$el.removeClass( 'hide-toolbar' ); 6080 this.content.set( new UploaderInline({5995 this.content.set( new wp.media.view.UploaderInline({ 6081 5996 controller: this 6082 5997 }) ); … … 6094 6009 options.controller = this; 6095 6010 6096 toolbar.view = new ToolbarSelect( options );6011 toolbar.view = new wp.media.view.Toolbar.Select( options ); 6097 6012 } 6098 6013 }); … … 6100 6015 module.exports = Select; 6101 6016 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){ 6103 6018 /** 6104 6019 * wp.media.view.Iframe … … 6109 6024 * @augments Backbone.View 6110 6025 */ 6111 var View = require( './view.js' ), 6112 Iframe; 6113 6114 Iframe = View.extend({ 6026 var Iframe = wp.media.View.extend({ 6115 6027 className: 'media-iframe', 6116 6028 /** … … 6127 6039 module.exports = Iframe; 6128 6040 6129 },{ "./view.js":71}],46:[function(require,module,exports){6041 },{}],46:[function(require,module,exports){ 6130 6042 /*globals wp, _, jQuery */ 6131 6043 … … 6140 6052 * @augments Backbone.View 6141 6053 */ 6142 var AttachmentDisplay = require( './settings/attachment-display.js' ),6054 var AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay, 6143 6055 $ = jQuery, 6144 6056 ImageDetails; … … 6297 6209 module.exports = ImageDetails; 6298 6210 6299 },{ "./settings/attachment-display.js":58}],47:[function(require,module,exports){6211 },{}],47:[function(require,module,exports){ 6300 6212 /** 6301 6213 * wp.media.view.Label … … 6306 6218 * @augments Backbone.View 6307 6219 */ 6308 var View = require( './view.js' ), 6309 Label; 6310 6311 Label = View.extend({ 6220 var Label = wp.media.View.extend({ 6312 6221 tagName: 'label', 6313 6222 className: 'screen-reader-text', … … 6326 6235 module.exports = Label; 6327 6236 6328 },{ "./view.js":71}],48:[function(require,module,exports){6237 },{}],48:[function(require,module,exports){ 6329 6238 /*globals wp, _, jQuery */ 6330 6239 … … 6341 6250 * @mixes wp.media.controller.StateMachine 6342 6251 */ 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' ), 6252 var Frame = wp.media.view.Frame, 6351 6253 $ = jQuery, 6352 6254 MediaFrame; … … 6378 6280 // Initialize modal container view. 6379 6281 if ( this.options.modal ) { 6380 this.modal = new Modal({6282 this.modal = new wp.media.view.Modal({ 6381 6283 controller: this, 6382 6284 title: this.options.title … … 6394 6296 // Initialize window-wide uploader. 6395 6297 if ( this.options.uploader ) { 6396 this.uploader = new UploaderWindow({6298 this.uploader = new wp.media.view.UploaderWindow({ 6397 6299 controller: this, 6398 6300 uploader: { … … 6435 6337 */ 6436 6338 createTitle: function( title ) { 6437 title.view = new View({6339 title.view = new wp.media.View({ 6438 6340 controller: this, 6439 6341 tagName: 'h1' … … 6445 6347 */ 6446 6348 createMenu: function( menu ) { 6447 menu.view = new Menu({6349 menu.view = new wp.media.view.Menu({ 6448 6350 controller: this 6449 6351 }); … … 6459 6361 */ 6460 6362 createToolbar: function( toolbar ) { 6461 toolbar.view = new Toolbar({6363 toolbar.view = new wp.media.view.Toolbar({ 6462 6364 controller: this 6463 6365 }); … … 6468 6370 */ 6469 6371 createRouter: function( router ) { 6470 router.view = new Router({6372 router.view = new wp.media.view.Router({ 6471 6373 controller: this 6472 6374 }); … … 6515 6417 iframeContent: function( content ) { 6516 6418 this.$el.addClass('hide-toolbar'); 6517 content.view = new Iframe({6419 content.view = new wp.media.view.Iframe({ 6518 6420 controller: this 6519 6421 }); … … 6582 6484 module.exports = MediaFrame; 6583 6485 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){ 6585 6487 /*globals jQuery */ 6586 6488 … … 6593 6495 * @augments Backbone.View 6594 6496 */ 6595 var View = require( './view.js' ), 6596 $ = jQuery, 6497 var $ = jQuery, 6597 6498 MenuItem; 6598 6499 6599 MenuItem = View.extend({6500 MenuItem = wp.media.View.extend({ 6600 6501 tagName: 'a', 6601 6502 className: 'media-menu-item', … … 6657 6558 module.exports = MenuItem; 6658 6559 6659 },{ "./view.js":71}],50:[function(require,module,exports){6560 },{}],50:[function(require,module,exports){ 6660 6561 /** 6661 6562 * wp.media.view.Menu … … 6667 6568 * @augments Backbone.View 6668 6569 */ 6669 var MenuItem = require( './menu-item.js' ),6670 PriorityList = require( './priority-list.js' ),6570 var MenuItem = wp.media.view.MenuItem, 6571 PriorityList = wp.media.view.PriorityList, 6671 6572 Menu; 6672 6573 … … 6774 6675 module.exports = Menu; 6775 6676 6776 },{ "./menu-item.js":49,"./priority-list.js":52}],51:[function(require,module,exports){6677 },{}],51:[function(require,module,exports){ 6777 6678 /*globals wp, _, jQuery */ 6778 6679 … … 6787 6688 * @augments Backbone.View 6788 6689 */ 6789 var View = require( './view.js' ), 6790 FocusManager = require( './focus-manager.js' ), 6791 $ = jQuery, 6690 var $ = jQuery, 6792 6691 Modal; 6793 6692 6794 Modal = View.extend({6693 Modal = wp.media.View.extend({ 6795 6694 tagName: 'div', 6796 6695 template: wp.template('media-modal'), … … 6813 6712 }); 6814 6713 6815 this.focusManager = new FocusManager({6714 this.focusManager = new wp.media.view.FocusManager({ 6816 6715 el: this.el 6817 6716 }); … … 6991 6890 module.exports = Modal; 6992 6891 6993 },{ "./focus-manager.js":40,"./view.js":71}],52:[function(require,module,exports){6892 },{}],52:[function(require,module,exports){ 6994 6893 /*globals _, Backbone */ 6995 6894 … … 7002 6901 * @augments Backbone.View 7003 6902 */ 7004 var View = require( './view.js' ), 7005 PriorityList; 7006 7007 PriorityList = View.extend({ 6903 var PriorityList = wp.media.View.extend({ 7008 6904 tagName: 'div', 7009 6905 … … 7087 6983 */ 7088 6984 toView: function( options ) { 7089 return new View( options );6985 return new wp.media.View( options ); 7090 6986 } 7091 6987 }); … … 7093 6989 module.exports = PriorityList; 7094 6990 7095 },{ "./view.js":71}],53:[function(require,module,exports){6991 },{}],53:[function(require,module,exports){ 7096 6992 /** 7097 6993 * wp.media.view.RouterItem … … 7103 6999 * @augments Backbone.View 7104 7000 */ 7105 var MenuItem = require( './menu-item.js' ), 7106 RouterItem; 7107 7108 RouterItem = MenuItem.extend({ 7001 var RouterItem = wp.media.view.MenuItem.extend({ 7109 7002 /** 7110 7003 * On click handler to activate the content region's corresponding mode. … … 7120 7013 module.exports = RouterItem; 7121 7014 7122 },{"./menu-item.js":49}],54:[function(require,module,exports){ 7015 },{}],54:[function(require,module,exports){ 7016 /*globals wp */ 7017 7123 7018 /** 7124 7019 * wp.media.view.Router … … 7131 7026 * @augments Backbone.View 7132 7027 */ 7133 var Menu = require( './menu.js' ), 7134 RouterItem = require( './router-item.js' ), 7028 var Menu = wp.media.view.Menu, 7135 7029 Router; 7136 7030 … … 7139 7033 className: 'media-router', 7140 7034 property: 'contentMode', 7141 ItemView: RouterItem,7035 ItemView: wp.media.view.RouterItem, 7142 7036 region: 'router', 7143 7037 … … 7158 7052 module.exports = Router; 7159 7053 7160 },{ "./menu.js":50,"./router-item.js":53}],55:[function(require,module,exports){7054 },{}],55:[function(require,module,exports){ 7161 7055 /*globals wp */ 7162 7056 … … 7169 7063 * @augments Backbone.View 7170 7064 */ 7171 var View = require( './view.js' ), 7172 l10n = wp.media.view.l10n, 7065 var l10n = wp.media.view.l10n, 7173 7066 Search; 7174 7067 7175 Search = View.extend({7068 Search = wp.media.View.extend({ 7176 7069 tagName: 'input', 7177 7070 className: 'search', … … 7209 7102 module.exports = Search; 7210 7103 7211 },{ "./view.js":71}],56:[function(require,module,exports){7104 },{}],56:[function(require,module,exports){ 7212 7105 /*globals wp, _, Backbone */ 7213 7106 … … 7220 7113 * @augments Backbone.View 7221 7114 */ 7222 var View = require( './view.js' ), 7223 AttachmentsSelection = require( './attachments/selection.js' ), 7224 l10n = wp.media.view.l10n, 7115 var l10n = wp.media.view.l10n, 7225 7116 Selection; 7226 7117 7227 Selection = View.extend({7118 Selection = wp.media.View.extend({ 7228 7119 tagName: 'div', 7229 7120 className: 'media-selection', … … 7244 7135 * @member {wp.media.view.Attachments.Selection} 7245 7136 */ 7246 this.attachments = new AttachmentsSelection({7137 this.attachments = new wp.media.view.Attachments.Selection({ 7247 7138 controller: this.controller, 7248 7139 collection: this.collection, … … 7296 7187 module.exports = Selection; 7297 7188 7298 },{ "./attachments/selection.js":31,"./view.js":71}],57:[function(require,module,exports){7189 },{}],57:[function(require,module,exports){ 7299 7190 /*globals _, Backbone */ 7300 7191 … … 7307 7198 * @augments Backbone.View 7308 7199 */ 7309 var View = require( './view.js' ),7200 var View = wp.media.View, 7310 7201 $ = Backbone.$, 7311 7202 Settings; … … 7419 7310 module.exports = Settings; 7420 7311 7421 },{ "./view.js":71}],58:[function(require,module,exports){7312 },{}],58:[function(require,module,exports){ 7422 7313 /*globals wp, _ */ 7423 7314 … … 7431 7322 * @augments Backbone.View 7432 7323 */ 7433 var Settings = require( '../settings.js' ),7324 var Settings = wp.media.view.Settings, 7434 7325 AttachmentDisplay; 7435 7326 … … 7515 7406 module.exports = AttachmentDisplay; 7516 7407 7517 },{ "../settings.js":57}],59:[function(require,module,exports){7408 },{}],59:[function(require,module,exports){ 7518 7409 /*globals wp */ 7519 7410 … … 7527 7418 * @augments Backbone.View 7528 7419 */ 7529 var Settings = require( '../settings.js' ), 7530 Gallery; 7531 7532 Gallery = Settings.extend({ 7420 var Gallery = wp.media.view.Settings.extend({ 7533 7421 className: 'collection-settings gallery-settings', 7534 7422 template: wp.template('gallery-settings') … … 7537 7425 module.exports = Gallery; 7538 7426 7539 },{ "../settings.js":57}],60:[function(require,module,exports){7427 },{}],60:[function(require,module,exports){ 7540 7428 /*globals wp */ 7541 7429 … … 7549 7437 * @augments Backbone.View 7550 7438 */ 7551 var Settings = require( '../settings.js' ), 7552 Playlist; 7553 7554 Playlist = Settings.extend({ 7439 var Playlist = wp.media.view.Settings.extend({ 7555 7440 className: 'collection-settings playlist-settings', 7556 7441 template: wp.template('playlist-settings') … … 7559 7444 module.exports = Playlist; 7560 7445 7561 },{ "../settings.js":57}],61:[function(require,module,exports){7446 },{}],61:[function(require,module,exports){ 7562 7447 /** 7563 7448 * wp.media.view.Sidebar … … 7569 7454 * @augments Backbone.View 7570 7455 */ 7571 var PriorityList = require( './priority-list.js' ), 7572 Sidebar; 7573 7574 Sidebar = PriorityList.extend({ 7456 var Sidebar = wp.media.view.PriorityList.extend({ 7575 7457 className: 'media-sidebar' 7576 7458 }); … … 7578 7460 module.exports = Sidebar; 7579 7461 7580 },{ "./priority-list.js":52}],62:[function(require,module,exports){7462 },{}],62:[function(require,module,exports){ 7581 7463 /*globals _ */ 7582 7464 … … 7589 7471 * @augments Backbone.View 7590 7472 */ 7591 var View = require( './view.js' ), 7592 Spinner; 7593 7594 Spinner = View.extend({ 7473 var Spinner = wp.media.View.extend({ 7595 7474 tagName: 'span', 7596 7475 className: 'spinner', … … 7618 7497 module.exports = Spinner; 7619 7498 7620 },{ "./view.js":71}],63:[function(require,module,exports){7499 },{}],63:[function(require,module,exports){ 7621 7500 /*globals _, Backbone */ 7622 7501 … … 7632 7511 * @augments Backbone.View 7633 7512 */ 7634 var View = require( './view.js' ), 7635 Button = require( './button.js' ), 7636 PriorityList = require( './priority-list.js' ), 7513 var View = wp.media.View, 7637 7514 Toolbar; 7638 7515 … … 7649 7526 7650 7527 // 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(); 7653 7530 this.primary.$el.addClass('media-toolbar-primary search-form'); 7654 7531 this.secondary.$el.addClass('media-toolbar-secondary'); … … 7712 7589 if ( ! ( view instanceof Backbone.View ) ) { 7713 7590 view.classes = [ 'media-button-' + id ].concat( view.classes || [] ); 7714 view = new Button( view ).render();7591 view = new wp.media.view.Button( view ).render(); 7715 7592 } 7716 7593 … … 7782 7659 module.exports = Toolbar; 7783 7660 7784 },{ "./button.js":33,"./priority-list.js":52,"./view.js":71}],64:[function(require,module,exports){7661 },{}],64:[function(require,module,exports){ 7785 7662 /*globals wp, _ */ 7786 7663 … … 7795 7672 * @augments Backbone.View 7796 7673 */ 7797 var Select = require( './select.js' ),7674 var Select = wp.media.view.Toolbar.Select, 7798 7675 l10n = wp.media.view.l10n, 7799 7676 Embed; … … 7821 7698 module.exports = Embed; 7822 7699 7823 },{ "./select.js":65}],65:[function(require,module,exports){7700 },{}],65:[function(require,module,exports){ 7824 7701 /*globals wp, _ */ 7825 7702 … … 7833 7710 * @augments Backbone.View 7834 7711 */ 7835 var Toolbar = require( '../toolbar.js' ),7712 var Toolbar = wp.media.view.Toolbar, 7836 7713 l10n = wp.media.view.l10n, 7837 7714 Select; … … 7893 7770 module.exports = Select; 7894 7771 7895 },{ "../toolbar.js":63}],66:[function(require,module,exports){7772 },{}],66:[function(require,module,exports){ 7896 7773 /*globals wp, _, jQuery */ 7897 7774 … … 7907 7784 * @augments Backbone.View 7908 7785 */ 7909 var View = require( '../view.js' ),7786 var View = wp.media.View, 7910 7787 l10n = wp.media.view.l10n, 7911 7788 $ = jQuery, … … 8114 7991 module.exports = EditorUploader; 8115 7992 8116 },{ "../view.js":71}],67:[function(require,module,exports){7993 },{}],67:[function(require,module,exports){ 8117 7994 /*globals wp, _ */ 8118 7995 … … 8127 8004 * @augments Backbone.View 8128 8005 */ 8129 var View = require( '../view.js' ), 8130 UploaderStatus = require( './status.js' ), 8006 var View = wp.media.View, 8131 8007 UploaderInline; 8132 8008 … … 8156 8032 8157 8033 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({ 8159 8035 controller: this.controller 8160 8036 }) ); … … 8248 8124 module.exports = UploaderInline; 8249 8125 8250 },{ "../view.js":71,"./status.js":69}],68:[function(require,module,exports){8126 },{}],68:[function(require,module,exports){ 8251 8127 /*globals wp */ 8252 8128 … … 8259 8135 * @augments Backbone.View 8260 8136 */ 8261 var View = require( '../view.js' ), 8262 UploaderStatusError; 8263 8264 UploaderStatusError = View.extend({ 8137 var UploaderStatusError = wp.media.View.extend({ 8265 8138 className: 'upload-error', 8266 8139 template: wp.template('uploader-status-error') … … 8269 8142 module.exports = UploaderStatusError; 8270 8143 8271 },{ "../view.js":71}],69:[function(require,module,exports){8144 },{}],69:[function(require,module,exports){ 8272 8145 /*globals wp, _ */ 8273 8146 … … 8282 8155 * @augments Backbone.View 8283 8156 */ 8284 var View = require( '../view.js' ), 8285 UploaderStatusError = require( './status-error.js' ), 8157 var View = wp.media.View, 8286 8158 UploaderStatus; 8287 8159 … … 8385 8257 */ 8386 8258 error: function( error ) { 8387 this.views.add( '.upload-errors', new UploaderStatusError({8259 this.views.add( '.upload-errors', new wp.media.view.UploaderStatusError({ 8388 8260 filename: this.filename( error.get('file').name ), 8389 8261 message: error.get('message') … … 8410 8282 module.exports = UploaderStatus; 8411 8283 8412 },{ "../view.js":71,"./status-error.js":68}],70:[function(require,module,exports){8284 },{}],70:[function(require,module,exports){ 8413 8285 /*globals wp, _, jQuery */ 8414 8286 … … 8429 8301 * @param {object} [options.uploader.params] 8430 8302 */ 8431 var View = require( '../view.js' ), 8432 $ = jQuery, 8303 var $ = jQuery, 8433 8304 UploaderWindow; 8434 8305 8435 UploaderWindow = View.extend({8306 UploaderWindow = wp.media.View.extend({ 8436 8307 tagName: 'div', 8437 8308 className: 'uploader-window', … … 8524 8395 module.exports = UploaderWindow; 8525 8396 8526 },{ "../view.js":71}],71:[function(require,module,exports){8397 },{}],71:[function(require,module,exports){ 8527 8398 /*globals wp */ 8528 8399 -
trunk/src/wp-includes/js/media/views/attachment-compat.js
r31491 r31935 11 11 * @augments Backbone.View 12 12 */ 13 var View = require( './view.js' ),13 var View = wp.media.View, 14 14 AttachmentCompat; 15 15 -
trunk/src/wp-includes/js/media/views/attachment-filters.js
r31492 r31935 9 9 * @augments Backbone.View 10 10 */ 11 var View = require( './view.js' ), 12 $ = jQuery, 11 var $ = jQuery, 13 12 AttachmentFilters; 14 13 15 AttachmentFilters = View.extend({14 AttachmentFilters = wp.media.View.extend({ 16 15 tagName: 'select', 17 16 className: 'attachment-filters', -
trunk/src/wp-includes/js/media/views/attachment-filters/all.js
r31492 r31935 10 10 * @augments Backbone.View 11 11 */ 12 var AttachmentFilters = require( '../attachment-filters.js' ), 13 l10n = wp.media.view.l10n, 12 var l10n = wp.media.view.l10n, 14 13 All; 15 14 16 All = AttachmentFilters.extend({15 All = wp.media.view.AttachmentFilters.extend({ 17 16 createFilters: function() { 18 17 var filters = {}; -
trunk/src/wp-includes/js/media/views/attachment-filters/date.js
r31491 r31935 10 10 * @augments Backbone.View 11 11 */ 12 var AttachmentFilters = require( '../attachment-filters.js' ), 13 l10n = wp.media.view.l10n, 12 var l10n = wp.media.view.l10n, 14 13 DateFilter; 15 14 16 DateFilter = AttachmentFilters.extend({15 DateFilter = wp.media.view.AttachmentFilters.extend({ 17 16 id: 'media-attachment-date-filters', 18 17 -
trunk/src/wp-includes/js/media/views/attachment-filters/uploaded.js
r31492 r31935 10 10 * @augments Backbone.View 11 11 */ 12 var AttachmentFilters = require( '../attachment-filters.js' ), 13 l10n = wp.media.view.l10n, 12 var l10n = wp.media.view.l10n, 14 13 Uploaded; 15 14 16 Uploaded = AttachmentFilters.extend({15 Uploaded = wp.media.view.AttachmentFilters.extend({ 17 16 createFilters: function() { 18 17 var type = this.model.get('type'), -
trunk/src/wp-includes/js/media/views/attachment.js
r31619 r31935 9 9 * @augments Backbone.View 10 10 */ 11 var View = require( './view.js' ),11 var View = wp.media.View, 12 12 $ = jQuery, 13 13 Attachment; -
trunk/src/wp-includes/js/media/views/attachment/details.js
r31619 r31935 10 10 * @augments Backbone.View 11 11 */ 12 var Attachment = require( '../attachment.js' ),12 var Attachment = wp.media.view.Attachment, 13 13 l10n = wp.media.view.l10n, 14 14 Details; -
trunk/src/wp-includes/js/media/views/attachment/edit-library.js
r31385 r31935 1 /*globals wp */ 2 1 3 /** 2 4 * wp.media.view.Attachment.EditLibrary … … 8 10 * @augments Backbone.View 9 11 */ 10 var Attachment = require( '../attachment.js' ), 11 EditLibrary; 12 13 EditLibrary = Attachment.extend({ 12 var EditLibrary = wp.media.view.Attachment.extend({ 14 13 buttons: { 15 14 close: true -
trunk/src/wp-includes/js/media/views/attachment/edit-selection.js
r31385 r31935 1 /*globals wp */ 2 1 3 /** 2 4 * wp.media.view.Attachments.EditSelection … … 9 11 * @augments Backbone.View 10 12 */ 11 var Selection = require( './selection.js' ), 12 EditSelection; 13 14 EditSelection = Selection.extend({ 13 var EditSelection = wp.media.view.Attachment.Selection.extend({ 15 14 buttons: { 16 15 close: true -
trunk/src/wp-includes/js/media/views/attachment/library.js
r31385 r31935 1 /*globals wp */ 2 1 3 /** 2 4 * wp.media.view.Attachment.Library … … 8 10 * @augments Backbone.View 9 11 */ 10 var Attachment = require( '../attachment.js' ), 11 Library; 12 13 Library = Attachment.extend({ 12 var Library = wp.media.view.Attachment.extend({ 14 13 buttons: { 15 14 check: true -
trunk/src/wp-includes/js/media/views/attachment/selection.js
r31385 r31935 1 /*globals wp */ 2 1 3 /** 2 4 * wp.media.view.Attachment.Selection … … 8 10 * @augments Backbone.View 9 11 */ 10 var Attachment = require( '../attachment.js' ), 11 Selection; 12 13 Selection = Attachment.extend({ 12 var Selection = wp.media.view.Attachment.extend({ 14 13 className: 'attachment selection', 15 14 -
trunk/src/wp-includes/js/media/views/attachments.js
r31492 r31935 9 9 * @augments Backbone.View 10 10 */ 11 var View = require( './view.js' ), 12 Attachment = require( './attachment.js' ), 11 var View = wp.media.View, 13 12 $ = jQuery, 14 13 Attachments; … … 28 27 refreshSensitivity: wp.media.isTouchDevice ? 300 : 200, 29 28 refreshThreshold: 3, 30 AttachmentView: Attachment,29 AttachmentView: wp.media.view.Attachment, 31 30 sortable: false, 32 31 resize: true, -
trunk/src/wp-includes/js/media/views/attachments/browser.js
r31491 r31935 21 21 * Accepts true, false, and 'errors'. 22 22 */ 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' ), 23 var View = wp.media.View, 39 24 mediaTrash = wp.media.view.settings.mediaTrash, 40 25 l10n = wp.media.view.l10n, … … 53 38 display: false, 54 39 sidebar: true, 55 AttachmentView: Library40 AttachmentView: wp.media.view.Attachment.Library 56 41 }); 57 42 … … 104 89 * @member {wp.media.view.Toolbar} 105 90 */ 106 this.toolbar = new Toolbar( toolbarOptions );91 this.toolbar = new wp.media.view.Toolbar( toolbarOptions ); 107 92 108 93 this.views.add( this.toolbar ); 109 94 110 this.toolbar.set( 'spinner', new Spinner({95 this.toolbar.set( 'spinner', new wp.media.view.Spinner({ 111 96 priority: -60 112 97 }) ); … … 115 100 // "Filters" will return a <select>, need to render 116 101 // screen reader text before 117 this.toolbar.set( 'filtersLabel', new Label({102 this.toolbar.set( 'filtersLabel', new wp.media.view.Label({ 118 103 value: l10n.filterByType, 119 104 attributes: { … … 124 109 125 110 if ( 'uploaded' === this.options.filters ) { 126 this.toolbar.set( 'filters', new Uploaded({111 this.toolbar.set( 'filters', new wp.media.view.AttachmentFilters.Uploaded({ 127 112 controller: this.controller, 128 113 model: this.collection.props, … … 130 115 }).render() ); 131 116 } else { 132 Filters = new All({117 Filters = new wp.media.view.AttachmentFilters.All({ 133 118 controller: this.controller, 134 119 model: this.collection.props, … … 155 140 156 141 // 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({ 158 143 value: l10n.filterByDate, 159 144 attributes: { … … 162 147 priority: -75 163 148 }).render() ); 164 this.toolbar.set( 'dateFilter', new DateFilter({149 this.toolbar.set( 'dateFilter', new wp.media.view.DateFilter({ 165 150 controller: this.controller, 166 151 model: this.collection.props, … … 266 251 } else if ( this.options.date ) { 267 252 // 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({ 269 254 value: l10n.filterByDate, 270 255 attributes: { … … 273 258 priority: -75 274 259 }).render() ); 275 this.toolbar.set( 'dateFilter', new DateFilter({260 this.toolbar.set( 'dateFilter', new wp.media.view.DateFilter({ 276 261 controller: this.controller, 277 262 model: this.collection.props, … … 282 267 if ( this.options.search ) { 283 268 // 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({ 285 270 value: l10n.searchMediaLabel, 286 271 attributes: { … … 289 274 priority: 60 290 275 }).render() ); 291 this.toolbar.set( 'search', new Search({276 this.toolbar.set( 'search', new wp.media.view.Search({ 292 277 controller: this.controller, 293 278 model: this.collection.props, … … 338 323 339 324 createUploader: function() { 340 this.uploader = new UploaderInline({325 this.uploader = new wp.media.view.UploaderInline({ 341 326 controller: this.controller, 342 327 status: false, … … 358 343 359 344 createAttachments: function() { 360 this.attachments = new Attachments({345 this.attachments = new wp.media.view.Attachments({ 361 346 controller: this.controller, 362 347 collection: this.collection, … … 394 379 var options = this.options, 395 380 selection = options.selection, 396 sidebar = this.sidebar = new Sidebar({381 sidebar = this.sidebar = new wp.media.view.Sidebar({ 397 382 controller: this.controller 398 383 }); … … 401 386 402 387 if ( this.controller.uploader ) { 403 sidebar.set( 'uploads', new UploaderStatus({388 sidebar.set( 'uploads', new wp.media.view.UploaderStatus({ 404 389 controller: this.controller, 405 390 priority: 40 … … 419 404 single = this.options.selection.single(); 420 405 421 sidebar.set( 'details', new Details({406 sidebar.set( 'details', new wp.media.view.Attachment.Details({ 422 407 controller: this.controller, 423 408 model: single, … … 425 410 }) ); 426 411 427 sidebar.set( 'compat', new AttachmentCompat({412 sidebar.set( 'compat', new wp.media.view.AttachmentCompat({ 428 413 controller: this.controller, 429 414 model: single, … … 432 417 433 418 if ( this.options.display ) { 434 sidebar.set( 'display', new AttachmentDisplay({419 sidebar.set( 'display', new wp.media.view.Settings.AttachmentDisplay({ 435 420 controller: this.controller, 436 421 model: this.model.display( single ), -
trunk/src/wp-includes/js/media/views/attachments/selection.js
r31491 r31935 1 /*globals _ */1 /*globals wp, _ */ 2 2 3 3 /** … … 10 10 * @augments Backbone.View 11 11 */ 12 var Attachments = require( '../attachments.js' ), 13 AttachmentSelection = require( '../attachment/selection.js' ), 12 var Attachments = wp.media.view.Attachments, 14 13 Selection; 15 14 … … 22 21 23 22 // The single `Attachment` view to be used in the `Attachments` view. 24 AttachmentView: AttachmentSelection23 AttachmentView: wp.media.view.Attachment.Selection 25 24 }); 26 25 // Call 'initialize' directly on the parent class. -
trunk/src/wp-includes/js/media/views/audio-details.js
r31491 r31935 12 12 * @augments Backbone.View 13 13 */ 14 var MediaDetails = require( './media-details' ),14 var MediaDetails = wp.media.view.MediaDetails, 15 15 AudioDetails; 16 16 -
trunk/src/wp-includes/js/media/views/button-group.js
r31618 r31935 9 9 * @augments Backbone.View 10 10 */ 11 var View = require( './view.js' ), 12 Button = require( './button.js' ), 13 $ = Backbone.$, 11 var $ = Backbone.$, 14 12 ButtonGroup; 15 13 16 ButtonGroup = View.extend({14 ButtonGroup = wp.media.View.extend({ 17 15 tagName: 'div', 18 16 className: 'button-group button-large media-button-group', … … 26 24 return button; 27 25 } else { 28 return new Button( button ).render();26 return new wp.media.view.Button( button ).render(); 29 27 } 30 28 }); -
trunk/src/wp-includes/js/media/views/button.js
r31491 r31935 9 9 * @augments Backbone.View 10 10 */ 11 var View = require( './view.js' ), 12 Button; 13 14 Button = View.extend({ 11 var Button = wp.media.View.extend({ 15 12 tagName: 'a', 16 13 className: 'media-button', -
trunk/src/wp-includes/js/media/views/button/delete-selected-permanently.js
r31494 r31935 1 /*globals wp */ 2 1 3 /** 2 4 * wp.media.view.DeleteSelectedPermanentlyButton … … 12 14 */ 13 15 var Button = wp.media.view.Button, 14 DeleteSelected = require( './delete-selected.js' ),16 DeleteSelected = wp.media.view.DeleteSelectedButton, 15 17 DeleteSelectedPermanently; 16 18 -
trunk/src/wp-includes/js/media/views/cropper.js
r31491 r31935 15 15 * @augments Backbone.View 16 16 */ 17 var View = require( './view.js' ), 18 UploaderStatusError = require( './uploader/status-error.js' ), 19 UploaderStatus = require( './uploader/status.js' ), 17 var View = wp.media.View, 18 UploaderStatus = wp.media.view.UploaderStatus, 20 19 l10n = wp.media.view.l10n, 21 20 $ = jQuery, … … 59 58 var filename = this.options.attachment.get('filename'); 60 59 61 this.views.add( '.upload-errors', new UploaderStatusError({60 this.views.add( '.upload-errors', new wp.media.view.UploaderStatusError({ 62 61 filename: UploaderStatus.prototype.filename(filename), 63 62 message: window._wpMediaViewsL10n.cropError -
trunk/src/wp-includes/js/media/views/edit-image.js
r31492 r31935 9 9 * @augments Backbone.View 10 10 */ 11 var View = require( './view.js' ),11 var View = wp.media.View, 12 12 EditImage; 13 13 -
trunk/src/wp-includes/js/media/views/embed.js
r31385 r31935 7 7 * @augments Backbone.View 8 8 */ 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({ 9 var Embed = wp.media.View.extend({ 16 10 className: 'media-embed', 17 11 … … 20 14 * @member {wp.media.view.EmbedUrl} 21 15 */ 22 this.url = new EmbedUrl({16 this.url = new wp.media.view.EmbedUrl({ 23 17 controller: this.controller, 24 18 model: this.model.props … … 47 41 48 42 if ( 'image' === type ) { 49 constructor = EmbedImage;43 constructor = wp.media.view.EmbedImage; 50 44 } else if ( 'link' === type ) { 51 constructor = EmbedLink;45 constructor = wp.media.view.EmbedLink; 52 46 } else { 53 47 return; -
trunk/src/wp-includes/js/media/views/embed/image.js
r31492 r31935 11 11 * @augments Backbone.View 12 12 */ 13 var AttachmentDisplay = require( '../settings/attachment-display.js' ),13 var AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay, 14 14 EmbedImage; 15 15 -
trunk/src/wp-includes/js/media/views/embed/link.js
r31690 r31935 10 10 * @augments Backbone.View 11 11 */ 12 var Settings = require( '../settings.js' ), 13 $ = jQuery, 12 var $ = jQuery, 14 13 EmbedLink; 15 14 16 EmbedLink = Settings.extend({15 EmbedLink = wp.media.view.Settings.extend({ 17 16 className: 'embed-link-settings', 18 17 template: wp.template('embed-link-settings'), -
trunk/src/wp-includes/js/media/views/embed/url.js
r31492 r31935 9 9 * @augments Backbone.View 10 10 */ 11 var View = require( '../view.js' ),11 var View = wp.media.View, 12 12 $ = jQuery, 13 13 EmbedUrl; -
trunk/src/wp-includes/js/media/views/focus-manager.js
r31385 r31935 7 7 * @augments Backbone.View 8 8 */ 9 var View = require( './view.js' ), 10 FocusManager; 11 12 FocusManager = View.extend({ 9 var FocusManager = wp.media.View.extend({ 13 10 14 11 events: { -
trunk/src/wp-includes/js/media/views/frame.js
r31491 r31935 16 16 * @mixes wp.media.controller.StateMachine 17 17 */ 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({ 18 var Frame = wp.media.View.extend({ 25 19 initialize: function() { 26 20 _.defaults( this.options, { … … 38 32 // Initialize regions. 39 33 _.each( this.regions, function( region ) { 40 this[ region ] = new Region({34 this[ region ] = new wp.media.controller.Region({ 41 35 view: this, 42 36 id: region, … … 56 50 // Create the default `states` collection. 57 51 this.states = new Backbone.Collection( null, { 58 model: State52 model: wp.media.controller.State 59 53 }); 60 54 … … 168 162 169 163 // Make the `Frame` a `StateMachine`. 170 _.extend( Frame.prototype, StateMachine.prototype );164 _.extend( Frame.prototype, wp.media.controller.StateMachine.prototype ); 171 165 172 166 module.exports = Frame; -
trunk/src/wp-includes/js/media/views/frame/audio-details.js
r31493 r31935 16 16 var MediaDetails = wp.media.view.MediaFrame.MediaDetails, 17 17 MediaLibrary = wp.media.controller.MediaLibrary, 18 19 AudioDetailsView = require( '../audio-details.js' ), 20 AudioDetailsController = require( '../../controllers/audio-details.js' ), 18 21 19 l10n = wp.media.view.l10n, 22 20 AudioDetails; … … 35 33 36 34 initialize: function( options ) { 37 options.DetailsView = AudioDetailsView;35 options.DetailsView = wp.media.view.AudioDetails; 38 36 options.cancelText = l10n.audioDetailsCancel; 39 37 options.addText = l10n.audioAddSourceTitle; … … 51 49 createStates: function() { 52 50 this.states.add([ 53 new AudioDetailsController( {51 new wp.media.controller.AudioDetails( { 54 52 media: this.media 55 53 } ), -
trunk/src/wp-includes/js/media/views/frame/edit-attachments.js
r31494 r31935 19 19 var Frame = wp.media.view.Frame, 20 20 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' ),28 21 29 22 $ = jQuery, … … 81 74 // Initialize modal container view. 82 75 if ( this.options.modal ) { 83 this.modal = new Modal({76 this.modal = new wp.media.view.Modal({ 84 77 controller: this, 85 78 title: this.options.title … … 110 103 createStates: function() { 111 104 this.states.add([ 112 new EditAttachmentMetadata( { model: this.model } )105 new wp.media.controller.EditAttachmentMetadata( { model: this.model } ) 113 106 ]); 114 107 }, … … 121 114 */ 122 115 editMetadataMode: function( contentRegion ) { 123 contentRegion.view = new TwoColumn({116 contentRegion.view = new wp.media.view.Attachment.Details.TwoColumn({ 124 117 controller: this, 125 118 model: this.model … … 130 123 * `attachment_fields_to_edit` filter. 131 124 */ 132 contentRegion.view.views.set( '.attachment-compat', new AttachmentCompat({125 contentRegion.view.views.set( '.attachment-compat', new wp.media.view.AttachmentCompat({ 133 126 controller: this, 134 127 model: this.model … … 148 141 */ 149 142 editImageMode: function( contentRegion ) { 150 var editImageController = new EditImageController( {143 var editImageController = new wp.media.controller.EditImage( { 151 144 model: this.model, 152 145 frame: this … … 157 150 editImageController._menu = function() {}; 158 151 159 contentRegion.view = new DetailsView( {152 contentRegion.view = new wp.media.view.EditImage.Details( { 160 153 model: this.model, 161 154 frame: this, -
trunk/src/wp-includes/js/media/views/frame/image-details.js
r31492 r31935 16 16 * @mixes wp.media.controller.StateMachine 17 17 */ 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' ), 18 var Select = wp.media.view.MediaFrame.Select, 25 19 l10n = wp.media.view.l10n, 26 20 ImageDetails; … … 56 50 createStates: function() { 57 51 this.states.add([ 58 new ImageDetailsController({52 new wp.media.controller.ImageDetails({ 59 53 image: this.image, 60 54 editable: false 61 55 }), 62 new ReplaceImageController({56 new wp.media.controller.ReplaceImage({ 63 57 id: 'replace-image', 64 58 library: wp.media.query( { type: 'image' } ), … … 70 64 displaySettings: true 71 65 }), 72 new EditImageController( {66 new wp.media.controller.EditImage( { 73 67 image: this.image, 74 68 selection: this.options.selection … … 78 72 79 73 imageDetailsContent: function( options ) { 80 options.view = new ImageDetailsView({74 options.view = new wp.media.view.ImageDetails({ 81 75 controller: this, 82 76 model: this.state().image, … … 94 88 } 95 89 96 view = new EditImageView( { model: model, controller: this } ).render();90 view = new wp.media.view.EditImage( { model: model, controller: this } ).render(); 97 91 98 92 this.content.set( view ); … … 104 98 105 99 renderImageDetailsToolbar: function() { 106 this.toolbar.set( new Toolbar({100 this.toolbar.set( new wp.media.view.Toolbar({ 107 101 controller: this, 108 102 items: { … … 136 130 previous = lastState && lastState.id; 137 131 138 this.toolbar.set( new Toolbar({132 this.toolbar.set( new wp.media.view.Toolbar({ 139 133 controller: this, 140 134 items: { -
trunk/src/wp-includes/js/media/views/frame/manage.js
r31618 r31935 17 17 */ 18 18 var MediaFrame = wp.media.view.MediaFrame, 19 UploaderWindow = wp.media.view.UploaderWindow,20 AttachmentsBrowser = wp.media.view.AttachmentsBrowser,21 19 Library = wp.media.controller.Library, 22 23 Router = require( '../../routers/manage.js' ),24 20 25 21 $ = Backbone.$, … … 59 55 // Initialize a window-wide uploader. 60 56 if ( this.options.uploader ) { 61 this.uploader = new UploaderWindow({57 this.uploader = new wp.media.view.UploaderWindow({ 62 58 controller: this, 63 59 uploader: { … … 72 68 } 73 69 74 this.gridRouter = new Router();70 this.gridRouter = new wp.media.view.MediaFrame.Manage.Router(); 75 71 76 72 // Call 'initialize' directly on the parent class. … … 222 218 223 219 // Browse our library of attachments. 224 this.browserView = contentRegion.view = new AttachmentsBrowser({220 this.browserView = contentRegion.view = new wp.media.view.AttachmentsBrowser({ 225 221 controller: this, 226 222 collection: state.get('library'), -
trunk/src/wp-includes/js/media/views/frame/media-details.js
r31493 r31935 13 13 * @mixes wp.media.controller.StateMachine 14 14 */ 15 var View = wp.media.View, 16 Toolbar = wp.media.view.Toolbar, 17 Select = wp.media.view.MediaFrame.Select, 15 var Select = wp.media.view.MediaFrame.Select, 18 16 l10n = wp.media.view.l10n, 19 17 MediaDetails; … … 78 76 } 79 77 }, 80 separateCancel: new View({78 separateCancel: new wp.media.View({ 81 79 className: 'separator', 82 80 priority: 40 … … 87 85 88 86 setPrimaryButton: function(text, handler) { 89 this.toolbar.set( new Toolbar({87 this.toolbar.set( new wp.media.view.Toolbar({ 90 88 controller: this, 91 89 items: { -
trunk/src/wp-includes/js/media/views/frame/post.js
r31491 r31935 15 15 * @mixes wp.media.controller.StateMachine 16 16 */ 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' ), 17 var Select = wp.media.view.MediaFrame.Select, 18 Library = wp.media.controller.Library, 35 19 l10n = wp.media.view.l10n, 36 20 Post; … … 106 90 107 91 // 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 } ), 111 95 112 96 // Gallery states. 113 new GalleryEditController({97 new wp.media.controller.GalleryEdit({ 114 98 library: options.selection, 115 99 editing: options.editing, … … 117 101 }), 118 102 119 new GalleryAddController(),103 new wp.media.controller.GalleryAdd(), 120 104 121 105 new Library({ … … 134 118 135 119 // Playlist states. 136 new CollectionEditController({120 new wp.media.controller.CollectionEdit({ 137 121 type: 'audio', 138 122 collectionType: 'playlist', 139 123 title: l10n.editPlaylistTitle, 140 SettingsView: PlaylistSettings,124 SettingsView: wp.media.view.Settings.Playlist, 141 125 library: options.selection, 142 126 editing: options.editing, … … 146 130 }), 147 131 148 new CollectionAddController({132 new wp.media.controller.CollectionAdd({ 149 133 type: 'audio', 150 134 collectionType: 'playlist', … … 166 150 }), 167 151 168 new CollectionEditController({152 new wp.media.controller.CollectionEdit({ 169 153 type: 'video', 170 154 collectionType: 'playlist', 171 155 title: l10n.editVideoPlaylistTitle, 172 SettingsView: PlaylistSettings,156 SettingsView: wp.media.view.Settings.Playlist, 173 157 library: options.selection, 174 158 editing: options.editing, … … 178 162 }), 179 163 180 new CollectionAddController({164 new wp.media.controller.CollectionAdd({ 181 165 type: 'video', 182 166 collectionType: 'playlist', … … 186 170 187 171 if ( wp.media.view.settings.post.featuredImageId ) { 188 this.states.add( new FeaturedImageController() );172 this.states.add( new wp.media.controller.FeaturedImage() ); 189 173 } 190 174 }, … … 273 257 mainMenu: function( view ) { 274 258 view.set({ 275 'library-separator': new View({259 'library-separator': new wp.media.View({ 276 260 className: 'separator', 277 261 priority: 100 … … 312 296 } 313 297 }, 314 separateCancel: new View({298 separateCancel: new wp.media.View({ 315 299 className: 'separator', 316 300 priority: 40 … … 336 320 } 337 321 }, 338 separateCancel: new View({322 separateCancel: new wp.media.View({ 339 323 className: 'separator', 340 324 priority: 40 … … 360 344 } 361 345 }, 362 separateCancel: new View({346 separateCancel: new wp.media.View({ 363 347 className: 'separator', 364 348 priority: 40 … … 369 353 // Content 370 354 embedContent: function() { 371 var view = new Embed({355 var view = new wp.media.view.Embed({ 372 356 controller: this, 373 357 model: this.state() … … 386 370 view; 387 371 388 view = new AttachmentsBrowser({372 view = new wp.media.view.AttachmentsBrowser({ 389 373 controller: this, 390 374 collection: selection, … … 396 380 dragInfo: true, 397 381 398 AttachmentView: EditSelection382 AttachmentView: wp.media.view.Attachments.EditSelection 399 383 }).render(); 400 384 … … 417 401 editImageContent: function() { 418 402 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(); 420 404 421 405 this.content.set( view ); … … 434 418 var editable = this.state().get('editable'); 435 419 436 view.set( 'selection', new SelectionView({420 view.set( 'selection', new wp.media.view.Selection({ 437 421 controller: this, 438 422 collection: this.state().get('selection'), … … 575 559 576 560 mainEmbedToolbar: function( toolbar ) { 577 toolbar.view = new ToolbarEmbed({561 toolbar.view = new wp.media.view.Toolbar.Embed({ 578 562 controller: this 579 563 }); … … 582 566 galleryEditToolbar: function() { 583 567 var editing = this.state().get('editing'); 584 this.toolbar.set( new Toolbar({568 this.toolbar.set( new wp.media.view.Toolbar({ 585 569 controller: this, 586 570 items: { … … 611 595 612 596 galleryAddToolbar: function() { 613 this.toolbar.set( new Toolbar({597 this.toolbar.set( new wp.media.view.Toolbar({ 614 598 controller: this, 615 599 items: { … … 639 623 playlistEditToolbar: function() { 640 624 var editing = this.state().get('editing'); 641 this.toolbar.set( new Toolbar({625 this.toolbar.set( new wp.media.view.Toolbar({ 642 626 controller: this, 643 627 items: { … … 668 652 669 653 playlistAddToolbar: function() { 670 this.toolbar.set( new Toolbar({654 this.toolbar.set( new wp.media.view.Toolbar({ 671 655 controller: this, 672 656 items: { … … 696 680 videoPlaylistEditToolbar: function() { 697 681 var editing = this.state().get('editing'); 698 this.toolbar.set( new Toolbar({682 this.toolbar.set( new wp.media.view.Toolbar({ 699 683 controller: this, 700 684 items: { … … 725 709 726 710 videoPlaylistAddToolbar: function() { 727 this.toolbar.set( new Toolbar({711 this.toolbar.set( new wp.media.view.Toolbar({ 728 712 controller: this, 729 713 items: { -
trunk/src/wp-includes/js/media/views/frame/select.js
r31491 r31935 15 15 */ 16 16 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' ), 17 var MediaFrame = wp.media.view.MediaFrame, 22 18 l10n = wp.media.view.l10n, 23 19 Select; … … 77 73 this.states.add([ 78 74 // Main states. 79 new Library({75 new wp.media.controller.Library({ 80 76 library: wp.media.query( options.library ), 81 77 multiple: options.multiple, … … 128 124 129 125 // Browse our library of attachments. 130 contentRegion.view = new AttachmentsBrowser({126 contentRegion.view = new wp.media.view.AttachmentsBrowser({ 131 127 controller: this, 132 128 collection: state.get('library'), … … 152 148 uploadContent: function() { 153 149 this.$el.removeClass( 'hide-toolbar' ); 154 this.content.set( new UploaderInline({150 this.content.set( new wp.media.view.UploaderInline({ 155 151 controller: this 156 152 }) ); … … 168 164 options.controller = this; 169 165 170 toolbar.view = new ToolbarSelect( options );166 toolbar.view = new wp.media.view.Toolbar.Select( options ); 171 167 } 172 168 }); -
trunk/src/wp-includes/js/media/views/frame/video-details.js
r31493 r31935 16 16 var MediaDetails = wp.media.view.MediaFrame.MediaDetails, 17 17 MediaLibrary = wp.media.controller.MediaLibrary, 18 VideoDetailsView = require( '../video-details.js' ),19 VideoDetailsController = require( '../../controllers/video-details.js' ),20 18 l10n = wp.media.view.l10n, 21 19 VideoDetails; … … 34 32 35 33 initialize: function( options ) { 36 options.DetailsView = VideoDetailsView;34 options.DetailsView = wp.media.view.VideoDetails; 37 35 options.cancelText = l10n.videoDetailsCancel; 38 36 options.addText = l10n.videoAddSourceTitle; … … 52 50 createStates: function() { 53 51 this.states.add([ 54 new VideoDetailsController({52 new wp.media.controller.VideoDetails({ 55 53 media: this.media 56 54 }), -
trunk/src/wp-includes/js/media/views/iframe.js
r31385 r31935 7 7 * @augments Backbone.View 8 8 */ 9 var View = require( './view.js' ), 10 Iframe; 11 12 Iframe = View.extend({ 9 var Iframe = wp.media.View.extend({ 13 10 className: 'media-iframe', 14 11 /** -
trunk/src/wp-includes/js/media/views/image-details.js
r31492 r31935 11 11 * @augments Backbone.View 12 12 */ 13 var AttachmentDisplay = require( './settings/attachment-display.js' ),13 var AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay, 14 14 $ = jQuery, 15 15 ImageDetails; -
trunk/src/wp-includes/js/media/views/label.js
r31492 r31935 7 7 * @augments Backbone.View 8 8 */ 9 var View = require( './view.js' ), 10 Label; 11 12 Label = View.extend({ 9 var Label = wp.media.View.extend({ 13 10 tagName: 'label', 14 11 className: 'screen-reader-text', -
trunk/src/wp-includes/js/media/views/media-frame.js
r31491 r31935 13 13 * @mixes wp.media.controller.StateMachine 14 14 */ 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' ), 15 var Frame = wp.media.view.Frame, 23 16 $ = jQuery, 24 17 MediaFrame; … … 50 43 // Initialize modal container view. 51 44 if ( this.options.modal ) { 52 this.modal = new Modal({45 this.modal = new wp.media.view.Modal({ 53 46 controller: this, 54 47 title: this.options.title … … 66 59 // Initialize window-wide uploader. 67 60 if ( this.options.uploader ) { 68 this.uploader = new UploaderWindow({61 this.uploader = new wp.media.view.UploaderWindow({ 69 62 controller: this, 70 63 uploader: { … … 107 100 */ 108 101 createTitle: function( title ) { 109 title.view = new View({102 title.view = new wp.media.View({ 110 103 controller: this, 111 104 tagName: 'h1' … … 117 110 */ 118 111 createMenu: function( menu ) { 119 menu.view = new Menu({112 menu.view = new wp.media.view.Menu({ 120 113 controller: this 121 114 }); … … 131 124 */ 132 125 createToolbar: function( toolbar ) { 133 toolbar.view = new Toolbar({126 toolbar.view = new wp.media.view.Toolbar({ 134 127 controller: this 135 128 }); … … 140 133 */ 141 134 createRouter: function( router ) { 142 router.view = new Router({135 router.view = new wp.media.view.Router({ 143 136 controller: this 144 137 }); … … 187 180 iframeContent: function( content ) { 188 181 this.$el.addClass('hide-toolbar'); 189 content.view = new Iframe({182 content.view = new wp.media.view.Iframe({ 190 183 controller: this 191 184 }); -
trunk/src/wp-includes/js/media/views/menu-item.js
r31492 r31935 9 9 * @augments Backbone.View 10 10 */ 11 var View = require( './view.js' ), 12 $ = jQuery, 11 var $ = jQuery, 13 12 MenuItem; 14 13 15 MenuItem = View.extend({14 MenuItem = wp.media.View.extend({ 16 15 tagName: 'a', 17 16 className: 'media-menu-item', -
trunk/src/wp-includes/js/media/views/menu.js
r31385 r31935 8 8 * @augments Backbone.View 9 9 */ 10 var MenuItem = require( './menu-item.js' ),11 PriorityList = require( './priority-list.js' ),10 var MenuItem = wp.media.view.MenuItem, 11 PriorityList = wp.media.view.PriorityList, 12 12 Menu; 13 13 -
trunk/src/wp-includes/js/media/views/modal.js
r31492 r31935 11 11 * @augments Backbone.View 12 12 */ 13 var View = require( './view.js' ), 14 FocusManager = require( './focus-manager.js' ), 15 $ = jQuery, 13 var $ = jQuery, 16 14 Modal; 17 15 18 Modal = View.extend({16 Modal = wp.media.View.extend({ 19 17 tagName: 'div', 20 18 template: wp.template('media-modal'), … … 37 35 }); 38 36 39 this.focusManager = new FocusManager({37 this.focusManager = new wp.media.view.FocusManager({ 40 38 el: this.el 41 39 }); -
trunk/src/wp-includes/js/media/views/priority-list.js
r31491 r31935 9 9 * @augments Backbone.View 10 10 */ 11 var View = require( './view.js' ), 12 PriorityList; 13 14 PriorityList = View.extend({ 11 var PriorityList = wp.media.View.extend({ 15 12 tagName: 'div', 16 13 … … 94 91 */ 95 92 toView: function( options ) { 96 return new View( options );93 return new wp.media.View( options ); 97 94 } 98 95 }); -
trunk/src/wp-includes/js/media/views/router-item.js
r31385 r31935 8 8 * @augments Backbone.View 9 9 */ 10 var MenuItem = require( './menu-item.js' ), 11 RouterItem; 12 13 RouterItem = MenuItem.extend({ 10 var RouterItem = wp.media.view.MenuItem.extend({ 14 11 /** 15 12 * 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 1 3 /** 2 4 * wp.media.view.Router … … 9 11 * @augments Backbone.View 10 12 */ 11 var Menu = require( './menu.js' ), 12 RouterItem = require( './router-item.js' ), 13 var Menu = wp.media.view.Menu, 13 14 Router; 14 15 … … 17 18 className: 'media-router', 18 19 property: 'contentMode', 19 ItemView: RouterItem,20 ItemView: wp.media.view.RouterItem, 20 21 region: 'router', 21 22 -
trunk/src/wp-includes/js/media/views/search.js
r31492 r31935 9 9 * @augments Backbone.View 10 10 */ 11 var View = require( './view.js' ), 12 l10n = wp.media.view.l10n, 11 var l10n = wp.media.view.l10n, 13 12 Search; 14 13 15 Search = View.extend({14 Search = wp.media.View.extend({ 16 15 tagName: 'input', 17 16 className: 'search', -
trunk/src/wp-includes/js/media/views/selection.js
r31491 r31935 9 9 * @augments Backbone.View 10 10 */ 11 var View = require( './view.js' ), 12 AttachmentsSelection = require( './attachments/selection.js' ), 13 l10n = wp.media.view.l10n, 11 var l10n = wp.media.view.l10n, 14 12 Selection; 15 13 16 Selection = View.extend({14 Selection = wp.media.View.extend({ 17 15 tagName: 'div', 18 16 className: 'media-selection', … … 33 31 * @member {wp.media.view.Attachments.Selection} 34 32 */ 35 this.attachments = new AttachmentsSelection({33 this.attachments = new wp.media.view.Attachments.Selection({ 36 34 controller: this.controller, 37 35 collection: this.collection, -
trunk/src/wp-includes/js/media/views/settings.js
r31618 r31935 9 9 * @augments Backbone.View 10 10 */ 11 var View = require( './view.js' ),11 var View = wp.media.View, 12 12 $ = Backbone.$, 13 13 Settings; -
trunk/src/wp-includes/js/media/views/settings/attachment-display.js
r31491 r31935 10 10 * @augments Backbone.View 11 11 */ 12 var Settings = require( '../settings.js' ),12 var Settings = wp.media.view.Settings, 13 13 AttachmentDisplay; 14 14 -
trunk/src/wp-includes/js/media/views/settings/gallery.js
r31492 r31935 10 10 * @augments Backbone.View 11 11 */ 12 var Settings = require( '../settings.js' ), 13 Gallery; 14 15 Gallery = Settings.extend({ 12 var Gallery = wp.media.view.Settings.extend({ 16 13 className: 'collection-settings gallery-settings', 17 14 template: wp.template('gallery-settings') -
trunk/src/wp-includes/js/media/views/settings/playlist.js
r31492 r31935 10 10 * @augments Backbone.View 11 11 */ 12 var Settings = require( '../settings.js' ), 13 Playlist; 14 15 Playlist = Settings.extend({ 12 var Playlist = wp.media.view.Settings.extend({ 16 13 className: 'collection-settings playlist-settings', 17 14 template: wp.template('playlist-settings') -
trunk/src/wp-includes/js/media/views/sidebar.js
r31385 r31935 8 8 * @augments Backbone.View 9 9 */ 10 var PriorityList = require( './priority-list.js' ), 11 Sidebar; 12 13 Sidebar = PriorityList.extend({ 10 var Sidebar = wp.media.view.PriorityList.extend({ 14 11 className: 'media-sidebar' 15 12 }); -
trunk/src/wp-includes/js/media/views/spinner.js
r31491 r31935 9 9 * @augments Backbone.View 10 10 */ 11 var View = require( './view.js' ), 12 Spinner; 13 14 Spinner = View.extend({ 11 var Spinner = wp.media.View.extend({ 15 12 tagName: 'span', 16 13 className: 'spinner', -
trunk/src/wp-includes/js/media/views/toolbar.js
r31491 r31935 12 12 * @augments Backbone.View 13 13 */ 14 var View = require( './view.js' ), 15 Button = require( './button.js' ), 16 PriorityList = require( './priority-list.js' ), 14 var View = wp.media.View, 17 15 Toolbar; 18 16 … … 29 27 30 28 // 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(); 33 31 this.primary.$el.addClass('media-toolbar-primary search-form'); 34 32 this.secondary.$el.addClass('media-toolbar-secondary'); … … 92 90 if ( ! ( view instanceof Backbone.View ) ) { 93 91 view.classes = [ 'media-button-' + id ].concat( view.classes || [] ); 94 view = new Button( view ).render();92 view = new wp.media.view.Button( view ).render(); 95 93 } 96 94 -
trunk/src/wp-includes/js/media/views/toolbar/embed.js
r31491 r31935 11 11 * @augments Backbone.View 12 12 */ 13 var Select = require( './select.js' ),13 var Select = wp.media.view.Toolbar.Select, 14 14 l10n = wp.media.view.l10n, 15 15 Embed; -
trunk/src/wp-includes/js/media/views/toolbar/select.js
r31491 r31935 10 10 * @augments Backbone.View 11 11 */ 12 var Toolbar = require( '../toolbar.js' ),12 var Toolbar = wp.media.view.Toolbar, 13 13 l10n = wp.media.view.l10n, 14 14 Select; -
trunk/src/wp-includes/js/media/views/uploader/editor.js
r31491 r31935 12 12 * @augments Backbone.View 13 13 */ 14 var View = require( '../view.js' ),14 var View = wp.media.View, 15 15 l10n = wp.media.view.l10n, 16 16 $ = jQuery, -
trunk/src/wp-includes/js/media/views/uploader/inline.js
r31491 r31935 11 11 * @augments Backbone.View 12 12 */ 13 var View = require( '../view.js' ), 14 UploaderStatus = require( './status.js' ), 13 var View = wp.media.View, 15 14 UploaderInline; 16 15 … … 40 39 41 40 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({ 43 42 controller: this.controller 44 43 }) ); -
trunk/src/wp-includes/js/media/views/uploader/status-error.js
r31492 r31935 9 9 * @augments Backbone.View 10 10 */ 11 var View = require( '../view.js' ), 12 UploaderStatusError; 13 14 UploaderStatusError = View.extend({ 11 var UploaderStatusError = wp.media.View.extend({ 15 12 className: 'upload-error', 16 13 template: wp.template('uploader-status-error') -
trunk/src/wp-includes/js/media/views/uploader/status.js
r31491 r31935 11 11 * @augments Backbone.View 12 12 */ 13 var View = require( '../view.js' ), 14 UploaderStatusError = require( './status-error.js' ), 13 var View = wp.media.View, 15 14 UploaderStatus; 16 15 … … 114 113 */ 115 114 error: function( error ) { 116 this.views.add( '.upload-errors', new UploaderStatusError({115 this.views.add( '.upload-errors', new wp.media.view.UploaderStatusError({ 117 116 filename: this.filename( error.get('file').name ), 118 117 message: error.get('message') -
trunk/src/wp-includes/js/media/views/uploader/window.js
r31491 r31935 17 17 * @param {object} [options.uploader.params] 18 18 */ 19 var View = require( '../view.js' ), 20 $ = jQuery, 19 var $ = jQuery, 21 20 UploaderWindow; 22 21 23 UploaderWindow = View.extend({22 UploaderWindow = wp.media.View.extend({ 24 23 tagName: 'div', 25 24 className: 'uploader-window', -
trunk/src/wp-includes/js/media/views/video-details.js
r31491 r31935 12 12 * @augments Backbone.View 13 13 */ 14 var MediaDetails = require( './media-details' ),14 var MediaDetails = wp.media.view.MediaDetails, 15 15 VideoDetails; 16 16
Note: See TracChangeset
for help on using the changeset viewer.