<!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>[31380] trunk/src/wp-includes/js/media: Bind `this` at calltime instead of letting `self` spill down into closures.</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" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/31380">31380</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/31380","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>wonderboymusic</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2015-02-09 04:44:39 +0000 (Mon, 09 Feb 2015)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Bind `this` at calltime instead of letting `self` spill down into closures.
See <a href="https://core.trac.wordpress.org/ticket/28510">#28510</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesjsmediaaudiovideojs">trunk/src/wp-includes/js/media/audio-video.js</a></li>
<li><a href="#trunksrcwpincludesjsmediaaudiovideomanifestjs">trunk/src/wp-includes/js/media/audio-video.manifest.js</a></li>
<li><a href="#trunksrcwpincludesjsmediacontrollerscropperjs">trunk/src/wp-includes/js/media/controllers/cropper.js</a></li>
<li><a href="#trunksrcwpincludesjsmediagridjs">trunk/src/wp-includes/js/media/grid.js</a></li>
<li><a href="#trunksrcwpincludesjsmediamodelspostmediajs">trunk/src/wp-includes/js/media/models/post-media.js</a></li>
<li><a href="#trunksrcwpincludesjsmediaviewsattachmentsbrowserjs">trunk/src/wp-includes/js/media/views/attachments/browser.js</a></li>
<li><a href="#trunksrcwpincludesjsmediaviewseditimagedetailsjs">trunk/src/wp-includes/js/media/views/edit-image-details.js</a></li>
<li><a href="#trunksrcwpincludesjsmediaviewseditimagejs">trunk/src/wp-includes/js/media/views/edit-image.js</a></li>
<li><a href="#trunksrcwpincludesjsmediaviewsembedurljs">trunk/src/wp-includes/js/media/views/embed/url.js</a></li>
<li><a href="#trunksrcwpincludesjsmediaviewsframeeditattachmentsjs">trunk/src/wp-includes/js/media/views/frame/edit-attachments.js</a></li>
<li><a href="#trunksrcwpincludesjsmediaviewsimagedetailsjs">trunk/src/wp-includes/js/media/views/image-details.js</a></li>
<li><a href="#trunksrcwpincludesjsmediaviewsmediadetailsjs">trunk/src/wp-includes/js/media/views/media-details.js</a></li>
<li><a href="#trunksrcwpincludesjsmediaviewsuploadereditorjs">trunk/src/wp-includes/js/media/views/uploader/editor.js</a></li>
<li><a href="#trunksrcwpincludesjsmediaviewsjs">trunk/src/wp-includes/js/media/views.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesjsmediaaudiovideojs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/media/audio-video.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/media/audio-video.js 2015-02-09 04:13:38 UTC (rev 31379)
+++ trunk/src/wp-includes/js/media/audio-video.js 2015-02-09 04:44:39 UTC (rev 31380)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -130,7 +130,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> shortcode : function( model ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var self = this, content;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var content;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> _.each( this.defaults, function( value, key ) {
</span><span class="cx" style="display: block; padding: 0 10px"> model[ key ] = self.coerce( model, key );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -138,7 +138,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( value === model[ key ] ) {
</span><span class="cx" style="display: block; padding: 0 10px"> delete model[ key ];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }, this );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> content = model.content;
</span><span class="cx" style="display: block; padding: 0 10px"> delete model.content;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -191,15 +191,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> shortcode : function( model ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var self = this, content;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var content;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> _.each( this.defaults, function( value, key ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- model[ key ] = self.coerce( model, key );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ model[ key ] = this.coerce( model, key );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( value === model[ key ] ) {
</span><span class="cx" style="display: block; padding: 0 10px"> delete model[ key ];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }, this );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> content = model.content;
</span><span class="cx" style="display: block; padding: 0 10px"> delete model.content;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1189,14 +1189,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> changeAttachment: function( attachment ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var self = this;
-
</del><span class="cx" style="display: block; padding: 0 10px"> this.setSource( attachment );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> this.unset( 'src' );
</span><span class="cx" style="display: block; padding: 0 10px"> _.each( _.without( wp.media.view.settings.embedExts, this.extension ), function( ext ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self.unset( ext );
- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.unset( ext );
+ }, this );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2831,7 +2829,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> controller: this.controller,
</span><span class="cx" style="display: block; padding: 0 10px"> priority: -60,
</span><span class="cx" style="display: block; padding: 0 10px"> click: function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var changed = [], removed = [], self = this,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var changed = [], removed = [],
</ins><span class="cx" style="display: block; padding: 0 10px"> selection = this.controller.state().get( 'selection' ),
</span><span class="cx" style="display: block; padding: 0 10px"> library = this.controller.state().get( 'library' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2872,10 +2870,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( changed.length ) {
</span><span class="cx" style="display: block; padding: 0 10px"> selection.remove( removed );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $.when.apply( null, changed ).then( function() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $.when.apply( null, changed ).then( _.bind( function() {
</ins><span class="cx" style="display: block; padding: 0 10px"> library._requery( true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self.controller.trigger( 'selection:action:done' );
- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.controller.trigger( 'selection:action:done' );
+ }, this ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> this.controller.trigger( 'selection:action:done' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4145,10 +4143,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @returns {media.view.MediaDetails} Returns itself to allow chaining
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> render: function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var self = this;
-
</del><span class="cx" style="display: block; padding: 0 10px"> AttachmentDisplay.prototype.render.apply( this, arguments );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- setTimeout( function() { self.resetFocus(); }, 10 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ setTimeout( _.bind( function() {
+ this.resetFocus();
+ }, this ), 10 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> this.settings = _.defaults( {
</span><span class="cx" style="display: block; padding: 0 10px"> success : this.success
</span></span></pre></div>
<a id="trunksrcwpincludesjsmediaaudiovideomanifestjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/media/audio-video.manifest.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/media/audio-video.manifest.js 2015-02-09 04:13:38 UTC (rev 31379)
+++ trunk/src/wp-includes/js/media/audio-video.manifest.js 2015-02-09 04:44:39 UTC (rev 31380)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -129,7 +129,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> shortcode : function( model ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var self = this, content;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var content;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> _.each( this.defaults, function( value, key ) {
</span><span class="cx" style="display: block; padding: 0 10px"> model[ key ] = self.coerce( model, key );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -137,7 +137,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( value === model[ key ] ) {
</span><span class="cx" style="display: block; padding: 0 10px"> delete model[ key ];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }, this );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> content = model.content;
</span><span class="cx" style="display: block; padding: 0 10px"> delete model.content;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -190,15 +190,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> shortcode : function( model ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var self = this, content;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var content;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> _.each( this.defaults, function( value, key ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- model[ key ] = self.coerce( model, key );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ model[ key ] = this.coerce( model, key );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( value === model[ key ] ) {
</span><span class="cx" style="display: block; padding: 0 10px"> delete model[ key ];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }, this );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> content = model.content;
</span><span class="cx" style="display: block; padding: 0 10px"> delete model.content;
</span></span></pre></div>
<a id="trunksrcwpincludesjsmediacontrollerscropperjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/media/controllers/cropper.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/media/controllers/cropper.js 2015-02-09 04:13:38 UTC (rev 31379)
+++ trunk/src/wp-includes/js/media/controllers/cropper.js 2015-02-09 04:44:39 UTC (rev 31380)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -67,18 +67,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> requires: { library: false, selection: false },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> click: function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var self = this,
- selection = this.controller.state().get('selection').first();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var controller = this.controller,
+ selection;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- selection.set({cropDetails: this.controller.state().imgSelect.getSelection()});
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ selection = controller.state().get('selection').first();
+ selection.set({cropDetails: controller.state().imgSelect.getSelection()});
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> this.$el.text(l10n.cropping);
</span><span class="cx" style="display: block; padding: 0 10px"> this.$el.attr('disabled', true);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- this.controller.state().doCrop( selection ).done( function( croppedImage ) {
- self.controller.trigger('cropped', croppedImage );
- self.controller.close();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ controller.state().doCrop( selection ).done( function( croppedImage ) {
+ controller.trigger('cropped', croppedImage );
+ controller.close();
</ins><span class="cx" style="display: block; padding: 0 10px"> }).fail( function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self.controller.trigger('content:error:crop');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ controller.trigger('content:error:crop');
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesjsmediagridjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/media/grid.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/media/grid.js 2015-02-09 04:13:38 UTC (rev 31379)
+++ trunk/src/wp-includes/js/media/grid.js 2015-02-09 04:44:39 UTC (rev 31380)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2663,7 +2663,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> controller: this.controller,
</span><span class="cx" style="display: block; padding: 0 10px"> priority: -60,
</span><span class="cx" style="display: block; padding: 0 10px"> click: function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var changed = [], removed = [], self = this,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var changed = [], removed = [],
</ins><span class="cx" style="display: block; padding: 0 10px"> selection = this.controller.state().get( 'selection' ),
</span><span class="cx" style="display: block; padding: 0 10px"> library = this.controller.state().get( 'library' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2704,10 +2704,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( changed.length ) {
</span><span class="cx" style="display: block; padding: 0 10px"> selection.remove( removed );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $.when.apply( null, changed ).then( function() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $.when.apply( null, changed ).then( _.bind( function() {
</ins><span class="cx" style="display: block; padding: 0 10px"> library._requery( true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self.controller.trigger( 'selection:action:done' );
- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.controller.trigger( 'selection:action:done' );
+ }, this ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> this.controller.trigger( 'selection:action:done' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3198,11 +3198,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> save: function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var self = this;
-
- this.model.fetch().done( function() {
- self.frame.content.mode( 'edit-metadata' );
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.model.fetch().done( _.bind( function() {
+ this.frame.content.mode( 'edit-metadata' );
+ }, this ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3251,12 +3249,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> save: function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var self = this,
- lastState = this.controller.lastState();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var lastState = this.controller.lastState();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- this.model.fetch().done( function() {
- self.controller.setState( lastState );
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.model.fetch().done( _.bind( function() {
+ this.controller.setState( lastState );
+ }, this ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3560,8 +3557,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> createModal: function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var self = this;
-
</del><span class="cx" style="display: block; padding: 0 10px"> // Initialize modal container view.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( this.options.modal ) {
</span><span class="cx" style="display: block; padding: 0 10px"> this.modal = new Modal({
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3569,18 +3564,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> title: this.options.title
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- this.modal.on( 'open', function () {
- $( 'body' ).on( 'keydown.media-modal', _.bind( self.keyEvent, self ) );
- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.modal.on( 'open', _.bind( function () {
+ $( 'body' ).on( 'keydown.media-modal', _.bind( this.keyEvent, this ) );
+ }, this ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Completely destroy the modal DOM element when closing it.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- this.modal.on( 'close', function() {
- self.modal.remove();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.modal.on( 'close', _.bind( function() {
+ this.modal.remove();
</ins><span class="cx" style="display: block; padding: 0 10px"> $( 'body' ).off( 'keydown.media-modal' ); /* remove the keydown event */
</span><span class="cx" style="display: block; padding: 0 10px"> // Restore the original focus item if possible
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $( 'li.attachment[data-id="' + self.model.get( 'id' ) +'"]' ).focus();
- self.resetRoute();
- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $( 'li.attachment[data-id="' + this.model.get( 'id' ) +'"]' ).focus();
+ this.resetRoute();
+ }, this ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Set this frame as the modal's content.
</span><span class="cx" style="display: block; padding: 0 10px"> this.modal.content( this );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4145,10 +4140,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @returns {media.view.MediaDetails} Returns itself to allow chaining
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> render: function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var self = this;
-
</del><span class="cx" style="display: block; padding: 0 10px"> AttachmentDisplay.prototype.render.apply( this, arguments );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- setTimeout( function() { self.resetFocus(); }, 10 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ setTimeout( _.bind( function() {
+ this.resetFocus();
+ }, this ), 10 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> this.settings = _.defaults( {
</span><span class="cx" style="display: block; padding: 0 10px"> success : this.success
</span></span></pre></div>
<a id="trunksrcwpincludesjsmediamodelspostmediajs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/media/models/post-media.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/media/models/post-media.js 2015-02-09 04:13:38 UTC (rev 31379)
+++ trunk/src/wp-includes/js/media/models/post-media.js 2015-02-09 04:44:39 UTC (rev 31380)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -28,14 +28,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> changeAttachment: function( attachment ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var self = this;
-
</del><span class="cx" style="display: block; padding: 0 10px"> this.setSource( attachment );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> this.unset( 'src' );
</span><span class="cx" style="display: block; padding: 0 10px"> _.each( _.without( wp.media.view.settings.embedExts, this.extension ), function( ext ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self.unset( ext );
- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.unset( ext );
+ }, this );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpincludesjsmediaviewsattachmentsbrowserjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/media/views/attachments/browser.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/media/views/attachments/browser.js 2015-02-09 04:13:38 UTC (rev 31379)
+++ trunk/src/wp-includes/js/media/views/attachments/browser.js 2015-02-09 04:44:39 UTC (rev 31380)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -182,7 +182,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> controller: this.controller,
</span><span class="cx" style="display: block; padding: 0 10px"> priority: -60,
</span><span class="cx" style="display: block; padding: 0 10px"> click: function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var changed = [], removed = [], self = this,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var changed = [], removed = [],
</ins><span class="cx" style="display: block; padding: 0 10px"> selection = this.controller.state().get( 'selection' ),
</span><span class="cx" style="display: block; padding: 0 10px"> library = this.controller.state().get( 'library' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -223,10 +223,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( changed.length ) {
</span><span class="cx" style="display: block; padding: 0 10px"> selection.remove( removed );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $.when.apply( null, changed ).then( function() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $.when.apply( null, changed ).then( _.bind( function() {
</ins><span class="cx" style="display: block; padding: 0 10px"> library._requery( true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self.controller.trigger( 'selection:action:done' );
- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.controller.trigger( 'selection:action:done' );
+ }, this ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> this.controller.trigger( 'selection:action:done' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesjsmediaviewseditimagedetailsjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/media/views/edit-image-details.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/media/views/edit-image-details.js 2015-02-09 04:13:38 UTC (rev 31379)
+++ trunk/src/wp-includes/js/media/views/edit-image-details.js 2015-02-09 04:44:39 UTC (rev 31380)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -15,11 +15,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> save: function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var self = this;
-
- this.model.fetch().done( function() {
- self.frame.content.mode( 'edit-metadata' );
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.model.fetch().done( _.bind( function() {
+ this.frame.content.mode( 'edit-metadata' );
+ }, this ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpincludesjsmediaviewseditimagejs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/media/views/edit-image.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/media/views/edit-image.js 2015-02-09 04:13:38 UTC (rev 31379)
+++ trunk/src/wp-includes/js/media/views/edit-image.js 2015-02-09 04:44:39 UTC (rev 31380)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -41,12 +41,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> save: function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var self = this,
- lastState = this.controller.lastState();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var lastState = this.controller.lastState();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- this.model.fetch().done( function() {
- self.controller.setState( lastState );
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.model.fetch().done( _.bind( function() {
+ this.controller.setState( lastState );
+ }, this ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span></span></pre></div>
<a id="trunksrcwpincludesjsmediaviewsembedurljs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/media/views/embed/url.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/media/views/embed/url.js 2015-02-09 04:13:38 UTC (rev 31379)
+++ trunk/src/wp-includes/js/media/views/embed/url.js 2015-02-09 04:44:39 UTC (rev 31380)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -23,8 +23,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> initialize: function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var self = this;
-
</del><span class="cx" style="display: block; padding: 0 10px"> this.$input = $('<input id="embed-url-field" type="url" />').val( this.model.get('url') );
</span><span class="cx" style="display: block; padding: 0 10px"> this.input = this.$input[0];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -34,9 +32,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> this.listenTo( this.model, 'change:url', this.render );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( this.model.get( 'url' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- _.delay( function () {
- self.model.trigger( 'change:url' );
- }, 500 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _.delay( _.bind( function () {
+ this.model.trigger( 'change:url' );
+ }, this ), 500 );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunksrcwpincludesjsmediaviewsframeeditattachmentsjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/media/views/frame/edit-attachments.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/media/views/frame/edit-attachments.js 2015-02-09 04:13:38 UTC (rev 31379)
+++ trunk/src/wp-includes/js/media/views/frame/edit-attachments.js 2015-02-09 04:44:39 UTC (rev 31380)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -74,8 +74,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> createModal: function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var self = this;
-
</del><span class="cx" style="display: block; padding: 0 10px"> // Initialize modal container view.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( this.options.modal ) {
</span><span class="cx" style="display: block; padding: 0 10px"> this.modal = new Modal({
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -83,18 +81,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> title: this.options.title
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- this.modal.on( 'open', function () {
- $( 'body' ).on( 'keydown.media-modal', _.bind( self.keyEvent, self ) );
- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.modal.on( 'open', _.bind( function () {
+ $( 'body' ).on( 'keydown.media-modal', _.bind( this.keyEvent, this ) );
+ }, this ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Completely destroy the modal DOM element when closing it.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- this.modal.on( 'close', function() {
- self.modal.remove();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.modal.on( 'close', _.bind( function() {
+ this.modal.remove();
</ins><span class="cx" style="display: block; padding: 0 10px"> $( 'body' ).off( 'keydown.media-modal' ); /* remove the keydown event */
</span><span class="cx" style="display: block; padding: 0 10px"> // Restore the original focus item if possible
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $( 'li.attachment[data-id="' + self.model.get( 'id' ) +'"]' ).focus();
- self.resetRoute();
- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $( 'li.attachment[data-id="' + this.model.get( 'id' ) +'"]' ).focus();
+ this.resetRoute();
+ }, this ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Set this frame as the modal's content.
</span><span class="cx" style="display: block; padding: 0 10px"> this.modal.content( this );
</span></span></pre></div>
<a id="trunksrcwpincludesjsmediaviewsimagedetailsjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/media/views/image-details.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/media/views/image-details.js 2015-02-09 04:13:38 UTC (rev 31379)
+++ trunk/src/wp-includes/js/media/views/image-details.js 2015-02-09 04:44:39 UTC (rev 31380)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -49,18 +49,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> render: function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var self = this,
- args = arguments;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var args = arguments;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( this.model.attachment && 'pending' === this.model.dfd.state() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- this.model.dfd.done( function() {
- AttachmentDisplay.prototype.render.apply( self, args );
- self.postRender();
- } ).fail( function() {
- self.model.attachment = false;
- AttachmentDisplay.prototype.render.apply( self, args );
- self.postRender();
- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.model.dfd
+ .done( _.bind( function() {
+ AttachmentDisplay.prototype.render.apply( this, args );
+ this.postRender();
+ }, this ) )
+ .fail( _.bind( function() {
+ this.model.attachment = false;
+ AttachmentDisplay.prototype.render.apply( this, args );
+ this.postRender();
+ }, this ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> AttachmentDisplay.prototype.render.apply( this, arguments );
</span><span class="cx" style="display: block; padding: 0 10px"> this.postRender();
</span></span></pre></div>
<a id="trunksrcwpincludesjsmediaviewsmediadetailsjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/media/views/media-details.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/media/views/media-details.js 2015-02-09 04:13:38 UTC (rev 31379)
+++ trunk/src/wp-includes/js/media/views/media-details.js 2015-02-09 04:44:39 UTC (rev 31380)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -110,10 +110,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @returns {media.view.MediaDetails} Returns itself to allow chaining
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> render: function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var self = this;
-
</del><span class="cx" style="display: block; padding: 0 10px"> AttachmentDisplay.prototype.render.apply( this, arguments );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- setTimeout( function() { self.resetFocus(); }, 10 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ setTimeout( _.bind( function() {
+ this.resetFocus();
+ }, this ), 10 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> this.settings = _.defaults( {
</span><span class="cx" style="display: block; padding: 0 10px"> success : this.success
</span></span></pre></div>
<a id="trunksrcwpincludesjsmediaviewsuploadereditorjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/media/views/uploader/editor.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/media/views/uploader/editor.js 2015-02-09 04:13:38 UTC (rev 31379)
+++ trunk/src/wp-includes/js/media/views/uploader/editor.js 2015-02-09 04:44:39 UTC (rev 31380)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -30,8 +30,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Bind drag'n'drop events to callbacks.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> initialize: function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var self = this;
-
</del><span class="cx" style="display: block; padding: 0 10px"> this.initialized = false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Bail if not enabled or UA does not support drag'n'drop or File API.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -51,9 +49,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> this.$document.on( 'dragover', _.bind( this.containerDragover, this ) );
</span><span class="cx" style="display: block; padding: 0 10px"> this.$document.on( 'dragleave', _.bind( this.containerDragleave, this ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- this.$document.on( 'dragstart dragend drop', function( event ) {
- self.localDrag = event.type === 'dragstart';
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.$document.on( 'dragstart dragend drop', _.bind( function( event ) {
+ this.localDrag = event.type === 'dragstart';
+ }, this ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> this.initialized = true;
</span><span class="cx" style="display: block; padding: 0 10px"> return this;
</span></span></pre></div>
<a id="trunksrcwpincludesjsmediaviewsjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/media/views.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/media/views.js 2015-02-09 04:13:38 UTC (rev 31379)
+++ trunk/src/wp-includes/js/media/views.js 2015-02-09 04:44:39 UTC (rev 31380)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -333,18 +333,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> requires: { library: false, selection: false },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> click: function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var self = this,
- selection = this.controller.state().get('selection').first();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var controller = this.controller,
+ selection;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- selection.set({cropDetails: this.controller.state().imgSelect.getSelection()});
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ selection = controller.state().get('selection').first();
+ selection.set({cropDetails: controller.state().imgSelect.getSelection()});
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> this.$el.text(l10n.cropping);
</span><span class="cx" style="display: block; padding: 0 10px"> this.$el.attr('disabled', true);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- this.controller.state().doCrop( selection ).done( function( croppedImage ) {
- self.controller.trigger('cropped', croppedImage );
- self.controller.close();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ controller.state().doCrop( selection ).done( function( croppedImage ) {
+ controller.trigger('cropped', croppedImage );
+ controller.close();
</ins><span class="cx" style="display: block; padding: 0 10px"> }).fail( function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self.controller.trigger('content:error:crop');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ controller.trigger('content:error:crop');
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3836,7 +3838,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> controller: this.controller,
</span><span class="cx" style="display: block; padding: 0 10px"> priority: -60,
</span><span class="cx" style="display: block; padding: 0 10px"> click: function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var changed = [], removed = [], self = this,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var changed = [], removed = [],
</ins><span class="cx" style="display: block; padding: 0 10px"> selection = this.controller.state().get( 'selection' ),
</span><span class="cx" style="display: block; padding: 0 10px"> library = this.controller.state().get( 'library' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3877,10 +3879,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( changed.length ) {
</span><span class="cx" style="display: block; padding: 0 10px"> selection.remove( removed );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $.when.apply( null, changed ).then( function() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $.when.apply( null, changed ).then( _.bind( function() {
</ins><span class="cx" style="display: block; padding: 0 10px"> library._requery( true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self.controller.trigger( 'selection:action:done' );
- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.controller.trigger( 'selection:action:done' );
+ }, this ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> this.controller.trigger( 'selection:action:done' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4395,12 +4397,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> save: function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var self = this,
- lastState = this.controller.lastState();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var lastState = this.controller.lastState();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- this.model.fetch().done( function() {
- self.controller.setState( lastState );
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.model.fetch().done( _.bind( function() {
+ this.controller.setState( lastState );
+ }, this ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4603,8 +4604,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> initialize: function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var self = this;
-
</del><span class="cx" style="display: block; padding: 0 10px"> this.$input = $('<input id="embed-url-field" type="url" />').val( this.model.get('url') );
</span><span class="cx" style="display: block; padding: 0 10px"> this.input = this.$input[0];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4614,9 +4613,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> this.listenTo( this.model, 'change:url', this.render );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( this.model.get( 'url' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- _.delay( function () {
- self.model.trigger( 'change:url' );
- }, 500 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _.delay( _.bind( function () {
+ this.model.trigger( 'change:url' );
+ }, this ), 500 );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6069,18 +6068,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> render: function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var self = this,
- args = arguments;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var args = arguments;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( this.model.attachment && 'pending' === this.model.dfd.state() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- this.model.dfd.done( function() {
- AttachmentDisplay.prototype.render.apply( self, args );
- self.postRender();
- } ).fail( function() {
- self.model.attachment = false;
- AttachmentDisplay.prototype.render.apply( self, args );
- self.postRender();
- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.model.dfd
+ .done( _.bind( function() {
+ AttachmentDisplay.prototype.render.apply( this, args );
+ this.postRender();
+ }, this ) )
+ .fail( _.bind( function() {
+ this.model.attachment = false;
+ AttachmentDisplay.prototype.render.apply( this, args );
+ this.postRender();
+ }, this ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> AttachmentDisplay.prototype.render.apply( this, arguments );
</span><span class="cx" style="display: block; padding: 0 10px"> this.postRender();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7793,8 +7793,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Bind drag'n'drop events to callbacks.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> initialize: function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var self = this;
-
</del><span class="cx" style="display: block; padding: 0 10px"> this.initialized = false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Bail if not enabled or UA does not support drag'n'drop or File API.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7814,9 +7812,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> this.$document.on( 'dragover', _.bind( this.containerDragover, this ) );
</span><span class="cx" style="display: block; padding: 0 10px"> this.$document.on( 'dragleave', _.bind( this.containerDragleave, this ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- this.$document.on( 'dragstart dragend drop', function( event ) {
- self.localDrag = event.type === 'dragstart';
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.$document.on( 'dragstart dragend drop', _.bind( function( event ) {
+ this.localDrag = event.type === 'dragstart';
+ }, this ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> this.initialized = true;
</span><span class="cx" style="display: block; padding: 0 10px"> return this;
</span></span></pre>
</div>
</div>
</body>
</html>