WordPress.org

Make WordPress Core

Ticket #28510: 28510.5.patch

File 28510.5.patch, 193.0 KB (added by iseulde, 5 years ago)
  • Gruntfile.js

     
    123123                                        'src/wp-includes/js/media/views.js' : [ SOURCE_DIR + 'wp-includes/js/media/views.manifest.js' ],
    124124                                        'src/wp-includes/js/media/audio-video.js' : [ SOURCE_DIR + 'wp-includes/js/media/audio-video.manifest.js' ],
    125125                                        'src/wp-includes/js/media/grid.js' : [ SOURCE_DIR + 'wp-includes/js/media/grid.manifest.js' ]
    126                                 },
    127                                 options: { debug: true }
     126                                }
    128127                        }
    129128                },
    130129                sass: {
     
    235234                                        '!twenty{fourteen,fifteen}/js/html5.js'
    236235                                ]
    237236                        },
     237                        media: {
     238                                options: {
     239                                        browserify: true
     240                                },
     241                                expand: true,
     242                                cwd: SOURCE_DIR,
     243                                src: [
     244                                        'wp-includes/js/media/**/*.js',
     245                                        '!wp-includes/js/media/*.js',
     246                                        'wp-includes/js/media/*.manifest.js'
     247                                ]
     248                        },
    238249                        core: {
    239250                                expand: true,
    240251                                cwd: SOURCE_DIR,
     
    507518        grunt.registerTask('colors', ['sass:colors', 'autoprefixer:colors']);
    508519
    509520        // JSHint task.
    510         grunt.registerTask('jshint:corejs', ['jshint:grunt', 'jshint:tests', 'jshint:themes', 'jshint:core']);
     521        grunt.registerTask( 'jshint:corejs', [
     522                'jshint:grunt',
     523                'jshint:tests',
     524                'jshint:themes',
     525                'jshint:core',
     526                'jshint:media'
     527        ] );
    511528
    512529        // Pre-commit task.
    513530        grunt.registerTask('precommit', 'Runs front-end dev/test tasks in preparation for a commit.',
  • src/wp-includes/js/media/audio-video.js

     
    11(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
    2 /* global wp, _wpMediaViewsL10n, _wpmejsSettings, MediaElementPlayer */
     2var media = wp.media,
     3        baseSettings = window._wpmejsSettings || {},
     4        l10n = window._wpMediaViewsL10n || {};
    35
    4 (function(_) {
    5         var media = wp.media,
    6                 baseSettings = {},
    7                 l10n = typeof _wpMediaViewsL10n === 'undefined' ? {} : _wpMediaViewsL10n;
     6/**
     7 * @mixin
     8 */
     9wp.media.mixin = {
     10        mejsSettings: baseSettings,
    811
    9         if ( ! _.isUndefined( window._wpmejsSettings ) ) {
    10                 baseSettings = _wpmejsSettings;
    11         }
     12        removeAllPlayers: function() {
     13                var p;
     14
     15                if ( window.mejs && window.mejs.players ) {
     16                        for ( p in window.mejs.players ) {
     17                                window.mejs.players[p].pause();
     18                                this.removePlayer( window.mejs.players[p] );
     19                        }
     20                }
     21        },
    1222
    1323        /**
    14          * @mixin
     24         * Override the MediaElement method for removing a player.
     25         *      MediaElement tries to pull the audio/video tag out of
     26         *      its container and re-add it to the DOM.
    1527         */
    16         wp.media.mixin = {
    17                 mejsSettings: baseSettings,
     28        removePlayer: function(t) {
     29                var featureIndex, feature;
    1830
    19                 removeAllPlayers: function() {
    20                         var p;
     31                if ( ! t.options ) {
     32                        return;
     33                }
    2134
    22                         if ( window.mejs && window.mejs.players ) {
    23                                 for ( p in window.mejs.players ) {
    24                                         window.mejs.players[p].pause();
    25                                         this.removePlayer( window.mejs.players[p] );
    26                                 }
     35                // invoke features cleanup
     36                for ( featureIndex in t.options.features ) {
     37                        feature = t.options.features[featureIndex];
     38                        if ( t['clean' + feature] ) {
     39                                try {
     40                                        t['clean' + feature](t);
     41                                } catch (e) {}
    2742                        }
    28                 },
     43                }
    2944
    30                 /**
    31                  * Override the MediaElement method for removing a player.
    32                  *      MediaElement tries to pull the audio/video tag out of
    33                  *      its container and re-add it to the DOM.
    34                  */
    35                 removePlayer: function(t) {
    36                         var featureIndex, feature;
     45                if ( ! t.isDynamic ) {
     46                        t.$node.remove();
     47                }
    3748
    38                         if ( ! t.options ) {
    39                                 return;
    40                         }
     49                if ( 'native' !== t.media.pluginType ) {
     50                        t.media.remove();
     51                }
    4152
    42                         // invoke features cleanup
    43                         for ( featureIndex in t.options.features ) {
    44                                 feature = t.options.features[featureIndex];
    45                                 if ( t['clean' + feature] ) {
    46                                         try {
    47                                                 t['clean' + feature](t);
    48                                         } catch (e) {}
    49                                 }
    50                         }
     53                delete window.mejs.players[t.id];
    5154
    52                         if ( ! t.isDynamic ) {
    53                                 t.$node.remove();
    54                         }
     55                t.container.remove();
     56                t.globalUnbind();
     57                delete t.node.player;
     58        },
    5559
    56                         if ( 'native' !== t.media.pluginType ) {
    57                                 t.media.remove();
    58                         }
     60        /**
     61         * Allows any class that has set 'player' to a MediaElementPlayer
     62         *  instance to remove the player when listening to events.
     63         *
     64         *  Examples: modal closes, shortcode properties are removed, etc.
     65         */
     66        unsetPlayers : function() {
     67                if ( this.players && this.players.length ) {
     68                        _.each( this.players, function (player) {
     69                                player.pause();
     70                                wp.media.mixin.removePlayer( player );
     71                        } );
     72                        this.players = [];
     73                }
     74        }
     75};
    5976
    60                         delete window.mejs.players[t.id];
     77/**
     78 * Autowire "collection"-type shortcodes
     79 */
     80wp.media.playlist = new wp.media.collection({
     81        tag: 'playlist',
     82        editTitle : l10n.editPlaylistTitle,
     83        defaults : {
     84                id: wp.media.view.settings.post.id,
     85                style: 'light',
     86                tracklist: true,
     87                tracknumbers: true,
     88                images: true,
     89                artists: true,
     90                type: 'audio'
     91        }
     92});
    6193
    62                         t.container.remove();
    63                         t.globalUnbind();
    64                         delete t.node.player;
    65                 },
     94/**
     95 * Shortcode modeling for audio
     96 *  `edit()` prepares the shortcode for the media modal
     97 *  `shortcode()` builds the new shortcode after update
     98 *
     99 * @namespace
     100 */
     101wp.media.audio = {
     102        coerce : wp.media.coerce,
    66103
    67                 /**
    68                  * Allows any class that has set 'player' to a MediaElementPlayer
    69                  *  instance to remove the player when listening to events.
    70                  *
    71                  *  Examples: modal closes, shortcode properties are removed, etc.
    72                  */
    73                 unsetPlayers : function() {
    74                         if ( this.players && this.players.length ) {
    75                                 _.each( this.players, function (player) {
    76                                         player.pause();
    77                                         wp.media.mixin.removePlayer( player );
    78                                 } );
    79                                 this.players = [];
    80                         }
    81                 }
    82         };
     104        defaults : {
     105                id : wp.media.view.settings.post.id,
     106                src : '',
     107                loop : false,
     108                autoplay : false,
     109                preload : 'none',
     110                width : 400
     111        },
    83112
    84         /**
    85          * Autowire "collection"-type shortcodes
    86          */
    87         wp.media.playlist = new wp.media.collection({
    88                 tag: 'playlist',
    89                 editTitle : l10n.editPlaylistTitle,
    90                 defaults : {
    91                         id: wp.media.view.settings.post.id,
    92                         style: 'light',
    93                         tracklist: true,
    94                         tracknumbers: true,
    95                         images: true,
    96                         artists: true,
    97                         type: 'audio'
    98                 }
    99         });
    100 
    101         /**
    102          * Shortcode modeling for audio
    103          *  `edit()` prepares the shortcode for the media modal
    104          *  `shortcode()` builds the new shortcode after update
    105          *
    106          * @namespace
    107          */
    108         wp.media.audio = {
    109                 coerce : wp.media.coerce,
    110 
    111                 defaults : {
    112                         id : wp.media.view.settings.post.id,
    113                         src : '',
    114                         loop : false,
    115                         autoplay : false,
    116                         preload : 'none',
    117                         width : 400
    118                 },
    119 
    120                 edit : function( data ) {
    121                         var frame, shortcode = wp.shortcode.next( 'audio', data ).shortcode;
    122 
    123                         frame = wp.media({
    124                                 frame: 'audio',
    125                                 state: 'audio-details',
    126                                 metadata: _.defaults( shortcode.attrs.named, this.defaults )
    127                         });
     113        edit : function( data ) {
     114                var frame, shortcode = wp.shortcode.next( 'audio', data ).shortcode;
    128115
    129                         return frame;
    130                 },
     116                frame = wp.media({
     117                        frame: 'audio',
     118                        state: 'audio-details',
     119                        metadata: _.defaults( shortcode.attrs.named, this.defaults )
     120                });
    131121
    132                 shortcode : function( model ) {
    133                         var content;
     122                return frame;
     123        },
    134124
    135                         _.each( this.defaults, function( value, key ) {
    136                                 model[ key ] = self.coerce( model, key );
     125        shortcode : function( model ) {
     126                var content;
    137127
    138                                 if ( value === model[ key ] ) {
    139                                         delete model[ key ];
    140                                 }
    141                         }, this );
     128                _.each( this.defaults, function( value, key ) {
     129                        model[ key ] = this.coerce( model, key );
    142130
    143                         content = model.content;
    144                         delete model.content;
     131                        if ( value === model[ key ] ) {
     132                                delete model[ key ];
     133                        }
     134                }, this );
    145135
    146                         return new wp.shortcode({
    147                                 tag: 'audio',
    148                                 attrs: model,
    149                                 content: content
    150                         });
    151                 }
    152         };
     136                content = model.content;
     137                delete model.content;
    153138
    154         /**
    155          * Shortcode modeling for video
    156          *  `edit()` prepares the shortcode for the media modal
    157          *  `shortcode()` builds the new shortcode after update
    158          *
    159          * @namespace
    160          */
    161         wp.media.video = {
    162                 coerce : wp.media.coerce,
    163 
    164                 defaults : {
    165                         id : wp.media.view.settings.post.id,
    166                         src : '',
    167                         poster : '',
    168                         loop : false,
    169                         autoplay : false,
    170                         preload : 'metadata',
    171                         content : '',
    172                         width : 640,
    173                         height : 360
    174                 },
    175 
    176                 edit : function( data ) {
    177                         var frame,
    178                                 shortcode = wp.shortcode.next( 'video', data ).shortcode,
    179                                 attrs;
    180 
    181                         attrs = shortcode.attrs.named;
    182                         attrs.content = shortcode.content;
    183 
    184                         frame = wp.media({
    185                                 frame: 'video',
    186                                 state: 'video-details',
    187                                 metadata: _.defaults( attrs, this.defaults )
    188                         });
     139                return new wp.shortcode({
     140                        tag: 'audio',
     141                        attrs: model,
     142                        content: content
     143                });
     144        }
     145};
     146
     147/**
     148 * Shortcode modeling for video
     149 *  `edit()` prepares the shortcode for the media modal
     150 *  `shortcode()` builds the new shortcode after update
     151 *
     152 * @namespace
     153 */
     154wp.media.video = {
     155        coerce : wp.media.coerce,
     156
     157        defaults : {
     158                id : wp.media.view.settings.post.id,
     159                src : '',
     160                poster : '',
     161                loop : false,
     162                autoplay : false,
     163                preload : 'metadata',
     164                content : '',
     165                width : 640,
     166                height : 360
     167        },
     168
     169        edit : function( data ) {
     170                var frame,
     171                        shortcode = wp.shortcode.next( 'video', data ).shortcode,
     172                        attrs;
     173
     174                attrs = shortcode.attrs.named;
     175                attrs.content = shortcode.content;
     176
     177                frame = wp.media({
     178                        frame: 'video',
     179                        state: 'video-details',
     180                        metadata: _.defaults( attrs, this.defaults )
     181                });
    189182
    190                         return frame;
    191                 },
     183                return frame;
     184        },
    192185
    193                 shortcode : function( model ) {
    194                         var content;
     186        shortcode : function( model ) {
     187                var content;
    195188
    196                         _.each( this.defaults, function( value, key ) {
    197                                 model[ key ] = this.coerce( model, key );
     189                _.each( this.defaults, function( value, key ) {
     190                        model[ key ] = this.coerce( model, key );
    198191
    199                                 if ( value === model[ key ] ) {
    200                                         delete model[ key ];
    201                                 }
    202                         }, this );
     192                        if ( value === model[ key ] ) {
     193                                delete model[ key ];
     194                        }
     195                }, this );
    203196
    204                         content = model.content;
    205                         delete model.content;
     197                content = model.content;
     198                delete model.content;
    206199
    207                         return new wp.shortcode({
    208                                 tag: 'video',
    209                                 attrs: model,
    210                                 content: content
    211                         });
    212                 }
    213         };
     200                return new wp.shortcode({
     201                        tag: 'video',
     202                        attrs: model,
     203                        content: content
     204                });
     205        }
     206};
    214207
    215         media.model.PostMedia = require( './models/post-media.js' );
    216         media.controller.AudioDetails = require( './controllers/audio-details.js' );
    217         media.controller.VideoDetails = require( './controllers/video-details.js' );
    218         media.view.MediaFrame.MediaDetails = require( './views/frame/media-details.js' );
    219         media.view.MediaFrame.AudioDetails = require( './views/frame/audio-details.js' );
    220         media.view.MediaFrame.VideoDetails = require( './views/frame/video-details.js' );
    221         media.view.MediaDetails = require( './views/media-details.js' );
    222         media.view.AudioDetails = require( './views/audio-details.js' );
    223         media.view.VideoDetails = require( './views/video-details.js' );
     208media.model.PostMedia = require( './models/post-media.js' );
     209media.controller.AudioDetails = require( './controllers/audio-details.js' );
     210media.controller.VideoDetails = require( './controllers/video-details.js' );
     211media.view.MediaFrame.MediaDetails = require( './views/frame/media-details.js' );
     212media.view.MediaFrame.AudioDetails = require( './views/frame/audio-details.js' );
     213media.view.MediaFrame.VideoDetails = require( './views/frame/video-details.js' );
     214media.view.MediaDetails = require( './views/media-details.js' );
     215media.view.AudioDetails = require( './views/audio-details.js' );
     216media.view.VideoDetails = require( './views/video-details.js' );
    224217
    225 }(_));
    226218},{"./controllers/audio-details.js":2,"./controllers/video-details.js":8,"./models/post-media.js":9,"./views/audio-details.js":21,"./views/frame/audio-details.js":25,"./views/frame/media-details.js":26,"./views/frame/video-details.js":28,"./views/media-details.js":31,"./views/video-details.js":50}],2:[function(require,module,exports){
    227 /*globals wp */
    228 
    229219/**
    230220 * The controller for the Audio Details state
    231221 *
     
    255245});
    256246
    257247module.exports = AudioDetails;
    258 },{"./state.js":7}],3:[function(require,module,exports){
    259 /*globals _, wp, Backbone, getUserSetting, setUserSetting */
    260248
     249},{"./state.js":7}],3:[function(require,module,exports){
    261250/**
    262251 * wp.media.controller.Library
    263252 *
     
    295284var selectionSync = require( '../utils/selection-sync.js' ),
    296285        State = require( './state.js' ),
    297286        l10n = wp.media.view.l10n,
     287        getUserSetting = window.getUserSetting,
     288        setUserSetting = window.setUserSetting,
    298289        Library;
    299290
    300291Library = State.extend({
     
    329320                        this.set( 'library', wp.media.query() );
    330321                }
    331322
    332                 if ( ! (selection instanceof Selection) ) {
     323                if ( ! ( selection instanceof wp.media.model.Selection ) ) {
    333324                        props = selection;
    334325
    335326                        if ( ! props ) {
     
    528519_.extend( Library.prototype, selectionSync );
    529520
    530521module.exports = Library;
    531 },{"../utils/selection-sync.js":10,"./state.js":7}],4:[function(require,module,exports){
    532 /*globals _, wp */
    533522
     523},{"../utils/selection-sync.js":10,"./state.js":7}],4:[function(require,module,exports){
    534524/**
    535525 * wp.media.controller.MediaLibrary
    536526 *
     
    579569});
    580570
    581571module.exports = MediaLibrary;
    582 },{"./library.js":3}],5:[function(require,module,exports){
    583 /*globals _, Backbone */
    584572
     573},{"./library.js":3}],5:[function(require,module,exports){
    585574/**
    586575 * wp.media.controller.Region
    587576 *
     
    759748});
    760749
    761750module.exports = Region;
    762 },{}],6:[function(require,module,exports){
    763 /*globals _, Backbone */
    764751
     752},{}],6:[function(require,module,exports){
    765753/**
    766754 * wp.media.controller.StateMachine
    767755 *
     
    884872});
    885873
    886874module.exports = StateMachine;
    887 },{}],7:[function(require,module,exports){
    888 /*globals _, Backbone */
    889875
     876},{}],7:[function(require,module,exports){
    890877/**
    891878 * wp.media.controller.State
    892879 *
     
    11261113});
    11271114
    11281115module.exports = State;
    1129 },{}],8:[function(require,module,exports){
    1130 /*globals wp */
    11311116
     1117},{}],8:[function(require,module,exports){
    11321118/**
    11331119 * The controller for the Video Details state
    11341120 *
     
    11581144});
    11591145
    11601146module.exports = VideoDetails;
    1161 },{"./state.js":7}],9:[function(require,module,exports){
    1162 /*globals Backbone, _, wp */
    11631147
     1148},{"./state.js":7}],9:[function(require,module,exports){
    11641149/**
    11651150 * Shared model class for audio and video. Updates the model after
    11661151 *   "Add Audio|Video Source" and "Replace Audio|Video" states return
     
    11991184});
    12001185
    12011186module.exports = PostMedia;
    1202 },{}],10:[function(require,module,exports){
    1203 /*globals _ */
    12041187
     1188},{}],10:[function(require,module,exports){
    12051189/**
    12061190 * wp.media.selectionSync
    12071191 *
     
    12661250};
    12671251
    12681252module.exports = selectionSync;
    1269 },{}],11:[function(require,module,exports){
    1270 /*globals _ */
    12711253
     1254},{}],11:[function(require,module,exports){
    12721255/**
    12731256 * wp.media.view.AttachmentCompat
    12741257 *
     
    13521335});
    13531336
    13541337module.exports = AttachmentCompat;
    1355 },{"./view.js":51}],12:[function(require,module,exports){
    1356 /*globals _, jQuery */
    13571338
     1339},{"./view.js":51}],12:[function(require,module,exports){
    13581340/**
    13591341 * wp.media.view.AttachmentFilters
    13601342 *
     
    14311413});
    14321414
    14331415module.exports = AttachmentFilters;
    1434 },{"./view.js":51}],13:[function(require,module,exports){
    1435 /*globals _, wp */
    14361416
     1417},{"./view.js":51}],13:[function(require,module,exports){
    14371418/**
    14381419 * wp.media.view.AttachmentFilters.All
    14391420 *
     
    15231504});
    15241505
    15251506module.exports = All;
    1526 },{"../attachment-filters.js":12}],14:[function(require,module,exports){
    1527 /*globals _, wp */
    15281507
     1508},{"../attachment-filters.js":12}],14:[function(require,module,exports){
    15291509/**
    15301510 * A filter dropdown for month/dates.
    15311511 *
     
    15661546});
    15671547
    15681548module.exports = DateFilter;
    1569 },{"../attachment-filters.js":12}],15:[function(require,module,exports){
    1570 /*globals wp */
    15711549
     1550},{"../attachment-filters.js":12}],15:[function(require,module,exports){
    15721551/**
    15731552 * wp.media.view.AttachmentFilters.Uploaded
    15741553 *
     
    16271606});
    16281607
    16291608module.exports = Uploaded;
    1630 },{"../attachment-filters.js":12}],16:[function(require,module,exports){
    1631 /*globals _, wp, jQuery */
    16321609
     1610},{"../attachment-filters.js":12}],16:[function(require,module,exports){
    16331611/**
    16341612 * wp.media.view.Attachment
    16351613 *
     
    21822160});
    21832161
    21842162module.exports = Attachment;
    2185 },{"./view.js":51}],17:[function(require,module,exports){
    2186 /*globals _, wp */
    21872163
     2164},{"./view.js":51}],17:[function(require,module,exports){
    21882165/**
    21892166 * wp.media.view.Attachment.Details
    21902167 *
     
    22442221        deleteAttachment: function( event ) {
    22452222                event.preventDefault();
    22462223
    2247                 if ( confirm( l10n.warnDelete ) ) {
     2224                if ( window.confirm( l10n.warnDelete ) ) {
    22482225                        this.model.destroy();
    22492226                        // Keep focus inside media modal
    22502227                        // after image is deleted
     
    23232300});
    23242301
    23252302module.exports = Details;
     2303
    23262304},{"../attachment.js":16}],18:[function(require,module,exports){
    23272305/**
    23282306 * wp.media.view.Attachment.Library
     
    23432321});
    23442322
    23452323module.exports = Library;
    2346 },{"../attachment.js":16}],19:[function(require,module,exports){
    2347 /*globals _, wp, jQuery */
    23482324
     2325},{"../attachment.js":16}],19:[function(require,module,exports){
    23492326/**
    23502327 * wp.media.view.Attachments
    23512328 *
     
    26182595
    26192596                // The scroll event occurs on the document, but the element
    26202597                // that should be checked is the document body.
    2621                 if ( el == document ) {
     2598                if ( el === document ) {
    26222599                        el = document.body;
    26232600                        scrollTop = $(document).scrollTop();
    26242601                }
     
    26442621});
    26452622
    26462623module.exports = Attachments;
    2647 },{"./attachment.js":16,"./view.js":51}],20:[function(require,module,exports){
    2648 /*globals _, wp, jQuery */
    26492624
     2625},{"./attachment.js":16,"./view.js":51}],20:[function(require,module,exports){
    26502626/**
    26512627 * wp.media.view.AttachmentsBrowser
    26522628 *
     
    28372813                                                return;
    28382814                                        }
    28392815
    2840                                         if ( ! mediaTrash && ! confirm( l10n.warnBulkDelete ) ) {
     2816                                        if ( ! mediaTrash && ! window.confirm( l10n.warnBulkDelete ) ) {
    28412817                                                return;
    28422818                                        }
    28432819
    28442820                                        if ( mediaTrash &&
    28452821                                                'trash' !== selection.at( 0 ).get( 'status' ) &&
    2846                                                 ! confirm( l10n.warnBulkTrash ) ) {
     2822                                                ! window.confirm( l10n.warnBulkTrash ) ) {
    28472823
    28482824                                                return;
    28492825                                        }
     
    28912867                                        click: function() {
    28922868                                                var removed = [], selection = this.controller.state().get( 'selection' );
    28932869
    2894                                                 if ( ! selection.length || ! confirm( l10n.warnBulkDelete ) ) {
     2870                                                if ( ! selection.length || ! window.confirm( l10n.warnBulkDelete ) ) {
    28952871                                                        return;
    28962872                                                }
    28972873
     
    31043080});
    31053081
    31063082module.exports = AttachmentsBrowser;
    3107 },{"../attachment-compat.js":11,"../attachment-filters/all.js":13,"../attachment-filters/date.js":14,"../attachment-filters/uploaded.js":15,"../attachment/details.js":17,"../attachment/library.js":18,"../attachments.js":19,"../label.js":30,"../search.js":39,"../settings/attachment-display.js":41,"../sidebar.js":42,"../spinner.js":43,"../toolbar.js":44,"../uploader/inline.js":46,"../uploader/status.js":48,"../view.js":51}],21:[function(require,module,exports){
    3108 /*globals wp */
    31093083
     3084},{"../attachment-compat.js":11,"../attachment-filters/all.js":13,"../attachment-filters/date.js":14,"../attachment-filters/uploaded.js":15,"../attachment/details.js":17,"../attachment/library.js":18,"../attachments.js":19,"../label.js":30,"../search.js":39,"../settings/attachment-display.js":41,"../sidebar.js":42,"../spinner.js":43,"../toolbar.js":44,"../uploader/inline.js":46,"../uploader/status.js":48,"../view.js":51}],21:[function(require,module,exports){
    31103085/**
    31113086 * wp.media.view.AudioDetails
    31123087 *
     
    31433118});
    31443119
    31453120module.exports = AudioDetails;
    3146 },{"./media-details":31}],22:[function(require,module,exports){
    3147 /*globals _, Backbone */
    31483121
     3122},{"./media-details":31}],22:[function(require,module,exports){
    31493123/**
    31503124 * wp.media.view.Button
    31513125 *
     
    32333207});
    32343208
    32353209module.exports = Button;
     3210
    32363211},{"./view.js":51}],23:[function(require,module,exports){
    32373212/**
    32383213 * wp.media.view.FocusManager
     
    32813256});
    32823257
    32833258module.exports = FocusManager;
    3284 },{"./view.js":51}],24:[function(require,module,exports){
    3285 /*globals _, Backbone */
    32863259
     3260},{"./view.js":51}],24:[function(require,module,exports){
    32873261/**
    32883262 * wp.media.view.Frame
    32893263 *
     
    34543428_.extend( Frame.prototype, StateMachine.prototype );
    34553429
    34563430module.exports = Frame;
    3457 },{"../controllers/region.js":5,"../controllers/state-machine.js":6,"../controllers/state.js":7,"./view.js":51}],25:[function(require,module,exports){
    3458 /*globals wp */
    34593431
     3432},{"../controllers/region.js":5,"../controllers/state-machine.js":6,"../controllers/state.js":7,"./view.js":51}],25:[function(require,module,exports){
    34603433/**
    34613434 * wp.media.view.MediaFrame.AudioDetails
    34623435 *
     
    35323505});
    35333506
    35343507module.exports = AudioDetails;
    3535 },{"../../controllers/audio-details.js":2,"../../controllers/media-library.js":4,"../audio-details.js":21,"./media-details":26}],26:[function(require,module,exports){
    3536 /*globals wp */
    35373508
     3509},{"../../controllers/audio-details.js":2,"../../controllers/media-library.js":4,"../audio-details.js":21,"./media-details":26}],26:[function(require,module,exports){
    35383510/**
    35393511 * wp.media.view.MediaFrame.MediaDetails
    35403512 *
     
    36653637});
    36663638
    36673639module.exports = MediaDetails;
    3668 },{"../toolbar.js":44,"../view.js":51,"./select.js":27}],27:[function(require,module,exports){
    3669 /*globals _, wp */
    36703640
     3641},{"../toolbar.js":44,"../view.js":51,"./select.js":27}],27:[function(require,module,exports){
    36713642/**
    36723643 * wp.media.view.MediaFrame.Select
    36733644 *
     
    38403811});
    38413812
    38423813module.exports = Select;
    3843 },{"../../controllers/library.js":3,"../attachments/browser.js":20,"../media-frame.js":32,"../toolbar/select.js":45,"../uploader/inline.js":46}],28:[function(require,module,exports){
    3844 /*globals _, wp */
    38453814
     3815},{"../../controllers/library.js":3,"../attachments/browser.js":20,"../media-frame.js":32,"../toolbar/select.js":45,"../uploader/inline.js":46}],28:[function(require,module,exports){
    38463816/**
    38473817 * wp.media.view.MediaFrame.VideoDetails
    38483818 *
     
    39783948});
    39793949
    39803950module.exports = VideoDetails;
     3951
    39813952},{"../../controllers/media-library.js":4,"../../controllers/video-details.js":8,"../video-details.js":50,"./media-details":26}],29:[function(require,module,exports){
    39823953/**
    39833954 * wp.media.view.Iframe
     
    40043975});
    40053976
    40063977module.exports = Iframe;
     3978
    40073979},{"./view.js":51}],30:[function(require,module,exports){
    40083980/**
    40093981 * @class
     
    40304002});
    40314003
    40324004module.exports = Label;
    4033 },{"./view.js":51}],31:[function(require,module,exports){
    4034 /*globals _, wp, jQuery */
    40354005
     4006},{"./view.js":51}],31:[function(require,module,exports){
    40364007/**
    40374008 * wp.media.view.MediaDetails
    40384009 *
     
    41164087         */
    41174088        setPlayer : function() {
    41184089                if ( ! this.players.length && this.media ) {
    4119                         this.players.push( new MediaElementPlayer( this.media, this.settings ) );
     4090                        this.players.push( new window.MediaElementPlayer( this.media, this.settings ) );
    41204091                }
    41214092        },
    41224093
     
    41444115         */
    41454116        render: function() {
    41464117                AttachmentDisplay.prototype.render.apply( this, arguments );
    4147                
     4118
    41484119                setTimeout( _.bind( function() {
    41494120                        this.resetFocus();
    41504121                }, this ), 10 );
     
    41834154});
    41844155
    41854156module.exports = MediaDetails;
    4186 },{"./settings/attachment-display.js":41}],32:[function(require,module,exports){
    4187 /*globals _, wp, jQuery */
    41884157
     4158},{"./settings/attachment-display.js":41}],32:[function(require,module,exports){
    41894159/**
    41904160 * wp.media.view.MediaFrame
    41914161 *
     
    44384408});
    44394409
    44404410module.exports = MediaFrame;
    4441 },{"./frame.js":24,"./iframe.js":29,"./menu.js":34,"./modal.js":35,"./router.js":38,"./toolbar.js":44,"./uploader/window.js":49,"./view.js":51}],33:[function(require,module,exports){
    4442 /*globals wp, jQuery */
    44434411
     4412},{"./frame.js":24,"./iframe.js":29,"./menu.js":34,"./modal.js":35,"./router.js":38,"./toolbar.js":44,"./uploader/window.js":49,"./view.js":51}],33:[function(require,module,exports){
    44444413/**
    44454414 * wp.media.view.MenuItem
    44464415 *
     
    45124481});
    45134482
    45144483module.exports = MenuItem;
     4484
    45154485},{"./view.js":51}],34:[function(require,module,exports){
    45164486/**
    45174487 * wp.media.view.Menu
     
    46284598});
    46294599
    46304600module.exports = Menu;
    4631 },{"./menu-item.js":33,"./priority-list.js":36}],35:[function(require,module,exports){
    4632 /*globals _, wp, jQuery */
    46334601
     4602},{"./menu-item.js":33,"./priority-list.js":36}],35:[function(require,module,exports){
    46344603/**
    46354604 * wp.media.view.Modal
    46364605 *
     
    48444813});
    48454814
    48464815module.exports = Modal;
    4847 },{"./focus-manager.js":23,"./view.js":51}],36:[function(require,module,exports){
    4848 /*globals _, Backbone */
    48494816
     4817},{"./focus-manager.js":23,"./view.js":51}],36:[function(require,module,exports){
    48504818/**
    48514819 * wp.media.view.PriorityList
    48524820 *
     
    49454913});
    49464914
    49474915module.exports = PriorityList;
     4916
    49484917},{"./view.js":51}],37:[function(require,module,exports){
    49494918/**
    49504919 * wp.media.view.RouterItem
     
    49714940});
    49724941
    49734942module.exports = RouterItem;
     4943
    49744944},{"./menu-item.js":33}],38:[function(require,module,exports){
    49754945/**
    49764946 * wp.media.view.Router
     
    50084978});
    50094979
    50104980module.exports = Router;
    5011 },{"./menu.js":34,"./router-item.js":37}],39:[function(require,module,exports){
    5012 /*globals wp */
    50134981
     4982},{"./menu.js":34,"./router-item.js":37}],39:[function(require,module,exports){
    50144983/**
    50154984 * wp.media.view.Search
    50164985 *
     
    50585027});
    50595028
    50605029module.exports = Search;
    5061 },{"./view.js":51}],40:[function(require,module,exports){
    5062 /*globals _, Backbone, jQuery */
    50635030
     5031},{"./view.js":51}],40:[function(require,module,exports){
    50645032/**
    50655033 * wp.media.view.Settings
    50665034 *
     
    51685136                // If the setting has a corresponding user setting,
    51695137                // update that as well.
    51705138                if ( userSetting = $setting.data('userSetting') ) {
    5171                         setUserSetting( userSetting, value );
     5139                        window.setUserSetting( userSetting, value );
    51725140                }
    51735141        },
    51745142
     
    51805148});
    51815149
    51825150module.exports = Settings;
    5183 },{"./view.js":51}],41:[function(require,module,exports){
    5184 /*globals _, wp */
    51855151
     5152},{"./view.js":51}],41:[function(require,module,exports){
    51865153/**
    51875154 * wp.media.view.Settings.AttachmentDisplay
    51885155 *
     
    52755242});
    52765243
    52775244module.exports = AttachmentDisplay;
     5245
    52785246},{"../settings.js":40}],42:[function(require,module,exports){
    52795247/**
    52805248 * wp.media.view.Sidebar
     
    52935261});
    52945262
    52955263module.exports = Sidebar;
    5296 },{"./priority-list.js":36}],43:[function(require,module,exports){
    5297 /*globals _, wp */
    52985264
     5265},{"./priority-list.js":36}],43:[function(require,module,exports){
    52995266/**
    53005267 * wp.media.view.Spinner
    53015268 *
     
    53325299});
    53335300
    53345301module.exports = Spinner;
    5335 },{"./view.js":51}],44:[function(require,module,exports){
    5336 /*globals Backbone, _ */
    53375302
     5303},{"./view.js":51}],44:[function(require,module,exports){
    53385304/**
    53395305 * wp.media.view.Toolbar
    53405306 *
     
    54955461});
    54965462
    54975463module.exports = Toolbar;
    5498 },{"./button.js":22,"./priority-list.js":36,"./view.js":51}],45:[function(require,module,exports){
    5499 /*globals _, wp */
    55005464
     5465},{"./button.js":22,"./priority-list.js":36,"./view.js":51}],45:[function(require,module,exports){
    55015466/**
    55025467 * wp.media.view.Toolbar.Select
    55035468 *
     
    55665531});
    55675532
    55685533module.exports = Select;
    5569 },{"../toolbar.js":44}],46:[function(require,module,exports){
    5570 /*globals _, wp */
    55715534
     5535},{"../toolbar.js":44}],46:[function(require,module,exports){
    55725536/**
    55735537 * wp.media.view.UploaderInline
    55745538 *
     
    56995663});
    57005664
    57015665module.exports = UploaderInline;
    5702 },{"../view.js":51,"./status.js":48}],47:[function(require,module,exports){
    5703 /*globals wp */
    57045666
     5667},{"../view.js":51,"./status.js":48}],47:[function(require,module,exports){
    57055668/**
    57065669 * wp.media.view.UploaderStatusError
    57075670 *
     
    57195682});
    57205683
    57215684module.exports = UploaderStatusError;
    5722 },{"../view.js":51}],48:[function(require,module,exports){
    5723 /*globals _, wp */
    57245685
     5686},{"../view.js":51}],48:[function(require,module,exports){
    57255687/**
    57265688 * wp.media.view.UploaderStatus
    57275689 *
     
    58595821});
    58605822
    58615823module.exports = UploaderStatus;
    5862 },{"../view.js":51,"./status-error.js":47}],49:[function(require,module,exports){
    5863 /*globals _, wp, jQuery */
    58645824
     5825},{"../view.js":51,"./status-error.js":47}],49:[function(require,module,exports){
    58655826/**
    58665827 * wp.media.view.UploaderWindow
    58675828 *
     
    59725933});
    59735934
    59745935module.exports = UploaderWindow;
    5975 },{"../view.js":51}],50:[function(require,module,exports){
    5976 /*globals wp */
    59775936
     5937},{"../view.js":51}],50:[function(require,module,exports){
    59785938/**
    59795939 * wp.media.view.VideoDetails
    59805940 *
     
    60165976});
    60175977
    60185978module.exports = VideoDetails;
    6019 },{"./media-details":31}],51:[function(require,module,exports){
    6020 /*globals wp */
    60215979
     5980},{"./media-details":31}],51:[function(require,module,exports){
    60225981/**
    60235982 * wp.media.View
    60245983 *
     
    60836042});
    60846043
    60856044module.exports = View;
     6045
    60866046},{}]},{},[1]);
  • src/wp-includes/js/media/audio-video.manifest.js

     
    1 /* global wp, _wpMediaViewsL10n, _wpmejsSettings, MediaElementPlayer */
    2 
    3 (function(_) {
    4         var media = wp.media,
    5                 baseSettings = {},
    6                 l10n = typeof _wpMediaViewsL10n === 'undefined' ? {} : _wpMediaViewsL10n;
    7 
    8         if ( ! _.isUndefined( window._wpmejsSettings ) ) {
    9                 baseSettings = _wpmejsSettings;
    10         }
     1var media = wp.media,
     2        baseSettings = window._wpmejsSettings || {},
     3        l10n = window._wpMediaViewsL10n || {};
     4
     5/**
     6 * @mixin
     7 */
     8wp.media.mixin = {
     9        mejsSettings: baseSettings,
     10
     11        removeAllPlayers: function() {
     12                var p;
     13
     14                if ( window.mejs && window.mejs.players ) {
     15                        for ( p in window.mejs.players ) {
     16                                window.mejs.players[p].pause();
     17                                this.removePlayer( window.mejs.players[p] );
     18                        }
     19                }
     20        },
    1121
    1222        /**
    13          * @mixin
     23         * Override the MediaElement method for removing a player.
     24         *      MediaElement tries to pull the audio/video tag out of
     25         *      its container and re-add it to the DOM.
    1426         */
    15         wp.media.mixin = {
    16                 mejsSettings: baseSettings,
    17 
    18                 removeAllPlayers: function() {
    19                         var p;
    20 
    21                         if ( window.mejs && window.mejs.players ) {
    22                                 for ( p in window.mejs.players ) {
    23                                         window.mejs.players[p].pause();
    24                                         this.removePlayer( window.mejs.players[p] );
    25                                 }
    26                         }
    27                 },
     27        removePlayer: function(t) {
     28                var featureIndex, feature;
    2829
    29                 /**
    30                  * Override the MediaElement method for removing a player.
    31                  *      MediaElement tries to pull the audio/video tag out of
    32                  *      its container and re-add it to the DOM.
    33                  */
    34                 removePlayer: function(t) {
    35                         var featureIndex, feature;
    36 
    37                         if ( ! t.options ) {
    38                                 return;
    39                         }
    40 
    41                         // invoke features cleanup
    42                         for ( featureIndex in t.options.features ) {
    43                                 feature = t.options.features[featureIndex];
    44                                 if ( t['clean' + feature] ) {
    45                                         try {
    46                                                 t['clean' + feature](t);
    47                                         } catch (e) {}
    48                                 }
    49                         }
    50 
    51                         if ( ! t.isDynamic ) {
    52                                 t.$node.remove();
    53                         }
     30                if ( ! t.options ) {
     31                        return;
     32                }
    5433
    55                         if ( 'native' !== t.media.pluginType ) {
    56                                 t.media.remove();
     34                // invoke features cleanup
     35                for ( featureIndex in t.options.features ) {
     36                        feature = t.options.features[featureIndex];
     37                        if ( t['clean' + feature] ) {
     38                                try {
     39                                        t['clean' + feature](t);
     40                                } catch (e) {}
    5741                        }
     42                }
    5843
    59                         delete window.mejs.players[t.id];
    60 
    61                         t.container.remove();
    62                         t.globalUnbind();
    63                         delete t.node.player;
    64                 },
    65 
    66                 /**
    67                  * Allows any class that has set 'player' to a MediaElementPlayer
    68                  *  instance to remove the player when listening to events.
    69                  *
    70                  *  Examples: modal closes, shortcode properties are removed, etc.
    71                  */
    72                 unsetPlayers : function() {
    73                         if ( this.players && this.players.length ) {
    74                                 _.each( this.players, function (player) {
    75                                         player.pause();
    76                                         wp.media.mixin.removePlayer( player );
    77                                 } );
    78                                 this.players = [];
    79                         }
     44                if ( ! t.isDynamic ) {
     45                        t.$node.remove();
    8046                }
    81         };
    8247
    83         /**
    84          * Autowire "collection"-type shortcodes
    85          */
    86         wp.media.playlist = new wp.media.collection({
    87                 tag: 'playlist',
    88                 editTitle : l10n.editPlaylistTitle,
    89                 defaults : {
    90                         id: wp.media.view.settings.post.id,
    91                         style: 'light',
    92                         tracklist: true,
    93                         tracknumbers: true,
    94                         images: true,
    95                         artists: true,
    96                         type: 'audio'
     48                if ( 'native' !== t.media.pluginType ) {
     49                        t.media.remove();
    9750                }
    98         });
    9951
    100         /**
    101          * Shortcode modeling for audio
    102          *  `edit()` prepares the shortcode for the media modal
    103          *  `shortcode()` builds the new shortcode after update
    104          *
    105          * @namespace
    106          */
    107         wp.media.audio = {
    108                 coerce : wp.media.coerce,
     52                delete window.mejs.players[t.id];
    10953
    110                 defaults : {
    111                         id : wp.media.view.settings.post.id,
    112                         src : '',
    113                         loop : false,
    114                         autoplay : false,
    115                         preload : 'none',
    116                         width : 400
    117                 },
    118 
    119                 edit : function( data ) {
    120                         var frame, shortcode = wp.shortcode.next( 'audio', data ).shortcode;
    121 
    122                         frame = wp.media({
    123                                 frame: 'audio',
    124                                 state: 'audio-details',
    125                                 metadata: _.defaults( shortcode.attrs.named, this.defaults )
    126                         });
    127 
    128                         return frame;
    129                 },
    130 
    131                 shortcode : function( model ) {
    132                         var content;
    133 
    134                         _.each( this.defaults, function( value, key ) {
    135                                 model[ key ] = self.coerce( model, key );
    136 
    137                                 if ( value === model[ key ] ) {
    138                                         delete model[ key ];
    139                                 }
    140                         }, this );
    141 
    142                         content = model.content;
    143                         delete model.content;
    144 
    145                         return new wp.shortcode({
    146                                 tag: 'audio',
    147                                 attrs: model,
    148                                 content: content
    149                         });
    150                 }
    151         };
     54                t.container.remove();
     55                t.globalUnbind();
     56                delete t.node.player;
     57        },
    15258
    15359        /**
    154          * Shortcode modeling for video
    155          *  `edit()` prepares the shortcode for the media modal
    156          *  `shortcode()` builds the new shortcode after update
     60         * Allows any class that has set 'player' to a MediaElementPlayer
     61         *  instance to remove the player when listening to events.
    15762         *
    158          * @namespace
     63         *  Examples: modal closes, shortcode properties are removed, etc.
    15964         */
    160         wp.media.video = {
    161                 coerce : wp.media.coerce,
     65        unsetPlayers : function() {
     66                if ( this.players && this.players.length ) {
     67                        _.each( this.players, function (player) {
     68                                player.pause();
     69                                wp.media.mixin.removePlayer( player );
     70                        } );
     71                        this.players = [];
     72                }
     73        }
     74};
     75
     76/**
     77 * Autowire "collection"-type shortcodes
     78 */
     79wp.media.playlist = new wp.media.collection({
     80        tag: 'playlist',
     81        editTitle : l10n.editPlaylistTitle,
     82        defaults : {
     83                id: wp.media.view.settings.post.id,
     84                style: 'light',
     85                tracklist: true,
     86                tracknumbers: true,
     87                images: true,
     88                artists: true,
     89                type: 'audio'
     90        }
     91});
    16292
    163                 defaults : {
    164                         id : wp.media.view.settings.post.id,
    165                         src : '',
    166                         poster : '',
    167                         loop : false,
    168                         autoplay : false,
    169                         preload : 'metadata',
    170                         content : '',
    171                         width : 640,
    172                         height : 360
    173                 },
    174 
    175                 edit : function( data ) {
    176                         var frame,
    177                                 shortcode = wp.shortcode.next( 'video', data ).shortcode,
    178                                 attrs;
    179 
    180                         attrs = shortcode.attrs.named;
    181                         attrs.content = shortcode.content;
    182 
    183                         frame = wp.media({
    184                                 frame: 'video',
    185                                 state: 'video-details',
    186                                 metadata: _.defaults( attrs, this.defaults )
    187                         });
    188 
    189                         return frame;
    190                 },
    191 
    192                 shortcode : function( model ) {
    193                         var content;
    194 
    195                         _.each( this.defaults, function( value, key ) {
    196                                 model[ key ] = this.coerce( model, key );
    197 
    198                                 if ( value === model[ key ] ) {
    199                                         delete model[ key ];
    200                                 }
    201                         }, this );
    202 
    203                         content = model.content;
    204                         delete model.content;
    205 
    206                         return new wp.shortcode({
    207                                 tag: 'video',
    208                                 attrs: model,
    209                                 content: content
    210                         });
    211                 }
    212         };
    213 
    214         media.model.PostMedia = require( './models/post-media.js' );
    215         media.controller.AudioDetails = require( './controllers/audio-details.js' );
    216         media.controller.VideoDetails = require( './controllers/video-details.js' );
    217         media.view.MediaFrame.MediaDetails = require( './views/frame/media-details.js' );
    218         media.view.MediaFrame.AudioDetails = require( './views/frame/audio-details.js' );
    219         media.view.MediaFrame.VideoDetails = require( './views/frame/video-details.js' );
    220         media.view.MediaDetails = require( './views/media-details.js' );
    221         media.view.AudioDetails = require( './views/audio-details.js' );
    222         media.view.VideoDetails = require( './views/video-details.js' );
     93/**
     94 * Shortcode modeling for audio
     95 *  `edit()` prepares the shortcode for the media modal
     96 *  `shortcode()` builds the new shortcode after update
     97 *
     98 * @namespace
     99 */
     100wp.media.audio = {
     101        coerce : wp.media.coerce,
     102
     103        defaults : {
     104                id : wp.media.view.settings.post.id,
     105                src : '',
     106                loop : false,
     107                autoplay : false,
     108                preload : 'none',
     109                width : 400
     110        },
     111
     112        edit : function( data ) {
     113                var frame, shortcode = wp.shortcode.next( 'audio', data ).shortcode;
     114
     115                frame = wp.media({
     116                        frame: 'audio',
     117                        state: 'audio-details',
     118                        metadata: _.defaults( shortcode.attrs.named, this.defaults )
     119                });
     120
     121                return frame;
     122        },
     123
     124        shortcode : function( model ) {
     125                var content;
     126
     127                _.each( this.defaults, function( value, key ) {
     128                        model[ key ] = this.coerce( model, key );
     129
     130                        if ( value === model[ key ] ) {
     131                                delete model[ key ];
     132                        }
     133                }, this );
     134
     135                content = model.content;
     136                delete model.content;
     137
     138                return new wp.shortcode({
     139                        tag: 'audio',
     140                        attrs: model,
     141                        content: content
     142                });
     143        }
     144};
     145
     146/**
     147 * Shortcode modeling for video
     148 *  `edit()` prepares the shortcode for the media modal
     149 *  `shortcode()` builds the new shortcode after update
     150 *
     151 * @namespace
     152 */
     153wp.media.video = {
     154        coerce : wp.media.coerce,
     155
     156        defaults : {
     157                id : wp.media.view.settings.post.id,
     158                src : '',
     159                poster : '',
     160                loop : false,
     161                autoplay : false,
     162                preload : 'metadata',
     163                content : '',
     164                width : 640,
     165                height : 360
     166        },
     167
     168        edit : function( data ) {
     169                var frame,
     170                        shortcode = wp.shortcode.next( 'video', data ).shortcode,
     171                        attrs;
     172
     173                attrs = shortcode.attrs.named;
     174                attrs.content = shortcode.content;
     175
     176                frame = wp.media({
     177                        frame: 'video',
     178                        state: 'video-details',
     179                        metadata: _.defaults( attrs, this.defaults )
     180                });
     181
     182                return frame;
     183        },
     184
     185        shortcode : function( model ) {
     186                var content;
     187
     188                _.each( this.defaults, function( value, key ) {
     189                        model[ key ] = this.coerce( model, key );
     190
     191                        if ( value === model[ key ] ) {
     192                                delete model[ key ];
     193                        }
     194                }, this );
     195
     196                content = model.content;
     197                delete model.content;
     198
     199                return new wp.shortcode({
     200                        tag: 'video',
     201                        attrs: model,
     202                        content: content
     203                });
     204        }
     205};
    223206
    224 }(_));
    225  No newline at end of file
     207media.model.PostMedia = require( './models/post-media.js' );
     208media.controller.AudioDetails = require( './controllers/audio-details.js' );
     209media.controller.VideoDetails = require( './controllers/video-details.js' );
     210media.view.MediaFrame.MediaDetails = require( './views/frame/media-details.js' );
     211media.view.MediaFrame.AudioDetails = require( './views/frame/audio-details.js' );
     212media.view.MediaFrame.VideoDetails = require( './views/frame/video-details.js' );
     213media.view.MediaDetails = require( './views/media-details.js' );
     214media.view.AudioDetails = require( './views/audio-details.js' );
     215media.view.VideoDetails = require( './views/video-details.js' );
  • src/wp-includes/js/media/controllers/audio-details.js

     
    1 /*globals wp */
    2 
    31/**
    42 * The controller for the Audio Details state
    53 *
     
    2826        }
    2927});
    3028
    31 module.exports = AudioDetails;
    32  No newline at end of file
     29module.exports = AudioDetails;
  • src/wp-includes/js/media/controllers/collection-add.js

     
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.controller.CollectionAdd
    53 *
     
    9896        }
    9997});
    10098
    101 module.exports = CollectionAdd;
    102  No newline at end of file
     99module.exports = CollectionAdd;
  • src/wp-includes/js/media/controllers/collection-edit.js

     
    1 /*globals wp, jQuery, Backbone */
    2 
    31/**
    42 * wp.media.controller.CollectionEdit
    53 *
     
    159157        }
    160158});
    161159
    162 module.exports = CollectionEdit;
    163  No newline at end of file
     160module.exports = CollectionEdit;
  • src/wp-includes/js/media/controllers/cropper.js

     
    1 /*globals _, wp, Backbone */
    2 
    31/**
    42 * wp.media.controller.Cropper
    53 *
     
    7573
    7674                                                this.$el.text(l10n.cropping);
    7775                                                this.$el.attr('disabled', true);
    78                                                
     76
    7977                                                controller.state().doCrop( selection ).done( function( croppedImage ) {
    8078                                                        controller.trigger('cropped', croppedImage );
    8179                                                        controller.close();
     
    116114        }
    117115});
    118116
    119 module.exports = Cropper;
    120  No newline at end of file
     117module.exports = Cropper;
  • src/wp-includes/js/media/controllers/edit-attachment-metadata.js

     
    1 /*globals wp */
    2 
    31/**
    42 * wp.media.controller.EditAttachmentMetadata
    53 *
     
    2624        }
    2725});
    2826
    29 module.exports = EditAttachmentMetadata;
    30  No newline at end of file
     27module.exports = EditAttachmentMetadata;
  • src/wp-includes/js/media/controllers/edit-image.js

     
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.controller.EditImage
    53 *
     
    7573        }
    7674});
    7775
    78 module.exports = EditImage;
    79  No newline at end of file
     76module.exports = EditImage;
  • src/wp-includes/js/media/controllers/embed.js

     
    1 /*globals _, wp, jQuery, Backbone */
    2 
    31/**
    42 * wp.media.controller.Embed
    53 *
     
    134132        }
    135133});
    136134
    137 module.exports = Embed;
    138  No newline at end of file
     135module.exports = Embed;
  • src/wp-includes/js/media/controllers/featured-image.js

     
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.controller.FeaturedImage
    53 *
     
    119117        }
    120118});
    121119
    122 module.exports = FeaturedImage;
    123  No newline at end of file
     120module.exports = FeaturedImage;
  • src/wp-includes/js/media/controllers/gallery-add.js

     
    1 /*globals _, wp */
    2 
    31/**
    42 * A state for selecting more images to add to a gallery.
    53 *
     
    5149         */
    5250        initialize: function() {
    5351                // If a library wasn't supplied, create a library of images.
    54                 if ( ! this.get('library') )
     52                if ( ! this.get('library') ) {
    5553                        this.set( 'library', wp.media.query({ type: 'image' }) );
     54                }
    5655
    5756                Library.prototype.initialize.apply( this, arguments );
    5857        },
     
    6463                var library = this.get('library'),
    6564                        edit    = this.frame.state('gallery-edit').get('library');
    6665
    67                 if ( this.editLibrary && this.editLibrary !== edit )
     66                if ( this.editLibrary && this.editLibrary !== edit ) {
    6867                        library.unobserve( this.editLibrary );
     68                }
    6969
    7070                // Accepts attachments that exist in the original library and
    7171                // that do not exist in gallery's library.
     
    8484        }
    8585});
    8686
    87 module.exports = GalleryAdd;
    88  No newline at end of file
     87module.exports = GalleryAdd;
  • src/wp-includes/js/media/controllers/gallery-edit.js

     
    1 /*globals wp, Backbone */
    2 
    31/**
    42 * wp.media.controller.GalleryEdit
    53 *
     
    6159         */
    6260        initialize: function() {
    6361                // If we haven't been provided a `library`, create a `Selection`.
    64                 if ( ! this.get('library') )
     62                if ( ! this.get('library') ) {
    6563                        this.set( 'library', new wp.media.model.Selection() );
     64                }
    6665
    6766                // The single `Attachment` view to be used in the `Attachments` view.
    68                 if ( ! this.get('AttachmentView') )
     67                if ( ! this.get('AttachmentView') ) {
    6968                        this.set( 'AttachmentView', EditLibraryView );
     69                }
     70
    7071                Library.prototype.initialize.apply( this, arguments );
    7172        },
    7273
     
    136137        }
    137138});
    138139
    139 module.exports = GalleryEdit;
    140  No newline at end of file
     140module.exports = GalleryEdit;
  • src/wp-includes/js/media/controllers/image-details.js

     
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.controller.ImageDetails
    53 *
     
    5957        }
    6058});
    6159
    62 module.exports = ImageDetails;
    63  No newline at end of file
     60module.exports = ImageDetails;
  • src/wp-includes/js/media/controllers/library.js

     
    1 /*globals _, wp, Backbone, getUserSetting, setUserSetting */
    2 
    31/**
    42 * wp.media.controller.Library
    53 *
     
    3735var selectionSync = require( '../utils/selection-sync.js' ),
    3836        State = require( './state.js' ),
    3937        l10n = wp.media.view.l10n,
     38        getUserSetting = window.getUserSetting,
     39        setUserSetting = window.setUserSetting,
    4040        Library;
    4141
    4242Library = State.extend({
     
    7171                        this.set( 'library', wp.media.query() );
    7272                }
    7373
    74                 if ( ! (selection instanceof Selection) ) {
     74                if ( ! ( selection instanceof wp.media.model.Selection ) ) {
    7575                        props = selection;
    7676
    7777                        if ( ! props ) {
     
    269269// Make selectionSync available on any Media Library state.
    270270_.extend( Library.prototype, selectionSync );
    271271
    272 module.exports = Library;
    273  No newline at end of file
     272module.exports = Library;
  • src/wp-includes/js/media/controllers/media-library.js

     
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.controller.MediaLibrary
    53 *
     
    4745        }
    4846});
    4947
    50 module.exports = MediaLibrary;
    51  No newline at end of file
     48module.exports = MediaLibrary;
  • src/wp-includes/js/media/controllers/region.js

     
    1 /*globals _, Backbone */
    2 
    31/**
    42 * wp.media.controller.Region
    53 *
     
    176174        }
    177175});
    178176
    179 module.exports = Region;
    180  No newline at end of file
     177module.exports = Region;
  • src/wp-includes/js/media/controllers/replace-image.js

     
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.controller.ReplaceImage
    53 *
     
    105103        }
    106104});
    107105
    108 module.exports = ReplaceImage;
    109  No newline at end of file
     106module.exports = ReplaceImage;
  • src/wp-includes/js/media/controllers/state-machine.js

     
    1 /*globals _, Backbone */
    2 
    31/**
    42 * wp.media.controller.StateMachine
    53 *
     
    121119        };
    122120});
    123121
    124 module.exports = StateMachine;
    125  No newline at end of file
     122module.exports = StateMachine;
  • src/wp-includes/js/media/controllers/state.js

     
    1 /*globals _, Backbone */
    2 
    31/**
    42 * wp.media.controller.State
    53 *
     
    238236        };
    239237});
    240238
    241 module.exports = State;
    242  No newline at end of file
     239module.exports = State;
  • src/wp-includes/js/media/controllers/video-details.js

     
    1 /*globals wp */
    2 
    31/**
    42 * The controller for the Video Details state
    53 *
     
    2826        }
    2927});
    3028
    31 module.exports = VideoDetails;
    32  No newline at end of file
     29module.exports = VideoDetails;
  • src/wp-includes/js/media/grid.js

     
    11(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
    2 /*globals wp */
    3 
    42/**
    53 * wp.media.controller.EditAttachmentMetadata
    64 *
     
    2826});
    2927
    3028module.exports = EditAttachmentMetadata;
    31 },{"./state.js":6}],2:[function(require,module,exports){
    32 /*globals _, wp */
    3329
     30},{"./state.js":6}],2:[function(require,module,exports){
    3431/**
    3532 * wp.media.controller.EditImage
    3633 *
     
    107104});
    108105
    109106module.exports = EditImage;
    110 },{"../views/toolbar.js":46,"./state.js":6}],3:[function(require,module,exports){
    111 /*globals _, wp, Backbone, getUserSetting, setUserSetting */
    112107
     108},{"../views/toolbar.js":46,"./state.js":6}],3:[function(require,module,exports){
    113109/**
    114110 * wp.media.controller.Library
    115111 *
     
    147143var selectionSync = require( '../utils/selection-sync.js' ),
    148144        State = require( './state.js' ),
    149145        l10n = wp.media.view.l10n,
     146        getUserSetting = window.getUserSetting,
     147        setUserSetting = window.setUserSetting,
    150148        Library;
    151149
    152150Library = State.extend({
     
    181179                        this.set( 'library', wp.media.query() );
    182180                }
    183181
    184                 if ( ! (selection instanceof Selection) ) {
     182                if ( ! ( selection instanceof wp.media.model.Selection ) ) {
    185183                        props = selection;
    186184
    187185                        if ( ! props ) {
     
    380378_.extend( Library.prototype, selectionSync );
    381379
    382380module.exports = Library;
    383 },{"../utils/selection-sync.js":9,"./state.js":6}],4:[function(require,module,exports){
    384 /*globals _, Backbone */
    385381
     382},{"../utils/selection-sync.js":9,"./state.js":6}],4:[function(require,module,exports){
    386383/**
    387384 * wp.media.controller.Region
    388385 *
     
    560557});
    561558
    562559module.exports = Region;
    563 },{}],5:[function(require,module,exports){
    564 /*globals _, Backbone */
    565560
     561},{}],5:[function(require,module,exports){
    566562/**
    567563 * wp.media.controller.StateMachine
    568564 *
     
    685681});
    686682
    687683module.exports = StateMachine;
    688 },{}],6:[function(require,module,exports){
    689 /*globals _, Backbone */
    690684
     685},{}],6:[function(require,module,exports){
    691686/**
    692687 * wp.media.controller.State
    693688 *
     
    927922});
    928923
    929924module.exports = State;
     925
    930926},{}],7:[function(require,module,exports){
    931 /* global wp, _wpMediaViewsL10n, MediaElementPlayer, _wpMediaGridSettings */
    932 (function (wp) {
    933         var media = wp.media;
    934 
    935         media.controller.EditAttachmentMetadata = require( './controllers/edit-attachment-metadata.js' );
    936         media.view.MediaFrame.Manage = require( './views/frame/manage.js' );
    937         media.view.Attachment.Details.TwoColumn = require( './views/attachment/details-two-column.js' );
    938         media.view.MediaFrame.Manage.Router = require( './routers/manage.js' );
    939         media.view.EditImage.Details = require( './views/edit-image-details.js' );
    940         media.view.MediaFrame.EditAttachments = require( './views/frame/edit-attachments.js' );
    941         media.view.SelectModeToggleButton = require( './views/button/select-mode-toggle.js' );
    942         media.view.DeleteSelectedButton = require( './views/button/delete-selected.js' );
    943         media.view.DeleteSelectedPermanentlyButton = require( './views/button/delete-selected-permanently.js' );
     927var media = wp.media;
    944928
    945 }(wp));
    946 },{"./controllers/edit-attachment-metadata.js":1,"./routers/manage.js":8,"./views/attachment/details-two-column.js":16,"./views/button/delete-selected-permanently.js":22,"./views/button/delete-selected.js":23,"./views/button/select-mode-toggle.js":24,"./views/edit-image-details.js":25,"./views/frame/edit-attachments.js":29,"./views/frame/manage.js":30}],8:[function(require,module,exports){
    947 /*globals jQuery, Backbone */
     929media.controller.EditAttachmentMetadata = require( './controllers/edit-attachment-metadata.js' );
     930media.view.MediaFrame.Manage = require( './views/frame/manage.js' );
     931media.view.Attachment.Details.TwoColumn = require( './views/attachment/details-two-column.js' );
     932media.view.MediaFrame.Manage.Router = require( './routers/manage.js' );
     933media.view.EditImage.Details = require( './views/edit-image-details.js' );
     934media.view.MediaFrame.EditAttachments = require( './views/frame/edit-attachments.js' );
     935media.view.SelectModeToggleButton = require( './views/button/select-mode-toggle.js' );
     936media.view.DeleteSelectedButton = require( './views/button/delete-selected.js' );
     937media.view.DeleteSelectedPermanentlyButton = require( './views/button/delete-selected-permanently.js' );
    948938
     939},{"./controllers/edit-attachment-metadata.js":1,"./routers/manage.js":8,"./views/attachment/details-two-column.js":16,"./views/button/delete-selected-permanently.js":22,"./views/button/delete-selected.js":23,"./views/button/select-mode-toggle.js":24,"./views/edit-image-details.js":25,"./views/frame/edit-attachments.js":29,"./views/frame/manage.js":30}],8:[function(require,module,exports){
    949940/**
    950941 * A router for handling the browser history and application state.
    951942 *
     
    990981});
    991982
    992983module.exports = Router;
    993 },{}],9:[function(require,module,exports){
    994 /*globals _ */
    995984
     985},{}],9:[function(require,module,exports){
    996986/**
    997987 * wp.media.selectionSync
    998988 *
     
    10571047};
    10581048
    10591049module.exports = selectionSync;
    1060 },{}],10:[function(require,module,exports){
    1061 /*globals _ */
    10621050
     1051},{}],10:[function(require,module,exports){
    10631052/**
    10641053 * wp.media.view.AttachmentCompat
    10651054 *
     
    11431132});
    11441133
    11451134module.exports = AttachmentCompat;
    1146 },{"./view.js":51}],11:[function(require,module,exports){
    1147 /*globals _, jQuery */
    11481135
     1136},{"./view.js":51}],11:[function(require,module,exports){
    11491137/**
    11501138 * wp.media.view.AttachmentFilters
    11511139 *
     
    12221210});
    12231211
    12241212module.exports = AttachmentFilters;
    1225 },{"./view.js":51}],12:[function(require,module,exports){
    1226 /*globals _, wp */
    12271213
     1214},{"./view.js":51}],12:[function(require,module,exports){
    12281215/**
    12291216 * wp.media.view.AttachmentFilters.All
    12301217 *
     
    13141301});
    13151302
    13161303module.exports = All;
    1317 },{"../attachment-filters.js":11}],13:[function(require,module,exports){
    1318 /*globals _, wp */
    13191304
     1305},{"../attachment-filters.js":11}],13:[function(require,module,exports){
    13201306/**
    13211307 * A filter dropdown for month/dates.
    13221308 *
     
    13571343});
    13581344
    13591345module.exports = DateFilter;
    1360 },{"../attachment-filters.js":11}],14:[function(require,module,exports){
    1361 /*globals wp */
    13621346
     1347},{"../attachment-filters.js":11}],14:[function(require,module,exports){
    13631348/**
    13641349 * wp.media.view.AttachmentFilters.Uploaded
    13651350 *
     
    14181403});
    14191404
    14201405module.exports = Uploaded;
    1421 },{"../attachment-filters.js":11}],15:[function(require,module,exports){
    1422 /*globals _, wp, jQuery */
    14231406
     1407},{"../attachment-filters.js":11}],15:[function(require,module,exports){
    14241408/**
    14251409 * wp.media.view.Attachment
    14261410 *
     
    19731957});
    19741958
    19751959module.exports = Attachment;
    1976 },{"./view.js":51}],16:[function(require,module,exports){
    1977 /*globals wp */
    19781960
     1961},{"./view.js":51}],16:[function(require,module,exports){
    19791962/**
    19801963 * A similar view to media.view.Attachment.Details
    19811964 * for use in the Edit Attachment modal.
     
    20101993                wp.media.mixin.removeAllPlayers();
    20111994                this.$( 'audio, video' ).each( function (i, elem) {
    20121995                        var el = MediaDetails.prepareSrc( elem );
    2013                         new MediaElementPlayer( el, wp.media.mixin.mejsSettings );
     1996                        new window.MediaElementPlayer( el, wp.media.mixin.mejsSettings );
    20141997                } );
    20151998        }
    20161999});
    20172000
    20182001module.exports = TwoColumn;
    2019 },{"../media-details.js":33,"./details.js":17}],17:[function(require,module,exports){
    2020 /*globals _, wp */
    20212002
     2003},{"../media-details.js":33,"./details.js":17}],17:[function(require,module,exports){
    20222004/**
    20232005 * wp.media.view.Attachment.Details
    20242006 *
     
    20782060        deleteAttachment: function( event ) {
    20792061                event.preventDefault();
    20802062
    2081                 if ( confirm( l10n.warnDelete ) ) {
     2063                if ( window.confirm( l10n.warnDelete ) ) {
    20822064                        this.model.destroy();
    20832065                        // Keep focus inside media modal
    20842066                        // after image is deleted
     
    21572139});
    21582140
    21592141module.exports = Details;
     2142
    21602143},{"../attachment.js":15}],18:[function(require,module,exports){
    21612144/**
    21622145 * wp.media.view.Attachment.Library
     
    21772160});
    21782161
    21792162module.exports = Library;
    2180 },{"../attachment.js":15}],19:[function(require,module,exports){
    2181 /*globals _, wp, jQuery */
    21822163
     2164},{"../attachment.js":15}],19:[function(require,module,exports){
    21832165/**
    21842166 * wp.media.view.Attachments
    21852167 *
     
    24522434
    24532435                // The scroll event occurs on the document, but the element
    24542436                // that should be checked is the document body.
    2455                 if ( el == document ) {
     2437                if ( el === document ) {
    24562438                        el = document.body;
    24572439                        scrollTop = $(document).scrollTop();
    24582440                }
     
    24782460});
    24792461
    24802462module.exports = Attachments;
    2481 },{"./attachment.js":15,"./view.js":51}],20:[function(require,module,exports){
    2482 /*globals _, wp, jQuery */
    24832463
     2464},{"./attachment.js":15,"./view.js":51}],20:[function(require,module,exports){
    24842465/**
    24852466 * wp.media.view.AttachmentsBrowser
    24862467 *
     
    26712652                                                return;
    26722653                                        }
    26732654
    2674                                         if ( ! mediaTrash && ! confirm( l10n.warnBulkDelete ) ) {
     2655                                        if ( ! mediaTrash && ! window.confirm( l10n.warnBulkDelete ) ) {
    26752656                                                return;
    26762657                                        }
    26772658
    26782659                                        if ( mediaTrash &&
    26792660                                                'trash' !== selection.at( 0 ).get( 'status' ) &&
    2680                                                 ! confirm( l10n.warnBulkTrash ) ) {
     2661                                                ! window.confirm( l10n.warnBulkTrash ) ) {
    26812662
    26822663                                                return;
    26832664                                        }
     
    27252706                                        click: function() {
    27262707                                                var removed = [], selection = this.controller.state().get( 'selection' );
    27272708
    2728                                                 if ( ! selection.length || ! confirm( l10n.warnBulkDelete ) ) {
     2709                                                if ( ! selection.length || ! window.confirm( l10n.warnBulkDelete ) ) {
    27292710                                                        return;
    27302711                                                }
    27312712
     
    29382919});
    29392920
    29402921module.exports = AttachmentsBrowser;
    2941 },{"../attachment-compat.js":10,"../attachment-filters/all.js":12,"../attachment-filters/date.js":13,"../attachment-filters/uploaded.js":14,"../attachment/details.js":17,"../attachment/library.js":18,"../attachments.js":19,"../label.js":32,"../search.js":41,"../settings/attachment-display.js":43,"../sidebar.js":44,"../spinner.js":45,"../toolbar.js":46,"../uploader/inline.js":47,"../uploader/status.js":49,"../view.js":51}],21:[function(require,module,exports){
    2942 /*globals _, Backbone */
    29432922
     2923},{"../attachment-compat.js":10,"../attachment-filters/all.js":12,"../attachment-filters/date.js":13,"../attachment-filters/uploaded.js":14,"../attachment/details.js":17,"../attachment/library.js":18,"../attachments.js":19,"../label.js":32,"../search.js":41,"../settings/attachment-display.js":43,"../sidebar.js":44,"../spinner.js":45,"../toolbar.js":46,"../uploader/inline.js":47,"../uploader/status.js":49,"../view.js":51}],21:[function(require,module,exports){
    29442924/**
    29452925 * wp.media.view.Button
    29462926 *
     
    30283008});
    30293009
    30303010module.exports = Button;
     3011
    30313012},{"./view.js":51}],22:[function(require,module,exports){
    30323013/**
    30333014 * When MEDIA_TRASH is true, a button that handles bulk Delete Permanently logic
     
    30723053});
    30733054
    30743055module.exports = DeleteSelectedPermanently;
    3075 },{"../button.js":21,"./delete-selected.js":23}],23:[function(require,module,exports){
    3076 /*globals wp */
    30773056
     3057},{"../button.js":21,"./delete-selected.js":23}],23:[function(require,module,exports){
    30783058/**
    30793059 * A button that handles bulk Delete/Trash logic
    30803060 *
     
    31243104});
    31253105
    31263106module.exports = DeleteSelected;
    3127 },{"../button.js":21}],24:[function(require,module,exports){
    3128 /*globals wp */
    31293107
     3108},{"../button.js":21}],24:[function(require,module,exports){
    31303109var Button = require( '../button.js' ),
    31313110        l10n = wp.media.view.l10n,
    31323111        SelectModeToggle;
     
    31803159});
    31813160
    31823161module.exports = SelectModeToggle;
     3162
    31833163},{"../button.js":21}],25:[function(require,module,exports){
    31843164var View = require( './view.js' ),
    31853165        EditImage = require( './edit-image.js' ),
     
    32053185});
    32063186
    32073187module.exports = Details;
    3208 },{"./edit-image.js":26,"./view.js":51}],26:[function(require,module,exports){
    3209 /*globals _, wp */
    32103188
     3189},{"./edit-image.js":26,"./view.js":51}],26:[function(require,module,exports){
    32113190var View = require( './view.js' ),
    32123191        EditImage;
    32133192
     
    32593238});
    32603239
    32613240module.exports = EditImage;
     3241
    32623242},{"./view.js":51}],27:[function(require,module,exports){
    32633243/**
    32643244 * wp.media.view.FocusManager
     
    33073287});
    33083288
    33093289module.exports = FocusManager;
    3310 },{"./view.js":51}],28:[function(require,module,exports){
    3311 /*globals _, Backbone */
    33123290
     3291},{"./view.js":51}],28:[function(require,module,exports){
    33133292/**
    33143293 * wp.media.view.Frame
    33153294 *
     
    34803459_.extend( Frame.prototype, StateMachine.prototype );
    34813460
    34823461module.exports = Frame;
    3483 },{"../controllers/region.js":4,"../controllers/state-machine.js":5,"../controllers/state.js":6,"./view.js":51}],29:[function(require,module,exports){
    3484 /*globals _, wp, jQuery */
    34853462
     3463},{"../controllers/region.js":4,"../controllers/state-machine.js":5,"../controllers/state.js":6,"./view.js":51}],29:[function(require,module,exports){
    34863464/**
    34873465 * A frame for editing the details of a specific media item.
    34883466 *
     
    37273705});
    37283706
    37293707module.exports = EditAttachments;
    3730 },{"../../controllers/edit-attachment-metadata.js":1,"../../controllers/edit-image.js":2,"../attachment-compat.js":10,"../attachment/details-two-column.js":16,"../edit-image-details.js":25,"../frame.js":28,"../media-frame.js":34,"../modal.js":37}],30:[function(require,module,exports){
    3731 /*globals _, Backbone, wp, jQuery */
    37323708
     3709},{"../../controllers/edit-attachment-metadata.js":1,"../../controllers/edit-image.js":2,"../attachment-compat.js":10,"../attachment/details-two-column.js":16,"../edit-image-details.js":25,"../frame.js":28,"../media-frame.js":34,"../modal.js":37}],30:[function(require,module,exports){
    37333710/**
    37343711 * wp.media.view.MediaFrame.Manage
    37353712 *
     
    39673944                // Verify pushState support and activate
    39683945                if ( window.history && window.history.pushState ) {
    39693946                        Backbone.history.start( {
    3970                                 root: _wpMediaGridSettings.adminUrl,
     3947                                root: window._wpMediaGridSettings.adminUrl,
    39713948                                pushState: true
    39723949                        } );
    39733950                }
     
    39753952});
    39763953
    39773954module.exports = Manage;
     3955
    39783956},{"../../controllers/library.js":3,"../../routers/manage.js":8,"../attachments/browser.js":20,"../media-frame.js":34,"../uploader/window.js":50}],31:[function(require,module,exports){
    39793957/**
    39803958 * wp.media.view.Iframe
     
    40013979});
    40023980
    40033981module.exports = Iframe;
     3982
    40043983},{"./view.js":51}],32:[function(require,module,exports){
    40053984/**
    40063985 * @class
     
    40274006});
    40284007
    40294008module.exports = Label;
    4030 },{"./view.js":51}],33:[function(require,module,exports){
    4031 /*globals _, wp, jQuery */
    40324009
     4010},{"./view.js":51}],33:[function(require,module,exports){
    40334011/**
    40344012 * wp.media.view.MediaDetails
    40354013 *
     
    41134091         */
    41144092        setPlayer : function() {
    41154093                if ( ! this.players.length && this.media ) {
    4116                         this.players.push( new MediaElementPlayer( this.media, this.settings ) );
     4094                        this.players.push( new window.MediaElementPlayer( this.media, this.settings ) );
    41174095                }
    41184096        },
    41194097
     
    41414119         */
    41424120        render: function() {
    41434121                AttachmentDisplay.prototype.render.apply( this, arguments );
    4144                
     4122
    41454123                setTimeout( _.bind( function() {
    41464124                        this.resetFocus();
    41474125                }, this ), 10 );
     
    41804158});
    41814159
    41824160module.exports = MediaDetails;
    4183 },{"./settings/attachment-display.js":43}],34:[function(require,module,exports){
    4184 /*globals _, wp, jQuery */
    41854161
     4162},{"./settings/attachment-display.js":43}],34:[function(require,module,exports){
    41864163/**
    41874164 * wp.media.view.MediaFrame
    41884165 *
     
    44354412});
    44364413
    44374414module.exports = MediaFrame;
    4438 },{"./frame.js":28,"./iframe.js":31,"./menu.js":36,"./modal.js":37,"./router.js":40,"./toolbar.js":46,"./uploader/window.js":50,"./view.js":51}],35:[function(require,module,exports){
    4439 /*globals wp, jQuery */
    44404415
     4416},{"./frame.js":28,"./iframe.js":31,"./menu.js":36,"./modal.js":37,"./router.js":40,"./toolbar.js":46,"./uploader/window.js":50,"./view.js":51}],35:[function(require,module,exports){
    44414417/**
    44424418 * wp.media.view.MenuItem
    44434419 *
     
    45094485});
    45104486
    45114487module.exports = MenuItem;
     4488
    45124489},{"./view.js":51}],36:[function(require,module,exports){
    45134490/**
    45144491 * wp.media.view.Menu
     
    46254602});
    46264603
    46274604module.exports = Menu;
    4628 },{"./menu-item.js":35,"./priority-list.js":38}],37:[function(require,module,exports){
    4629 /*globals _, wp, jQuery */
    46304605
     4606},{"./menu-item.js":35,"./priority-list.js":38}],37:[function(require,module,exports){
    46314607/**
    46324608 * wp.media.view.Modal
    46334609 *
     
    48414817});
    48424818
    48434819module.exports = Modal;
    4844 },{"./focus-manager.js":27,"./view.js":51}],38:[function(require,module,exports){
    4845 /*globals _, Backbone */
    48464820
     4821},{"./focus-manager.js":27,"./view.js":51}],38:[function(require,module,exports){
    48474822/**
    48484823 * wp.media.view.PriorityList
    48494824 *
     
    49424917});
    49434918
    49444919module.exports = PriorityList;
     4920
    49454921},{"./view.js":51}],39:[function(require,module,exports){
    49464922/**
    49474923 * wp.media.view.RouterItem
     
    49684944});
    49694945
    49704946module.exports = RouterItem;
     4947
    49714948},{"./menu-item.js":35}],40:[function(require,module,exports){
    49724949/**
    49734950 * wp.media.view.Router
     
    50054982});
    50064983
    50074984module.exports = Router;
    5008 },{"./menu.js":36,"./router-item.js":39}],41:[function(require,module,exports){
    5009 /*globals wp */
    50104985
     4986},{"./menu.js":36,"./router-item.js":39}],41:[function(require,module,exports){
    50114987/**
    50124988 * wp.media.view.Search
    50134989 *
     
    50555031});
    50565032
    50575033module.exports = Search;
    5058 },{"./view.js":51}],42:[function(require,module,exports){
    5059 /*globals _, Backbone, jQuery */
    50605034
     5035},{"./view.js":51}],42:[function(require,module,exports){
    50615036/**
    50625037 * wp.media.view.Settings
    50635038 *
     
    51655140                // If the setting has a corresponding user setting,
    51665141                // update that as well.
    51675142                if ( userSetting = $setting.data('userSetting') ) {
    5168                         setUserSetting( userSetting, value );
     5143                        window.setUserSetting( userSetting, value );
    51695144                }
    51705145        },
    51715146
     
    51775152});
    51785153
    51795154module.exports = Settings;
    5180 },{"./view.js":51}],43:[function(require,module,exports){
    5181 /*globals _, wp */
    51825155
     5156},{"./view.js":51}],43:[function(require,module,exports){
    51835157/**
    51845158 * wp.media.view.Settings.AttachmentDisplay
    51855159 *
     
    52725246});
    52735247
    52745248module.exports = AttachmentDisplay;
     5249
    52755250},{"../settings.js":42}],44:[function(require,module,exports){
    52765251/**
    52775252 * wp.media.view.Sidebar
     
    52905265});
    52915266
    52925267module.exports = Sidebar;
    5293 },{"./priority-list.js":38}],45:[function(require,module,exports){
    5294 /*globals _, wp */
    52955268
     5269},{"./priority-list.js":38}],45:[function(require,module,exports){
    52965270/**
    52975271 * wp.media.view.Spinner
    52985272 *
     
    53295303});
    53305304
    53315305module.exports = Spinner;
    5332 },{"./view.js":51}],46:[function(require,module,exports){
    5333 /*globals Backbone, _ */
    53345306
     5307},{"./view.js":51}],46:[function(require,module,exports){
    53355308/**
    53365309 * wp.media.view.Toolbar
    53375310 *
     
    54925465});
    54935466
    54945467module.exports = Toolbar;
    5495 },{"./button.js":21,"./priority-list.js":38,"./view.js":51}],47:[function(require,module,exports){
    5496 /*globals _, wp */
    54975468
     5469},{"./button.js":21,"./priority-list.js":38,"./view.js":51}],47:[function(require,module,exports){
    54985470/**
    54995471 * wp.media.view.UploaderInline
    55005472 *
     
    56255597});
    56265598
    56275599module.exports = UploaderInline;
    5628 },{"../view.js":51,"./status.js":49}],48:[function(require,module,exports){
    5629 /*globals wp */
    56305600
     5601},{"../view.js":51,"./status.js":49}],48:[function(require,module,exports){
    56315602/**
    56325603 * wp.media.view.UploaderStatusError
    56335604 *
     
    56455616});
    56465617
    56475618module.exports = UploaderStatusError;
    5648 },{"../view.js":51}],49:[function(require,module,exports){
    5649 /*globals _, wp */
    56505619
     5620},{"../view.js":51}],49:[function(require,module,exports){
    56515621/**
    56525622 * wp.media.view.UploaderStatus
    56535623 *
     
    57855755});
    57865756
    57875757module.exports = UploaderStatus;
    5788 },{"../view.js":51,"./status-error.js":48}],50:[function(require,module,exports){
    5789 /*globals _, wp, jQuery */
    57905758
     5759},{"../view.js":51,"./status-error.js":48}],50:[function(require,module,exports){
    57915760/**
    57925761 * wp.media.view.UploaderWindow
    57935762 *
     
    58985867});
    58995868
    59005869module.exports = UploaderWindow;
    5901 },{"../view.js":51}],51:[function(require,module,exports){
    5902 /*globals wp */
    59035870
     5871},{"../view.js":51}],51:[function(require,module,exports){
    59045872/**
    59055873 * wp.media.View
    59065874 *
     
    59655933});
    59665934
    59675935module.exports = View;
     5936
    59685937},{}]},{},[7]);
  • src/wp-includes/js/media/grid.manifest.js

     
    1 /* global wp, _wpMediaViewsL10n, MediaElementPlayer, _wpMediaGridSettings */
    2 (function (wp) {
    3         var media = wp.media;
     1var media = wp.media;
    42
    5         media.controller.EditAttachmentMetadata = require( './controllers/edit-attachment-metadata.js' );
    6         media.view.MediaFrame.Manage = require( './views/frame/manage.js' );
    7         media.view.Attachment.Details.TwoColumn = require( './views/attachment/details-two-column.js' );
    8         media.view.MediaFrame.Manage.Router = require( './routers/manage.js' );
    9         media.view.EditImage.Details = require( './views/edit-image-details.js' );
    10         media.view.MediaFrame.EditAttachments = require( './views/frame/edit-attachments.js' );
    11         media.view.SelectModeToggleButton = require( './views/button/select-mode-toggle.js' );
    12         media.view.DeleteSelectedButton = require( './views/button/delete-selected.js' );
    13         media.view.DeleteSelectedPermanentlyButton = require( './views/button/delete-selected-permanently.js' );
    14 
    15 }(wp));
    16  No newline at end of file
     3media.controller.EditAttachmentMetadata = require( './controllers/edit-attachment-metadata.js' );
     4media.view.MediaFrame.Manage = require( './views/frame/manage.js' );
     5media.view.Attachment.Details.TwoColumn = require( './views/attachment/details-two-column.js' );
     6media.view.MediaFrame.Manage.Router = require( './routers/manage.js' );
     7media.view.EditImage.Details = require( './views/edit-image-details.js' );
     8media.view.MediaFrame.EditAttachments = require( './views/frame/edit-attachments.js' );
     9media.view.SelectModeToggleButton = require( './views/button/select-mode-toggle.js' );
     10media.view.DeleteSelectedButton = require( './views/button/delete-selected.js' );
     11media.view.DeleteSelectedPermanentlyButton = require( './views/button/delete-selected-permanently.js' );
  • src/wp-includes/js/media/models/attachment.js

     
    1 /*globals jQuery, Backbone, _, wp */
    2 
    31/**
    42 * wp.media.model.Attachment
    53 *
     
    128126                        return $.Deferred().rejectWith( this ).promise();
    129127                }
    130128
    131                 return media.post( 'save-attachment-compat', _.defaults({
     129                return wp.media.post( 'save-attachment-compat', _.defaults({
    132130                        id:      this.id,
    133131                        nonce:   this.get('nonces').update,
    134132                        post_id: wp.media.model.settings.post.id
     
    165163        })
    166164});
    167165
    168 module.exports = Attachment;
    169  No newline at end of file
     166module.exports = Attachment;
  • src/wp-includes/js/media/models/attachments.js

     
    1 /*globals jQuery, Backbone, _, wp */
    2 
    31/**
    42 * wp.media.model.Attachments
    53 *
     
    323321                // checking if we're still mirroring that collection when
    324322                // the request resolves.
    325323                mirroring.more( options ).done( function() {
    326                         if ( this === attachments.mirroring )
     324                        if ( this === attachments.mirroring ) {
    327325                                deferred.resolveWith( this );
     326                        }
    328327                });
    329328
    330329                return deferred.promise();
     
    532531        }
    533532});
    534533
    535 module.exports = Attachments;
    536  No newline at end of file
     534module.exports = Attachments;
  • src/wp-includes/js/media/models/post-image.js

     
    1 /*globals jQuery, Backbone */
    2 
    31/**
    42 * wp.media.model.PostImage
    53 *
     
    153151        }
    154152});
    155153
    156 module.exports = PostImage;
    157  No newline at end of file
     154module.exports = PostImage;
  • src/wp-includes/js/media/models/post-media.js

     
    1 /*globals Backbone, _, wp */
    2 
    31/**
    42 * Shared model class for audio and video. Updates the model after
    53 *   "Add Audio|Video Source" and "Replace Audio|Video" states return
     
    3735        }
    3836});
    3937
    40 module.exports = PostMedia;
    41  No newline at end of file
     38module.exports = PostMedia;
  • src/wp-includes/js/media/models/query.js

     
    1 /*globals jQuery, _, wp */
    2 
    31/**
    42 * wp.media.model.Query
    53 *
     
    305303        }())
    306304});
    307305
    308 module.exports = Query;
    309  No newline at end of file
     306module.exports = Query;
  • src/wp-includes/js/media/models/selection.js

     
    1 /*globals _ */
    2 
    31/**
    42 * wp.media.model.Selection
    53 *
     
    9492        }
    9593});
    9694
    97 module.exports = Selection;
    98  No newline at end of file
     95module.exports = Selection;
  • src/wp-includes/js/media/models.js

     
    11(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
    2 /* global _wpMediaModelsL10n:false */
     2var $ = jQuery,
     3        Attachment, Attachments, l10n, media;
     4
    35window.wp = window.wp || {};
    46
    5 (function($){
    6         var Attachment, Attachments, l10n, media;
     7/**
     8 * Create and return a media frame.
     9 *
     10 * Handles the default media experience.
     11 *
     12 * @param  {object} attributes The properties passed to the main media controller.
     13 * @return {wp.media.view.MediaFrame} A media workflow.
     14 */
     15media = wp.media = function( attributes ) {
     16        var MediaFrame = media.view.MediaFrame,
     17                frame;
    718
    8         /**
    9          * Create and return a media frame.
    10          *
    11          * Handles the default media experience.
    12          *
    13          * @param  {object} attributes The properties passed to the main media controller.
    14          * @return {wp.media.view.MediaFrame} A media workflow.
    15          */
    16         media = wp.media = function( attributes ) {
    17                 var MediaFrame = media.view.MediaFrame,
    18                         frame;
     19        if ( ! MediaFrame ) {
     20                return;
     21        }
    1922
    20                 if ( ! MediaFrame ) {
    21                         return;
    22                 }
     23        attributes = _.defaults( attributes || {}, {
     24                frame: 'select'
     25        });
    2326
    24                 attributes = _.defaults( attributes || {}, {
    25                         frame: 'select'
    26                 });
     27        if ( 'select' === attributes.frame && MediaFrame.Select ) {
     28                frame = new MediaFrame.Select( attributes );
     29        } else if ( 'post' === attributes.frame && MediaFrame.Post ) {
     30                frame = new MediaFrame.Post( attributes );
     31        } else if ( 'manage' === attributes.frame && MediaFrame.Manage ) {
     32                frame = new MediaFrame.Manage( attributes );
     33        } else if ( 'image' === attributes.frame && MediaFrame.ImageDetails ) {
     34                frame = new MediaFrame.ImageDetails( attributes );
     35        } else if ( 'audio' === attributes.frame && MediaFrame.AudioDetails ) {
     36                frame = new MediaFrame.AudioDetails( attributes );
     37        } else if ( 'video' === attributes.frame && MediaFrame.VideoDetails ) {
     38                frame = new MediaFrame.VideoDetails( attributes );
     39        } else if ( 'edit-attachments' === attributes.frame && MediaFrame.EditAttachments ) {
     40                frame = new MediaFrame.EditAttachments( attributes );
     41        }
    2742
    28                 if ( 'select' === attributes.frame && MediaFrame.Select ) {
    29                         frame = new MediaFrame.Select( attributes );
    30                 } else if ( 'post' === attributes.frame && MediaFrame.Post ) {
    31                         frame = new MediaFrame.Post( attributes );
    32                 } else if ( 'manage' === attributes.frame && MediaFrame.Manage ) {
    33                         frame = new MediaFrame.Manage( attributes );
    34                 } else if ( 'image' === attributes.frame && MediaFrame.ImageDetails ) {
    35                         frame = new MediaFrame.ImageDetails( attributes );
    36                 } else if ( 'audio' === attributes.frame && MediaFrame.AudioDetails ) {
    37                         frame = new MediaFrame.AudioDetails( attributes );
    38                 } else if ( 'video' === attributes.frame && MediaFrame.VideoDetails ) {
    39                         frame = new MediaFrame.VideoDetails( attributes );
    40                 } else if ( 'edit-attachments' === attributes.frame && MediaFrame.EditAttachments ) {
    41                         frame = new MediaFrame.EditAttachments( attributes );
    42                 }
     43        delete attributes.frame;
    4344
    44                 delete attributes.frame;
     45        media.frame = frame;
    4546
    46                 media.frame = frame;
     47        return frame;
     48};
    4749
    48                 return frame;
    49         };
     50_.extend( media, { model: {}, view: {}, controller: {}, frames: {} });
    5051
    51         _.extend( media, { model: {}, view: {}, controller: {}, frames: {} });
     52// Link any localized strings.
     53l10n = media.model.l10n = window._wpMediaModelsL10n || {};
    5254
    53         // Link any localized strings.
    54         l10n = media.model.l10n = typeof _wpMediaModelsL10n === 'undefined' ? {} : _wpMediaModelsL10n;
     55// Link any settings.
     56media.model.settings = l10n.settings || {};
     57delete l10n.settings;
    5558
    56         // Link any settings.
    57         media.model.settings = l10n.settings || {};
    58         delete l10n.settings;
     59Attachments = media.model.Attachments = require( './models/attachments.js' );
     60Attachment = media.model.Attachment = require( './models/attachment.js' );
    5961
    60         Attachments = media.model.Attachments = require( './models/attachments.js' );
    61         Attachment = media.model.Attachment = require( './models/attachment.js' );
     62media.model.Query = require( './models/query.js' );
     63media.model.PostImage = require( './models/post-image.js' );
     64media.model.Selection = require( './models/selection.js' );
    6265
    63         media.model.Query = require( './models/query.js' );
    64         media.model.PostImage = require( './models/post-image.js' );
    65         media.model.Selection = require( './models/selection.js' );
     66/**
     67 * ========================================================================
     68 * UTILITIES
     69 * ========================================================================
     70 */
    6671
    67         /**
    68          * ========================================================================
    69          * UTILITIES
    70          * ========================================================================
    71          */
     72/**
     73 * A basic equality comparator for Backbone models.
     74 *
     75 * Used to order models within a collection - @see wp.media.model.Attachments.comparator().
     76 *
     77 * @param  {mixed}  a  The primary parameter to compare.
     78 * @param  {mixed}  b  The primary parameter to compare.
     79 * @param  {string} ac The fallback parameter to compare, a's cid.
     80 * @param  {string} bc The fallback parameter to compare, b's cid.
     81 * @return {number}    -1: a should come before b.
     82 *                      0: a and b are of the same rank.
     83 *                      1: b should come before a.
     84 */
     85media.compare = function( a, b, ac, bc ) {
     86        if ( _.isEqual( a, b ) ) {
     87                return ac === bc ? 0 : (ac > bc ? -1 : 1);
     88        } else {
     89                return a > b ? -1 : 1;
     90        }
     91};
    7292
     93_.extend( media, {
    7394        /**
    74          * A basic equality comparator for Backbone models.
     95         * media.template( id )
     96         *
     97         * Fetch a JavaScript template for an id, and return a templating function for it.
    7598         *
    76          * Used to order models within a collection - @see wp.media.model.Attachments.comparator().
     99         * See wp.template() in `wp-includes/js/wp-util.js`.
    77100         *
    78          * @param  {mixed}  a  The primary parameter to compare.
    79          * @param  {mixed}  b  The primary parameter to compare.
    80          * @param  {string} ac The fallback parameter to compare, a's cid.
    81          * @param  {string} bc The fallback parameter to compare, b's cid.
    82          * @return {number}    -1: a should come before b.
    83          *                      0: a and b are of the same rank.
    84          *                      1: b should come before a.
     101         * @borrows wp.template as template
    85102         */
    86         media.compare = function( a, b, ac, bc ) {
    87                 if ( _.isEqual( a, b ) ) {
    88                         return ac === bc ? 0 : (ac > bc ? -1 : 1);
    89                 } else {
    90                         return a > b ? -1 : 1;
    91                 }
    92         };
    93 
    94         _.extend( media, {
    95                 /**
    96                  * media.template( id )
    97                  *
    98                  * Fetch a JavaScript template for an id, and return a templating function for it.
    99                  *
    100                  * See wp.template() in `wp-includes/js/wp-util.js`.
    101                  *
    102                  * @borrows wp.template as template
    103                  */
    104                 template: wp.template,
    105 
    106                 /**
    107                  * media.post( [action], [data] )
    108                  *
    109                  * Sends a POST request to WordPress.
    110                  * See wp.ajax.post() in `wp-includes/js/wp-util.js`.
    111                  *
    112                  * @borrows wp.ajax.post as post
    113                  */
    114                 post: wp.ajax.post,
    115 
    116                 /**
    117                  * media.ajax( [action], [options] )
    118                  *
    119                  * Sends an XHR request to WordPress.
    120                  * See wp.ajax.send() in `wp-includes/js/wp-util.js`.
    121                  *
    122                  * @borrows wp.ajax.send as ajax
    123                  */
    124                 ajax: wp.ajax.send,
    125 
    126                 /**
    127                  * Scales a set of dimensions to fit within bounding dimensions.
    128                  *
    129                  * @param {Object} dimensions
    130                  * @returns {Object}
    131                  */
    132                 fit: function( dimensions ) {
    133                         var width     = dimensions.width,
    134                                 height    = dimensions.height,
    135                                 maxWidth  = dimensions.maxWidth,
    136                                 maxHeight = dimensions.maxHeight,
    137                                 constraint;
    138 
    139                         // Compare ratios between the two values to determine which
    140                         // max to constrain by. If a max value doesn't exist, then the
    141                         // opposite side is the constraint.
    142                         if ( ! _.isUndefined( maxWidth ) && ! _.isUndefined( maxHeight ) ) {
    143                                 constraint = ( width / height > maxWidth / maxHeight ) ? 'width' : 'height';
    144                         } else if ( _.isUndefined( maxHeight ) ) {
    145                                 constraint = 'width';
    146                         } else if (  _.isUndefined( maxWidth ) && height > maxHeight ) {
    147                                 constraint = 'height';
    148                         }
    149 
    150                         // If the value of the constrained side is larger than the max,
    151                         // then scale the values. Otherwise return the originals; they fit.
    152                         if ( 'width' === constraint && width > maxWidth ) {
    153                                 return {
    154                                         width : maxWidth,
    155                                         height: Math.round( maxWidth * height / width )
    156                                 };
    157                         } else if ( 'height' === constraint && height > maxHeight ) {
    158                                 return {
    159                                         width : Math.round( maxHeight * width / height ),
    160                                         height: maxHeight
    161                                 };
    162                         } else {
    163                                 return {
    164                                         width : width,
    165                                         height: height
    166                                 };
    167                         }
    168                 },
    169                 /**
    170                  * Truncates a string by injecting an ellipsis into the middle.
    171                  * Useful for filenames.
    172                  *
    173                  * @param {String} string
    174                  * @param {Number} [length=30]
    175                  * @param {String} [replacement=&hellip;]
    176                  * @returns {String} The string, unless length is greater than string.length.
    177                  */
    178                 truncate: function( string, length, replacement ) {
    179                         length = length || 30;
    180                         replacement = replacement || '&hellip;';
    181 
    182                         if ( string.length <= length ) {
    183                                 return string;
    184                         }
    185 
    186                         return string.substr( 0, length / 2 ) + replacement + string.substr( -1 * length / 2 );
    187                 }
    188         });
     103        template: wp.template,
    189104
    190105        /**
    191          * ========================================================================
    192          * MODELS
    193          * ========================================================================
     106         * media.post( [action], [data] )
     107         *
     108         * Sends a POST request to WordPress.
     109         * See wp.ajax.post() in `wp-includes/js/wp-util.js`.
     110         *
     111         * @borrows wp.ajax.post as post
    194112         */
     113        post: wp.ajax.post,
     114
    195115        /**
    196          * wp.media.attachment
     116         * media.ajax( [action], [options] )
    197117         *
    198          * @static
    199          * @param {String} id A string used to identify a model.
    200          * @returns {wp.media.model.Attachment}
     118         * Sends an XHR request to WordPress.
     119         * See wp.ajax.send() in `wp-includes/js/wp-util.js`.
     120         *
     121         * @borrows wp.ajax.send as ajax
    201122         */
    202         media.attachment = function( id ) {
    203                 return Attachment.get( id );
    204         };
     123        ajax: wp.ajax.send,
    205124
    206125        /**
    207          * A collection of all attachments that have been fetched from the server.
     126         * Scales a set of dimensions to fit within bounding dimensions.
    208127         *
    209          * @static
    210          * @member {wp.media.model.Attachments}
     128         * @param {Object} dimensions
     129         * @returns {Object}
    211130         */
    212         Attachments.all = new Attachments();
     131        fit: function( dimensions ) {
     132                var width     = dimensions.width,
     133                        height    = dimensions.height,
     134                        maxWidth  = dimensions.maxWidth,
     135                        maxHeight = dimensions.maxHeight,
     136                        constraint;
    213137
     138                // Compare ratios between the two values to determine which
     139                // max to constrain by. If a max value doesn't exist, then the
     140                // opposite side is the constraint.
     141                if ( ! _.isUndefined( maxWidth ) && ! _.isUndefined( maxHeight ) ) {
     142                        constraint = ( width / height > maxWidth / maxHeight ) ? 'width' : 'height';
     143                } else if ( _.isUndefined( maxHeight ) ) {
     144                        constraint = 'width';
     145                } else if (  _.isUndefined( maxWidth ) && height > maxHeight ) {
     146                        constraint = 'height';
     147                }
     148
     149                // If the value of the constrained side is larger than the max,
     150                // then scale the values. Otherwise return the originals; they fit.
     151                if ( 'width' === constraint && width > maxWidth ) {
     152                        return {
     153                                width : maxWidth,
     154                                height: Math.round( maxWidth * height / width )
     155                        };
     156                } else if ( 'height' === constraint && height > maxHeight ) {
     157                        return {
     158                                width : Math.round( maxHeight * width / height ),
     159                                height: maxHeight
     160                        };
     161                } else {
     162                        return {
     163                                width : width,
     164                                height: height
     165                        };
     166                }
     167        },
    214168        /**
    215          * wp.media.query
     169         * Truncates a string by injecting an ellipsis into the middle.
     170         * Useful for filenames.
    216171         *
    217          * Shorthand for creating a new Attachments Query.
    218          *
    219          * @param {object} [props]
    220          * @returns {wp.media.model.Attachments}
     172         * @param {String} string
     173         * @param {Number} [length=30]
     174         * @param {String} [replacement=&hellip;]
     175         * @returns {String} The string, unless length is greater than string.length.
    221176         */
    222         media.query = function( props ) {
    223                 return new Attachments( null, {
    224                         props: _.extend( _.defaults( props || {}, { orderby: 'date' } ), { query: true } )
    225                 });
    226         };
     177        truncate: function( string, length, replacement ) {
     178                length = length || 30;
     179                replacement = replacement || '&hellip;';
    227180
    228         // Clean up. Prevents mobile browsers caching
    229         $(window).on('unload', function(){
    230                 window.wp = null;
     181                if ( string.length <= length ) {
     182                        return string;
     183                }
     184
     185                return string.substr( 0, length / 2 ) + replacement + string.substr( -1 * length / 2 );
     186        }
     187});
     188
     189/**
     190 * ========================================================================
     191 * MODELS
     192 * ========================================================================
     193 */
     194/**
     195 * wp.media.attachment
     196 *
     197 * @static
     198 * @param {String} id A string used to identify a model.
     199 * @returns {wp.media.model.Attachment}
     200 */
     201media.attachment = function( id ) {
     202        return Attachment.get( id );
     203};
     204
     205/**
     206 * A collection of all attachments that have been fetched from the server.
     207 *
     208 * @static
     209 * @member {wp.media.model.Attachments}
     210 */
     211Attachments.all = new Attachments();
     212
     213/**
     214 * wp.media.query
     215 *
     216 * Shorthand for creating a new Attachments Query.
     217 *
     218 * @param {object} [props]
     219 * @returns {wp.media.model.Attachments}
     220 */
     221media.query = function( props ) {
     222        return new Attachments( null, {
     223                props: _.extend( _.defaults( props || {}, { orderby: 'date' } ), { query: true } )
    231224        });
     225};
    232226
    233 }(jQuery));
    234 },{"./models/attachment.js":2,"./models/attachments.js":3,"./models/post-image.js":4,"./models/query.js":5,"./models/selection.js":6}],2:[function(require,module,exports){
    235 /*globals jQuery, Backbone, _, wp */
     227// Clean up. Prevents mobile browsers caching
     228$(window).on('unload', function(){
     229        window.wp = null;
     230});
    236231
     232},{"./models/attachment.js":2,"./models/attachments.js":3,"./models/post-image.js":4,"./models/query.js":5,"./models/selection.js":6}],2:[function(require,module,exports){
    237233/**
    238234 * wp.media.model.Attachment
    239235 *
     
    362358                        return $.Deferred().rejectWith( this ).promise();
    363359                }
    364360
    365                 return media.post( 'save-attachment-compat', _.defaults({
     361                return wp.media.post( 'save-attachment-compat', _.defaults({
    366362                        id:      this.id,
    367363                        nonce:   this.get('nonces').update,
    368364                        post_id: wp.media.model.settings.post.id
     
    400396});
    401397
    402398module.exports = Attachment;
    403 },{"./attachments.js":3}],3:[function(require,module,exports){
    404 /*globals jQuery, Backbone, _, wp */
    405399
     400},{"./attachments.js":3}],3:[function(require,module,exports){
    406401/**
    407402 * wp.media.model.Attachments
    408403 *
     
    726721                // checking if we're still mirroring that collection when
    727722                // the request resolves.
    728723                mirroring.more( options ).done( function() {
    729                         if ( this === attachments.mirroring )
     724                        if ( this === attachments.mirroring ) {
    730725                                deferred.resolveWith( this );
     726                        }
    731727                });
    732728
    733729                return deferred.promise();
     
    936932});
    937933
    938934module.exports = Attachments;
    939 },{"./attachment.js":2,"./query.js":5}],4:[function(require,module,exports){
    940 /*globals jQuery, Backbone */
    941935
     936},{"./attachment.js":2,"./query.js":5}],4:[function(require,module,exports){
    942937/**
    943938 * wp.media.model.PostImage
    944939 *
     
    10931088});
    10941089
    10951090module.exports = PostImage;
    1096 },{"./attachment":2}],5:[function(require,module,exports){
    1097 /*globals jQuery, _, wp */
    10981091
     1092},{"./attachment":2}],5:[function(require,module,exports){
    10991093/**
    11001094 * wp.media.model.Query
    11011095 *
     
    14021396});
    14031397
    14041398module.exports = Query;
    1405 },{"./attachments.js":3}],6:[function(require,module,exports){
    1406 /*globals _ */
    14071399
     1400},{"./attachments.js":3}],6:[function(require,module,exports){
    14081401/**
    14091402 * wp.media.model.Selection
    14101403 *
     
    15001493});
    15011494
    15021495module.exports = Selection;
     1496
    15031497},{"./attachments.js":3}]},{},[1]);
  • src/wp-includes/js/media/models.manifest.js

     
    1 /* global _wpMediaModelsL10n:false */
     1var $ = jQuery,
     2        Attachment, Attachments, l10n, media;
     3
    24window.wp = window.wp || {};
    35
    4 (function($){
    5         var Attachment, Attachments, l10n, media;
     6/**
     7 * Create and return a media frame.
     8 *
     9 * Handles the default media experience.
     10 *
     11 * @param  {object} attributes The properties passed to the main media controller.
     12 * @return {wp.media.view.MediaFrame} A media workflow.
     13 */
     14media = wp.media = function( attributes ) {
     15        var MediaFrame = media.view.MediaFrame,
     16                frame;
     17
     18        if ( ! MediaFrame ) {
     19                return;
     20        }
    621
    7         /**
    8          * Create and return a media frame.
    9          *
    10          * Handles the default media experience.
    11          *
    12          * @param  {object} attributes The properties passed to the main media controller.
    13          * @return {wp.media.view.MediaFrame} A media workflow.
    14          */
    15         media = wp.media = function( attributes ) {
    16                 var MediaFrame = media.view.MediaFrame,
    17                         frame;
     22        attributes = _.defaults( attributes || {}, {
     23                frame: 'select'
     24        });
    1825
    19                 if ( ! MediaFrame ) {
    20                         return;
    21                 }
     26        if ( 'select' === attributes.frame && MediaFrame.Select ) {
     27                frame = new MediaFrame.Select( attributes );
     28        } else if ( 'post' === attributes.frame && MediaFrame.Post ) {
     29                frame = new MediaFrame.Post( attributes );
     30        } else if ( 'manage' === attributes.frame && MediaFrame.Manage ) {
     31                frame = new MediaFrame.Manage( attributes );
     32        } else if ( 'image' === attributes.frame && MediaFrame.ImageDetails ) {
     33                frame = new MediaFrame.ImageDetails( attributes );
     34        } else if ( 'audio' === attributes.frame && MediaFrame.AudioDetails ) {
     35                frame = new MediaFrame.AudioDetails( attributes );
     36        } else if ( 'video' === attributes.frame && MediaFrame.VideoDetails ) {
     37                frame = new MediaFrame.VideoDetails( attributes );
     38        } else if ( 'edit-attachments' === attributes.frame && MediaFrame.EditAttachments ) {
     39                frame = new MediaFrame.EditAttachments( attributes );
     40        }
    2241
    23                 attributes = _.defaults( attributes || {}, {
    24                         frame: 'select'
    25                 });
    26 
    27                 if ( 'select' === attributes.frame && MediaFrame.Select ) {
    28                         frame = new MediaFrame.Select( attributes );
    29                 } else if ( 'post' === attributes.frame && MediaFrame.Post ) {
    30                         frame = new MediaFrame.Post( attributes );
    31                 } else if ( 'manage' === attributes.frame && MediaFrame.Manage ) {
    32                         frame = new MediaFrame.Manage( attributes );
    33                 } else if ( 'image' === attributes.frame && MediaFrame.ImageDetails ) {
    34                         frame = new MediaFrame.ImageDetails( attributes );
    35                 } else if ( 'audio' === attributes.frame && MediaFrame.AudioDetails ) {
    36                         frame = new MediaFrame.AudioDetails( attributes );
    37                 } else if ( 'video' === attributes.frame && MediaFrame.VideoDetails ) {
    38                         frame = new MediaFrame.VideoDetails( attributes );
    39                 } else if ( 'edit-attachments' === attributes.frame && MediaFrame.EditAttachments ) {
    40                         frame = new MediaFrame.EditAttachments( attributes );
    41                 }
     42        delete attributes.frame;
    4243
    43                 delete attributes.frame;
     44        media.frame = frame;
    4445
    45                 media.frame = frame;
     46        return frame;
     47};
    4648
    47                 return frame;
    48         };
     49_.extend( media, { model: {}, view: {}, controller: {}, frames: {} });
    4950
    50         _.extend( media, { model: {}, view: {}, controller: {}, frames: {} });
     51// Link any localized strings.
     52l10n = media.model.l10n = window._wpMediaModelsL10n || {};
    5153
    52         // Link any localized strings.
    53         l10n = media.model.l10n = typeof _wpMediaModelsL10n === 'undefined' ? {} : _wpMediaModelsL10n;
     54// Link any settings.
     55media.model.settings = l10n.settings || {};
     56delete l10n.settings;
    5457
    55         // Link any settings.
    56         media.model.settings = l10n.settings || {};
    57         delete l10n.settings;
     58Attachments = media.model.Attachments = require( './models/attachments.js' );
     59Attachment = media.model.Attachment = require( './models/attachment.js' );
    5860
    59         Attachments = media.model.Attachments = require( './models/attachments.js' );
    60         Attachment = media.model.Attachment = require( './models/attachment.js' );
     61media.model.Query = require( './models/query.js' );
     62media.model.PostImage = require( './models/post-image.js' );
     63media.model.Selection = require( './models/selection.js' );
    6164
    62         media.model.Query = require( './models/query.js' );
    63         media.model.PostImage = require( './models/post-image.js' );
    64         media.model.Selection = require( './models/selection.js' );
     65/**
     66 * ========================================================================
     67 * UTILITIES
     68 * ========================================================================
     69 */
    6570
    66         /**
    67          * ========================================================================
    68          * UTILITIES
    69          * ========================================================================
    70          */
     71/**
     72 * A basic equality comparator for Backbone models.
     73 *
     74 * Used to order models within a collection - @see wp.media.model.Attachments.comparator().
     75 *
     76 * @param  {mixed}  a  The primary parameter to compare.
     77 * @param  {mixed}  b  The primary parameter to compare.
     78 * @param  {string} ac The fallback parameter to compare, a's cid.
     79 * @param  {string} bc The fallback parameter to compare, b's cid.
     80 * @return {number}    -1: a should come before b.
     81 *                      0: a and b are of the same rank.
     82 *                      1: b should come before a.
     83 */
     84media.compare = function( a, b, ac, bc ) {
     85        if ( _.isEqual( a, b ) ) {
     86                return ac === bc ? 0 : (ac > bc ? -1 : 1);
     87        } else {
     88                return a > b ? -1 : 1;
     89        }
     90};
    7191
     92_.extend( media, {
    7293        /**
    73          * A basic equality comparator for Backbone models.
     94         * media.template( id )
    7495         *
    75          * Used to order models within a collection - @see wp.media.model.Attachments.comparator().
     96         * Fetch a JavaScript template for an id, and return a templating function for it.
    7697         *
    77          * @param  {mixed}  a  The primary parameter to compare.
    78          * @param  {mixed}  b  The primary parameter to compare.
    79          * @param  {string} ac The fallback parameter to compare, a's cid.
    80          * @param  {string} bc The fallback parameter to compare, b's cid.
    81          * @return {number}    -1: a should come before b.
    82          *                      0: a and b are of the same rank.
    83          *                      1: b should come before a.
     98         * See wp.template() in `wp-includes/js/wp-util.js`.
     99         *
     100         * @borrows wp.template as template
    84101         */
    85         media.compare = function( a, b, ac, bc ) {
    86                 if ( _.isEqual( a, b ) ) {
    87                         return ac === bc ? 0 : (ac > bc ? -1 : 1);
    88                 } else {
    89                         return a > b ? -1 : 1;
    90                 }
    91         };
    92 
    93         _.extend( media, {
    94                 /**
    95                  * media.template( id )
    96                  *
    97                  * Fetch a JavaScript template for an id, and return a templating function for it.
    98                  *
    99                  * See wp.template() in `wp-includes/js/wp-util.js`.
    100                  *
    101                  * @borrows wp.template as template
    102                  */
    103                 template: wp.template,
    104 
    105                 /**
    106                  * media.post( [action], [data] )
    107                  *
    108                  * Sends a POST request to WordPress.
    109                  * See wp.ajax.post() in `wp-includes/js/wp-util.js`.
    110                  *
    111                  * @borrows wp.ajax.post as post
    112                  */
    113                 post: wp.ajax.post,
    114 
    115                 /**
    116                  * media.ajax( [action], [options] )
    117                  *
    118                  * Sends an XHR request to WordPress.
    119                  * See wp.ajax.send() in `wp-includes/js/wp-util.js`.
    120                  *
    121                  * @borrows wp.ajax.send as ajax
    122                  */
    123                 ajax: wp.ajax.send,
    124 
    125                 /**
    126                  * Scales a set of dimensions to fit within bounding dimensions.
    127                  *
    128                  * @param {Object} dimensions
    129                  * @returns {Object}
    130                  */
    131                 fit: function( dimensions ) {
    132                         var width     = dimensions.width,
    133                                 height    = dimensions.height,
    134                                 maxWidth  = dimensions.maxWidth,
    135                                 maxHeight = dimensions.maxHeight,
    136                                 constraint;
    137 
    138                         // Compare ratios between the two values to determine which
    139                         // max to constrain by. If a max value doesn't exist, then the
    140                         // opposite side is the constraint.
    141                         if ( ! _.isUndefined( maxWidth ) && ! _.isUndefined( maxHeight ) ) {
    142                                 constraint = ( width / height > maxWidth / maxHeight ) ? 'width' : 'height';
    143                         } else if ( _.isUndefined( maxHeight ) ) {
    144                                 constraint = 'width';
    145                         } else if (  _.isUndefined( maxWidth ) && height > maxHeight ) {
    146                                 constraint = 'height';
    147                         }
    148 
    149                         // If the value of the constrained side is larger than the max,
    150                         // then scale the values. Otherwise return the originals; they fit.
    151                         if ( 'width' === constraint && width > maxWidth ) {
    152                                 return {
    153                                         width : maxWidth,
    154                                         height: Math.round( maxWidth * height / width )
    155                                 };
    156                         } else if ( 'height' === constraint && height > maxHeight ) {
    157                                 return {
    158                                         width : Math.round( maxHeight * width / height ),
    159                                         height: maxHeight
    160                                 };
    161                         } else {
    162                                 return {
    163                                         width : width,
    164                                         height: height
    165                                 };
    166                         }
    167                 },
    168                 /**
    169                  * Truncates a string by injecting an ellipsis into the middle.
    170                  * Useful for filenames.
    171                  *
    172                  * @param {String} string
    173                  * @param {Number} [length=30]
    174                  * @param {String} [replacement=&hellip;]
    175                  * @returns {String} The string, unless length is greater than string.length.
    176                  */
    177                 truncate: function( string, length, replacement ) {
    178                         length = length || 30;
    179                         replacement = replacement || '&hellip;';
    180 
    181                         if ( string.length <= length ) {
    182                                 return string;
    183                         }
    184 
    185                         return string.substr( 0, length / 2 ) + replacement + string.substr( -1 * length / 2 );
    186                 }
    187         });
     102        template: wp.template,
    188103
    189104        /**
    190          * ========================================================================
    191          * MODELS
    192          * ========================================================================
     105         * media.post( [action], [data] )
     106         *
     107         * Sends a POST request to WordPress.
     108         * See wp.ajax.post() in `wp-includes/js/wp-util.js`.
     109         *
     110         * @borrows wp.ajax.post as post
    193111         */
     112        post: wp.ajax.post,
     113
    194114        /**
    195          * wp.media.attachment
     115         * media.ajax( [action], [options] )
     116         *
     117         * Sends an XHR request to WordPress.
     118         * See wp.ajax.send() in `wp-includes/js/wp-util.js`.
    196119         *
    197          * @static
    198          * @param {String} id A string used to identify a model.
    199          * @returns {wp.media.model.Attachment}
     120         * @borrows wp.ajax.send as ajax
    200121         */
    201         media.attachment = function( id ) {
    202                 return Attachment.get( id );
    203         };
     122        ajax: wp.ajax.send,
    204123
    205124        /**
    206          * A collection of all attachments that have been fetched from the server.
     125         * Scales a set of dimensions to fit within bounding dimensions.
    207126         *
    208          * @static
    209          * @member {wp.media.model.Attachments}
     127         * @param {Object} dimensions
     128         * @returns {Object}
    210129         */
    211         Attachments.all = new Attachments();
     130        fit: function( dimensions ) {
     131                var width     = dimensions.width,
     132                        height    = dimensions.height,
     133                        maxWidth  = dimensions.maxWidth,
     134                        maxHeight = dimensions.maxHeight,
     135                        constraint;
     136
     137                // Compare ratios between the two values to determine which
     138                // max to constrain by. If a max value doesn't exist, then the
     139                // opposite side is the constraint.
     140                if ( ! _.isUndefined( maxWidth ) && ! _.isUndefined( maxHeight ) ) {
     141                        constraint = ( width / height > maxWidth / maxHeight ) ? 'width' : 'height';
     142                } else if ( _.isUndefined( maxHeight ) ) {
     143                        constraint = 'width';
     144                } else if (  _.isUndefined( maxWidth ) && height > maxHeight ) {
     145                        constraint = 'height';
     146                }
    212147
     148                // If the value of the constrained side is larger than the max,
     149                // then scale the values. Otherwise return the originals; they fit.
     150                if ( 'width' === constraint && width > maxWidth ) {
     151                        return {
     152                                width : maxWidth,
     153                                height: Math.round( maxWidth * height / width )
     154                        };
     155                } else if ( 'height' === constraint && height > maxHeight ) {
     156                        return {
     157                                width : Math.round( maxHeight * width / height ),
     158                                height: maxHeight
     159                        };
     160                } else {
     161                        return {
     162                                width : width,
     163                                height: height
     164                        };
     165                }
     166        },
    213167        /**
    214          * wp.media.query
     168         * Truncates a string by injecting an ellipsis into the middle.
     169         * Useful for filenames.
    215170         *
    216          * Shorthand for creating a new Attachments Query.
    217          *
    218          * @param {object} [props]
    219          * @returns {wp.media.model.Attachments}
    220          */
    221         media.query = function( props ) {
    222                 return new Attachments( null, {
    223                         props: _.extend( _.defaults( props || {}, { orderby: 'date' } ), { query: true } )
    224                 });
    225         };
    226 
    227         // Clean up. Prevents mobile browsers caching
    228         $(window).on('unload', function(){
    229                 window.wp = null;
     171         * @param {String} string
     172         * @param {Number} [length=30]
     173         * @param {String} [replacement=&hellip;]
     174         * @returns {String} The string, unless length is greater than string.length.
     175         */
     176        truncate: function( string, length, replacement ) {
     177                length = length || 30;
     178                replacement = replacement || '&hellip;';
     179
     180                if ( string.length <= length ) {
     181                        return string;
     182                }
     183
     184                return string.substr( 0, length / 2 ) + replacement + string.substr( -1 * length / 2 );
     185        }
     186});
     187
     188/**
     189 * ========================================================================
     190 * MODELS
     191 * ========================================================================
     192 */
     193/**
     194 * wp.media.attachment
     195 *
     196 * @static
     197 * @param {String} id A string used to identify a model.
     198 * @returns {wp.media.model.Attachment}
     199 */
     200media.attachment = function( id ) {
     201        return Attachment.get( id );
     202};
     203
     204/**
     205 * A collection of all attachments that have been fetched from the server.
     206 *
     207 * @static
     208 * @member {wp.media.model.Attachments}
     209 */
     210Attachments.all = new Attachments();
     211
     212/**
     213 * wp.media.query
     214 *
     215 * Shorthand for creating a new Attachments Query.
     216 *
     217 * @param {object} [props]
     218 * @returns {wp.media.model.Attachments}
     219 */
     220media.query = function( props ) {
     221        return new Attachments( null, {
     222                props: _.extend( _.defaults( props || {}, { orderby: 'date' } ), { query: true } )
    230223        });
     224};
    231225
    232 }(jQuery));
    233  No newline at end of file
     226// Clean up. Prevents mobile browsers caching
     227$(window).on('unload', function(){
     228        window.wp = null;
     229});
  • src/wp-includes/js/media/routers/manage.js

     
    1 /*globals jQuery, Backbone */
    2 
    31/**
    42 * A router for handling the browser history and application state.
    53 *
     
    4341        }
    4442});
    4543
    46 module.exports = Router;
    47  No newline at end of file
     44module.exports = Router;
  • src/wp-includes/js/media/utils/selection-sync.js

     
    1 /*globals _ */
    2 
    31/**
    42 * wp.media.selectionSync
    53 *
     
    6361        }
    6462};
    6563
    66 module.exports = selectionSync;
    67  No newline at end of file
     64module.exports = selectionSync;
  • src/wp-includes/js/media/views/attachment/details-two-column.js

     
    1 /*globals wp */
    2 
    31/**
    42 * A similar view to media.view.Attachment.Details
    53 * for use in the Edit Attachment modal.
     
    3432                wp.media.mixin.removeAllPlayers();
    3533                this.$( 'audio, video' ).each( function (i, elem) {
    3634                        var el = MediaDetails.prepareSrc( elem );
    37                         new MediaElementPlayer( el, wp.media.mixin.mejsSettings );
     35                        new window.MediaElementPlayer( el, wp.media.mixin.mejsSettings );
    3836                } );
    3937        }
    4038});
    4139
    42 module.exports = TwoColumn;
    43  No newline at end of file
     40module.exports = TwoColumn;
  • src/wp-includes/js/media/views/attachment/details.js

     
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.view.Attachment.Details
    53 *
     
    5957        deleteAttachment: function( event ) {
    6058                event.preventDefault();
    6159
    62                 if ( confirm( l10n.warnDelete ) ) {
     60                if ( window.confirm( l10n.warnDelete ) ) {
    6361                        this.model.destroy();
    6462                        // Keep focus inside media modal
    6563                        // after image is deleted
     
    137135        }
    138136});
    139137
    140 module.exports = Details;
    141  No newline at end of file
     138module.exports = Details;
  • src/wp-includes/js/media/views/attachment/edit-library.js

     
    1616        }
    1717});
    1818
    19 module.exports = EditLibrary;
    20  No newline at end of file
     19module.exports = EditLibrary;
  • src/wp-includes/js/media/views/attachment/edit-selection.js

     
    1717        }
    1818});
    1919
    20 module.exports = EditSelection;
    21  No newline at end of file
     20module.exports = EditSelection;
  • src/wp-includes/js/media/views/attachment/library.js

     
    1616        }
    1717});
    1818
    19 module.exports = Library;
    20  No newline at end of file
     19module.exports = Library;
  • src/wp-includes/js/media/views/attachment/selection.js

     
    2020        }
    2121});
    2222
    23 module.exports = Selection;
    24  No newline at end of file
     23module.exports = Selection;
  • src/wp-includes/js/media/views/attachment-compat.js

     
    1 /*globals _ */
    2 
    31/**
    42 * wp.media.view.AttachmentCompat
    53 *
     
    8280        }
    8381});
    8482
    85 module.exports = AttachmentCompat;
    86  No newline at end of file
     83module.exports = AttachmentCompat;
  • src/wp-includes/js/media/views/attachment-filters/all.js

     
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.view.AttachmentFilters.All
    53 *
     
    8886        }
    8987});
    9088
    91 module.exports = All;
    92  No newline at end of file
     89module.exports = All;
  • src/wp-includes/js/media/views/attachment-filters/date.js

     
    1 /*globals _, wp */
    2 
    31/**
    42 * A filter dropdown for month/dates.
    53 *
     
    3937        }
    4038});
    4139
    42 module.exports = DateFilter;
    43  No newline at end of file
     40module.exports = DateFilter;
  • src/wp-includes/js/media/views/attachment-filters/uploaded.js

     
    1 /*globals wp */
    2 
    31/**
    42 * wp.media.view.AttachmentFilters.Uploaded
    53 *
     
    5755        }
    5856});
    5957
    60 module.exports = Uploaded;
    61  No newline at end of file
     58module.exports = Uploaded;
  • src/wp-includes/js/media/views/attachment-filters.js

     
    1 /*globals _, jQuery */
    2 
    31/**
    42 * wp.media.view.AttachmentFilters
    53 *
     
    7573        }
    7674});
    7775
    78 module.exports = AttachmentFilters;
    79  No newline at end of file
     76module.exports = AttachmentFilters;
  • src/wp-includes/js/media/views/attachment.js

     
    1 /*globals _, wp, jQuery */
    2 
    31/**
    42 * wp.media.view.Attachment
    53 *
     
    551549        };
    552550});
    553551
    554 module.exports = Attachment;
    555  No newline at end of file
     552module.exports = Attachment;
  • src/wp-includes/js/media/views/attachments/browser.js

     
    1 /*globals _, wp, jQuery */
    2 
    31/**
    42 * wp.media.view.AttachmentsBrowser
    53 *
     
    190188                                                return;
    191189                                        }
    192190
    193                                         if ( ! mediaTrash && ! confirm( l10n.warnBulkDelete ) ) {
     191                                        if ( ! mediaTrash && ! window.confirm( l10n.warnBulkDelete ) ) {
    194192                                                return;
    195193                                        }
    196194
    197195                                        if ( mediaTrash &&
    198196                                                'trash' !== selection.at( 0 ).get( 'status' ) &&
    199                                                 ! confirm( l10n.warnBulkTrash ) ) {
     197                                                ! window.confirm( l10n.warnBulkTrash ) ) {
    200198
    201199                                                return;
    202200                                        }
     
    244242                                        click: function() {
    245243                                                var removed = [], selection = this.controller.state().get( 'selection' );
    246244
    247                                                 if ( ! selection.length || ! confirm( l10n.warnBulkDelete ) ) {
     245                                                if ( ! selection.length || ! window.confirm( l10n.warnBulkDelete ) ) {
    248246                                                        return;
    249247                                                }
    250248
     
    456454        }
    457455});
    458456
    459 module.exports = AttachmentsBrowser;
    460  No newline at end of file
     457module.exports = AttachmentsBrowser;
  • src/wp-includes/js/media/views/attachments/selection.js

     
    1 /*globals _ */
    2 
    31/**
    42 * wp.media.view.Attachments.Selection
    53 *
     
    2826        }
    2927});
    3028
    31 module.exports = Selection;
    32  No newline at end of file
     29module.exports = Selection;
  • src/wp-includes/js/media/views/attachments.js

     
    1 /*globals _, wp, jQuery */
    2 
    31/**
    42 * wp.media.view.Attachments
    53 *
     
    272270
    273271                // The scroll event occurs on the document, but the element
    274272                // that should be checked is the document body.
    275                 if ( el == document ) {
     273                if ( el === document ) {
    276274                        el = document.body;
    277275                        scrollTop = $(document).scrollTop();
    278276                }
     
    297295        }
    298296});
    299297
    300 module.exports = Attachments;
    301  No newline at end of file
     298module.exports = Attachments;
  • src/wp-includes/js/media/views/audio-details.js

     
    1 /*globals wp */
    2 
    31/**
    42 * wp.media.view.AudioDetails
    53 *
     
    3533        }
    3634});
    3735
    38 module.exports = AudioDetails;
    39  No newline at end of file
     36module.exports = AudioDetails;
  • src/wp-includes/js/media/views/button/delete-selected-permanently.js

     
    4040        }
    4141});
    4242
    43 module.exports = DeleteSelectedPermanently;
    44  No newline at end of file
     43module.exports = DeleteSelectedPermanently;
  • src/wp-includes/js/media/views/button/delete-selected.js

     
    1 /*globals wp */
    2 
    31/**
    42 * A button that handles bulk Delete/Trash logic
    53 *
     
    4846        }
    4947});
    5048
    51 module.exports = DeleteSelected;
    52  No newline at end of file
     49module.exports = DeleteSelected;
  • src/wp-includes/js/media/views/button/select-mode-toggle.js

     
    1 /*globals wp */
    2 
    31var Button = require( '../button.js' ),
    42        l10n = wp.media.view.l10n,
    53        SelectModeToggle;
     
    5250        }
    5351});
    5452
    55 module.exports = SelectModeToggle;
    56  No newline at end of file
     53module.exports = SelectModeToggle;
  • src/wp-includes/js/media/views/button-group.js

     
    1 /*globals _, Backbone, jQuery */
    2 
    31/**
    42 * wp.media.view.ButtonGroup
    53 *
     
    4543        }
    4644});
    4745
    48 module.exports = ButtonGroup;
    49  No newline at end of file
     46module.exports = ButtonGroup;
  • src/wp-includes/js/media/views/button.js

     
    1 /*globals _, Backbone */
    2 
    31/**
    42 * wp.media.view.Button
    53 *
     
    8684        }
    8785});
    8886
    89 module.exports = Button;
    90  No newline at end of file
     87module.exports = Button;
  • src/wp-includes/js/media/views/cropper.js

     
    1 /*globals _, wp, jQuery */
    2 
    31/**
    42 * wp.media.view.Cropper
    53 *
     
    6058
    6159                this.views.add( '.upload-errors', new UploaderStatusError({
    6260                        filename: UploaderStatus.prototype.filename(filename),
    63                         message: _wpMediaViewsL10n.cropError
     61                        message: window._wpMediaViewsL10n.cropError
    6462                }), { at: 0 });
    6563        }
    6664});
    6765
    68 module.exports = Cropper;
    69  No newline at end of file
     66module.exports = Cropper;
  • src/wp-includes/js/media/views/edit-image-details.js

     
    2121        }
    2222});
    2323
    24 module.exports = Details;
    25  No newline at end of file
     24module.exports = Details;
  • src/wp-includes/js/media/views/edit-image.js

     
    1 /*globals _, wp */
    2 
    31var View = require( './view.js' ),
    42        EditImage;
    53
     
    5048
    5149});
    5250
    53 module.exports = EditImage;
    54  No newline at end of file
     51module.exports = EditImage;
  • src/wp-includes/js/media/views/embed/image.js

     
    1 /*globals wp */
    2 
    31/**
    42 * wp.media.view.EmbedImage
    53 *
     
    3028        }
    3129});
    3230
    33 module.exports = EmbedImage;
    34  No newline at end of file
     31module.exports = EmbedImage;
  • src/wp-includes/js/media/views/embed/link.js

     
    1 /*globals _, wp, jQuery */
    2 
    31/**
    42 * wp.media.view.EmbedLink
    53 *
     
    6462        }
    6563});
    6664
    67 module.exports = EmbedLink;
    68  No newline at end of file
     65module.exports = EmbedLink;
  • src/wp-includes/js/media/views/embed/url.js

     
    1 /*globals _, wp, jQuery */
    2 
    31/**
    42 * wp.media.view.EmbedUrl
    53 *
     
    7674        }
    7775});
    7876
    79 module.exports = EmbedUrl;
    80  No newline at end of file
     77module.exports = EmbedUrl;
  • src/wp-includes/js/media/views/embed.js

     
    6565        }
    6666});
    6767
    68 module.exports = Embed;
    69  No newline at end of file
     68module.exports = Embed;
  • src/wp-includes/js/media/views/focus-manager.js

     
    4444
    4545});
    4646
    47 module.exports = FocusManager;
    48  No newline at end of file
     47module.exports = FocusManager;
  • src/wp-includes/js/media/views/frame/audio-details.js

     
    1 /*globals wp */
    2 
    31/**
    42 * wp.media.view.MediaFrame.AudioDetails
    53 *
     
    7472        }
    7573});
    7674
    77 module.exports = AudioDetails;
    78  No newline at end of file
     75module.exports = AudioDetails;
  • src/wp-includes/js/media/views/frame/edit-attachments.js

     
    1 /*globals _, wp, jQuery */
    2 
    31/**
    42 * A frame for editing the details of a specific media item.
    53 *
     
    243241        }
    244242});
    245243
    246 module.exports = EditAttachments;
    247  No newline at end of file
     244module.exports = EditAttachments;
  • src/wp-includes/js/media/views/frame/image-details.js

     
    1 /*globals wp */
    2 
    31/**
    42 * wp.media.view.MediaFrame.ImageDetails
    53 *
     
    180178
    181179});
    182180
    183 module.exports = ImageDetails;
    184  No newline at end of file
     181module.exports = ImageDetails;
  • src/wp-includes/js/media/views/frame/manage.js

     
    1 /*globals _, Backbone, wp, jQuery */
    2 
    31/**
    42 * wp.media.view.MediaFrame.Manage
    53 *
     
    237235                // Verify pushState support and activate
    238236                if ( window.history && window.history.pushState ) {
    239237                        Backbone.history.start( {
    240                                 root: _wpMediaGridSettings.adminUrl,
     238                                root: window._wpMediaGridSettings.adminUrl,
    241239                                pushState: true
    242240                        } );
    243241                }
    244242        }
    245243});
    246244
    247 module.exports = Manage;
    248  No newline at end of file
     245module.exports = Manage;
  • src/wp-includes/js/media/views/frame/media-details.js

     
    1 /*globals wp */
    2 
    31/**
    42 * wp.media.view.MediaFrame.MediaDetails
    53 *
     
    129127        }
    130128});
    131129
    132 module.exports = MediaDetails;
    133  No newline at end of file
     130module.exports = MediaDetails;
  • src/wp-includes/js/media/views/frame/post.js

     
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.view.MediaFrame.Post
    53 *
     
    748746        }
    749747});
    750748
    751 module.exports = Post;
    752  No newline at end of file
     749module.exports = Post;
  • src/wp-includes/js/media/views/frame/select.js

     
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.view.MediaFrame.Select
    53 *
     
    171169        }
    172170});
    173171
    174 module.exports = Select;
    175  No newline at end of file
     172module.exports = Select;
  • src/wp-includes/js/media/views/frame/video-details.js

     
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.view.MediaFrame.VideoDetails
    53 *
     
    134132        }
    135133});
    136134
    137 module.exports = VideoDetails;
    138  No newline at end of file
     135module.exports = VideoDetails;
  • src/wp-includes/js/media/views/frame.js

     
    1 /*globals _, Backbone */
    2 
    31/**
    42 * wp.media.view.Frame
    53 *
     
    169167// Make the `Frame` a `StateMachine`.
    170168_.extend( Frame.prototype, StateMachine.prototype );
    171169
    172 module.exports = Frame;
    173  No newline at end of file
     170module.exports = Frame;
  • src/wp-includes/js/media/views/iframe.js

     
    2222        }
    2323});
    2424
    25 module.exports = Iframe;
    26  No newline at end of file
     25module.exports = Iframe;
  • src/wp-includes/js/media/views/image-details.js

     
    1 /*globals _, wp, jQuery */
    2 
    31/**
    42 * wp.media.view.ImageDetails
    53 *
     
    7371        postRender: function() {
    7472                setTimeout( _.bind( this.resetFocus, this ), 10 );
    7573                this.toggleLinkSettings();
    76                 if ( getUserSetting( 'advImgDetails' ) === 'show' ) {
     74                if ( window.getUserSetting( 'advImgDetails' ) === 'show' ) {
    7775                        this.toggleAdvanced( true );
    7876                }
    7977                this.trigger( 'post-render' );
     
    146144                        mode = 'show';
    147145                }
    148146
    149                 setUserSetting( 'advImgDetails', mode );
     147                window.setUserSetting( 'advImgDetails', mode );
    150148        },
    151149
    152150        editAttachment: function( event ) {
     
    165163        }
    166164});
    167165
    168 module.exports = AttachmentDisplay;
    169  No newline at end of file
     166module.exports = AttachmentDisplay;
  • src/wp-includes/js/media/views/label.js

     
    2222        }
    2323});
    2424
    25 module.exports = Label;
    26  No newline at end of file
     25module.exports = Label;
  • src/wp-includes/js/media/views/media-details.js

     
    1 /*globals _, wp, jQuery */
    2 
    31/**
    42 * wp.media.view.MediaDetails
    53 *
     
    8381         */
    8482        setPlayer : function() {
    8583                if ( ! this.players.length && this.media ) {
    86                         this.players.push( new MediaElementPlayer( this.media, this.settings ) );
     84                        this.players.push( new window.MediaElementPlayer( this.media, this.settings ) );
    8785                }
    8886        },
    8987
     
    111109         */
    112110        render: function() {
    113111                AttachmentDisplay.prototype.render.apply( this, arguments );
    114                
     112
    115113                setTimeout( _.bind( function() {
    116114                        this.resetFocus();
    117115                }, this ), 10 );
     
    149147        }
    150148});
    151149
    152 module.exports = MediaDetails;
    153  No newline at end of file
     150module.exports = MediaDetails;
  • src/wp-includes/js/media/views/media-frame.js

     
    1 /*globals _, wp, jQuery */
    2 
    31/**
    42 * wp.media.view.MediaFrame
    53 *
     
    251249        };
    252250});
    253251
    254 module.exports = MediaFrame;
    255  No newline at end of file
     252module.exports = MediaFrame;
  • src/wp-includes/js/media/views/menu-item.js

     
    1 /*globals wp, jQuery */
    2 
    31/**
    42 * wp.media.view.MenuItem
    53 *
     
    7068        }
    7169});
    7270
    73 module.exports = MenuItem;
    74  No newline at end of file
     71module.exports = MenuItem;
  • src/wp-includes/js/media/views/menu.js

     
    112112        }
    113113});
    114114
    115 module.exports = Menu;
    116  No newline at end of file
     115module.exports = Menu;
  • src/wp-includes/js/media/views/modal.js

     
    1 /*globals _, wp, jQuery */
    2 
    31/**
    42 * wp.media.view.Modal
    53 *
     
    212210        }
    213211});
    214212
    215 module.exports = Modal;
    216  No newline at end of file
     213module.exports = Modal;
  • src/wp-includes/js/media/views/priority-list.js

     
    1 /*globals _, Backbone */
    2 
    31/**
    42 * wp.media.view.PriorityList
    53 *
     
    9795        }
    9896});
    9997
    100 module.exports = PriorityList;
    101  No newline at end of file
     98module.exports = PriorityList;
  • src/wp-includes/js/media/views/router-item.js

     
    2222        }
    2323});
    2424
    25 module.exports = RouterItem;
    26  No newline at end of file
     25module.exports = RouterItem;
  • src/wp-includes/js/media/views/router.js

     
    3333        }
    3434});
    3535
    36 module.exports = Router;
    37  No newline at end of file
     36module.exports = Router;
  • src/wp-includes/js/media/views/search.js

     
    1 /*globals wp */
    2 
    31/**
    42 * wp.media.view.Search
    53 *
     
    4644        }
    4745});
    4846
    49 module.exports = Search;
    50  No newline at end of file
     47module.exports = Search;
  • src/wp-includes/js/media/views/selection.js

     
    1 /*globals _, Backbone, wp */
    2 
    31/**
    42 * wp.media.view.Selection
    53 *
     
    8280        }
    8381});
    8482
    85 module.exports = Selection;
    86  No newline at end of file
     83module.exports = Selection;
  • src/wp-includes/js/media/views/settings/attachment-display.js

     
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.view.Settings.AttachmentDisplay
    53 *
     
    9189        }
    9290});
    9391
    94 module.exports = AttachmentDisplay;
    95  No newline at end of file
     92module.exports = AttachmentDisplay;
  • src/wp-includes/js/media/views/settings/gallery.js

     
    1 /*globals wp */
    2 
    31/**
    42 * wp.media.view.Settings.Gallery
    53 *
     
    1715        template:  wp.template('gallery-settings')
    1816});
    1917
    20 module.exports = Gallery;
    21  No newline at end of file
     18module.exports = Gallery;
  • src/wp-includes/js/media/views/settings/playlist.js

     
    1 /*globals wp */
    2 
    31/**
    42 * wp.media.view.Settings.Playlist
    53 *
     
    1715        template:  wp.template('playlist-settings')
    1816});
    1917
    20 module.exports = Playlist;
    21  No newline at end of file
     18module.exports = Playlist;
  • src/wp-includes/js/media/views/settings.js

     
    1 /*globals _, Backbone, jQuery */
    2 
    31/**
    42 * wp.media.view.Settings
    53 *
     
    107105                // If the setting has a corresponding user setting,
    108106                // update that as well.
    109107                if ( userSetting = $setting.data('userSetting') ) {
    110                         setUserSetting( userSetting, value );
     108                        window.setUserSetting( userSetting, value );
    111109                }
    112110        },
    113111
     
    118116        }
    119117});
    120118
    121 module.exports = Settings;
    122  No newline at end of file
     119module.exports = Settings;
  • src/wp-includes/js/media/views/sidebar.js

     
    1414        className: 'media-sidebar'
    1515});
    1616
    17 module.exports = Sidebar;
    18  No newline at end of file
     17module.exports = Sidebar;
  • src/wp-includes/js/media/views/spinner.js

     
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.view.Spinner
    53 *
     
    3533        }
    3634});
    3735
    38 module.exports = Spinner;
    39  No newline at end of file
     36module.exports = Spinner;
  • src/wp-includes/js/media/views/toolbar/embed.js

     
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.view.Toolbar.Embed
    53 *
     
    3432        }
    3533});
    3634
    37 module.exports = Embed;
    38  No newline at end of file
     35module.exports = Embed;
  • src/wp-includes/js/media/views/toolbar/select.js

     
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.view.Toolbar.Select
    53 *
     
    6765        }
    6866});
    6967
    70 module.exports = Select;
    71  No newline at end of file
     68module.exports = Select;
  • src/wp-includes/js/media/views/toolbar.js

     
    1 /*globals Backbone, _ */
    2 
    31/**
    42 * wp.media.view.Toolbar
    53 *
     
    159157        }
    160158});
    161159
    162 module.exports = Toolbar;
    163  No newline at end of file
     160module.exports = Toolbar;
  • src/wp-includes/js/media/views/uploader/editor.js

     
    1 /*globals _, wp, jQuery */
    2 
    31/**
    42 * Creates a dropzone on WP editor instances (elements with .wp-editor-wrap
    53 * or #wp-fullscreen-body) and relays drag'n'dropped files to a media workflow.
     
    216214        }
    217215});
    218216
    219 module.exports = EditorUploader;
    220  No newline at end of file
     217module.exports = EditorUploader;
  • src/wp-includes/js/media/views/uploader/inline.js

     
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.view.UploaderInline
    53 *
     
    129127
    130128});
    131129
    132 module.exports = UploaderInline;
    133  No newline at end of file
     130module.exports = UploaderInline;
  • src/wp-includes/js/media/views/uploader/status-error.js

     
    1 /*globals wp */
    2 
    31/**
    42 * wp.media.view.UploaderStatusError
    53 *
     
    1614        template:  wp.template('uploader-status-error')
    1715});
    1816
    19 module.exports = UploaderStatusError;
    20  No newline at end of file
     17module.exports = UploaderStatusError;
  • src/wp-includes/js/media/views/uploader/status.js

     
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.view.UploaderStatus
    53 *
     
    136134        }
    137135});
    138136
    139 module.exports = UploaderStatus;
    140  No newline at end of file
     137module.exports = UploaderStatus;
  • src/wp-includes/js/media/views/uploader/window.js

     
    1 /*globals _, wp, jQuery */
    2 
    31/**
    42 * wp.media.view.UploaderWindow
    53 *
     
    109107        }
    110108});
    111109
    112 module.exports = UploaderWindow;
    113  No newline at end of file
     110module.exports = UploaderWindow;
  • src/wp-includes/js/media/views/video-details.js

     
    1 /*globals wp */
    2 
    31/**
    42 * wp.media.view.VideoDetails
    53 *
     
    4038        }
    4139});
    4240
    43 module.exports = VideoDetails;
    44  No newline at end of file
     41module.exports = VideoDetails;
  • src/wp-includes/js/media/views/view.js

     
    1 /*globals wp */
    2 
    31/**
    42 * wp.media.View
    53 *
     
    6361        }
    6462});
    6563
    66 module.exports = View;
    67  No newline at end of file
     64module.exports = View;
  • src/wp-includes/js/media/views.js

     
    11(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
    2 /*globals _, wp */
    3 
    42/**
    53 * wp.media.controller.CollectionAdd
    64 *
     
    10098});
    10199
    102100module.exports = CollectionAdd;
    103 },{"./library.js":10}],2:[function(require,module,exports){
    104 /*globals wp, jQuery, Backbone */
    105101
     102},{"./library.js":10}],2:[function(require,module,exports){
    106103/**
    107104 * wp.media.controller.CollectionEdit
    108105 *
     
    263260});
    264261
    265262module.exports = CollectionEdit;
    266 },{"../views/attachment/edit-library.js":25,"../views/view.js":71,"./library.js":10}],3:[function(require,module,exports){
    267 /*globals _, wp, Backbone */
    268263
     264},{"../views/attachment/edit-library.js":25,"../views/view.js":71,"./library.js":10}],3:[function(require,module,exports){
    269265/**
    270266 * wp.media.controller.Cropper
    271267 *
     
    341337
    342338                                                this.$el.text(l10n.cropping);
    343339                                                this.$el.attr('disabled', true);
    344                                                
     340
    345341                                                controller.state().doCrop( selection ).done( function( croppedImage ) {
    346342                                                        controller.trigger('cropped', croppedImage );
    347343                                                        controller.close();
     
    383379});
    384380
    385381module.exports = Cropper;
    386 },{"../views/cropper.js":34,"../views/toolbar.js":63,"./state.js":15}],4:[function(require,module,exports){
    387 /*globals _, wp */
    388382
     383},{"../views/cropper.js":34,"../views/toolbar.js":63,"./state.js":15}],4:[function(require,module,exports){
    389384/**
    390385 * wp.media.controller.EditImage
    391386 *
     
    462457});
    463458
    464459module.exports = EditImage;
    465 },{"../views/toolbar.js":63,"./state.js":15}],5:[function(require,module,exports){
    466 /*globals _, wp, jQuery, Backbone */
    467460
     461},{"../views/toolbar.js":63,"./state.js":15}],5:[function(require,module,exports){
    468462/**
    469463 * wp.media.controller.Embed
    470464 *
     
    600594});
    601595
    602596module.exports = Embed;
    603 },{"./state.js":15}],6:[function(require,module,exports){
    604 /*globals _, wp */
    605597
     598},{"./state.js":15}],6:[function(require,module,exports){
    606599/**
    607600 * wp.media.controller.FeaturedImage
    608601 *
     
    723716});
    724717
    725718module.exports = FeaturedImage;
    726 },{"./library.js":10}],7:[function(require,module,exports){
    727 /*globals _, wp */
    728719
     720},{"./library.js":10}],7:[function(require,module,exports){
    729721/**
    730722 * A state for selecting more images to add to a gallery.
    731723 *
     
    777769         */
    778770        initialize: function() {
    779771                // If a library wasn't supplied, create a library of images.
    780                 if ( ! this.get('library') )
     772                if ( ! this.get('library') ) {
    781773                        this.set( 'library', wp.media.query({ type: 'image' }) );
     774                }
    782775
    783776                Library.prototype.initialize.apply( this, arguments );
    784777        },
     
    790783                var library = this.get('library'),
    791784                        edit    = this.frame.state('gallery-edit').get('library');
    792785
    793                 if ( this.editLibrary && this.editLibrary !== edit )
     786                if ( this.editLibrary && this.editLibrary !== edit ) {
    794787                        library.unobserve( this.editLibrary );
     788                }
    795789
    796790                // Accepts attachments that exist in the original library and
    797791                // that do not exist in gallery's library.
     
    811805});
    812806
    813807module.exports = GalleryAdd;
    814 },{"./library.js":10}],8:[function(require,module,exports){
    815 /*globals wp, Backbone */
    816808
     809},{"./library.js":10}],8:[function(require,module,exports){
    817810/**
    818811 * wp.media.controller.GalleryEdit
    819812 *
     
    875868         */
    876869        initialize: function() {
    877870                // If we haven't been provided a `library`, create a `Selection`.
    878                 if ( ! this.get('library') )
     871                if ( ! this.get('library') ) {
    879872                        this.set( 'library', new wp.media.model.Selection() );
     873                }
    880874
    881875                // The single `Attachment` view to be used in the `Attachments` view.
    882                 if ( ! this.get('AttachmentView') )
     876                if ( ! this.get('AttachmentView') ) {
    883877                        this.set( 'AttachmentView', EditLibraryView );
     878                }
     879
    884880                Library.prototype.initialize.apply( this, arguments );
    885881        },
    886882
     
    951947});
    952948
    953949module.exports = GalleryEdit;
    954 },{"../views/attachment/edit-library.js":25,"../views/settings/gallery.js":59,"./library.js":10}],9:[function(require,module,exports){
    955 /*globals _, wp */
    956950
     951},{"../views/attachment/edit-library.js":25,"../views/settings/gallery.js":59,"./library.js":10}],9:[function(require,module,exports){
    957952/**
    958953 * wp.media.controller.ImageDetails
    959954 *
     
    10141009});
    10151010
    10161011module.exports = ImageDetails;
    1017 },{"./library.js":10,"./state.js":15}],10:[function(require,module,exports){
    1018 /*globals _, wp, Backbone, getUserSetting, setUserSetting */
    10191012
     1013},{"./library.js":10,"./state.js":15}],10:[function(require,module,exports){
    10201014/**
    10211015 * wp.media.controller.Library
    10221016 *
     
    10541048var selectionSync = require( '../utils/selection-sync.js' ),
    10551049        State = require( './state.js' ),
    10561050        l10n = wp.media.view.l10n,
     1051        getUserSetting = window.getUserSetting,
     1052        setUserSetting = window.setUserSetting,
    10571053        Library;
    10581054
    10591055Library = State.extend({
     
    10881084                        this.set( 'library', wp.media.query() );
    10891085                }
    10901086
    1091                 if ( ! (selection instanceof Selection) ) {
     1087                if ( ! ( selection instanceof wp.media.model.Selection ) ) {
    10921088                        props = selection;
    10931089
    10941090                        if ( ! props ) {
     
    12871283_.extend( Library.prototype, selectionSync );
    12881284
    12891285module.exports = Library;
    1290 },{"../utils/selection-sync.js":16,"./state.js":15}],11:[function(require,module,exports){
    1291 /*globals _, wp */
    12921286
     1287},{"../utils/selection-sync.js":16,"./state.js":15}],11:[function(require,module,exports){
    12931288/**
    12941289 * wp.media.controller.MediaLibrary
    12951290 *
     
    13381333});
    13391334
    13401335module.exports = MediaLibrary;
    1341 },{"./library.js":10}],12:[function(require,module,exports){
    1342 /*globals _, Backbone */
    13431336
     1337},{"./library.js":10}],12:[function(require,module,exports){
    13441338/**
    13451339 * wp.media.controller.Region
    13461340 *
     
    15181512});
    15191513
    15201514module.exports = Region;
    1521 },{}],13:[function(require,module,exports){
    1522 /*globals _, wp */
    15231515
     1516},{}],13:[function(require,module,exports){
    15241517/**
    15251518 * wp.media.controller.ReplaceImage
    15261519 *
     
    16271620});
    16281621
    16291622module.exports = ReplaceImage;
    1630 },{"./library.js":10}],14:[function(require,module,exports){
    1631 /*globals _, Backbone */
    16321623
     1624},{"./library.js":10}],14:[function(require,module,exports){
    16331625/**
    16341626 * wp.media.controller.StateMachine
    16351627 *
     
    17521744});
    17531745
    17541746module.exports = StateMachine;
    1755 },{}],15:[function(require,module,exports){
    1756 /*globals _, Backbone */
    17571747
     1748},{}],15:[function(require,module,exports){
    17581749/**
    17591750 * wp.media.controller.State
    17601751 *
     
    19941985});
    19951986
    19961987module.exports = State;
    1997 },{}],16:[function(require,module,exports){
    1998 /*globals _ */
    19991988
     1989},{}],16:[function(require,module,exports){
    20001990/**
    20011991 * wp.media.selectionSync
    20021992 *
     
    20612051};
    20622052
    20632053module.exports = selectionSync;
    2064 },{}],17:[function(require,module,exports){
    2065 /* global _wpMediaViewsL10n, confirm, getUserSetting, setUserSetting */
    2066 ( function( $, _ ) {
    2067         var l10n,
    2068                 media = wp.media;
    2069 
    2070         media.isTouchDevice = ( 'ontouchend' in document );
    2071 
    2072         // Link any localized strings.
    2073         l10n = media.view.l10n = typeof _wpMediaViewsL10n === 'undefined' ? {} : _wpMediaViewsL10n;
    2074 
    2075         // Link any settings.
    2076         media.view.settings = l10n.settings || {};
    2077         delete l10n.settings;
    2078 
    2079         // Copy the `post` setting over to the model settings.
    2080         media.model.settings.post = media.view.settings.post;
    2081 
    2082         // Check if the browser supports CSS 3.0 transitions
    2083         $.support.transition = (function(){
    2084                 var style = document.documentElement.style,
    2085                         transitions = {
    2086                                 WebkitTransition: 'webkitTransitionEnd',
    2087                                 MozTransition:    'transitionend',
    2088                                 OTransition:      'oTransitionEnd otransitionend',
    2089                                 transition:       'transitionend'
    2090                         }, transition;
    20912054
    2092                 transition = _.find( _.keys( transitions ), function( transition ) {
    2093                         return ! _.isUndefined( style[ transition ] );
    2094                 });
     2055},{}],17:[function(require,module,exports){
     2056var media = wp.media,
     2057        $ = jQuery,
     2058        l10n;
    20952059
    2096                 return transition && {
    2097                         end: transitions[ transition ]
    2098                 };
    2099         }());
     2060media.isTouchDevice = ( 'ontouchend' in document );
    21002061
    2101         /**
    2102          * A shared event bus used to provide events into
    2103          * the media workflows that 3rd-party devs can use to hook
    2104          * in.
    2105          */
    2106         media.events = _.extend( {}, Backbone.Events );
     2062// Link any localized strings.
     2063l10n = media.view.l10n = window._wpMediaViewsL10n || {};
    21072064
    2108         /**
    2109          * Makes it easier to bind events using transitions.
    2110          *
    2111          * @param {string} selector
    2112          * @param {Number} sensitivity
    2113          * @returns {Promise}
    2114          */
    2115         media.transition = function( selector, sensitivity ) {
    2116                 var deferred = $.Deferred();
     2065// Link any settings.
     2066media.view.settings = l10n.settings || {};
     2067delete l10n.settings;
     2068
     2069// Copy the `post` setting over to the model settings.
     2070media.model.settings.post = media.view.settings.post;
     2071
     2072// Check if the browser supports CSS 3.0 transitions
     2073$.support.transition = (function(){
     2074        var style = document.documentElement.style,
     2075                transitions = {
     2076                        WebkitTransition: 'webkitTransitionEnd',
     2077                        MozTransition:    'transitionend',
     2078                        OTransition:      'oTransitionEnd otransitionend',
     2079                        transition:       'transitionend'
     2080                }, transition;
     2081
     2082        transition = _.find( _.keys( transitions ), function( transition ) {
     2083                return ! _.isUndefined( style[ transition ] );
     2084        });
    21172085
    2118                 sensitivity = sensitivity || 2000;
     2086        return transition && {
     2087                end: transitions[ transition ]
     2088        };
     2089}());
    21192090
    2120                 if ( $.support.transition ) {
    2121                         if ( ! (selector instanceof $) ) {
    2122                                 selector = $( selector );
    2123                         }
     2091/**
     2092 * A shared event bus used to provide events into
     2093 * the media workflows that 3rd-party devs can use to hook
     2094 * in.
     2095 */
     2096media.events = _.extend( {}, Backbone.Events );
    21242097
    2125                         // Resolve the deferred when the first element finishes animating.
    2126                         selector.first().one( $.support.transition.end, deferred.resolve );
     2098/**
     2099 * Makes it easier to bind events using transitions.
     2100 *
     2101 * @param {string} selector
     2102 * @param {Number} sensitivity
     2103 * @returns {Promise}
     2104 */
     2105media.transition = function( selector, sensitivity ) {
     2106        var deferred = $.Deferred();
    21272107
    2128                         // Just in case the event doesn't trigger, fire a callback.
    2129                         _.delay( deferred.resolve, sensitivity );
     2108        sensitivity = sensitivity || 2000;
    21302109
    2131                 // Otherwise, execute on the spot.
    2132                 } else {
    2133                         deferred.resolve();
     2110        if ( $.support.transition ) {
     2111                if ( ! (selector instanceof $) ) {
     2112                        selector = $( selector );
    21342113                }
    21352114
    2136                 return deferred.promise();
    2137         };
     2115                // Resolve the deferred when the first element finishes animating.
     2116                selector.first().one( $.support.transition.end, deferred.resolve );
    21382117
    2139         media.controller.Region = require( './controllers/region.js' );
    2140         media.controller.StateMachine = require( './controllers/state-machine.js' );
    2141         media.controller.State = require( './controllers/state.js' );
    2142 
    2143         media.selectionSync = require( './utils/selection-sync.js' );
    2144         media.controller.Library = require( './controllers/library.js' );
    2145         media.controller.ImageDetails = require( './controllers/image-details.js' );
    2146         media.controller.GalleryEdit = require( './controllers/gallery-edit.js' );
    2147         media.controller.GalleryAdd = require( './controllers/gallery-add.js' );
    2148         media.controller.CollectionEdit = require( './controllers/collection-edit.js' );
    2149         media.controller.CollectionAdd = require( './controllers/collection-add.js' );
    2150         media.controller.FeaturedImage = require( './controllers/featured-image.js' );
    2151         media.controller.ReplaceImage = require( './controllers/replace-image.js' );
    2152         media.controller.EditImage = require( './controllers/edit-image.js' );
    2153         media.controller.MediaLibrary = require( './controllers/media-library.js' );
    2154         media.controller.Embed = require( './controllers/embed.js' );
    2155         media.controller.Cropper = require( './controllers/cropper.js' );
    2156 
    2157         media.View = require( './views/view.js' );
    2158         media.view.Frame = require( './views/view.js' );
    2159         media.view.MediaFrame = require( './views/media-frame.js' );
    2160         media.view.MediaFrame.Select = require( './views/frame/select.js' );
    2161         media.view.MediaFrame.Post = require( './views/frame/post.js' );
    2162         media.view.MediaFrame.ImageDetails = require( './views/frame/image-details.js' );
    2163         media.view.Modal = require( './views/modal.js' );
    2164         media.view.FocusManager = require( './views/focus-manager.js' );
    2165         media.view.UploaderWindow = require( './views/uploader/window.js' );
    2166         media.view.EditorUploader = require( './views/uploader/editor.js' );
    2167         media.view.UploaderInline = require( './views/uploader/inline.js' );
    2168         media.view.UploaderStatus = require( './views/uploader/status.js' );
    2169         media.view.UploaderStatusError = require( './views/uploader/status-error.js' );
    2170         media.view.Toolbar = require( './views/toolbar.js' );
    2171         media.view.Toolbar.Select = require( './views/toolbar/select.js' );
    2172         media.view.Toolbar.Embed = require( './views/toolbar/embed.js' );
    2173         media.view.Button = require( './views/button.js' );
    2174         media.view.ButtonGroup = require( './views/button-group.js' );
    2175         media.view.PriorityList = require( './views/priority-list.js' );
    2176         media.view.MenuItem = require( './views/menu-item.js' );
    2177         media.view.Menu = require( './views/menu.js' );
    2178         media.view.RouterItem = require( './views/router-item.js' );
    2179         media.view.Router = require( './views/router.js' );
    2180         media.view.Sidebar = require( './views/sidebar.js' );
    2181         media.view.Attachment = require( './views/attachment.js' );
    2182         media.view.Attachment.Library = require( './views/attachment/library.js' );
    2183         media.view.Attachment.EditLibrary = require( './views/attachment/edit-library.js' );
    2184         media.view.Attachments = require( './views/attachments.js' );
    2185         media.view.Search = require( './views/search.js' );
    2186         media.view.AttachmentFilters = require( './views/attachment-filters.js' );
    2187         media.view.DateFilter = require( './views/attachment-filters/date.js' );
    2188         media.view.AttachmentFilters.Uploaded = require( './views/attachment-filters/uploaded.js' );
    2189         media.view.AttachmentFilters.All = require( './views/attachment-filters/all.js' );
    2190         media.view.AttachmentsBrowser = require( './views/attachments/browser.js' );
    2191         media.view.Selection = require( './views/selection.js' );
    2192         media.view.Attachment.Selection = require( './views/attachment/selection.js' );
    2193         media.view.Attachments.Selection = require( './views/attachments/selection.js' );
    2194         media.view.Attachment.EditSelection = require( './views/attachment/edit-selection.js' );
    2195         media.view.Settings = require( './views/settings.js' );
    2196         media.view.Settings.AttachmentDisplay = require( './views/settings/attachment-display.js' );
    2197         media.view.Settings.Gallery = require( './views/settings/gallery.js' );
    2198         media.view.Settings.Playlist = require( './views/settings/playlist.js' );
    2199         media.view.Attachment.Details = require( './views/attachment/details.js' );
    2200         media.view.AttachmentCompat = require( './views/attachment-compat.js' );
    2201         media.view.Iframe = require( './views/iframe.js' );
    2202         media.view.Embed = require( './views/embed.js' );
    2203         media.view.Label = require( './views/label.js' );
    2204         media.view.EmbedUrl = require( './views/embed/url.js' );
    2205         media.view.EmbedLink = require( './views/embed/link.js' );
    2206         media.view.EmbedImage = require( './views/embed/image.js' );
    2207         media.view.ImageDetails = require( './views/image-details.js' );
    2208         media.view.Cropper = require( './views/cropper.js' );
    2209         media.view.EditImage = require( './views/edit-image.js' );
    2210         media.view.Spinner = require( './views/spinner.js' );
     2118                // Just in case the event doesn't trigger, fire a callback.
     2119                _.delay( deferred.resolve, sensitivity );
    22112120
    2212 }(jQuery, _));
    2213 },{"./controllers/collection-add.js":1,"./controllers/collection-edit.js":2,"./controllers/cropper.js":3,"./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/image-details.js":9,"./controllers/library.js":10,"./controllers/media-library.js":11,"./controllers/region.js":12,"./controllers/replace-image.js":13,"./controllers/state-machine.js":14,"./controllers/state.js":15,"./utils/selection-sync.js":16,"./views/attachment-compat.js":18,"./views/attachment-filters.js":19,"./views/attachment-filters/all.js":20,"./views/attachment-filters/date.js":21,"./views/attachment-filters/uploaded.js":22,"./views/attachment.js":23,"./views/attachment/details.js":24,"./views/attachment/edit-library.js":25,"./views/attachment/edit-selection.js":26,"./views/attachment/library.js":27,"./views/attachment/selection.js":28,"./views/attachments.js":29,"./views/attachments/browser.js":30,"./views/attachments/selection.js":31,"./views/button-group.js":32,"./views/button.js":33,"./views/cropper.js":34,"./views/edit-image.js":35,"./views/embed.js":36,"./views/embed/image.js":37,"./views/embed/link.js":38,"./views/embed/url.js":39,"./views/focus-manager.js":40,"./views/frame/image-details.js":42,"./views/frame/post.js":43,"./views/frame/select.js":44,"./views/iframe.js":45,"./views/image-details.js":46,"./views/label.js":47,"./views/media-frame.js":48,"./views/menu-item.js":49,"./views/menu.js":50,"./views/modal.js":51,"./views/priority-list.js":52,"./views/router-item.js":53,"./views/router.js":54,"./views/search.js":55,"./views/selection.js":56,"./views/settings.js":57,"./views/settings/attachment-display.js":58,"./views/settings/gallery.js":59,"./views/settings/playlist.js":60,"./views/sidebar.js":61,"./views/spinner.js":62,"./views/toolbar.js":63,"./views/toolbar/embed.js":64,"./views/toolbar/select.js":65,"./views/uploader/editor.js":66,"./views/uploader/inline.js":67,"./views/uploader/status-error.js":68,"./views/uploader/status.js":69,"./views/uploader/window.js":70,"./views/view.js":71}],18:[function(require,module,exports){
    2214 /*globals _ */
     2121        // Otherwise, execute on the spot.
     2122        } else {
     2123                deferred.resolve();
     2124        }
     2125
     2126        return deferred.promise();
     2127};
    22152128
     2129media.controller.Region = require( './controllers/region.js' );
     2130media.controller.StateMachine = require( './controllers/state-machine.js' );
     2131media.controller.State = require( './controllers/state.js' );
     2132
     2133media.selectionSync = require( './utils/selection-sync.js' );
     2134media.controller.Library = require( './controllers/library.js' );
     2135media.controller.ImageDetails = require( './controllers/image-details.js' );
     2136media.controller.GalleryEdit = require( './controllers/gallery-edit.js' );
     2137media.controller.GalleryAdd = require( './controllers/gallery-add.js' );
     2138media.controller.CollectionEdit = require( './controllers/collection-edit.js' );
     2139media.controller.CollectionAdd = require( './controllers/collection-add.js' );
     2140media.controller.FeaturedImage = require( './controllers/featured-image.js' );
     2141media.controller.ReplaceImage = require( './controllers/replace-image.js' );
     2142media.controller.EditImage = require( './controllers/edit-image.js' );
     2143media.controller.MediaLibrary = require( './controllers/media-library.js' );
     2144media.controller.Embed = require( './controllers/embed.js' );
     2145media.controller.Cropper = require( './controllers/cropper.js' );
     2146
     2147media.View = require( './views/view.js' );
     2148media.view.Frame = require( './views/view.js' );
     2149media.view.MediaFrame = require( './views/media-frame.js' );
     2150media.view.MediaFrame.Select = require( './views/frame/select.js' );
     2151media.view.MediaFrame.Post = require( './views/frame/post.js' );
     2152media.view.MediaFrame.ImageDetails = require( './views/frame/image-details.js' );
     2153media.view.Modal = require( './views/modal.js' );
     2154media.view.FocusManager = require( './views/focus-manager.js' );
     2155media.view.UploaderWindow = require( './views/uploader/window.js' );
     2156media.view.EditorUploader = require( './views/uploader/editor.js' );
     2157media.view.UploaderInline = require( './views/uploader/inline.js' );
     2158media.view.UploaderStatus = require( './views/uploader/status.js' );
     2159media.view.UploaderStatusError = require( './views/uploader/status-error.js' );
     2160media.view.Toolbar = require( './views/toolbar.js' );
     2161media.view.Toolbar.Select = require( './views/toolbar/select.js' );
     2162media.view.Toolbar.Embed = require( './views/toolbar/embed.js' );
     2163media.view.Button = require( './views/button.js' );
     2164media.view.ButtonGroup = require( './views/button-group.js' );
     2165media.view.PriorityList = require( './views/priority-list.js' );
     2166media.view.MenuItem = require( './views/menu-item.js' );
     2167media.view.Menu = require( './views/menu.js' );
     2168media.view.RouterItem = require( './views/router-item.js' );
     2169media.view.Router = require( './views/router.js' );
     2170media.view.Sidebar = require( './views/sidebar.js' );
     2171media.view.Attachment = require( './views/attachment.js' );
     2172media.view.Attachment.Library = require( './views/attachment/library.js' );
     2173media.view.Attachment.EditLibrary = require( './views/attachment/edit-library.js' );
     2174media.view.Attachments = require( './views/attachments.js' );
     2175media.view.Search = require( './views/search.js' );
     2176media.view.AttachmentFilters = require( './views/attachment-filters.js' );
     2177media.view.DateFilter = require( './views/attachment-filters/date.js' );
     2178media.view.AttachmentFilters.Uploaded = require( './views/attachment-filters/uploaded.js' );
     2179media.view.AttachmentFilters.All = require( './views/attachment-filters/all.js' );
     2180media.view.AttachmentsBrowser = require( './views/attachments/browser.js' );
     2181media.view.Selection = require( './views/selection.js' );
     2182media.view.Attachment.Selection = require( './views/attachment/selection.js' );
     2183media.view.Attachments.Selection = require( './views/attachments/selection.js' );
     2184media.view.Attachment.EditSelection = require( './views/attachment/edit-selection.js' );
     2185media.view.Settings = require( './views/settings.js' );
     2186media.view.Settings.AttachmentDisplay = require( './views/settings/attachment-display.js' );
     2187media.view.Settings.Gallery = require( './views/settings/gallery.js' );
     2188media.view.Settings.Playlist = require( './views/settings/playlist.js' );
     2189media.view.Attachment.Details = require( './views/attachment/details.js' );
     2190media.view.AttachmentCompat = require( './views/attachment-compat.js' );
     2191media.view.Iframe = require( './views/iframe.js' );
     2192media.view.Embed = require( './views/embed.js' );
     2193media.view.Label = require( './views/label.js' );
     2194media.view.EmbedUrl = require( './views/embed/url.js' );
     2195media.view.EmbedLink = require( './views/embed/link.js' );
     2196media.view.EmbedImage = require( './views/embed/image.js' );
     2197media.view.ImageDetails = require( './views/image-details.js' );
     2198media.view.Cropper = require( './views/cropper.js' );
     2199media.view.EditImage = require( './views/edit-image.js' );
     2200media.view.Spinner = require( './views/spinner.js' );
     2201
     2202},{"./controllers/collection-add.js":1,"./controllers/collection-edit.js":2,"./controllers/cropper.js":3,"./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/image-details.js":9,"./controllers/library.js":10,"./controllers/media-library.js":11,"./controllers/region.js":12,"./controllers/replace-image.js":13,"./controllers/state-machine.js":14,"./controllers/state.js":15,"./utils/selection-sync.js":16,"./views/attachment-compat.js":18,"./views/attachment-filters.js":19,"./views/attachment-filters/all.js":20,"./views/attachment-filters/date.js":21,"./views/attachment-filters/uploaded.js":22,"./views/attachment.js":23,"./views/attachment/details.js":24,"./views/attachment/edit-library.js":25,"./views/attachment/edit-selection.js":26,"./views/attachment/library.js":27,"./views/attachment/selection.js":28,"./views/attachments.js":29,"./views/attachments/browser.js":30,"./views/attachments/selection.js":31,"./views/button-group.js":32,"./views/button.js":33,"./views/cropper.js":34,"./views/edit-image.js":35,"./views/embed.js":36,"./views/embed/image.js":37,"./views/embed/link.js":38,"./views/embed/url.js":39,"./views/focus-manager.js":40,"./views/frame/image-details.js":42,"./views/frame/post.js":43,"./views/frame/select.js":44,"./views/iframe.js":45,"./views/image-details.js":46,"./views/label.js":47,"./views/media-frame.js":48,"./views/menu-item.js":49,"./views/menu.js":50,"./views/modal.js":51,"./views/priority-list.js":52,"./views/router-item.js":53,"./views/router.js":54,"./views/search.js":55,"./views/selection.js":56,"./views/settings.js":57,"./views/settings/attachment-display.js":58,"./views/settings/gallery.js":59,"./views/settings/playlist.js":60,"./views/sidebar.js":61,"./views/spinner.js":62,"./views/toolbar.js":63,"./views/toolbar/embed.js":64,"./views/toolbar/select.js":65,"./views/uploader/editor.js":66,"./views/uploader/inline.js":67,"./views/uploader/status-error.js":68,"./views/uploader/status.js":69,"./views/uploader/window.js":70,"./views/view.js":71}],18:[function(require,module,exports){
    22162203/**
    22172204 * wp.media.view.AttachmentCompat
    22182205 *
     
    22962283});
    22972284
    22982285module.exports = AttachmentCompat;
    2299 },{"./view.js":71}],19:[function(require,module,exports){
    2300 /*globals _, jQuery */
    23012286
     2287},{"./view.js":71}],19:[function(require,module,exports){
    23022288/**
    23032289 * wp.media.view.AttachmentFilters
    23042290 *
     
    23752361});
    23762362
    23772363module.exports = AttachmentFilters;
    2378 },{"./view.js":71}],20:[function(require,module,exports){
    2379 /*globals _, wp */
    23802364
     2365},{"./view.js":71}],20:[function(require,module,exports){
    23812366/**
    23822367 * wp.media.view.AttachmentFilters.All
    23832368 *
     
    24672452});
    24682453
    24692454module.exports = All;
    2470 },{"../attachment-filters.js":19}],21:[function(require,module,exports){
    2471 /*globals _, wp */
    24722455
     2456},{"../attachment-filters.js":19}],21:[function(require,module,exports){
    24732457/**
    24742458 * A filter dropdown for month/dates.
    24752459 *
     
    25102494});
    25112495
    25122496module.exports = DateFilter;
    2513 },{"../attachment-filters.js":19}],22:[function(require,module,exports){
    2514 /*globals wp */
    25152497
     2498},{"../attachment-filters.js":19}],22:[function(require,module,exports){
    25162499/**
    25172500 * wp.media.view.AttachmentFilters.Uploaded
    25182501 *
     
    25712554});
    25722555
    25732556module.exports = Uploaded;
    2574 },{"../attachment-filters.js":19}],23:[function(require,module,exports){
    2575 /*globals _, wp, jQuery */
    25762557
     2558},{"../attachment-filters.js":19}],23:[function(require,module,exports){
    25772559/**
    25782560 * wp.media.view.Attachment
    25792561 *
     
    31263108});
    31273109
    31283110module.exports = Attachment;
    3129 },{"./view.js":71}],24:[function(require,module,exports){
    3130 /*globals _, wp */
    31313111
     3112},{"./view.js":71}],24:[function(require,module,exports){
    31323113/**
    31333114 * wp.media.view.Attachment.Details
    31343115 *
     
    31883169        deleteAttachment: function( event ) {
    31893170                event.preventDefault();
    31903171
    3191                 if ( confirm( l10n.warnDelete ) ) {
     3172                if ( window.confirm( l10n.warnDelete ) ) {
    31923173                        this.model.destroy();
    31933174                        // Keep focus inside media modal
    31943175                        // after image is deleted
     
    32673248});
    32683249
    32693250module.exports = Details;
     3251
    32703252},{"../attachment.js":23}],25:[function(require,module,exports){
    32713253/**
    32723254 * wp.media.view.Attachment.EditLibrary
     
    32873269});
    32883270
    32893271module.exports = EditLibrary;
     3272
    32903273},{"../attachment.js":23}],26:[function(require,module,exports){
    32913274/**
    32923275 * wp.media.view.Attachments.EditSelection
     
    33083291});
    33093292
    33103293module.exports = EditSelection;
     3294
    33113295},{"./selection.js":28}],27:[function(require,module,exports){
    33123296/**
    33133297 * wp.media.view.Attachment.Library
     
    33283312});
    33293313
    33303314module.exports = Library;
     3315
    33313316},{"../attachment.js":23}],28:[function(require,module,exports){
    33323317/**
    33333318 * wp.media.view.Attachment.Selection
     
    33523337});
    33533338
    33543339module.exports = Selection;
    3355 },{"../attachment.js":23}],29:[function(require,module,exports){
    3356 /*globals _, wp, jQuery */
    33573340
     3341},{"../attachment.js":23}],29:[function(require,module,exports){
    33583342/**
    33593343 * wp.media.view.Attachments
    33603344 *
     
    36273611
    36283612                // The scroll event occurs on the document, but the element
    36293613                // that should be checked is the document body.
    3630                 if ( el == document ) {
     3614                if ( el === document ) {
    36313615                        el = document.body;
    36323616                        scrollTop = $(document).scrollTop();
    36333617                }
     
    36533637});
    36543638
    36553639module.exports = Attachments;
    3656 },{"./attachment.js":23,"./view.js":71}],30:[function(require,module,exports){
    3657 /*globals _, wp, jQuery */
    36583640
     3641},{"./attachment.js":23,"./view.js":71}],30:[function(require,module,exports){
    36593642/**
    36603643 * wp.media.view.AttachmentsBrowser
    36613644 *
     
    38463829                                                return;
    38473830                                        }
    38483831
    3849                                         if ( ! mediaTrash && ! confirm( l10n.warnBulkDelete ) ) {
     3832                                        if ( ! mediaTrash && ! window.confirm( l10n.warnBulkDelete ) ) {
    38503833                                                return;
    38513834                                        }
    38523835
    38533836                                        if ( mediaTrash &&
    38543837                                                'trash' !== selection.at( 0 ).get( 'status' ) &&
    3855                                                 ! confirm( l10n.warnBulkTrash ) ) {
     3838                                                ! window.confirm( l10n.warnBulkTrash ) ) {
    38563839
    38573840                                                return;
    38583841                                        }
     
    39003883                                        click: function() {
    39013884                                                var removed = [], selection = this.controller.state().get( 'selection' );
    39023885
    3903                                                 if ( ! selection.length || ! confirm( l10n.warnBulkDelete ) ) {
     3886                                                if ( ! selection.length || ! window.confirm( l10n.warnBulkDelete ) ) {
    39043887                                                        return;
    39053888                                                }
    39063889
     
    41134096});
    41144097
    41154098module.exports = AttachmentsBrowser;
    4116 },{"../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){
    4117 /*globals _ */
    41184099
     4100},{"../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){
    41194101/**
    41204102 * wp.media.view.Attachments.Selection
    41214103 *
     
    41454127});
    41464128
    41474129module.exports = Selection;
    4148 },{"../attachment/selection.js":28,"../attachments.js":29}],32:[function(require,module,exports){
    4149 /*globals _, Backbone, jQuery */
    41504130
     4131},{"../attachment/selection.js":28,"../attachments.js":29}],32:[function(require,module,exports){
    41514132/**
    41524133 * wp.media.view.ButtonGroup
    41534134 *
     
    41944175});
    41954176
    41964177module.exports = ButtonGroup;
    4197 },{"./button.js":33,"./view.js":71}],33:[function(require,module,exports){
    4198 /*globals _, Backbone */
    41994178
     4179},{"./button.js":33,"./view.js":71}],33:[function(require,module,exports){
    42004180/**