<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[26161] trunk/src/wp-includes/js/media-views.js: Fix JSHint errors in media-views.js.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/26161">26161</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2013-11-14 05:53:15 +0000 (Thu, 14 Nov 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>Fix JSHint errors in media-views.js.
props kadamwhite.
fixes <a href="http://core.trac.wordpress.org/ticket/25974">#25974</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesjsmediaviewsjs">trunk/src/wp-includes/js/media-views.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesjsmediaviewsjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/media-views.js (26160 => 26161)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/media-views.js 2013-11-14 05:50:40 UTC (rev 26160)
+++ trunk/src/wp-includes/js/media-views.js 2013-11-14 05:53:15 UTC (rev 26161)
</span><span class="lines">@@ -1,3 +1,4 @@
</span><ins>+/* global _wpMediaViewsL10n, confirm, getUserSetting, setUserSetting */
</ins><span class="cx"> (function($){
</span><span class="cx"> var media = wp.media,
</span><span class="cx"> Attachment = media.model.Attachment,
</span><span class="lines">@@ -2,3 +3,2 @@
</span><span class="cx"> Attachments = media.model.Attachments,
</span><del>- Query = media.model.Query,
</del><span class="cx"> l10n;
</span><span class="lines">@@ -118,11 +118,12 @@
</span><span class="cx"> },
</span><span class="cx">
</span><span class="cx"> trigger: function( event ) {
</span><del>- var base;
</del><ins>+ var base, args;
+
</ins><span class="cx"> if ( ! this._mode )
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- var args = _.toArray( arguments );
</del><ins>+ args = _.toArray( arguments );
</ins><span class="cx"> base = this.id + ':' + event;
</span><span class="cx">
</span><span class="cx"> // Trigger `region:action:mode` event.
</span><span class="lines">@@ -455,7 +456,7 @@
</span><span class="cx"> },
</span><span class="cx">
</span><span class="cx"> defaultDisplaySettings: function( attachment ) {
</span><del>- settings = this._defaultDisplaySettings;
</del><ins>+ var settings = this._defaultDisplaySettings;
</ins><span class="cx"> if ( settings.canEmbed = this.canEmbed( attachment ) )
</span><span class="cx"> settings.link = 'embed';
</span><span class="cx"> return settings;
</span><span class="lines">@@ -495,8 +496,7 @@
</span><span class="cx">
</span><span class="cx"> recordSelection: function() {
</span><span class="cx"> var selection = this.get('selection'),
</span><del>- manager = this.frame._selection,
- filtered;
</del><ins>+ manager = this.frame._selection;
</ins><span class="cx">
</span><span class="cx"> if ( ! this.get('syncSelection') || ! manager || ! selection )
</span><span class="cx"> return;
</span><span class="lines">@@ -1059,7 +1059,7 @@
</span><span class="cx">
</span><span class="cx"> // Generate the tab states.
</span><span class="cx"> _.each( tabs, function( title, id ) {
</span><del>- var frame = this.state( 'iframe:' + id ).set( _.defaults({
</del><ins>+ this.state( 'iframe:' + id ).set( _.defaults({
</ins><span class="cx"> tab: id,
</span><span class="cx"> src: tabUrl + '&tab=' + id,
</span><span class="cx"> title: title,
</span><span class="lines">@@ -1123,7 +1123,7 @@
</span><span class="cx">
</span><span class="cx"> // Map some of the modal's methods to the frame.
</span><span class="cx"> _.each(['open','close','attach','detach','escape'], function( method ) {
</span><del>- media.view.MediaFrame.prototype[ method ] = function( view ) {
</del><ins>+ media.view.MediaFrame.prototype[ method ] = function() {
</ins><span class="cx"> if ( this.modal )
</span><span class="cx"> this.modal[ method ].apply( this.modal, arguments );
</span><span class="cx"> return this;
</span><span class="lines">@@ -1150,8 +1150,7 @@
</span><span class="cx"> },
</span><span class="cx">
</span><span class="cx"> createSelection: function() {
</span><del>- var controller = this,
- selection = this.options.selection;
</del><ins>+ var selection = this.options.selection;
</ins><span class="cx">
</span><span class="cx"> if ( ! (selection instanceof media.model.Selection) ) {
</span><span class="cx"> this.options.selection = new media.model.Selection( selection, {
</span><span class="lines">@@ -1931,8 +1930,7 @@
</span><span class="cx">
</span><span class="cx"> progress: function() {
</span><span class="cx"> var queue = this.queue,
</span><del>- $bar = this.$bar,
- memo = 0;
</del><ins>+ $bar = this.$bar;
</ins><span class="cx">
</span><span class="cx"> if ( ! $bar || ! queue.length )
</span><span class="cx"> return;
</span><span class="lines">@@ -2111,9 +2109,7 @@
</span><span class="cx"> // ----------------------------
</span><span class="cx"> media.view.Toolbar.Select = media.view.Toolbar.extend({
</span><span class="cx"> initialize: function() {
</span><del>- var options = this.options,
- controller = options.controller,
- selection = controller.state().get('selection');
</del><ins>+ var options = this.options;
</ins><span class="cx">
</span><span class="cx"> _.bindAll( this, 'clickSelect' );
</span><span class="cx">
</span><span class="lines">@@ -2618,7 +2614,7 @@
</span><span class="cx"> selection = this.options.selection,
</span><span class="cx"> model = this.model,
</span><span class="cx"> method = options && options.method,
</span><del>- single, between, models, singleIndex, modelIndex;
</del><ins>+ single, models, singleIndex, modelIndex;
</ins><span class="cx">
</span><span class="cx"> if ( ! selection )
</span><span class="cx"> return;
</span><span class="lines">@@ -2899,13 +2895,13 @@
</span><span class="cx">
</span><span class="cx"> this._viewsByCid = {};
</span><span class="cx">
</span><del>- this.collection.on( 'add', function( attachment, attachments, options ) {
</del><ins>+ this.collection.on( 'add', function( attachment ) {
</ins><span class="cx"> this.views.add( this.createAttachmentView( attachment ), {
</span><span class="cx"> at: this.collection.indexOf( attachment )
</span><span class="cx"> });
</span><span class="cx"> }, this );
</span><span class="cx">
</span><del>- this.collection.on( 'remove', function( attachment, attachments, options ) {
</del><ins>+ this.collection.on( 'remove', function( attachment ) {
</ins><span class="cx"> var view = this._viewsByCid[ attachment.cid ];
</span><span class="cx"> delete this._viewsByCid[ attachment.cid ];
</span><span class="cx">
</span><span class="lines">@@ -3066,7 +3062,7 @@
</span><span class="cx"> this.scroll();
</span><span class="cx"> },
</span><span class="cx">
</span><del>- scroll: function( event ) {
</del><ins>+ scroll: function() {
</ins><span class="cx"> // @todo: is this still necessary?
</span><span class="cx"> if ( ! this.$el.is(':visible') )
</span><span class="cx"> return;
</span><span class="lines">@@ -3149,7 +3145,7 @@
</span><span class="cx"> this.filters = {};
</span><span class="cx"> },
</span><span class="cx">
</span><del>- change: function( event ) {
</del><ins>+ change: function() {
</ins><span class="cx"> var filter = this.filters[ this.el.value ];
</span><span class="cx">
</span><span class="cx"> if ( filter )
</span><span class="lines">@@ -3396,8 +3392,7 @@
</span><span class="cx">
</span><span class="cx"> createSingle: function() {
</span><span class="cx"> var sidebar = this.sidebar,
</span><del>- single = this.options.selection.single(),
- views = {};
</del><ins>+ single = this.options.selection.single();
</ins><span class="cx">
</span><span class="cx"> sidebar.set( 'details', new media.view.Attachment.Details({
</span><span class="cx"> controller: this.controller,
</span><span class="lines">@@ -3630,7 +3625,7 @@
</span><span class="cx"> setUserSetting( userSetting, value );
</span><span class="cx"> },
</span><span class="cx">
</span><del>- updateChanges: function( model, options ) {
</del><ins>+ updateChanges: function( model ) {
</ins><span class="cx"> if ( model.hasChanged() )
</span><span class="cx"> _( model.changed ).chain().keys().each( this.update, this );
</span><span class="cx"> }
</span><span class="lines">@@ -3756,7 +3751,7 @@
</span><span class="cx"> this.model.destroy();
</span><span class="cx"> },
</span><span class="cx">
</span><del>- editAttachment: function( event ) {
</del><ins>+ editAttachment: function() {
</ins><span class="cx"> this.$el.addClass('needs-refresh');
</span><span class="cx"> },
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>