<!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>[31797] trunk/src: Press This:</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/31797">31797</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/31797","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>azaozz</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2015-03-16 20:50:39 +0000 (Mon, 16 Mar 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'>Press This:
- Test image sizes from JS after Press This loads, before adding them to  "Suggested media".
- Clean up and simplify the HTML and JS a bit.
Fixes <a href="https://core.trac.wordpress.org/ticket/31561">#31561</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadmincsspressthiscss">trunk/src/wp-admin/css/press-this.css</a></li>
<li><a href="#trunksrcwpadminincludesclasswppressthisphp">trunk/src/wp-admin/includes/class-wp-press-this.php</a></li>
<li><a href="#trunksrcwpadminjsbookmarkletjs">trunk/src/wp-admin/js/bookmarklet.js</a></li>
<li><a href="#trunksrcwpadminjsbookmarkletminjs">trunk/src/wp-admin/js/bookmarklet.min.js</a></li>
<li><a href="#trunksrcwpadminjspressthisjs">trunk/src/wp-admin/js/press-this.js</a></li>
<li><a href="#trunksrcwpincludesscriptloaderphp">trunk/src/wp-includes/script-loader.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadmincsspressthiscss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/css/press-this.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/css/press-this.css     2015-03-16 20:36:02 UTC (rev 31796)
+++ trunk/src/wp-admin/css/press-this.css       2015-03-16 20:50:39 UTC (rev 31797)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1439,37 +1439,47 @@
</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"> /* Suggested images */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.featured-container {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.media-list-container {
</ins><span class="cx" style="display: block; padding: 0 10px">         position: relative;
</span><span class="cx" style="display: block; padding: 0 10px">        padding: 2px 0;
</span><span class="cx" style="display: block; padding: 0 10px">        border-bottom: 1px solid #e5e5e5;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        display: none;
</ins><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">-.all-media {
-       display: none;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.media-list-inner-container {
</ins><span class="cx" style="display: block; padding: 0 10px">         overflow: auto;
</span><span class="cx" style="display: block; padding: 0 10px">        max-height: 150px;
</span><span class="cx" style="display: block; padding: 0 10px">        max-height: 40vw;
</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">-.all-media:before, .all-media:after {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.media-list-container.has-media {
+       display: block;
+}
+
+.media-list-inner-container:before,
+.media-list-inner-container:after {
</ins><span class="cx" style="display: block; padding: 0 10px">         content: "";
</span><span class="cx" style="display: block; padding: 0 10px">        display: table;
</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">-.all-media:after {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.media-list-inner-container:after {
</ins><span class="cx" style="display: block; padding: 0 10px">         clear: both;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.media-list {
+       margin: 0;
+       padding: 0;
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> @media (min-width: 321px) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        .all-media {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ .media-list-inner-container {
</ins><span class="cx" style="display: block; padding: 0 10px">                 max-height: 250px;
</span><span class="cx" style="display: block; padding: 0 10px">                max-height: 40vw;
</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"> 
</span><span class="cx" style="display: block; padding: 0 10px"> @media (min-width: 601px) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        .all-media {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ .media-list-inner-container {
</ins><span class="cx" style="display: block; padding: 0 10px">                 max-height: 200px;
</span><span class="cx" style="display: block; padding: 0 10px">                max-height: 18.75vw;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1482,7 +1492,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"> .suggested-media-thumbnail:focus,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.suggested-media-embed:focus {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.is-embed:focus {
</ins><span class="cx" style="display: block; padding: 0 10px">         outline: 0;
</span><span class="cx" style="display: block; padding: 0 10px">        -webkit-box-shadow: inset 0 0 0 3px #2ea2cc;
</span><span class="cx" style="display: block; padding: 0 10px">        box-shadow: inset 0 0 0 3px #2ea2cc;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1546,55 +1556,51 @@
</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"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.suggested-media-embed:before {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.is-embed:before {
</ins><span class="cx" style="display: block; padding: 0 10px">         content: "\f104";
</span><span class="cx" style="display: block; padding: 0 10px">        color: #fff;
</span><span class="cx" style="display: block; padding: 0 10px">        color: rgba(255, 255, 255, 0.9);
</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">-.suggested-media-embed.is-audio:hover:before,
-.suggested-media-embed.is-audio:active:before,
-.suggested-media-embed.is-audio:focus:before,
-.suggested-media-embed.is-tweet:hover:before,
-.suggested-media-embed.is-tweet:active:before,
-.suggested-media-embed.is-tweet:focus:before {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.is-embed.is-audio:hover:before,
+.is-embed.is-audio:active:before,
+.is-embed.is-audio:focus:before,
+.is-embed.is-tweet:hover:before,
+.is-embed.is-tweet:active:before,
+.is-embed.is-tweet:focus:before {
</ins><span class="cx" style="display: block; padding: 0 10px">         color: #fff;
</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">-.suggested-media-embed.is-video {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.is-embed.is-video {
</ins><span class="cx" style="display: block; padding: 0 10px">         background-color: #222;
</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">-.suggested-media-embed.is-video:hover:before,
-.suggested-media-embed.is-video:active:before,
-.suggested-media-embed.is-video:focus:before {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.is-embed.is-video:hover:before,
+.is-embed.is-video:active:before,
+.is-embed.is-video:focus:before {
</ins><span class="cx" style="display: block; padding: 0 10px">         color: rgba(255, 255, 255, 0.2);
</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">-.suggested-media-embed.is-video:before {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.is-embed.is-video:before {
</ins><span class="cx" style="display: block; padding: 0 10px">         content: "\f236";
</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">-.suggested-media-embed.is-audio {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.is-embed.is-audio {
</ins><span class="cx" style="display: block; padding: 0 10px">         background-color: #ff7d44;
</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">-.suggested-media-embed.is-audio:before {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.is-embed.is-audio:before {
</ins><span class="cx" style="display: block; padding: 0 10px">         content: "\f127";
</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">-.suggested-media-embed.is-tweet {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.is-embed.is-tweet {
</ins><span class="cx" style="display: block; padding: 0 10px">         background-color: #55acee;
</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">-.suggested-media-embed.is-tweet:before {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.is-embed.is-tweet:before {
</ins><span class="cx" style="display: block; padding: 0 10px">         content: "\f301";
</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">-.all-media-visible .all-media {
-       display: block;
-}
-
</del><span class="cx" style="display: block; padding: 0 10px"> .no-media {
</span><span class="cx" style="display: block; padding: 0 10px">        margin: 0;
</span><span class="cx" style="display: block; padding: 0 10px">        padding: 0;
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasswppressthisphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/class-wp-press-this.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-press-this.php       2015-03-16 20:36:02 UTC (rev 31796)
+++ trunk/src/wp-admin/includes/class-wp-press-this.php 2015-03-16 20:50:39 UTC (rev 31797)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1212,12 +1212,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                </p>
</span><span class="cx" style="display: block; padding: 0 10px">                        </div>
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        <div id='app-container' class="editor">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 <div id="app-container" class="editor">
</ins><span class="cx" style="display: block; padding: 0 10px">                                 <span id="title-container-label" class="post-title-placeholder" aria-hidden="true"><?php _e( 'Post title' ); ?></span>
</span><span class="cx" style="display: block; padding: 0 10px">                                <h2 id="title-container" class="post-title" contenteditable="true" spellcheck="true" aria-label="<?php esc_attr_e( 'Post title' ); ?>" tabindex="0"><?php echo esc_html( $post_title ); ?></h2>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                <div id='featured-media-container' class="featured-container no-media">
-                                       <div id='all-media-widget' class="all-media">
-                                               <div id='all-media-container'></div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+                               <div class="media-list-container">
+                                       <div class="media-list-inner-container">
+                                               <h2 class="screen-reader-text"><?php _e( 'Suggested media' ); ?></h2>
+                                               <ul class="media-list"></ul>
</ins><span class="cx" style="display: block; padding: 0 10px">                                         </div>
</span><span class="cx" style="display: block; padding: 0 10px">                                </div>
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span></span></pre></div>
<a id="trunksrcwpadminjsbookmarkletjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/js/bookmarklet.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/js/bookmarklet.js      2015-03-16 20:36:02 UTC (rev 31796)
+++ trunk/src/wp-admin/js/bookmarklet.js        2015-03-16 20:50:39 UTC (rev 31797)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2,12 +2,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">        var encURI = window.encodeURIComponent,
</span><span class="cx" style="display: block; padding: 0 10px">                form = document.createElement( 'form' ),
</span><span class="cx" style="display: block; padding: 0 10px">                head = document.getElementsByTagName( 'head' )[0],
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                img = new Image(),
</del><span class="cx" style="display: block; padding: 0 10px">                 target = '_press_this_app',
</span><span class="cx" style="display: block; padding: 0 10px">                canPost = true,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                windowWidth, windowHeight,
-               metas, links, content, imgs, ifrs,
-               selection;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         windowWidth, windowHeight, selection,
+               metas, links, content, images, iframes, img;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        if ( ! pt_url ) {
</span><span class="cx" style="display: block; padding: 0 10px">                return;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -119,32 +117,33 @@
</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">        content = document.getElementById( 'content' ) || content || document.body;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        imgs = content.getElementsByTagName( 'img' ) || [];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ images = content.getElementsByTagName( 'img' ) || [];
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        for ( var n = 0; n < imgs.length; n++ ) {
-               if ( n >= 50 ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for ( var n = 0; n < images.length; n++ ) {
+               if ( n >= 100 ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                         break;
</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">-                if ( imgs[ n ].src.indexOf( 'avatar' ) > -1 || imgs[ n ].className.indexOf( 'avatar' ) > -1 ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         img = images[ n ];
+
+               // If we know the image width and/or height, check them now and drop the "uninteresting" images.
+               if ( img.src.indexOf( 'avatar' ) > -1 || img.className.indexOf( 'avatar' ) > -1 ||
+                       ( img.width && img.width < 256 ) || ( img.height && img.height < 128 ) ) {
+
</ins><span class="cx" style="display: block; padding: 0 10px">                         continue;
</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">-                img.src = imgs[ n ].src;
-
-               if ( img.width >= 256 && img.height >= 128 ) {
-                       add( '_images[]', img.src );
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         add( '_images[]', img.src );
</ins><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">-        ifrs = document.body.getElementsByTagName( 'iframe' ) || [];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ iframes = document.body.getElementsByTagName( 'iframe' ) || [];
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        for ( var p = 0; p < ifrs.length; p++ ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for ( var p = 0; p < iframes.length; p++ ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                 if ( p >= 50 ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        break;
</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">-                add( '_embeds[]', ifrs[ p ].src );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         add( '_embeds[]', iframes[ p ].src );
</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">        if ( document.title ) {
</span></span></pre></div>
<a id="trunksrcwpadminjsbookmarkletminjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/js/bookmarklet.min.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/js/bookmarklet.min.js  2015-03-16 20:36:02 UTC (rev 31796)
+++ trunk/src/wp-admin/js/bookmarklet.min.js    2015-03-16 20:50:39 UTC (rev 31797)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1 +1 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-(function(a,b,c,d){function e(a,c){if("undefined"!=typeof c){var d=b.createElement("input");d.name=a,d.value=c,d.type="hidden",o.appendChild(d)}}var f,g,h,i,j,k,l,m,n=a.encodeURIComponent,o=b.createElement("form"),p=b.getElementsByTagName("head")[0],q=new Image,r="_press_this_app",s=!0;if(d){if(!c.match(/^https?:/))return void(top.location.href=d);if(d+="&u="+n(c),c.match(/^https:/)&&d.match(/^http:/)&&(s=!1),a.getSelection?m=a.getSelection()+"":b.getSelection?m=b.getSelection()+"":b.selection&&(m=b.selection.createRange().text||""),d+="&buster="+(new Date).getTime(),s||(b.title&&(d+="&t="+n(b.title.substr(0,256))),m&&(d+="&s="+n(m.substr(0,512)))),f=a.outerWidth||b.documentElement.clientWidth||600,g=a.ou
 terHeight||b.documentElement.clientHeight||700,f=800>f||f>5e3?600:.7*f,g=800>g||g>3e3?700:.9*g,!s)return void a.open(d,r,"location,resizable,scrollbars,width="+f+",height="+g);(c.match(/\/\/(www|m)\.youtube\.com\/watch/)||c.match(/\/\/vimeo\.com\/(.+\/)?([\d]+)$/)||c.match(/\/\/(www\.)?dailymotion\.com\/video\/.+$/)||c.match(/\/\/soundcloud\.com\/.+$/)||c.match(/\/\/twitter\.com\/[^\/]+\/status\/[\d]+$/)||c.match(/\/\/vine\.co\/v\/[^\/]+/))&&e("_embeds[]",c),h=p.getElementsByTagName("meta")||[];for(var t=0;t<h.length&&!(t>200);t++){var u=h[t],v=u.getAttribute("name"),w=u.getAttribute("property"),x=u.getAttribute("content");x&&(v?e("_meta["+v+"]",x):w&&e("_meta["+w+"]",x))}i=p.getElementsByTagName("link")||[];for(var y=0;y<i.length&&!(y>=50);y++){var z=i[y],A=z.getAttribute("rel");("canon
 ical"===A||"icon"===A||"shortlink"===A)&&e("_links["+A+"]",z.getAttribute("href"))}b.body.getElementsByClassName&&(j=b.body.getElementsByClassName("hfeed")[0]),j=b.getElementById("content")||j||b.body,k=j.getElementsByTagName("img")||[];for(var B=0;B<k.length&&!(B>=50);B++)k[B].src.indexOf("avatar")>-1||k[B].className.indexOf("avatar")>-1||(q.src=k[B].src,q.width>=256&&q.height>=128&&e("_images[]",q.src));l=b.body.getElementsByTagName("iframe")||[];for(var C=0;C<l.length&&!(C>=50);C++)e("_embeds[]",l[C].src);b.title&&e("t",b.title),m&&e("s",m),o.setAttribute("method","POST"),o.setAttribute("action",d),o.setAttribute("target",r),o.setAttribute("style","display: none;"),a.open("abou
 t:blank",r,"location,resizable,scrollbars,width="+f+",height="+g),b.body.appendChild(o),o.submit()}})(window,document,top.location.href,window.pt_url);
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+(function(a,b,c,d){function e(a,c){if("undefined"!=typeof c){var d=b.createElement("input");d.name=a,d.value=c,d.type="hidden",p.appendChild(d)}}var f,g,h,i,j,k,l,m,n,o=a.encodeURIComponent,p=b.createElement("form"),q=b.getElementsByTagName("head")[0],r="_press_this_app",s=!0;if(d){if(!c.match(/^https?:/))return void(top.location.href=d);if(d+="&u="+o(c),c.match(/^https:/)&&d.match(/^http:/)&&(s=!1),a.getSelection?h=a.getSelection()+"":b.getSelection?h=b.getSelection()+"":b.selection&&(h=b.selection.createRange().text||""),d+="&buster="+(new Date).getTime(),s||(b.title&&(d+="&t="+o(b.title.substr(0,256))),h&&(d+="&s="+o(h.substr(0,512)))),f=a.outerWidth||b.documentElement.clientWidth||600,g=a.outerHeight|
 |b.documentElement.clientHeight||700,f=800>f||f>5e3?600:.7*f,g=800>g||g>3e3?700:.9*g,!s)return void a.open(d,r,"location,resizable,scrollbars,width="+f+",height="+g);(c.match(/\/\/(www|m)\.youtube\.com\/watch/)||c.match(/\/\/vimeo\.com\/(.+\/)?([\d]+)$/)||c.match(/\/\/(www\.)?dailymotion\.com\/video\/.+$/)||c.match(/\/\/soundcloud\.com\/.+$/)||c.match(/\/\/twitter\.com\/[^\/]+\/status\/[\d]+$/)||c.match(/\/\/vine\.co\/v\/[^\/]+/))&&e("_embeds[]",c),i=q.getElementsByTagName("meta")||[];for(var t=0;t<i.length&&!(t>200);t++){var u=i[t],v=u.getAttribute("name"),w=u.getAttribute("property"),x=u.getAttribute("content");x&&(v?e("_meta["+v+"]",x):w&&e("_meta["+w+"]",x))}j=q.getElementsByTagName("link")||[];for(var y=0;y<j.length&&!(y>=50);y++){var z=j[y],A=z.getAttribute("rel");("canonical"
 ===A||"icon"===A||"shortlink"===A)&&e("_links["+A+"]",z.getAttribute("href"))}b.body.getElementsByClassName&&(k=b.body.getElementsByClassName("hfeed")[0]),k=b.getElementById("content")||k||b.body,l=k.getElementsByTagName("img")||[];for(var B=0;B<l.length&&!(B>=100);B++)n=l[B],n.src.indexOf("avatar")>-1||n.className.indexOf("avatar")>-1||n.width&&n.width<256||n.height&&n.height<128||e("_images[]",n.src);m=b.body.getElementsByTagName("iframe")||[];for(var C=0;C<m.length&&!(C>=50);C++)e("_embeds[]",m[C].src);b.title&&e("t",b.title),h&&e("s",h),p.setAttribute("method","POST"),p.setAttribute("action",d),p.setAttribute("target",r),p.setAttribute("style","display: none;"),a.open("about:blank&
 quot;,r,"location,resizable,scrollbars,width="+f+",height="+g),b.body.appendChild(p),p.submit()}})(window,document,top.location.href,window.pt_url);
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpadminjspressthisjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/js/press-this.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/js/press-this.js       2015-03-16 20:36:02 UTC (rev 31796)
+++ trunk/src/wp-admin/js/press-this.js 2015-03-16 20:50:39 UTC (rev 31797)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4,7 +4,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> ( function( $, window ) {
</span><span class="cx" style="display: block; padding: 0 10px">        var PressThis = function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                var editor,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         var editor, $mediaList, $mediaThumbWrap,
</ins><span class="cx" style="display: block; padding: 0 10px">                         saveAlert             = false,
</span><span class="cx" style="display: block; padding: 0 10px">                        textarea              = document.createElement( 'textarea' ),
</span><span class="cx" style="display: block; padding: 0 10px">                        sidebarIsOpen         = false,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -252,7 +252,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                                var $node = $( '<li>' ).append( $( '<div class="category selected" tabindex="0" role="checkbox" aria-checked="true">' )
</span><span class="cx" style="display: block; padding: 0 10px">                                                        .attr( 'data-term-id', newCat.term_id )
</span><span class="cx" style="display: block; padding: 0 10px">                                                        .text( newCat.name ) );
</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">+
</ins><span class="cx" style="display: block; padding: 0 10px">                                                 if ( newCat.parent ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                                        if ( ! $ul || ! $ul.length ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                                                $parent = $wrap.find( 'div[data-term-id="' + newCat.parent + '"]' ).parent();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -329,26 +329,38 @@
</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">                /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 * Add an image to the list of found images.
+                */
+               function addImg( src, displaySrc, i ) {
+                       var $element = $mediaThumbWrap.clone().addClass( 'is-image' );
+
+                       $element.css( 'background-image', 'url(' + displaySrc + ')' )
+                               .find( 'span' ).text( __( 'suggestedImgAlt' ).replace( '%d', i + 1 ) );
+
+                       $element.on( 'click keypress', function ( event ) {
+                               if ( event.type === 'click' || event.keyCode === 13 ) {
+                                       insertSelectedMedia( 'img', src, data.u );
+                               }
+                       } ).appendTo( $mediaList );
+               }
+
+               /**
</ins><span class="cx" style="display: block; padding: 0 10px">                  * Render the detected images and embed for selection, if any
</span><span class="cx" style="display: block; padding: 0 10px">                 */
</span><span class="cx" style="display: block; padding: 0 10px">                function renderDetectedMedia() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        var mediaContainer = $( '#featured-media-container'),
-                               listContainer  = $( '#all-media-container' ),
-                               found          = 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 var found = 0;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        listContainer.empty();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $mediaList = $( 'ul.media-list' );
+                       $mediaThumbWrap = $( '<li class="suggested-media-thumbnail" tabindex="0"><span class="screen-reader-text"></span></li>' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if ( data._embeds || data._images ) {
-                               listContainer.append( '<h2 class="screen-reader-text">' + __( 'allMediaHeading' ) + '</h2><ul class="wppt-all-media-list" />' );
-                       }
-
</del><span class="cx" style="display: block; padding: 0 10px">                         if ( data._embeds ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                $.each( data._embeds, function ( i, src ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                        var displaySrc = '',
+                                               cssClass = '',
+                                               $element = $mediaThumbWrap.clone().addClass( 'is-embed' );
+
</ins><span class="cx" style="display: block; padding: 0 10px">                                         src = checkUrl( src );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        var displaySrc = '',
-                                               cssClass   = 'suggested-media-thumbnail suggested-media-embed';
-
</del><span class="cx" style="display: block; padding: 0 10px">                                         if ( src.indexOf( 'youtube.com/' ) > -1 ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                                displaySrc = 'https://i.ytimg.com/vi/' + src.replace( /.+v=([^&]+).*/, '$1' ) + '/hqdefault.jpg';
</span><span class="cx" style="display: block; padding: 0 10px">                                                cssClass += ' is-video';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -366,19 +378,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                                cssClass += ' is-video';
</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">-                                        $( '<li></li>', {
-                                               'id': 'embed-' + i + '-container',
-                                               'class': cssClass,
-                                               'tabindex': '0'
-                                       } ).css( {
-                                               'background-image': ( displaySrc ) ? 'url(' + displaySrc + ')' : null
-                                       } ).html(
-                                               '<span class="screen-reader-text">' + __( 'suggestedEmbedAlt' ).replace( '%d', i + 1 ) + '</span>'
-                                       ).on( 'click keypress', function ( e ) {
-                                               if ( e.type === 'click' || e.which === 13 ) {
-                                                       insertSelectedMedia( 'embed',src );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 $element.find( 'span' ).text( __( 'suggestedEmbedAlt' ).replace( '%d', i + 1 ) );
+
+                                       if ( displaySrc ) {
+                                               $element.css( 'background-image', 'url(' + displaySrc + ')' );
+                                       }
+
+                                       $element.on( 'click keypress', function ( event ) {
+                                               if ( event.type === 'click' || event.keyCode === 13 ) {
+                                                       insertSelectedMedia( 'embed', src );
</ins><span class="cx" style="display: block; padding: 0 10px">                                                 }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        } ).appendTo( '.wppt-all-media-list', listContainer );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 } ).appendTo( $mediaList );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                        found++;
</span><span class="cx" style="display: block; padding: 0 10px">                                } );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -386,41 +396,37 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( data._images ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                $.each( data._images, function( i, src ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                        var displaySrc, img = new Image();
+
</ins><span class="cx" style="display: block; padding: 0 10px">                                         src = checkUrl( src );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                        displaySrc = src.replace( /^(http[^\?]+)(\?.*)?$/, '$1' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        var displaySrc = src.replace(/^(http[^\?]+)(\?.*)?$/, '$1');
</del><span class="cx" style="display: block; padding: 0 10px">                                         if ( src.indexOf( 'files.wordpress.com/' ) > -1 ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                                displaySrc = displaySrc.replace(/\?.*$/, '') + '?w=' + smallestWidth;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                         displaySrc = displaySrc.replace( /\?.*$/, '' ) + '?w=' + smallestWidth;
</ins><span class="cx" style="display: block; padding: 0 10px">                                         } else if ( src.indexOf( 'gravatar.com/' ) > -1 ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                                displaySrc = displaySrc.replace( /\?.*$/, '' ) + '?s=' + smallestWidth;
</span><span class="cx" style="display: block; padding: 0 10px">                                        } else {
</span><span class="cx" style="display: block; padding: 0 10px">                                                displaySrc = src;
</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">-                                        $( '<li></li>', {
-                                               'id': 'img-' + i + '-container',
-                                               'class': 'suggested-media-thumbnail is-image',
-                                               'tabindex': '0'
-                                       } ).css( {
-                                               'background-image': 'url(' + displaySrc + ')'
-                                       } ).html(
-                                               '<span class="screen-reader-text">' +__( 'suggestedImgAlt' ).replace( '%d', i + 1 ) + '</span>'
-                                       ).on( 'click keypress', function ( e ) {
-                                               if ( e.type === 'click' || e.which === 13 ) {
-                                                       insertSelectedMedia( 'img', src, data.u );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 img.onload = function() {
+                                               if ( ( img.width && img.width < 256 ) ||
+                                                       ( img.height && img.height < 128 ) ) {
+
+                                                       return;
</ins><span class="cx" style="display: block; padding: 0 10px">                                                 }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        } ).appendTo( '.wppt-all-media-list', listContainer );
</del><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                                addImg( src, displaySrc, i );
+                                       };
+
+                                       img.src = src;
</ins><span class="cx" style="display: block; padding: 0 10px">                                         found++;
</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"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if ( ! found ) {
-                               mediaContainer.removeClass( 'all-media-visible' ).addClass( 'no-media');
-                               return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 if ( found ) {
+                               $( '.media-list-container' ).addClass( 'has-media' );
</ins><span class="cx" style="display: block; padding: 0 10px">                         }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
-                       mediaContainer.removeClass( 'no-media' ).addClass( 'all-media-visible' );
</del><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="trunksrcwpincludesscriptloaderphp"></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/script-loader.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/script-loader.php   2015-03-16 20:36:02 UTC (rev 31796)
+++ trunk/src/wp-includes/script-loader.php     2015-03-16 20:50:39 UTC (rev 31797)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -502,7 +502,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'newPost' => __( 'Title' ),
</span><span class="cx" style="display: block; padding: 0 10px">                        'unexpectedError' => __( 'Sorry, but an unexpected error occurred.' ),
</span><span class="cx" style="display: block; padding: 0 10px">                        'saveAlert' => __( 'The changes you made will be lost if you navigate away from this page.' ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        'allMediaHeading' => __( 'Suggested media' ),
</del><span class="cx" style="display: block; padding: 0 10px">                         'suggestedEmbedAlt' => __( 'Suggested embed #%d' ),
</span><span class="cx" style="display: block; padding: 0 10px">                        'suggestedImgAlt' => __( 'Suggested image #%d' ),
</span><span class="cx" style="display: block; padding: 0 10px">                ) );
</span></span></pre>
</div>
</div>

</body>
</html>