Make WordPress Core

Changeset 31385


Ignore:
Timestamp:
02/09/2015 04:00:44 PM (10 years ago)
Author:
wonderboymusic
Message:

Media JS files:

  • In media manifests, ditch IIFEs and global injection, these get dynamically scoped via Browserify
  • Remove the debug option from browserify:media
  • Add jshint:media to jshint:corejs
  • Add a trailing newline to all new module files

Props iseulde.
See #28510.

Location:
trunk
Files:
88 edited

Legend:

Unmodified
Added
Removed
  • trunk/Gruntfile.js

    r31373 r31385  
    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        },
     
    234233                    // Third party scripts
    235234                    '!twenty{fourteen,fifteen}/js/html5.js'
     235                ]
     236            },
     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'
    236247                ]
    237248            },
     
    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.
  • trunk/src/wp-includes/js/media/audio-video.js

    r31380 r31385  
    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 */
    3 
    4 (function(_) {
    5     var media = wp.media,
    6         baseSettings = {},
    7         l10n = typeof _wpMediaViewsL10n === 'undefined' ? {} : _wpMediaViewsL10n;
    8 
    9     if ( ! _.isUndefined( window._wpmejsSettings ) ) {
    10         baseSettings = _wpmejsSettings;
     2var media = wp.media,
     3    baseSettings = window._wpmejsSettings || {},
     4    l10n = window._wpMediaViewsL10n || {};
     5
     6/**
     7 * @mixin
     8 */
     9wp.media.mixin = {
     10    mejsSettings: baseSettings,
     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    },
     22
     23    /**
     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.
     27     */
     28    removePlayer: function(t) {
     29        var featureIndex, feature;
     30
     31        if ( ! t.options ) {
     32            return;
     33        }
     34
     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) {}
     42            }
     43        }
     44
     45        if ( ! t.isDynamic ) {
     46            t.$node.remove();
     47        }
     48
     49        if ( 'native' !== t.media.pluginType ) {
     50            t.media.remove();
     51        }
     52
     53        delete window.mejs.players[t.id];
     54
     55        t.container.remove();
     56        t.globalUnbind();
     57        delete t.node.player;
     58    },
     59
     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        }
    1174    }
    12 
    13     /**
    14      * @mixin
    15      */
    16     wp.media.mixin = {
    17         mejsSettings: baseSettings,
    18 
    19         removeAllPlayers: function() {
    20             var p;
    21 
    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                 }
     75};
     76
     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});
     93
     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,
     103
     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    },
     112
     113    edit : function( data ) {
     114        var frame, shortcode = wp.shortcode.next( 'audio', data ).shortcode;
     115
     116        frame = wp.media({
     117            frame: 'audio',
     118            state: 'audio-details',
     119            metadata: _.defaults( shortcode.attrs.named, this.defaults )
     120        });
     121
     122        return frame;
     123    },
     124
     125    shortcode : function( model ) {
     126        var content;
     127
     128        _.each( this.defaults, function( value, key ) {
     129            model[ key ] = this.coerce( model, key );
     130
     131            if ( value === model[ key ] ) {
     132                delete model[ key ];
    27133            }
    28         },
    29 
    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;
    37 
    38             if ( ! t.options ) {
    39                 return;
     134        }, this );
     135
     136        content = model.content;
     137        delete model.content;
     138
     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        });
     182
     183        return frame;
     184    },
     185
     186    shortcode : function( model ) {
     187        var content;
     188
     189        _.each( this.defaults, function( value, key ) {
     190            model[ key ] = this.coerce( model, key );
     191
     192            if ( value === model[ key ] ) {
     193                delete model[ key ];
    40194            }
    41 
    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             }
    51 
    52             if ( ! t.isDynamic ) {
    53                 t.$node.remove();
    54             }
    55 
    56             if ( 'native' !== t.media.pluginType ) {
    57                 t.media.remove();
    58             }
    59 
    60             delete window.mejs.players[t.id];
    61 
    62             t.container.remove();
    63             t.globalUnbind();
    64             delete t.node.player;
    65         },
    66 
    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     };
    83 
    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             });
    128 
    129             return frame;
    130         },
    131 
    132         shortcode : function( model ) {
    133             var content;
    134 
    135             _.each( this.defaults, function( value, key ) {
    136                 model[ key ] = self.coerce( model, key );
    137 
    138                 if ( value === model[ key ] ) {
    139                     delete model[ key ];
    140                 }
    141             }, this );
    142 
    143             content = model.content;
    144             delete model.content;
    145 
    146             return new wp.shortcode({
    147                 tag: 'audio',
    148                 attrs: model,
    149                 content: content
    150             });
    151         }
    152     };
    153 
    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             });
    189 
    190             return frame;
    191         },
    192 
    193         shortcode : function( model ) {
    194             var content;
    195 
    196             _.each( this.defaults, function( value, key ) {
    197                 model[ key ] = this.coerce( model, key );
    198 
    199                 if ( value === model[ key ] ) {
    200                     delete model[ key ];
    201                 }
    202             }, this );
    203 
    204             content = model.content;
    205             delete model.content;
    206 
    207             return new wp.shortcode({
    208                 tag: 'video',
    209                 attrs: model,
    210                 content: content
    211             });
    212         }
    213     };
    214 
    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' );
    224 
    225 }(_));
     195        }, this );
     196
     197        content = model.content;
     198        delete model.content;
     199
     200        return new wp.shortcode({
     201            tag: 'video',
     202            attrs: model,
     203            content: content
     204        });
     205    }
     206};
     207
     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' );
     217
    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
     
    256246
    257247module.exports = AudioDetails;
     248
    258249},{"./state.js":7}],3:[function(require,module,exports){
    259 /*globals _, wp, Backbone, getUserSetting, setUserSetting */
    260 
    261250/**
    262251 * wp.media.controller.Library
     
    296285    State = require( './state.js' ),
    297286    l10n = wp.media.view.l10n,
     287    getUserSetting = window.getUserSetting,
     288    setUserSetting = window.setUserSetting,
    298289    Library;
    299290
     
    330321        }
    331322
    332         if ( ! (selection instanceof Selection) ) {
     323        if ( ! ( selection instanceof wp.media.model.Selection ) ) {
    333324            props = selection;
    334325
     
    529520
    530521module.exports = Library;
     522
    531523},{"../utils/selection-sync.js":10,"./state.js":7}],4:[function(require,module,exports){
    532 /*globals _, wp */
    533 
    534524/**
    535525 * wp.media.controller.MediaLibrary
     
    580570
    581571module.exports = MediaLibrary;
     572
    582573},{"./library.js":3}],5:[function(require,module,exports){
    583 /*globals _, Backbone */
    584 
    585574/**
    586575 * wp.media.controller.Region
     
    760749
    761750module.exports = Region;
     751
    762752},{}],6:[function(require,module,exports){
    763 /*globals _, Backbone */
    764 
    765753/**
    766754 * wp.media.controller.StateMachine
     
    885873
    886874module.exports = StateMachine;
     875
    887876},{}],7:[function(require,module,exports){
    888 /*globals _, Backbone */
    889 
    890877/**
    891878 * wp.media.controller.State
     
    11271114
    11281115module.exports = State;
     1116
    11291117},{}],8:[function(require,module,exports){
    1130 /*globals wp */
    1131 
    11321118/**
    11331119 * The controller for the Video Details state
     
    11591145
    11601146module.exports = VideoDetails;
     1147
    11611148},{"./state.js":7}],9:[function(require,module,exports){
    1162 /*globals Backbone, _, wp */
    1163 
    11641149/**
    11651150 * Shared model class for audio and video. Updates the model after
     
    12001185
    12011186module.exports = PostMedia;
     1187
    12021188},{}],10:[function(require,module,exports){
    1203 /*globals _ */
    1204 
    12051189/**
    12061190 * wp.media.selectionSync
     
    12671251
    12681252module.exports = selectionSync;
     1253
    12691254},{}],11:[function(require,module,exports){
    1270 /*globals _ */
    1271 
    12721255/**
    12731256 * wp.media.view.AttachmentCompat
     
    13531336
    13541337module.exports = AttachmentCompat;
     1338
    13551339},{"./view.js":51}],12:[function(require,module,exports){
    1356 /*globals _, jQuery */
    1357 
    13581340/**
    13591341 * wp.media.view.AttachmentFilters
     
    14321414
    14331415module.exports = AttachmentFilters;
     1416
    14341417},{"./view.js":51}],13:[function(require,module,exports){
    1435 /*globals _, wp */
    1436 
    14371418/**
    14381419 * wp.media.view.AttachmentFilters.All
     
    15241505
    15251506module.exports = All;
     1507
    15261508},{"../attachment-filters.js":12}],14:[function(require,module,exports){
    1527 /*globals _, wp */
    1528 
    15291509/**
    15301510 * A filter dropdown for month/dates.
     
    15671547
    15681548module.exports = DateFilter;
     1549
    15691550},{"../attachment-filters.js":12}],15:[function(require,module,exports){
    1570 /*globals wp */
    1571 
    15721551/**
    15731552 * wp.media.view.AttachmentFilters.Uploaded
     
    16281607
    16291608module.exports = Uploaded;
     1609
    16301610},{"../attachment-filters.js":12}],16:[function(require,module,exports){
    1631 /*globals _, wp, jQuery */
    1632 
    16331611/**
    16341612 * wp.media.view.Attachment
     
    21832161
    21842162module.exports = Attachment;
     2163
    21852164},{"./view.js":51}],17:[function(require,module,exports){
    2186 /*globals _, wp */
    2187 
    21882165/**
    21892166 * wp.media.view.Attachment.Details
     
    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
     
    23242301
    23252302module.exports = Details;
     2303
    23262304},{"../attachment.js":16}],18:[function(require,module,exports){
    23272305/**
     
    23442322
    23452323module.exports = Library;
     2324
    23462325},{"../attachment.js":16}],19:[function(require,module,exports){
    2347 /*globals _, wp, jQuery */
    2348 
    23492326/**
    23502327 * wp.media.view.Attachments
     
    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();
     
    26452622
    26462623module.exports = Attachments;
     2624
    26472625},{"./attachment.js":16,"./view.js":51}],20:[function(require,module,exports){
    2648 /*globals _, wp, jQuery */
    2649 
    26502626/**
    26512627 * wp.media.view.AttachmentsBrowser
     
    28382814                    }
    28392815
    2840                     if ( ! mediaTrash && ! confirm( l10n.warnBulkDelete ) ) {
     2816                    if ( ! mediaTrash && ! window.confirm( l10n.warnBulkDelete ) ) {
    28412817                        return;
    28422818                    }
     
    28442820                    if ( mediaTrash &&
    28452821                        'trash' !== selection.at( 0 ).get( 'status' ) &&
    2846                         ! confirm( l10n.warnBulkTrash ) ) {
     2822                        ! window.confirm( l10n.warnBulkTrash ) ) {
    28472823
    28482824                        return;
     
    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                        }
     
    31053081
    31063082module.exports = AttachmentsBrowser;
     3083
    31073084},{"../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 */
    3109 
    31103085/**
    31113086 * wp.media.view.AudioDetails
     
    31443119
    31453120module.exports = AudioDetails;
     3121
    31463122},{"./media-details":31}],22:[function(require,module,exports){
    3147 /*globals _, Backbone */
    3148 
    31493123/**
    31503124 * wp.media.view.Button
     
    32343208
    32353209module.exports = Button;
     3210
    32363211},{"./view.js":51}],23:[function(require,module,exports){
    32373212/**
     
    32823257
    32833258module.exports = FocusManager;
     3259
    32843260},{"./view.js":51}],24:[function(require,module,exports){
    3285 /*globals _, Backbone */
    3286 
    32873261/**
    32883262 * wp.media.view.Frame
     
    34553429
    34563430module.exports = Frame;
     3431
    34573432},{"../controllers/region.js":5,"../controllers/state-machine.js":6,"../controllers/state.js":7,"./view.js":51}],25:[function(require,module,exports){
    3458 /*globals wp */
    3459 
    34603433/**
    34613434 * wp.media.view.MediaFrame.AudioDetails
     
    35333506
    35343507module.exports = AudioDetails;
     3508
    35353509},{"../../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 */
    3537 
    35383510/**
    35393511 * wp.media.view.MediaFrame.MediaDetails
     
    36663638
    36673639module.exports = MediaDetails;
     3640
    36683641},{"../toolbar.js":44,"../view.js":51,"./select.js":27}],27:[function(require,module,exports){
    3669 /*globals _, wp */
    3670 
    36713642/**
    36723643 * wp.media.view.MediaFrame.Select
     
    38413812
    38423813module.exports = Select;
     3814
    38433815},{"../../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 */
    3845 
    38463816/**
    38473817 * wp.media.view.MediaFrame.VideoDetails
     
    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/**
     
    40053976
    40063977module.exports = Iframe;
     3978
    40073979},{"./view.js":51}],30:[function(require,module,exports){
    40083980/**
     
    40314003
    40324004module.exports = Label;
     4005
    40334006},{"./view.js":51}],31:[function(require,module,exports){
    4034 /*globals _, wp, jQuery */
    4035 
    40364007/**
    40374008 * wp.media.view.MediaDetails
     
    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    },
     
    41454116    render: function() {
    41464117        AttachmentDisplay.prototype.render.apply( this, arguments );
    4147        
     4118
    41484119        setTimeout( _.bind( function() {
    41494120            this.resetFocus();
     
    41844155
    41854156module.exports = MediaDetails;
     4157
    41864158},{"./settings/attachment-display.js":41}],32:[function(require,module,exports){
    4187 /*globals _, wp, jQuery */
    4188 
    41894159/**
    41904160 * wp.media.view.MediaFrame
     
    44394409
    44404410module.exports = MediaFrame;
     4411
    44414412},{"./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 */
    4443 
    44444413/**
    44454414 * wp.media.view.MenuItem
     
    45134482
    45144483module.exports = MenuItem;
     4484
    45154485},{"./view.js":51}],34:[function(require,module,exports){
    45164486/**
     
    46294599
    46304600module.exports = Menu;
     4601
    46314602},{"./menu-item.js":33,"./priority-list.js":36}],35:[function(require,module,exports){
    4632 /*globals _, wp, jQuery */
    4633 
    46344603/**
    46354604 * wp.media.view.Modal
     
    48454814
    48464815module.exports = Modal;
     4816
    48474817},{"./focus-manager.js":23,"./view.js":51}],36:[function(require,module,exports){
    4848 /*globals _, Backbone */
    4849 
    48504818/**
    48514819 * wp.media.view.PriorityList
     
    49464914
    49474915module.exports = PriorityList;
     4916
    49484917},{"./view.js":51}],37:[function(require,module,exports){
    49494918/**
     
    49724941
    49734942module.exports = RouterItem;
     4943
    49744944},{"./menu-item.js":33}],38:[function(require,module,exports){
    49754945/**
     
    50094979
    50104980module.exports = Router;
     4981
    50114982},{"./menu.js":34,"./router-item.js":37}],39:[function(require,module,exports){
    5012 /*globals wp */
    5013 
    50144983/**
    50154984 * wp.media.view.Search
     
    50595028
    50605029module.exports = Search;
     5030
    50615031},{"./view.js":51}],40:[function(require,module,exports){
    5062 /*globals _, Backbone, jQuery */
    5063 
    50645032/**
    50655033 * wp.media.view.Settings
     
    51695137        // update that as well.
    51705138        if ( userSetting = $setting.data('userSetting') ) {
    5171             setUserSetting( userSetting, value );
     5139            window.setUserSetting( userSetting, value );
    51725140        }
    51735141    },
     
    51815149
    51825150module.exports = Settings;
     5151
    51835152},{"./view.js":51}],41:[function(require,module,exports){
    5184 /*globals _, wp */
    5185 
    51865153/**
    51875154 * wp.media.view.Settings.AttachmentDisplay
     
    52765243
    52775244module.exports = AttachmentDisplay;
     5245
    52785246},{"../settings.js":40}],42:[function(require,module,exports){
    52795247/**
     
    52945262
    52955263module.exports = Sidebar;
     5264
    52965265},{"./priority-list.js":36}],43:[function(require,module,exports){
    5297 /*globals _, wp */
    5298 
    52995266/**
    53005267 * wp.media.view.Spinner
     
    53335300
    53345301module.exports = Spinner;
     5302
    53355303},{"./view.js":51}],44:[function(require,module,exports){
    5336 /*globals Backbone, _ */
    5337 
    53385304/**
    53395305 * wp.media.view.Toolbar
     
    54965462
    54975463module.exports = Toolbar;
     5464
    54985465},{"./button.js":22,"./priority-list.js":36,"./view.js":51}],45:[function(require,module,exports){
    5499 /*globals _, wp */
    5500 
    55015466/**
    55025467 * wp.media.view.Toolbar.Select
     
    55675532
    55685533module.exports = Select;
     5534
    55695535},{"../toolbar.js":44}],46:[function(require,module,exports){
    5570 /*globals _, wp */
    5571 
    55725536/**
    55735537 * wp.media.view.UploaderInline
     
    57005664
    57015665module.exports = UploaderInline;
     5666
    57025667},{"../view.js":51,"./status.js":48}],47:[function(require,module,exports){
    5703 /*globals wp */
    5704 
    57055668/**
    57065669 * wp.media.view.UploaderStatusError
     
    57205683
    57215684module.exports = UploaderStatusError;
     5685
    57225686},{"../view.js":51}],48:[function(require,module,exports){
    5723 /*globals _, wp */
    5724 
    57255687/**
    57265688 * wp.media.view.UploaderStatus
     
    58605822
    58615823module.exports = UploaderStatus;
     5824
    58625825},{"../view.js":51,"./status-error.js":47}],49:[function(require,module,exports){
    5863 /*globals _, wp, jQuery */
    5864 
    58655826/**
    58665827 * wp.media.view.UploaderWindow
     
    59735934
    59745935module.exports = UploaderWindow;
     5936
    59755937},{"../view.js":51}],50:[function(require,module,exports){
    5976 /*globals wp */
    5977 
    59785938/**
    59795939 * wp.media.view.VideoDetails
     
    60175977
    60185978module.exports = VideoDetails;
     5979
    60195980},{"./media-details":31}],51:[function(require,module,exports){
    6020 /*globals wp */
    6021 
    60225981/**
    60235982 * wp.media.View
     
    60846043
    60856044module.exports = View;
     6045
    60866046},{}]},{},[1]);
  • trunk/src/wp-includes/js/media/audio-video.manifest.js

    r31380 r31385  
    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         },
    28 
    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             }
    54 
    55             if ( 'native' !== t.media.pluginType ) {
    56                 t.media.remove();
    57             }
    58 
    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             }
    80         }
    81     };
     27    removePlayer: function(t) {
     28        var featureIndex, feature;
     29
     30        if ( ! t.options ) {
     31            return;
     32        }
     33
     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) {}
     41            }
     42        }
     43
     44        if ( ! t.isDynamic ) {
     45            t.$node.remove();
     46        }
     47
     48        if ( 'native' !== t.media.pluginType ) {
     49            t.media.remove();
     50        }
     51
     52        delete window.mejs.players[t.id];
     53
     54        t.container.remove();
     55        t.globalUnbind();
     56        delete t.node.player;
     57    },
    8258
    8359    /**
    84      * Autowire "collection"-type shortcodes
     60     * Allows any class that has set 'player' to a MediaElementPlayer
     61     *  instance to remove the player when listening to events.
     62     *
     63     *  Examples: modal closes, shortcode properties are removed, etc.
    8564     */
    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'
    97         }
    98     });
    99 
    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,
    109 
    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     };
    152 
    153     /**
    154      * Shortcode modeling for video
    155      *  `edit()` prepares the shortcode for the media modal
    156      *  `shortcode()` builds the new shortcode after update
    157      *
    158      * @namespace
    159      */
    160     wp.media.video = {
    161         coerce : wp.media.coerce,
    162 
    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' );
    223 
    224 }(_));
     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});
     92
     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};
     206
     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' );
  • trunk/src/wp-includes/js/media/controllers/audio-details.js

    r31373 r31385  
    1 /*globals wp */
    2 
    31/**
    42 * The controller for the Audio Details state
  • trunk/src/wp-includes/js/media/controllers/collection-add.js

    r31379 r31385  
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.controller.CollectionAdd
  • trunk/src/wp-includes/js/media/controllers/collection-edit.js

    r31379 r31385  
    1 /*globals wp, jQuery, Backbone */
    2 
    31/**
    42 * wp.media.controller.CollectionEdit
  • trunk/src/wp-includes/js/media/controllers/cropper.js

    r31380 r31385  
    1 /*globals _, wp, Backbone */
    2 
    31/**
    42 * wp.media.controller.Cropper
     
    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 );
  • trunk/src/wp-includes/js/media/controllers/edit-attachment-metadata.js

    r31373 r31385  
    1 /*globals wp */
    2 
    31/**
    42 * wp.media.controller.EditAttachmentMetadata
  • trunk/src/wp-includes/js/media/controllers/edit-image.js

    r31373 r31385  
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.controller.EditImage
  • trunk/src/wp-includes/js/media/controllers/embed.js

    r31373 r31385  
    1 /*globals _, wp, jQuery, Backbone */
    2 
    31/**
    42 * wp.media.controller.Embed
  • trunk/src/wp-includes/js/media/controllers/featured-image.js

    r31379 r31385  
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.controller.FeaturedImage
  • trunk/src/wp-includes/js/media/controllers/gallery-add.js

    r31379 r31385  
    1 /*globals _, wp */
    2 
    31/**
    42 * A state for selecting more images to add to a gallery.
     
    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 );
     
    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
  • trunk/src/wp-includes/js/media/controllers/gallery-edit.js

    r31379 r31385  
    1 /*globals wp, Backbone */
    2 
    31/**
    42 * wp.media.controller.GalleryEdit
     
    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    },
  • trunk/src/wp-includes/js/media/controllers/image-details.js

    r31373 r31385  
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.controller.ImageDetails
  • trunk/src/wp-includes/js/media/controllers/library.js

    r31379 r31385  
    1 /*globals _, wp, Backbone, getUserSetting, setUserSetting */
    2 
    31/**
    42 * wp.media.controller.Library
     
    3836    State = require( './state.js' ),
    3937    l10n = wp.media.view.l10n,
     38    getUserSetting = window.getUserSetting,
     39    setUserSetting = window.setUserSetting,
    4040    Library;
    4141
     
    7272        }
    7373
    74         if ( ! (selection instanceof Selection) ) {
     74        if ( ! ( selection instanceof wp.media.model.Selection ) ) {
    7575            props = selection;
    7676
  • trunk/src/wp-includes/js/media/controllers/media-library.js

    r31373 r31385  
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.controller.MediaLibrary
  • trunk/src/wp-includes/js/media/controllers/region.js

    r31373 r31385  
    1 /*globals _, Backbone */
    2 
    31/**
    42 * wp.media.controller.Region
  • trunk/src/wp-includes/js/media/controllers/replace-image.js

    r31373 r31385  
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.controller.ReplaceImage
  • trunk/src/wp-includes/js/media/controllers/state-machine.js

    r31373 r31385  
    1 /*globals _, Backbone */
    2 
    31/**
    42 * wp.media.controller.StateMachine
  • trunk/src/wp-includes/js/media/controllers/state.js

    r31373 r31385  
    1 /*globals _, Backbone */
    2 
    31/**
    42 * wp.media.controller.State
  • trunk/src/wp-includes/js/media/controllers/video-details.js

    r31373 r31385  
    1 /*globals wp */
    2 
    31/**
    42 * The controller for the Video Details state
  • trunk/src/wp-includes/js/media/grid.js

    r31380 r31385  
    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
     
    2927
    3028module.exports = EditAttachmentMetadata;
     29
    3130},{"./state.js":6}],2:[function(require,module,exports){
    32 /*globals _, wp */
    33 
    3431/**
    3532 * wp.media.controller.EditImage
     
    108105
    109106module.exports = EditImage;
     107
    110108},{"../views/toolbar.js":46,"./state.js":6}],3:[function(require,module,exports){
    111 /*globals _, wp, Backbone, getUserSetting, setUserSetting */
    112 
    113109/**
    114110 * wp.media.controller.Library
     
    148144    State = require( './state.js' ),
    149145    l10n = wp.media.view.l10n,
     146    getUserSetting = window.getUserSetting,
     147    setUserSetting = window.setUserSetting,
    150148    Library;
    151149
     
    182180        }
    183181
    184         if ( ! (selection instanceof Selection) ) {
     182        if ( ! ( selection instanceof wp.media.model.Selection ) ) {
    185183            props = selection;
    186184
     
    381379
    382380module.exports = Library;
     381
    383382},{"../utils/selection-sync.js":9,"./state.js":6}],4:[function(require,module,exports){
    384 /*globals _, Backbone */
    385 
    386383/**
    387384 * wp.media.controller.Region
     
    561558
    562559module.exports = Region;
     560
    563561},{}],5:[function(require,module,exports){
    564 /*globals _, Backbone */
    565 
    566562/**
    567563 * wp.media.controller.StateMachine
     
    686682
    687683module.exports = StateMachine;
     684
    688685},{}],6:[function(require,module,exports){
    689 /*globals _, Backbone */
    690 
    691686/**
    692687 * wp.media.controller.State
     
    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' );
    944 
    945 }(wp));
     927var media = wp.media;
     928
     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' );
     938
    946939},{"./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 */
    948 
    949940/**
    950941 * A router for handling the browser history and application state.
     
    991982
    992983module.exports = Router;
     984
    993985},{}],9:[function(require,module,exports){
    994 /*globals _ */
    995 
    996986/**
    997987 * wp.media.selectionSync
     
    10581048
    10591049module.exports = selectionSync;
     1050
    10601051},{}],10:[function(require,module,exports){
    1061 /*globals _ */
    1062 
    10631052/**
    10641053 * wp.media.view.AttachmentCompat
     
    11441133
    11451134module.exports = AttachmentCompat;
     1135
    11461136},{"./view.js":51}],11:[function(require,module,exports){
    1147 /*globals _, jQuery */
    1148 
    11491137/**
    11501138 * wp.media.view.AttachmentFilters
     
    12231211
    12241212module.exports = AttachmentFilters;
     1213
    12251214},{"./view.js":51}],12:[function(require,module,exports){
    1226 /*globals _, wp */
    1227 
    12281215/**
    12291216 * wp.media.view.AttachmentFilters.All
     
    13151302
    13161303module.exports = All;
     1304
    13171305},{"../attachment-filters.js":11}],13:[function(require,module,exports){
    1318 /*globals _, wp */
    1319 
    13201306/**
    13211307 * A filter dropdown for month/dates.
     
    13581344
    13591345module.exports = DateFilter;
     1346
    13601347},{"../attachment-filters.js":11}],14:[function(require,module,exports){
    1361 /*globals wp */
    1362 
    13631348/**
    13641349 * wp.media.view.AttachmentFilters.Uploaded
     
    14191404
    14201405module.exports = Uploaded;
     1406
    14211407},{"../attachment-filters.js":11}],15:[function(require,module,exports){
    1422 /*globals _, wp, jQuery */
    1423 
    14241408/**
    14251409 * wp.media.view.Attachment
     
    19741958
    19751959module.exports = Attachment;
     1960
    19761961},{"./view.js":51}],16:[function(require,module,exports){
    1977 /*globals wp */
    1978 
    19791962/**
    19801963 * A similar view to media.view.Attachment.Details
     
    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    }
     
    20172000
    20182001module.exports = TwoColumn;
     2002
    20192003},{"../media-details.js":33,"./details.js":17}],17:[function(require,module,exports){
    2020 /*globals _, wp */
    2021 
    20222004/**
    20232005 * wp.media.view.Attachment.Details
     
    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
     
    21582140
    21592141module.exports = Details;
     2142
    21602143},{"../attachment.js":15}],18:[function(require,module,exports){
    21612144/**
     
    21782161
    21792162module.exports = Library;
     2163
    21802164},{"../attachment.js":15}],19:[function(require,module,exports){
    2181 /*globals _, wp, jQuery */
    2182 
    21832165/**
    21842166 * wp.media.view.Attachments
     
    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();
     
    24792461
    24802462module.exports = Attachments;
     2463
    24812464},{"./attachment.js":15,"./view.js":51}],20:[function(require,module,exports){
    2482 /*globals _, wp, jQuery */
    2483 
    24842465/**
    24852466 * wp.media.view.AttachmentsBrowser
     
    26722653                    }
    26732654
    2674                     if ( ! mediaTrash && ! confirm( l10n.warnBulkDelete ) ) {
     2655                    if ( ! mediaTrash && ! window.confirm( l10n.warnBulkDelete ) ) {
    26752656                        return;
    26762657                    }
     
    26782659                    if ( mediaTrash &&
    26792660                        'trash' !== selection.at( 0 ).get( 'status' ) &&
    2680                         ! confirm( l10n.warnBulkTrash ) ) {
     2661                        ! window.confirm( l10n.warnBulkTrash ) ) {
    26812662
    26822663                        return;
     
    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                        }
     
    29392920
    29402921module.exports = AttachmentsBrowser;
     2922
    29412923},{"../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 */
    2943 
    29442924/**
    29452925 * wp.media.view.Button
     
    30293009
    30303010module.exports = Button;
     3011
    30313012},{"./view.js":51}],22:[function(require,module,exports){
    30323013/**
     
    30733054
    30743055module.exports = DeleteSelectedPermanently;
     3056
    30753057},{"../button.js":21,"./delete-selected.js":23}],23:[function(require,module,exports){
    3076 /*globals wp */
    3077 
    30783058/**
    30793059 * A button that handles bulk Delete/Trash logic
     
    31253105
    31263106module.exports = DeleteSelected;
     3107
    31273108},{"../button.js":21}],24:[function(require,module,exports){
    3128 /*globals wp */
    3129 
    31303109var Button = require( '../button.js' ),
    31313110    l10n = wp.media.view.l10n,
     
    31813160
    31823161module.exports = SelectModeToggle;
     3162
    31833163},{"../button.js":21}],25:[function(require,module,exports){
    31843164var View = require( './view.js' ),
     
    32063186
    32073187module.exports = Details;
     3188
    32083189},{"./edit-image.js":26,"./view.js":51}],26:[function(require,module,exports){
    3209 /*globals _, wp */
    3210 
    32113190var View = require( './view.js' ),
    32123191    EditImage;
     
    32603239
    32613240module.exports = EditImage;
     3241
    32623242},{"./view.js":51}],27:[function(require,module,exports){
    32633243/**
     
    33083288
    33093289module.exports = FocusManager;
     3290
    33103291},{"./view.js":51}],28:[function(require,module,exports){
    3311 /*globals _, Backbone */
    3312 
    33133292/**
    33143293 * wp.media.view.Frame
     
    34813460
    34823461module.exports = Frame;
     3462
    34833463},{"../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 */
    3485 
    34863464/**
    34873465 * A frame for editing the details of a specific media item.
     
    37283706
    37293707module.exports = EditAttachments;
     3708
    37303709},{"../../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 */
    3732 
    37333710/**
    37343711 * wp.media.view.MediaFrame.Manage
     
    39683945        if ( window.history && window.history.pushState ) {
    39693946            Backbone.history.start( {
    3970                 root: _wpMediaGridSettings.adminUrl,
     3947                root: window._wpMediaGridSettings.adminUrl,
    39713948                pushState: true
    39723949            } );
     
    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/**
     
    40023980
    40033981module.exports = Iframe;
     3982
    40043983},{"./view.js":51}],32:[function(require,module,exports){
    40053984/**
     
    40284007
    40294008module.exports = Label;
     4009
    40304010},{"./view.js":51}],33:[function(require,module,exports){
    4031 /*globals _, wp, jQuery */
    4032 
    40334011/**
    40344012 * wp.media.view.MediaDetails
     
    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    },
     
    41424120    render: function() {
    41434121        AttachmentDisplay.prototype.render.apply( this, arguments );
    4144        
     4122
    41454123        setTimeout( _.bind( function() {
    41464124            this.resetFocus();
     
    41814159
    41824160module.exports = MediaDetails;
     4161
    41834162},{"./settings/attachment-display.js":43}],34:[function(require,module,exports){
    4184 /*globals _, wp, jQuery */
    4185 
    41864163/**
    41874164 * wp.media.view.MediaFrame
     
    44364413
    44374414module.exports = MediaFrame;
     4415
    44384416},{"./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 */
    4440 
    44414417/**
    44424418 * wp.media.view.MenuItem
     
    45104486
    45114487module.exports = MenuItem;
     4488
    45124489},{"./view.js":51}],36:[function(require,module,exports){
    45134490/**
     
    46264603
    46274604module.exports = Menu;
     4605
    46284606},{"./menu-item.js":35,"./priority-list.js":38}],37:[function(require,module,exports){
    4629 /*globals _, wp, jQuery */
    4630 
    46314607/**
    46324608 * wp.media.view.Modal
     
    48424818
    48434819module.exports = Modal;
     4820
    48444821},{"./focus-manager.js":27,"./view.js":51}],38:[function(require,module,exports){
    4845 /*globals _, Backbone */
    4846 
    48474822/**
    48484823 * wp.media.view.PriorityList
     
    49434918
    49444919module.exports = PriorityList;
     4920
    49454921},{"./view.js":51}],39:[function(require,module,exports){
    49464922/**
     
    49694945
    49704946module.exports = RouterItem;
     4947
    49714948},{"./menu-item.js":35}],40:[function(require,module,exports){
    49724949/**
     
    50064983
    50074984module.exports = Router;
     4985
    50084986},{"./menu.js":36,"./router-item.js":39}],41:[function(require,module,exports){
    5009 /*globals wp */
    5010 
    50114987/**
    50124988 * wp.media.view.Search
     
    50565032
    50575033module.exports = Search;
     5034
    50585035},{"./view.js":51}],42:[function(require,module,exports){
    5059 /*globals _, Backbone, jQuery */
    5060 
    50615036/**
    50625037 * wp.media.view.Settings
     
    51665141        // update that as well.
    51675142        if ( userSetting = $setting.data('userSetting') ) {
    5168             setUserSetting( userSetting, value );
     5143            window.setUserSetting( userSetting, value );
    51695144        }
    51705145    },
     
    51785153
    51795154module.exports = Settings;
     5155
    51805156},{"./view.js":51}],43:[function(require,module,exports){
    5181 /*globals _, wp */
    5182 
    51835157/**
    51845158 * wp.media.view.Settings.AttachmentDisplay
     
    52735247
    52745248module.exports = AttachmentDisplay;
     5249
    52755250},{"../settings.js":42}],44:[function(require,module,exports){
    52765251/**
     
    52915266
    52925267module.exports = Sidebar;
     5268
    52935269},{"./priority-list.js":38}],45:[function(require,module,exports){
    5294 /*globals _, wp */
    5295 
    52965270/**
    52975271 * wp.media.view.Spinner
     
    53305304
    53315305module.exports = Spinner;
     5306
    53325307},{"./view.js":51}],46:[function(require,module,exports){
    5333 /*globals Backbone, _ */
    5334 
    53355308/**
    53365309 * wp.media.view.Toolbar
     
    54935466
    54945467module.exports = Toolbar;
     5468
    54955469},{"./button.js":21,"./priority-list.js":38,"./view.js":51}],47:[function(require,module,exports){
    5496 /*globals _, wp */
    5497 
    54985470/**
    54995471 * wp.media.view.UploaderInline
     
    56265598
    56275599module.exports = UploaderInline;
     5600
    56285601},{"../view.js":51,"./status.js":49}],48:[function(require,module,exports){
    5629 /*globals wp */
    5630 
    56315602/**
    56325603 * wp.media.view.UploaderStatusError
     
    56465617
    56475618module.exports = UploaderStatusError;
     5619
    56485620},{"../view.js":51}],49:[function(require,module,exports){
    5649 /*globals _, wp */
    5650 
    56515621/**
    56525622 * wp.media.view.UploaderStatus
     
    57865756
    57875757module.exports = UploaderStatus;
     5758
    57885759},{"../view.js":51,"./status-error.js":48}],50:[function(require,module,exports){
    5789 /*globals _, wp, jQuery */
    5790 
    57915760/**
    57925761 * wp.media.view.UploaderWindow
     
    58995868
    59005869module.exports = UploaderWindow;
     5870
    59015871},{"../view.js":51}],51:[function(require,module,exports){
    5902 /*globals wp */
    5903 
    59045872/**
    59055873 * wp.media.View
     
    59665934
    59675935module.exports = View;
     5936
    59685937},{}]},{},[7]);
  • trunk/src/wp-includes/js/media/grid.manifest.js

    r31373 r31385  
    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));
     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' );
  • trunk/src/wp-includes/js/media/models.js

    r31373 r31385  
    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     /**
    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 
    20         if ( ! MediaFrame ) {
    21             return;
    22         }
    23 
    24         attributes = _.defaults( attributes || {}, {
    25             frame: 'select'
    26         });
    27 
    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 
    44         delete attributes.frame;
    45 
    46         media.frame = frame;
    47 
    48         return frame;
    49     };
    50 
    51     _.extend( media, { model: {}, view: {}, controller: {}, frames: {} });
    52 
    53     // Link any localized strings.
    54     l10n = media.model.l10n = typeof _wpMediaModelsL10n === 'undefined' ? {} : _wpMediaModelsL10n;
    55 
    56     // Link any settings.
    57     media.model.settings = l10n.settings || {};
    58     delete l10n.settings;
    59 
    60     Attachments = media.model.Attachments = require( './models/attachments.js' );
    61     Attachment = media.model.Attachment = require( './models/attachment.js' );
    62 
    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      * ========================================================================
    69      * UTILITIES
    70      * ========================================================================
    71      */
    72 
    73     /**
    74      * A basic equality comparator for Backbone models.
    75      *
    76      * Used to order models within a collection - @see wp.media.model.Attachments.comparator().
    77      *
    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.
    85      */
    86     media.compare = function( a, b, ac, bc ) {
    87         if ( _.isEqual( a, b ) ) {
    88             return ac === bc ? 0 : (ac > bc ? -1 : 1);
     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;
     18
     19    if ( ! MediaFrame ) {
     20        return;
     21    }
     22
     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
     43    delete attributes.frame;
     44
     45    media.frame = frame;
     46
     47    return frame;
     48};
     49
     50_.extend( media, { model: {}, view: {}, controller: {}, frames: {} });
     51
     52// Link any localized strings.
     53l10n = media.model.l10n = window._wpMediaModelsL10n || {};
     54
     55// Link any settings.
     56media.model.settings = l10n.settings || {};
     57delete l10n.settings;
     58
     59Attachments = media.model.Attachments = require( './models/attachments.js' );
     60Attachment = media.model.Attachment = require( './models/attachment.js' );
     61
     62media.model.Query = require( './models/query.js' );
     63media.model.PostImage = require( './models/post-image.js' );
     64media.model.Selection = require( './models/selection.js' );
     65
     66/**
     67 * ========================================================================
     68 * UTILITIES
     69 * ========================================================================
     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};
     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            };
    89161        } 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         }
     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});
     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 } )
    188224    });
    189 
    190     /**
    191      * ========================================================================
    192      * MODELS
    193      * ========================================================================
    194      */
    195     /**
    196      * wp.media.attachment
    197      *
    198      * @static
    199      * @param {String} id A string used to identify a model.
    200      * @returns {wp.media.model.Attachment}
    201      */
    202     media.attachment = function( id ) {
    203         return Attachment.get( id );
    204     };
    205 
    206     /**
    207      * A collection of all attachments that have been fetched from the server.
    208      *
    209      * @static
    210      * @member {wp.media.model.Attachments}
    211      */
    212     Attachments.all = new Attachments();
    213 
    214     /**
    215      * wp.media.query
    216      *
    217      * Shorthand for creating a new Attachments Query.
    218      *
    219      * @param {object} [props]
    220      * @returns {wp.media.model.Attachments}
    221      */
    222     media.query = function( props ) {
    223         return new Attachments( null, {
    224             props: _.extend( _.defaults( props || {}, { orderby: 'date' } ), { query: true } )
    225         });
    226     };
    227 
    228     // Clean up. Prevents mobile browsers caching
    229     $(window).on('unload', function(){
    230         window.wp = null;
    231     });
    232 
    233 }(jQuery));
     225};
     226
     227// Clean up. Prevents mobile browsers caching
     228$(window).on('unload', function(){
     229    window.wp = null;
     230});
     231
    234232},{"./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 */
    236 
    237233/**
    238234 * wp.media.model.Attachment
     
    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,
     
    401397
    402398module.exports = Attachment;
     399
    403400},{"./attachments.js":3}],3:[function(require,module,exports){
    404 /*globals jQuery, Backbone, _, wp */
    405 
    406401/**
    407402 * wp.media.model.Attachments
     
    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
     
    937933
    938934module.exports = Attachments;
     935
    939936},{"./attachment.js":2,"./query.js":5}],4:[function(require,module,exports){
    940 /*globals jQuery, Backbone */
    941 
    942937/**
    943938 * wp.media.model.PostImage
     
    10941089
    10951090module.exports = PostImage;
     1091
    10961092},{"./attachment":2}],5:[function(require,module,exports){
    1097 /*globals jQuery, _, wp */
    1098 
    10991093/**
    11001094 * wp.media.model.Query
     
    14031397
    14041398module.exports = Query;
     1399
    14051400},{"./attachments.js":3}],6:[function(require,module,exports){
    1406 /*globals _ */
    1407 
    14081401/**
    14091402 * wp.media.model.Selection
     
    15011494
    15021495module.exports = Selection;
     1496
    15031497},{"./attachments.js":3}]},{},[1]);
  • trunk/src/wp-includes/js/media/models.manifest.js

    r31373 r31385  
    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     /**
    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;
    18 
    19         if ( ! MediaFrame ) {
    20             return;
     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    }
     21
     22    attributes = _.defaults( attributes || {}, {
     23        frame: 'select'
     24    });
     25
     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    }
     41
     42    delete attributes.frame;
     43
     44    media.frame = frame;
     45
     46    return frame;
     47};
     48
     49_.extend( media, { model: {}, view: {}, controller: {}, frames: {} });
     50
     51// Link any localized strings.
     52l10n = media.model.l10n = window._wpMediaModelsL10n || {};
     53
     54// Link any settings.
     55media.model.settings = l10n.settings || {};
     56delete l10n.settings;
     57
     58Attachments = media.model.Attachments = require( './models/attachments.js' );
     59Attachment = media.model.Attachment = require( './models/attachment.js' );
     60
     61media.model.Query = require( './models/query.js' );
     62media.model.PostImage = require( './models/post-image.js' );
     63media.model.Selection = require( './models/selection.js' );
     64
     65/**
     66 * ========================================================================
     67 * UTILITIES
     68 * ========================================================================
     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};
     91
     92_.extend( media, {
     93    /**
     94     * media.template( id )
     95     *
     96     * Fetch a JavaScript template for an id, and return a templating function for it.
     97     *
     98     * See wp.template() in `wp-includes/js/wp-util.js`.
     99     *
     100     * @borrows wp.template as template
     101     */
     102    template: wp.template,
     103
     104    /**
     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
     111     */
     112    post: wp.ajax.post,
     113
     114    /**
     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`.
     119     *
     120     * @borrows wp.ajax.send as ajax
     121     */
     122    ajax: wp.ajax.send,
     123
     124    /**
     125     * Scales a set of dimensions to fit within bounding dimensions.
     126     *
     127     * @param {Object} dimensions
     128     * @returns {Object}
     129     */
     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';
    21146        }
    22147
    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 );
     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            };
    41165        }
    42 
    43         delete attributes.frame;
    44 
    45         media.frame = frame;
    46 
    47         return frame;
    48     };
    49 
    50     _.extend( media, { model: {}, view: {}, controller: {}, frames: {} });
    51 
    52     // Link any localized strings.
    53     l10n = media.model.l10n = typeof _wpMediaModelsL10n === 'undefined' ? {} : _wpMediaModelsL10n;
    54 
    55     // Link any settings.
    56     media.model.settings = l10n.settings || {};
    57     delete l10n.settings;
    58 
    59     Attachments = media.model.Attachments = require( './models/attachments.js' );
    60     Attachment = media.model.Attachment = require( './models/attachment.js' );
    61 
    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      * ========================================================================
    68      * UTILITIES
    69      * ========================================================================
    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      */
    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;
     166    },
     167    /**
     168     * Truncates a string by injecting an ellipsis into the middle.
     169     * Useful for filenames.
     170     *
     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;
    90182        }
    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         }
     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 } )
    187223    });
    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      */
    201     media.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      */
    211     Attachments.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      */
    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;
    230     });
    231 
    232 }(jQuery));
     224};
     225
     226// Clean up. Prevents mobile browsers caching
     227$(window).on('unload', function(){
     228    window.wp = null;
     229});
  • trunk/src/wp-includes/js/media/models/attachment.js

    r31373 r31385  
    1 /*globals jQuery, Backbone, _, wp */
    2 
    31/**
    42 * wp.media.model.Attachment
     
    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,
  • trunk/src/wp-includes/js/media/models/attachments.js

    r31373 r31385  
    1 /*globals jQuery, Backbone, _, wp */
    2 
    31/**
    42 * wp.media.model.Attachments
     
    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
  • trunk/src/wp-includes/js/media/models/post-image.js

    r31373 r31385  
    1 /*globals jQuery, Backbone */
    2 
    31/**
    42 * wp.media.model.PostImage
  • trunk/src/wp-includes/js/media/models/post-media.js

    r31380 r31385  
    1 /*globals Backbone, _, wp */
    2 
    31/**
    42 * Shared model class for audio and video. Updates the model after
  • trunk/src/wp-includes/js/media/models/query.js

    r31373 r31385  
    1 /*globals jQuery, _, wp */
    2 
    31/**
    42 * wp.media.model.Query
  • trunk/src/wp-includes/js/media/models/selection.js

    r31373 r31385  
    1 /*globals _ */
    2 
    31/**
    42 * wp.media.model.Selection
  • trunk/src/wp-includes/js/media/routers/manage.js

    r31373 r31385  
    1 /*globals jQuery, Backbone */
    2 
    31/**
    42 * A router for handling the browser history and application state.
  • trunk/src/wp-includes/js/media/utils/selection-sync.js

    r31373 r31385  
    1 /*globals _ */
    2 
    31/**
    42 * wp.media.selectionSync
  • trunk/src/wp-includes/js/media/views.js

    r31380 r31385  
    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
     
    10199
    102100module.exports = CollectionAdd;
     101
    103102},{"./library.js":10}],2:[function(require,module,exports){
    104 /*globals wp, jQuery, Backbone */
    105 
    106103/**
    107104 * wp.media.controller.CollectionEdit
     
    264261
    265262module.exports = CollectionEdit;
     263
    266264},{"../views/attachment/edit-library.js":25,"../views/view.js":71,"./library.js":10}],3:[function(require,module,exports){
    267 /*globals _, wp, Backbone */
    268 
    269265/**
    270266 * wp.media.controller.Cropper
     
    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 );
     
    384380
    385381module.exports = Cropper;
     382
    386383},{"../views/cropper.js":34,"../views/toolbar.js":63,"./state.js":15}],4:[function(require,module,exports){
    387 /*globals _, wp */
    388 
    389384/**
    390385 * wp.media.controller.EditImage
     
    463458
    464459module.exports = EditImage;
     460
    465461},{"../views/toolbar.js":63,"./state.js":15}],5:[function(require,module,exports){
    466 /*globals _, wp, jQuery, Backbone */
    467 
    468462/**
    469463 * wp.media.controller.Embed
     
    601595
    602596module.exports = Embed;
     597
    603598},{"./state.js":15}],6:[function(require,module,exports){
    604 /*globals _, wp */
    605 
    606599/**
    607600 * wp.media.controller.FeaturedImage
     
    724717
    725718module.exports = FeaturedImage;
     719
    726720},{"./library.js":10}],7:[function(require,module,exports){
    727 /*globals _, wp */
    728 
    729721/**
    730722 * A state for selecting more images to add to a gallery.
     
    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 );
     
    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
     
    812806
    813807module.exports = GalleryAdd;
     808
    814809},{"./library.js":10}],8:[function(require,module,exports){
    815 /*globals wp, Backbone */
    816 
    817810/**
    818811 * wp.media.controller.GalleryEdit
     
    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    },
     
    952948
    953949module.exports = GalleryEdit;
     950
    954951},{"../views/attachment/edit-library.js":25,"../views/settings/gallery.js":59,"./library.js":10}],9:[function(require,module,exports){
    955 /*globals _, wp */
    956 
    957952/**
    958953 * wp.media.controller.ImageDetails
     
    10151010
    10161011module.exports = ImageDetails;
     1012
    10171013},{"./library.js":10,"./state.js":15}],10:[function(require,module,exports){
    1018 /*globals _, wp, Backbone, getUserSetting, setUserSetting */
    1019 
    10201014/**
    10211015 * wp.media.controller.Library
     
    10551049    State = require( './state.js' ),
    10561050    l10n = wp.media.view.l10n,
     1051    getUserSetting = window.getUserSetting,
     1052    setUserSetting = window.setUserSetting,
    10571053    Library;
    10581054
     
    10891085        }
    10901086
    1091         if ( ! (selection instanceof Selection) ) {
     1087        if ( ! ( selection instanceof wp.media.model.Selection ) ) {
    10921088            props = selection;
    10931089
     
    12881284
    12891285module.exports = Library;
     1286
    12901287},{"../utils/selection-sync.js":16,"./state.js":15}],11:[function(require,module,exports){
    1291 /*globals _, wp */
    1292 
    12931288/**
    12941289 * wp.media.controller.MediaLibrary
     
    13391334
    13401335module.exports = MediaLibrary;
     1336
    13411337},{"./library.js":10}],12:[function(require,module,exports){
    1342 /*globals _, Backbone */
    1343 
    13441338/**
    13451339 * wp.media.controller.Region
     
    15191513
    15201514module.exports = Region;
     1515
    15211516},{}],13:[function(require,module,exports){
    1522 /*globals _, wp */
    1523 
    15241517/**
    15251518 * wp.media.controller.ReplaceImage
     
    16281621
    16291622module.exports = ReplaceImage;
     1623
    16301624},{"./library.js":10}],14:[function(require,module,exports){
    1631 /*globals _, Backbone */
    1632 
    16331625/**
    16341626 * wp.media.controller.StateMachine
     
    17531745
    17541746module.exports = StateMachine;
     1747
    17551748},{}],15:[function(require,module,exports){
    1756 /*globals _, Backbone */
    1757 
    17581749/**
    17591750 * wp.media.controller.State
     
    19951986
    19961987module.exports = State;
     1988
    19971989},{}],16:[function(require,module,exports){
    1998 /*globals _ */
    1999 
    20001990/**
    20011991 * wp.media.selectionSync
     
    20622052
    20632053module.exports = selectionSync;
     2054
    20642055},{}],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;
    2091 
    2092         transition = _.find( _.keys( transitions ), function( transition ) {
    2093             return ! _.isUndefined( style[ transition ] );
    2094         });
    2095 
    2096         return transition && {
    2097             end: transitions[ transition ]
    2098         };
    2099     }());
    2100 
    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 );
    2107 
    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();
    2117 
    2118         sensitivity = sensitivity || 2000;
    2119 
    2120         if ( $.support.transition ) {
    2121             if ( ! (selector instanceof $) ) {
    2122                 selector = $( selector );
    2123             }
    2124 
    2125             // Resolve the deferred when the first element finishes animating.
    2126             selector.first().one( $.support.transition.end, deferred.resolve );
    2127 
    2128             // Just in case the event doesn't trigger, fire a callback.
    2129             _.delay( deferred.resolve, sensitivity );
    2130 
    2131         // Otherwise, execute on the spot.
    2132         } else {
    2133             deferred.resolve();
    2134         }
    2135 
    2136         return deferred.promise();
     2056var media = wp.media,
     2057    $ = jQuery,
     2058    l10n;
     2059
     2060media.isTouchDevice = ( 'ontouchend' in document );
     2061
     2062// Link any localized strings.
     2063l10n = media.view.l10n = window._wpMediaViewsL10n || {};
     2064
     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    });
     2085
     2086    return transition && {
     2087        end: transitions[ transition ]
    21372088    };
    2138 
    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' );
    2211 
    2212 }(jQuery, _));
     2089}());
     2090
     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 );
     2097
     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();
     2107
     2108    sensitivity = sensitivity || 2000;
     2109
     2110    if ( $.support.transition ) {
     2111        if ( ! (selector instanceof $) ) {
     2112            selector = $( selector );
     2113        }
     2114
     2115        // Resolve the deferred when the first element finishes animating.
     2116        selector.first().one( $.support.transition.end, deferred.resolve );
     2117
     2118        // Just in case the event doesn't trigger, fire a callback.
     2119        _.delay( deferred.resolve, sensitivity );
     2120
     2121    // Otherwise, execute on the spot.
     2122    } else {
     2123        deferred.resolve();
     2124    }
     2125
     2126    return deferred.promise();
     2127};
     2128
     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
    22132202},{"./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 _ */
    2215 
    22162203/**
    22172204 * wp.media.view.AttachmentCompat
     
    22972284
    22982285module.exports = AttachmentCompat;
     2286
    22992287},{"./view.js":71}],19:[function(require,module,exports){
    2300 /*globals _, jQuery */
    2301 
    23022288/**
    23032289 * wp.media.view.AttachmentFilters
     
    23762362
    23772363module.exports = AttachmentFilters;
     2364
    23782365},{"./view.js":71}],20:[function(require,module,exports){
    2379 /*globals _, wp */
    2380 
    23812366/**
    23822367 * wp.media.view.AttachmentFilters.All
     
    24682453
    24692454module.exports = All;
     2455
    24702456},{"../attachment-filters.js":19}],21:[function(require,module,exports){
    2471 /*globals _, wp */
    2472 
    24732457/**
    24742458 * A filter dropdown for month/dates.
     
    25112495
    25122496module.exports = DateFilter;
     2497
    25132498},{"../attachment-filters.js":19}],22:[function(require,module,exports){
    2514 /*globals wp */
    2515 
    25162499/**
    25172500 * wp.media.view.AttachmentFilters.Uploaded
     
    25722555
    25732556module.exports = Uploaded;
     2557
    25742558},{"../attachment-filters.js":19}],23:[function(require,module,exports){
    2575 /*globals _, wp, jQuery */
    2576 
    25772559/**
    25782560 * wp.media.view.Attachment
     
    31273109
    31283110module.exports = Attachment;
     3111
    31293112},{"./view.js":71}],24:[function(require,module,exports){
    3130 /*globals _, wp */
    3131 
    31323113/**
    31333114 * wp.media.view.Attachment.Details
     
    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
     
    32683249
    32693250module.exports = Details;
     3251
    32703252},{"../attachment.js":23}],25:[function(require,module,exports){
    32713253/**
     
    32883270
    32893271module.exports = EditLibrary;
     3272
    32903273},{"../attachment.js":23}],26:[function(require,module,exports){
    32913274/**
     
    33093292
    33103293module.exports = EditSelection;
     3294
    33113295},{"./selection.js":28}],27:[function(require,module,exports){
    33123296/**
     
    33293313
    33303314module.exports = Library;
     3315
    33313316},{"../attachment.js":23}],28:[function(require,module,exports){
    33323317/**
     
    33533338
    33543339module.exports = Selection;
     3340
    33553341},{"../attachment.js":23}],29:[function(require,module,exports){
    3356 /*globals _, wp, jQuery */
    3357 
    33583342/**
    33593343 * wp.media.view.Attachments
     
    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();
     
    36543638
    36553639module.exports = Attachments;
     3640
    36563641},{"./attachment.js":23,"./view.js":71}],30:[function(require,module,exports){
    3657 /*globals _, wp, jQuery */
    3658 
    36593642/**
    36603643 * wp.media.view.AttachmentsBrowser
     
    38473830                    }
    38483831
    3849                     if ( ! mediaTrash && ! confirm( l10n.warnBulkDelete ) ) {
     3832                    if ( ! mediaTrash && ! window.confirm( l10n.warnBulkDelete ) ) {
    38503833                        return;
    38513834                    }
     
    38533836                    if ( mediaTrash &&
    38543837                        'trash' !== selection.at( 0 ).get( 'status' ) &&
    3855                         ! confirm( l10n.warnBulkTrash ) ) {
     3838                        ! window.confirm( l10n.warnBulkTrash ) ) {
    38563839
    38573840                        return;
     
    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                        }
     
    41144097
    41154098module.exports = AttachmentsBrowser;
     4099
    41164100},{"../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 _ */
    4118 
    41194101/**
    41204102 * wp.media.view.Attachments.Selection
     
    41464128
    41474129module.exports = Selection;
     4130
    41484131},{"../attachment/selection.js":28,"../attachments.js":29}],32:[function(require,module,exports){
    4149 /*globals _, Backbone, jQuery */
    4150 
    41514132/**
    41524133 * wp.media.view.ButtonGroup
     
    41954176
    41964177module.exports = ButtonGroup;
     4178
    41974179},{"./button.js":33,"./view.js":71}],33:[function(require,module,exports){
    4198 /*globals _, Backbone */
    4199 
    42004180/**
    42014181 * wp.media.view.Button
     
    42854265
    42864266module.exports = Button;
     4267
    42874268},{"./view.js":71}],34:[function(require,module,exports){
    4288 /*globals _, wp, jQuery */
    4289 
    42904269/**
    42914270 * wp.media.view.Cropper
     
    43484327        this.views.add( '.upload-errors', new UploaderStatusError({
    43494328            filename: UploaderStatus.prototype.filename(filename),
    4350             message: _wpMediaViewsL10n.cropError
     4329            message: window._wpMediaViewsL10n.cropError
    43514330        }), { at: 0 });
    43524331    }
     
    43544333
    43554334module.exports = Cropper;
     4335
    43564336},{"./uploader/status-error.js":68,"./uploader/status.js":69,"./view.js":71}],35:[function(require,module,exports){
    4357 /*globals _, wp */
    4358 
    43594337var View = require( './view.js' ),
    43604338    EditImage;
     
    44084386
    44094387module.exports = EditImage;
     4388
    44104389},{"./view.js":71}],36:[function(require,module,exports){
    44114390/**
     
    44774456
    44784457module.exports = Embed;
     4458
    44794459},{"./embed/image.js":37,"./embed/link.js":38,"./embed/url.js":39,"./view.js":71}],37:[function(require,module,exports){
    4480 /*globals wp */
    4481 
    44824460/**
    44834461 * wp.media.view.EmbedImage
     
    45114489
    45124490module.exports = EmbedImage;
     4491
    45134492},{"../settings/attachment-display.js":58}],38:[function(require,module,exports){
    4514 /*globals _, wp, jQuery */
    4515 
    45164493/**
    45174494 * wp.media.view.EmbedLink
     
    45794556
    45804557module.exports = EmbedLink;
     4558
    45814559},{"../settings.js":57}],39:[function(require,module,exports){
    4582 /*globals _, wp, jQuery */
    4583 
    45844560/**
    45854561 * wp.media.view.EmbedUrl
     
    46594635
    46604636module.exports = EmbedUrl;
     4637
    46614638},{"../view.js":71}],40:[function(require,module,exports){
    46624639/**
     
    47074684
    47084685module.exports = FocusManager;
     4686
    47094687},{"./view.js":71}],41:[function(require,module,exports){
    4710 /*globals _, Backbone */
    4711 
    47124688/**
    47134689 * wp.media.view.Frame
     
    48804856
    48814857module.exports = Frame;
     4858
    48824859},{"../controllers/region.js":12,"../controllers/state-machine.js":14,"../controllers/state.js":15,"./view.js":71}],42:[function(require,module,exports){
    4883 /*globals wp */
    4884 
    48854860/**
    48864861 * wp.media.view.MediaFrame.ImageDetails
     
    50645039
    50655040module.exports = ImageDetails;
     5041
    50665042},{"../../controllers/edit-image.js":4,"../../controllers/image-details.js":9,"../../controllers/replace-image.js":13,"../edit-image.js":35,"../image-details.js":46,"../toolbar.js":63,"./select.js":44}],43:[function(require,module,exports){
    5067 /*globals _, wp */
    5068 
    50695043/**
    50705044 * wp.media.view.MediaFrame.Post
     
    58165790
    58175791module.exports = Post;
     5792
    58185793},{"../../controllers/collection-add.js":1,"../../controllers/collection-edit.js":2,"../../controllers/edit-image.js":4,"../../controllers/embed.js":5,"../../controllers/featured-image.js":6,"../../controllers/gallery-add.js":7,"../../controllers/gallery-edit.js":8,"../../controllers/library.js":10,"../attachment/edit-selection.js":26,"../attachments/browser.js":30,"../edit-image.js":35,"../embed.js":36,"../selection.js":56,"../settings/playlist.js":60,"../toolbar.js":63,"../toolbar/embed.js":64,"../view.js":71,"./select.js":44}],44:[function(require,module,exports){
    5819 /*globals _, wp */
    5820 
    58215794/**
    58225795 * wp.media.view.MediaFrame.Select
     
    59915964
    59925965module.exports = Select;
     5966
    59935967},{"../../controllers/library.js":10,"../attachments/browser.js":30,"../media-frame.js":48,"../toolbar/select.js":65,"../uploader/inline.js":67}],45:[function(require,module,exports){
    59945968/**
     
    60175991
    60185992module.exports = Iframe;
     5993
    60195994},{"./view.js":71}],46:[function(require,module,exports){
    6020 /*globals _, wp, jQuery */
    6021 
    60225995/**
    60235996 * wp.media.view.ImageDetails
     
    60936066        setTimeout( _.bind( this.resetFocus, this ), 10 );
    60946067        this.toggleLinkSettings();
    6095         if ( getUserSetting( 'advImgDetails' ) === 'show' ) {
     6068        if ( window.getUserSetting( 'advImgDetails' ) === 'show' ) {
    60966069            this.toggleAdvanced( true );
    60976070        }
     
    61666139        }
    61676140
    6168         setUserSetting( 'advImgDetails', mode );
     6141        window.setUserSetting( 'advImgDetails', mode );
    61696142    },
    61706143
     
    61866159
    61876160module.exports = AttachmentDisplay;
     6161
    61886162},{"./settings/attachment-display.js":58}],47:[function(require,module,exports){
    61896163/**
     
    62126186
    62136187module.exports = Label;
     6188
    62146189},{"./view.js":71}],48:[function(require,module,exports){
    6215 /*globals _, wp, jQuery */
    6216 
    62176190/**
    62186191 * wp.media.view.MediaFrame
     
    64676440
    64686441module.exports = MediaFrame;
     6442
    64696443},{"./frame.js":41,"./iframe.js":45,"./menu.js":50,"./modal.js":51,"./router.js":54,"./toolbar.js":63,"./uploader/window.js":70,"./view.js":71}],49:[function(require,module,exports){
    6470 /*globals wp, jQuery */
    6471 
    64726444/**
    64736445 * wp.media.view.MenuItem
     
    65416513
    65426514module.exports = MenuItem;
     6515
    65436516},{"./view.js":71}],50:[function(require,module,exports){
    65446517/**
     
    66576630
    66586631module.exports = Menu;
     6632
    66596633},{"./menu-item.js":49,"./priority-list.js":52}],51:[function(require,module,exports){
    6660 /*globals _, wp, jQuery */
    6661 
    66626634/**
    66636635 * wp.media.view.Modal
     
    68736845
    68746846module.exports = Modal;
     6847
    68756848},{"./focus-manager.js":40,"./view.js":71}],52:[function(require,module,exports){
    6876 /*globals _, Backbone */
    6877 
    68786849/**
    68796850 * wp.media.view.PriorityList
     
    69746945
    69756946module.exports = PriorityList;
     6947
    69766948},{"./view.js":71}],53:[function(require,module,exports){
    69776949/**
     
    70006972
    70016973module.exports = RouterItem;
     6974
    70026975},{"./menu-item.js":49}],54:[function(require,module,exports){
    70036976/**
     
    70377010
    70387011module.exports = Router;
     7012
    70397013},{"./menu.js":50,"./router-item.js":53}],55:[function(require,module,exports){
    7040 /*globals wp */
    7041 
    70427014/**
    70437015 * wp.media.view.Search
     
    70877059
    70887060module.exports = Search;
     7061
    70897062},{"./view.js":71}],56:[function(require,module,exports){
    7090 /*globals _, Backbone, wp */
    7091 
    70927063/**
    70937064 * wp.media.view.Selection
     
    71737144
    71747145module.exports = Selection;
     7146
    71757147},{"./attachments/selection.js":31,"./view.js":71}],57:[function(require,module,exports){
    7176 /*globals _, Backbone, jQuery */
    7177 
    71787148/**
    71797149 * wp.media.view.Settings
     
    72837253        // update that as well.
    72847254        if ( userSetting = $setting.data('userSetting') ) {
    7285             setUserSetting( userSetting, value );
     7255            window.setUserSetting( userSetting, value );
    72867256        }
    72877257    },
     
    72957265
    72967266module.exports = Settings;
     7267
    72977268},{"./view.js":71}],58:[function(require,module,exports){
    7298 /*globals _, wp */
    7299 
    73007269/**
    73017270 * wp.media.view.Settings.AttachmentDisplay
     
    73907359
    73917360module.exports = AttachmentDisplay;
     7361
    73927362},{"../settings.js":57}],59:[function(require,module,exports){
    7393 /*globals wp */
    7394 
    73957363/**
    73967364 * wp.media.view.Settings.Gallery
     
    74117379
    74127380module.exports = Gallery;
     7381
    74137382},{"../settings.js":57}],60:[function(require,module,exports){
    7414 /*globals wp */
    7415 
    74167383/**
    74177384 * wp.media.view.Settings.Playlist
     
    74327399
    74337400module.exports = Playlist;
     7401
    74347402},{"../settings.js":57}],61:[function(require,module,exports){
    74357403/**
     
    74507418
    74517419module.exports = Sidebar;
     7420
    74527421},{"./priority-list.js":52}],62:[function(require,module,exports){
    7453 /*globals _, wp */
    7454 
    74557422/**
    74567423 * wp.media.view.Spinner
     
    74897456
    74907457module.exports = Spinner;
     7458
    74917459},{"./view.js":71}],63:[function(require,module,exports){
    7492 /*globals Backbone, _ */
    7493 
    74947460/**
    74957461 * wp.media.view.Toolbar
     
    76527618
    76537619module.exports = Toolbar;
     7620
    76547621},{"./button.js":33,"./priority-list.js":52,"./view.js":71}],64:[function(require,module,exports){
    7655 /*globals _, wp */
    7656 
    76577622/**
    76587623 * wp.media.view.Toolbar.Embed
     
    76907655
    76917656module.exports = Embed;
     7657
    76927658},{"./select.js":65}],65:[function(require,module,exports){
    7693 /*globals _, wp */
    7694 
    76957659/**
    76967660 * wp.media.view.Toolbar.Select
     
    77617725
    77627726module.exports = Select;
     7727
    77637728},{"../toolbar.js":63}],66:[function(require,module,exports){
    7764 /*globals _, wp, jQuery */
    7765 
    77667729/**
    77677730 * Creates a dropzone on WP editor instances (elements with .wp-editor-wrap
     
    79817944
    79827945module.exports = EditorUploader;
     7946
    79837947},{"../view.js":71}],67:[function(require,module,exports){
    7984 /*globals _, wp */
    7985 
    79867948/**
    79877949 * wp.media.view.UploaderInline
     
    81148076
    81158077module.exports = UploaderInline;
     8078
    81168079},{"../view.js":71,"./status.js":69}],68:[function(require,module,exports){
    8117 /*globals wp */
    8118 
    81198080/**
    81208081 * wp.media.view.UploaderStatusError
     
    81348095
    81358096module.exports = UploaderStatusError;
     8097
    81368098},{"../view.js":71}],69:[function(require,module,exports){
    8137 /*globals _, wp */
    8138 
    81398099/**
    81408100 * wp.media.view.UploaderStatus
     
    82748234
    82758235module.exports = UploaderStatus;
     8236
    82768237},{"../view.js":71,"./status-error.js":68}],70:[function(require,module,exports){
    8277 /*globals _, wp, jQuery */
    8278 
    82798238/**
    82808239 * wp.media.view.UploaderWindow
     
    83878346
    83888347module.exports = UploaderWindow;
     8348
    83898349},{"../view.js":71}],71:[function(require,module,exports){
    8390 /*globals wp */
    8391 
    83928350/**
    83938351 * wp.media.View
     
    84548412
    84558413module.exports = View;
     8414
    84568415},{}]},{},[17]);
  • trunk/src/wp-includes/js/media/views.manifest.js

    r31373 r31385  
    1 /* global _wpMediaViewsL10n, confirm, getUserSetting, setUserSetting */
    2 ( function( $, _ ) {
    3     var l10n,
    4         media = wp.media;
     1var media = wp.media,
     2    $ = jQuery,
     3    l10n;
    54
    6     media.isTouchDevice = ( 'ontouchend' in document );
     5media.isTouchDevice = ( 'ontouchend' in document );
    76
    8     // Link any localized strings.
    9     l10n = media.view.l10n = typeof _wpMediaViewsL10n === 'undefined' ? {} : _wpMediaViewsL10n;
     7// Link any localized strings.
     8l10n = media.view.l10n = window._wpMediaViewsL10n || {};
    109
    11     // Link any settings.
    12     media.view.settings = l10n.settings || {};
    13     delete l10n.settings;
     10// Link any settings.
     11media.view.settings = l10n.settings || {};
     12delete l10n.settings;
    1413
    15     // Copy the `post` setting over to the model settings.
    16     media.model.settings.post = media.view.settings.post;
     14// Copy the `post` setting over to the model settings.
     15media.model.settings.post = media.view.settings.post;
    1716
    18     // Check if the browser supports CSS 3.0 transitions
    19     $.support.transition = (function(){
    20         var style = document.documentElement.style,
    21             transitions = {
    22                 WebkitTransition: 'webkitTransitionEnd',
    23                 MozTransition:    'transitionend',
    24                 OTransition:      'oTransitionEnd otransitionend',
    25                 transition:       'transitionend'
    26             }, transition;
     17// Check if the browser supports CSS 3.0 transitions
     18$.support.transition = (function(){
     19    var style = document.documentElement.style,
     20        transitions = {
     21            WebkitTransition: 'webkitTransitionEnd',
     22            MozTransition:    'transitionend',
     23            OTransition:      'oTransitionEnd otransitionend',
     24            transition:       'transitionend'
     25        }, transition;
    2726
    28         transition = _.find( _.keys( transitions ), function( transition ) {
    29             return ! _.isUndefined( style[ transition ] );
    30         });
     27    transition = _.find( _.keys( transitions ), function( transition ) {
     28        return ! _.isUndefined( style[ transition ] );
     29    });
    3130
    32         return transition && {
    33             end: transitions[ transition ]
    34         };
    35     }());
     31    return transition && {
     32        end: transitions[ transition ]
     33    };
     34}());
    3635
    37     /**
    38     * A shared event bus used to provide events into
    39     * the media workflows that 3rd-party devs can use to hook
    40     * in.
    41     */
    42     media.events = _.extend( {}, Backbone.Events );
     36/**
     37 * A shared event bus used to provide events into
     38 * the media workflows that 3rd-party devs can use to hook
     39 * in.
     40 */
     41media.events = _.extend( {}, Backbone.Events );
    4342
    44     /**
    45     * Makes it easier to bind events using transitions.
    46     *
    47     * @param {string} selector
    48     * @param {Number} sensitivity
    49     * @returns {Promise}
    50     */
    51     media.transition = function( selector, sensitivity ) {
    52         var deferred = $.Deferred();
     43/**
     44 * Makes it easier to bind events using transitions.
     45 *
     46 * @param {string} selector
     47 * @param {Number} sensitivity
     48 * @returns {Promise}
     49 */
     50media.transition = function( selector, sensitivity ) {
     51    var deferred = $.Deferred();
    5352
    54         sensitivity = sensitivity || 2000;
     53    sensitivity = sensitivity || 2000;
    5554
    56         if ( $.support.transition ) {
    57             if ( ! (selector instanceof $) ) {
    58                 selector = $( selector );
    59             }
    60 
    61             // Resolve the deferred when the first element finishes animating.
    62             selector.first().one( $.support.transition.end, deferred.resolve );
    63 
    64             // Just in case the event doesn't trigger, fire a callback.
    65             _.delay( deferred.resolve, sensitivity );
    66 
    67         // Otherwise, execute on the spot.
    68         } else {
    69             deferred.resolve();
     55    if ( $.support.transition ) {
     56        if ( ! (selector instanceof $) ) {
     57            selector = $( selector );
    7058        }
    7159
    72         return deferred.promise();
    73     };
     60        // Resolve the deferred when the first element finishes animating.
     61        selector.first().one( $.support.transition.end, deferred.resolve );
    7462
    75     media.controller.Region = require( './controllers/region.js' );
    76     media.controller.StateMachine = require( './controllers/state-machine.js' );
    77     media.controller.State = require( './controllers/state.js' );
     63        // Just in case the event doesn't trigger, fire a callback.
     64        _.delay( deferred.resolve, sensitivity );
    7865
    79     media.selectionSync = require( './utils/selection-sync.js' );
    80     media.controller.Library = require( './controllers/library.js' );
    81     media.controller.ImageDetails = require( './controllers/image-details.js' );
    82     media.controller.GalleryEdit = require( './controllers/gallery-edit.js' );
    83     media.controller.GalleryAdd = require( './controllers/gallery-add.js' );
    84     media.controller.CollectionEdit = require( './controllers/collection-edit.js' );
    85     media.controller.CollectionAdd = require( './controllers/collection-add.js' );
    86     media.controller.FeaturedImage = require( './controllers/featured-image.js' );
    87     media.controller.ReplaceImage = require( './controllers/replace-image.js' );
    88     media.controller.EditImage = require( './controllers/edit-image.js' );
    89     media.controller.MediaLibrary = require( './controllers/media-library.js' );
    90     media.controller.Embed = require( './controllers/embed.js' );
    91     media.controller.Cropper = require( './controllers/cropper.js' );
     66    // Otherwise, execute on the spot.
     67    } else {
     68        deferred.resolve();
     69    }
    9270
    93     media.View = require( './views/view.js' );
    94     media.view.Frame = require( './views/view.js' );
    95     media.view.MediaFrame = require( './views/media-frame.js' );
    96     media.view.MediaFrame.Select = require( './views/frame/select.js' );
    97     media.view.MediaFrame.Post = require( './views/frame/post.js' );
    98     media.view.MediaFrame.ImageDetails = require( './views/frame/image-details.js' );
    99     media.view.Modal = require( './views/modal.js' );
    100     media.view.FocusManager = require( './views/focus-manager.js' );
    101     media.view.UploaderWindow = require( './views/uploader/window.js' );
    102     media.view.EditorUploader = require( './views/uploader/editor.js' );
    103     media.view.UploaderInline = require( './views/uploader/inline.js' );
    104     media.view.UploaderStatus = require( './views/uploader/status.js' );
    105     media.view.UploaderStatusError = require( './views/uploader/status-error.js' );
    106     media.view.Toolbar = require( './views/toolbar.js' );
    107     media.view.Toolbar.Select = require( './views/toolbar/select.js' );
    108     media.view.Toolbar.Embed = require( './views/toolbar/embed.js' );
    109     media.view.Button = require( './views/button.js' );
    110     media.view.ButtonGroup = require( './views/button-group.js' );
    111     media.view.PriorityList = require( './views/priority-list.js' );
    112     media.view.MenuItem = require( './views/menu-item.js' );
    113     media.view.Menu = require( './views/menu.js' );
    114     media.view.RouterItem = require( './views/router-item.js' );
    115     media.view.Router = require( './views/router.js' );
    116     media.view.Sidebar = require( './views/sidebar.js' );
    117     media.view.Attachment = require( './views/attachment.js' );
    118     media.view.Attachment.Library = require( './views/attachment/library.js' );
    119     media.view.Attachment.EditLibrary = require( './views/attachment/edit-library.js' );
    120     media.view.Attachments = require( './views/attachments.js' );
    121     media.view.Search = require( './views/search.js' );
    122     media.view.AttachmentFilters = require( './views/attachment-filters.js' );
    123     media.view.DateFilter = require( './views/attachment-filters/date.js' );
    124     media.view.AttachmentFilters.Uploaded = require( './views/attachment-filters/uploaded.js' );
    125     media.view.AttachmentFilters.All = require( './views/attachment-filters/all.js' );
    126     media.view.AttachmentsBrowser = require( './views/attachments/browser.js' );
    127     media.view.Selection = require( './views/selection.js' );
    128     media.view.Attachment.Selection = require( './views/attachment/selection.js' );
    129     media.view.Attachments.Selection = require( './views/attachments/selection.js' );
    130     media.view.Attachment.EditSelection = require( './views/attachment/edit-selection.js' );
    131     media.view.Settings = require( './views/settings.js' );
    132     media.view.Settings.AttachmentDisplay = require( './views/settings/attachment-display.js' );
    133     media.view.Settings.Gallery = require( './views/settings/gallery.js' );
    134     media.view.Settings.Playlist = require( './views/settings/playlist.js' );
    135     media.view.Attachment.Details = require( './views/attachment/details.js' );
    136     media.view.AttachmentCompat = require( './views/attachment-compat.js' );
    137     media.view.Iframe = require( './views/iframe.js' );
    138     media.view.Embed = require( './views/embed.js' );
    139     media.view.Label = require( './views/label.js' );
    140     media.view.EmbedUrl = require( './views/embed/url.js' );
    141     media.view.EmbedLink = require( './views/embed/link.js' );
    142     media.view.EmbedImage = require( './views/embed/image.js' );
    143     media.view.ImageDetails = require( './views/image-details.js' );
    144     media.view.Cropper = require( './views/cropper.js' );
    145     media.view.EditImage = require( './views/edit-image.js' );
    146     media.view.Spinner = require( './views/spinner.js' );
     71    return deferred.promise();
     72};
    14773
    148 }(jQuery, _));
     74media.controller.Region = require( './controllers/region.js' );
     75media.controller.StateMachine = require( './controllers/state-machine.js' );
     76media.controller.State = require( './controllers/state.js' );
     77
     78media.selectionSync = require( './utils/selection-sync.js' );
     79media.controller.Library = require( './controllers/library.js' );
     80media.controller.ImageDetails = require( './controllers/image-details.js' );
     81media.controller.GalleryEdit = require( './controllers/gallery-edit.js' );
     82media.controller.GalleryAdd = require( './controllers/gallery-add.js' );
     83media.controller.CollectionEdit = require( './controllers/collection-edit.js' );
     84media.controller.CollectionAdd = require( './controllers/collection-add.js' );
     85media.controller.FeaturedImage = require( './controllers/featured-image.js' );
     86media.controller.ReplaceImage = require( './controllers/replace-image.js' );
     87media.controller.EditImage = require( './controllers/edit-image.js' );
     88media.controller.MediaLibrary = require( './controllers/media-library.js' );
     89media.controller.Embed = require( './controllers/embed.js' );
     90media.controller.Cropper = require( './controllers/cropper.js' );
     91
     92media.View = require( './views/view.js' );
     93media.view.Frame = require( './views/view.js' );
     94media.view.MediaFrame = require( './views/media-frame.js' );
     95media.view.MediaFrame.Select = require( './views/frame/select.js' );
     96media.view.MediaFrame.Post = require( './views/frame/post.js' );
     97media.view.MediaFrame.ImageDetails = require( './views/frame/image-details.js' );
     98media.view.Modal = require( './views/modal.js' );
     99media.view.FocusManager = require( './views/focus-manager.js' );
     100media.view.UploaderWindow = require( './views/uploader/window.js' );
     101media.view.EditorUploader = require( './views/uploader/editor.js' );
     102media.view.UploaderInline = require( './views/uploader/inline.js' );
     103media.view.UploaderStatus = require( './views/uploader/status.js' );
     104media.view.UploaderStatusError = require( './views/uploader/status-error.js' );
     105media.view.Toolbar = require( './views/toolbar.js' );
     106media.view.Toolbar.Select = require( './views/toolbar/select.js' );
     107media.view.Toolbar.Embed = require( './views/toolbar/embed.js' );
     108media.view.Button = require( './views/button.js' );
     109media.view.ButtonGroup = require( './views/button-group.js' );
     110media.view.PriorityList = require( './views/priority-list.js' );
     111media.view.MenuItem = require( './views/menu-item.js' );
     112media.view.Menu = require( './views/menu.js' );
     113media.view.RouterItem = require( './views/router-item.js' );
     114media.view.Router = require( './views/router.js' );
     115media.view.Sidebar = require( './views/sidebar.js' );
     116media.view.Attachment = require( './views/attachment.js' );
     117media.view.Attachment.Library = require( './views/attachment/library.js' );
     118media.view.Attachment.EditLibrary = require( './views/attachment/edit-library.js' );
     119media.view.Attachments = require( './views/attachments.js' );
     120media.view.Search = require( './views/search.js' );
     121media.view.AttachmentFilters = require( './views/attachment-filters.js' );
     122media.view.DateFilter = require( './views/attachment-filters/date.js' );
     123media.view.AttachmentFilters.Uploaded = require( './views/attachment-filters/uploaded.js' );
     124media.view.AttachmentFilters.All = require( './views/attachment-filters/all.js' );
     125media.view.AttachmentsBrowser = require( './views/attachments/browser.js' );
     126media.view.Selection = require( './views/selection.js' );
     127media.view.Attachment.Selection = require( './views/attachment/selection.js' );
     128media.view.Attachments.Selection = require( './views/attachments/selection.js' );
     129media.view.Attachment.EditSelection = require( './views/attachment/edit-selection.js' );
     130media.view.Settings = require( './views/settings.js' );
     131media.view.Settings.AttachmentDisplay = require( './views/settings/attachment-display.js' );
     132media.view.Settings.Gallery = require( './views/settings/gallery.js' );
     133media.view.Settings.Playlist = require( './views/settings/playlist.js' );
     134media.view.Attachment.Details = require( './views/attachment/details.js' );
     135media.view.AttachmentCompat = require( './views/attachment-compat.js' );
     136media.view.Iframe = require( './views/iframe.js' );
     137media.view.Embed = require( './views/embed.js' );
     138media.view.Label = require( './views/label.js' );
     139media.view.EmbedUrl = require( './views/embed/url.js' );
     140media.view.EmbedLink = require( './views/embed/link.js' );
     141media.view.EmbedImage = require( './views/embed/image.js' );
     142media.view.ImageDetails = require( './views/image-details.js' );
     143media.view.Cropper = require( './views/cropper.js' );
     144media.view.EditImage = require( './views/edit-image.js' );
     145media.view.Spinner = require( './views/spinner.js' );
  • trunk/src/wp-includes/js/media/views/attachment-compat.js

    r31373 r31385  
    1 /*globals _ */
    2 
    31/**
    42 * wp.media.view.AttachmentCompat
  • trunk/src/wp-includes/js/media/views/attachment-filters.js

    r31373 r31385  
    1 /*globals _, jQuery */
    2 
    31/**
    42 * wp.media.view.AttachmentFilters
  • trunk/src/wp-includes/js/media/views/attachment-filters/all.js

    r31373 r31385  
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.view.AttachmentFilters.All
  • trunk/src/wp-includes/js/media/views/attachment-filters/date.js

    r31373 r31385  
    1 /*globals _, wp */
    2 
    31/**
    42 * A filter dropdown for month/dates.
  • trunk/src/wp-includes/js/media/views/attachment-filters/uploaded.js

    r31373 r31385  
    1 /*globals wp */
    2 
    31/**
    42 * wp.media.view.AttachmentFilters.Uploaded
  • trunk/src/wp-includes/js/media/views/attachment.js

    r31373 r31385  
    1 /*globals _, wp, jQuery */
    2 
    31/**
    42 * wp.media.view.Attachment
  • trunk/src/wp-includes/js/media/views/attachment/details-two-column.js

    r31373 r31385  
    1 /*globals wp */
    2 
    31/**
    42 * A similar view to media.view.Attachment.Details
     
    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    }
  • trunk/src/wp-includes/js/media/views/attachment/details.js

    r31373 r31385  
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.view.Attachment.Details
     
    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
  • trunk/src/wp-includes/js/media/views/attachments.js

    r31373 r31385  
    1 /*globals _, wp, jQuery */
    2 
    31/**
    42 * wp.media.view.Attachments
     
    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();
  • trunk/src/wp-includes/js/media/views/attachments/browser.js

    r31380 r31385  
    1 /*globals _, wp, jQuery */
    2 
    31/**
    42 * wp.media.view.AttachmentsBrowser
     
    191189                    }
    192190
    193                     if ( ! mediaTrash && ! confirm( l10n.warnBulkDelete ) ) {
     191                    if ( ! mediaTrash && ! window.confirm( l10n.warnBulkDelete ) ) {
    194192                        return;
    195193                    }
     
    197195                    if ( mediaTrash &&
    198196                        'trash' !== selection.at( 0 ).get( 'status' ) &&
    199                         ! confirm( l10n.warnBulkTrash ) ) {
     197                        ! window.confirm( l10n.warnBulkTrash ) ) {
    200198
    201199                        return;
     
    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                        }
  • trunk/src/wp-includes/js/media/views/attachments/selection.js

    r31373 r31385  
    1 /*globals _ */
    2 
    31/**
    42 * wp.media.view.Attachments.Selection
  • trunk/src/wp-includes/js/media/views/audio-details.js

    r31373 r31385  
    1 /*globals wp */
    2 
    31/**
    42 * wp.media.view.AudioDetails
  • trunk/src/wp-includes/js/media/views/button-group.js

    r31373 r31385  
    1 /*globals _, Backbone, jQuery */
    2 
    31/**
    42 * wp.media.view.ButtonGroup
  • trunk/src/wp-includes/js/media/views/button.js

    r31373 r31385  
    1 /*globals _, Backbone */
    2 
    31/**
    42 * wp.media.view.Button
  • trunk/src/wp-includes/js/media/views/button/delete-selected.js

    r31373 r31385  
    1 /*globals wp */
    2 
    31/**
    42 * A button that handles bulk Delete/Trash logic
  • trunk/src/wp-includes/js/media/views/button/select-mode-toggle.js

    r31373 r31385  
    1 /*globals wp */
    2 
    31var Button = require( '../button.js' ),
    42    l10n = wp.media.view.l10n,
  • trunk/src/wp-includes/js/media/views/cropper.js

    r31373 r31385  
    1 /*globals _, wp, jQuery */
    2 
    31/**
    42 * wp.media.view.Cropper
     
    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    }
  • trunk/src/wp-includes/js/media/views/edit-image.js

    r31380 r31385  
    1 /*globals _, wp */
    2 
    31var View = require( './view.js' ),
    42    EditImage;
  • trunk/src/wp-includes/js/media/views/embed/image.js

    r31373 r31385  
    1 /*globals wp */
    2 
    31/**
    42 * wp.media.view.EmbedImage
  • trunk/src/wp-includes/js/media/views/embed/link.js

    r31373 r31385  
    1 /*globals _, wp, jQuery */
    2 
    31/**
    42 * wp.media.view.EmbedLink
  • trunk/src/wp-includes/js/media/views/embed/url.js

    r31380 r31385  
    1 /*globals _, wp, jQuery */
    2 
    31/**
    42 * wp.media.view.EmbedUrl
  • trunk/src/wp-includes/js/media/views/frame.js

    r31373 r31385  
    1 /*globals _, Backbone */
    2 
    31/**
    42 * wp.media.view.Frame
  • trunk/src/wp-includes/js/media/views/frame/audio-details.js

    r31373 r31385  
    1 /*globals wp */
    2 
    31/**
    42 * wp.media.view.MediaFrame.AudioDetails
  • trunk/src/wp-includes/js/media/views/frame/edit-attachments.js

    r31380 r31385  
    1 /*globals _, wp, jQuery */
    2 
    31/**
    42 * A frame for editing the details of a specific media item.
  • trunk/src/wp-includes/js/media/views/frame/image-details.js

    r31379 r31385  
    1 /*globals wp */
    2 
    31/**
    42 * wp.media.view.MediaFrame.ImageDetails
  • trunk/src/wp-includes/js/media/views/frame/manage.js

    r31373 r31385  
    1 /*globals _, Backbone, wp, jQuery */
    2 
    31/**
    42 * wp.media.view.MediaFrame.Manage
     
    238236        if ( window.history && window.history.pushState ) {
    239237            Backbone.history.start( {
    240                 root: _wpMediaGridSettings.adminUrl,
     238                root: window._wpMediaGridSettings.adminUrl,
    241239                pushState: true
    242240            } );
  • trunk/src/wp-includes/js/media/views/frame/media-details.js

    r31379 r31385  
    1 /*globals wp */
    2 
    31/**
    42 * wp.media.view.MediaFrame.MediaDetails
  • trunk/src/wp-includes/js/media/views/frame/post.js

    r31379 r31385  
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.view.MediaFrame.Post
  • trunk/src/wp-includes/js/media/views/frame/select.js

    r31379 r31385  
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.view.MediaFrame.Select
  • trunk/src/wp-includes/js/media/views/frame/video-details.js

    r31373 r31385  
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.view.MediaFrame.VideoDetails
  • trunk/src/wp-includes/js/media/views/image-details.js

    r31380 r31385  
    1 /*globals _, wp, jQuery */
    2 
    31/**
    42 * wp.media.view.ImageDetails
     
    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        }
     
    147145        }
    148146
    149         setUserSetting( 'advImgDetails', mode );
     147        window.setUserSetting( 'advImgDetails', mode );
    150148    },
    151149
  • trunk/src/wp-includes/js/media/views/media-details.js

    r31380 r31385  
    1 /*globals _, wp, jQuery */
    2 
    31/**
    42 * wp.media.view.MediaDetails
     
    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    },
     
    112110    render: function() {
    113111        AttachmentDisplay.prototype.render.apply( this, arguments );
    114        
     112
    115113        setTimeout( _.bind( function() {
    116114            this.resetFocus();
  • trunk/src/wp-includes/js/media/views/media-frame.js

    r31373 r31385  
    1 /*globals _, wp, jQuery */
    2 
    31/**
    42 * wp.media.view.MediaFrame
  • trunk/src/wp-includes/js/media/views/menu-item.js

    r31373 r31385  
    1 /*globals wp, jQuery */
    2 
    31/**
    42 * wp.media.view.MenuItem
  • trunk/src/wp-includes/js/media/views/modal.js

    r31373 r31385  
    1 /*globals _, wp, jQuery */
    2 
    31/**
    42 * wp.media.view.Modal
  • trunk/src/wp-includes/js/media/views/priority-list.js

    r31373 r31385  
    1 /*globals _, Backbone */
    2 
    31/**
    42 * wp.media.view.PriorityList
  • trunk/src/wp-includes/js/media/views/search.js

    r31373 r31385  
    1 /*globals wp */
    2 
    31/**
    42 * wp.media.view.Search
  • trunk/src/wp-includes/js/media/views/selection.js

    r31373 r31385  
    1 /*globals _, Backbone, wp */
    2 
    31/**
    42 * wp.media.view.Selection
  • trunk/src/wp-includes/js/media/views/settings.js

    r31373 r31385  
    1 /*globals _, Backbone, jQuery */
    2 
    31/**
    42 * wp.media.view.Settings
     
    108106        // update that as well.
    109107        if ( userSetting = $setting.data('userSetting') ) {
    110             setUserSetting( userSetting, value );
     108            window.setUserSetting( userSetting, value );
    111109        }
    112110    },
  • trunk/src/wp-includes/js/media/views/settings/attachment-display.js

    r31373 r31385  
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.view.Settings.AttachmentDisplay
  • trunk/src/wp-includes/js/media/views/settings/gallery.js

    r31373 r31385  
    1 /*globals wp */
    2 
    31/**
    42 * wp.media.view.Settings.Gallery
  • trunk/src/wp-includes/js/media/views/settings/playlist.js

    r31373 r31385  
    1 /*globals wp */
    2 
    31/**
    42 * wp.media.view.Settings.Playlist
  • trunk/src/wp-includes/js/media/views/spinner.js

    r31373 r31385  
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.view.Spinner
  • trunk/src/wp-includes/js/media/views/toolbar.js

    r31373 r31385  
    1 /*globals Backbone, _ */
    2 
    31/**
    42 * wp.media.view.Toolbar
  • trunk/src/wp-includes/js/media/views/toolbar/embed.js

    r31373 r31385  
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.view.Toolbar.Embed
  • trunk/src/wp-includes/js/media/views/toolbar/select.js

    r31373 r31385  
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.view.Toolbar.Select
  • trunk/src/wp-includes/js/media/views/uploader/editor.js

    r31380 r31385  
    1 /*globals _, wp, jQuery */
    2 
    31/**
    42 * Creates a dropzone on WP editor instances (elements with .wp-editor-wrap
  • trunk/src/wp-includes/js/media/views/uploader/inline.js

    r31373 r31385  
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.view.UploaderInline
  • trunk/src/wp-includes/js/media/views/uploader/status-error.js

    r31373 r31385  
    1 /*globals wp */
    2 
    31/**
    42 * wp.media.view.UploaderStatusError
  • trunk/src/wp-includes/js/media/views/uploader/status.js

    r31373 r31385  
    1 /*globals _, wp */
    2 
    31/**
    42 * wp.media.view.UploaderStatus
  • trunk/src/wp-includes/js/media/views/uploader/window.js

    r31373 r31385  
    1 /*globals _, wp, jQuery */
    2 
    31/**
    42 * wp.media.view.UploaderWindow
  • trunk/src/wp-includes/js/media/views/video-details.js

    r31373 r31385  
    1 /*globals wp */
    2 
    31/**
    42 * wp.media.view.VideoDetails
  • trunk/src/wp-includes/js/media/views/view.js

    r31373 r31385  
    1 /*globals wp */
    2 
    31/**
    42 * wp.media.View
Note: See TracChangeset for help on using the changeset viewer.