Make WordPress Core

Changeset 26161


Ignore:
Timestamp:
11/14/2013 05:53:15 AM (12 years ago)
Author:
nacin
Message:

Fix JSHint errors in media-views.js.

props kadamwhite.
fixes #25974.

File:
1 edited

Legend:

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

    r24784 r26161  
     1/* global _wpMediaViewsL10n, confirm, getUserSetting, setUserSetting */
    12(function($){
    23    var media       = wp.media,
    34        Attachment  = media.model.Attachment,
    45        Attachments = media.model.Attachments,
    5         Query       = media.model.Query,
    66        l10n;
    77
     
    119119
    120120        trigger: function( event ) {
    121             var base;
     121            var base, args;
     122
    122123            if ( ! this._mode )
    123124                return;
    124125
    125             var args = _.toArray( arguments );
     126            args = _.toArray( arguments );
    126127            base = this.id + ':' + event;
    127128
     
    456457
    457458        defaultDisplaySettings: function( attachment ) {
    458             settings = this._defaultDisplaySettings;
     459            var settings = this._defaultDisplaySettings;
    459460            if ( settings.canEmbed = this.canEmbed( attachment ) )
    460461                settings.link = 'embed';
     
    496497        recordSelection: function() {
    497498            var selection = this.get('selection'),
    498                 manager = this.frame._selection,
    499                 filtered;
     499                manager = this.frame._selection;
    500500
    501501            if ( ! this.get('syncSelection') || ! manager || ! selection )
     
    10601060            // Generate the tab states.
    10611061            _.each( tabs, function( title, id ) {
    1062                 var frame = this.state( 'iframe:' + id ).set( _.defaults({
     1062                this.state( 'iframe:' + id ).set( _.defaults({
    10631063                    tab:     id,
    10641064                    src:     tabUrl + '&tab=' + id,
     
    11241124    // Map some of the modal's methods to the frame.
    11251125    _.each(['open','close','attach','detach','escape'], function( method ) {
    1126         media.view.MediaFrame.prototype[ method ] = function( view ) {
     1126        media.view.MediaFrame.prototype[ method ] = function() {
    11271127            if ( this.modal )
    11281128                this.modal[ method ].apply( this.modal, arguments );
     
    11511151
    11521152        createSelection: function() {
    1153             var controller = this,
    1154                 selection = this.options.selection;
     1153            var selection = this.options.selection;
    11551154
    11561155            if ( ! (selection instanceof media.model.Selection) ) {
     
    19321931        progress: function() {
    19331932            var queue = this.queue,
    1934                 $bar = this.$bar,
    1935                 memo = 0;
     1933                $bar = this.$bar;
    19361934
    19371935            if ( ! $bar || ! queue.length )
     
    21122110    media.view.Toolbar.Select = media.view.Toolbar.extend({
    21132111        initialize: function() {
    2114             var options = this.options,
    2115                 controller = options.controller,
    2116                 selection = controller.state().get('selection');
     2112            var options = this.options;
    21172113
    21182114            _.bindAll( this, 'clickSelect' );
     
    26192615                model = this.model,
    26202616                method = options && options.method,
    2621                 single, between, models, singleIndex, modelIndex;
     2617                single, models, singleIndex, modelIndex;
    26222618
    26232619            if ( ! selection )
     
    29002896            this._viewsByCid = {};
    29012897
    2902             this.collection.on( 'add', function( attachment, attachments, options ) {
     2898            this.collection.on( 'add', function( attachment ) {
    29032899                this.views.add( this.createAttachmentView( attachment ), {
    29042900                    at: this.collection.indexOf( attachment )
     
    29062902            }, this );
    29072903
    2908             this.collection.on( 'remove', function( attachment, attachments, options ) {
     2904            this.collection.on( 'remove', function( attachment ) {
    29092905                var view = this._viewsByCid[ attachment.cid ];
    29102906                delete this._viewsByCid[ attachment.cid ];
     
    30673063        },
    30683064
    3069         scroll: function( event ) {
     3065        scroll: function() {
    30703066            // @todo: is this still necessary?
    30713067            if ( ! this.$el.is(':visible') )
     
    31503146        },
    31513147
    3152         change: function( event ) {
     3148        change: function() {
    31533149            var filter = this.filters[ this.el.value ];
    31543150
     
    33973393        createSingle: function() {
    33983394            var sidebar = this.sidebar,
    3399                 single = this.options.selection.single(),
    3400                 views = {};
     3395                single = this.options.selection.single();
    34013396
    34023397            sidebar.set( 'details', new media.view.Attachment.Details({
     
    36313626        },
    36323627
    3633         updateChanges: function( model, options ) {
     3628        updateChanges: function( model ) {
    36343629            if ( model.hasChanged() )
    36353630                _( model.changed ).chain().keys().each( this.update, this );
     
    37573752        },
    37583753
    3759         editAttachment: function( event ) {
     3754        editAttachment: function() {
    37603755            this.$el.addClass('needs-refresh');
    37613756        },
Note: See TracChangeset for help on using the changeset viewer.