<!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>[22154] trunk: Improve styling and markup for gallery and attachment MCE views.</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, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/22154">22154</a></dd>
<dt>Author</dt> <dd>koopersmith</dd>
<dt>Date</dt> <dd>2012-10-10 06:47:22 +0000 (Wed, 10 Oct 2012)</dd>
</dl>

<h3>Log Message</h3>
<pre>Improve styling and markup for gallery and attachment MCE views.

Attachment views can now inherit from the theme's `editor-style.css` ?\226?\128?\148?\194?\160just have any rules that apply to the `img` tag apply to `.editor-attachment` as well.

Adds a non-functional edit button to gallery views.

see <a href="http://core.trac.wordpress.org/ticket/21390">#21390</a>, <a href="http://core.trac.wordpress.org/ticket/21813">#21813</a>, <a href="http://core.trac.wordpress.org/ticket/21815">#21815</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpcontentthemestwentyeleveneditorstylecss">trunk/wp-content/themes/twentyeleven/editor-style.css</a></li>
<li><a href="#trunkwpcontentthemestwentytwelveeditorstylecss">trunk/wp-content/themes/twentytwelve/editor-style.css</a></li>
<li><a href="#trunkwpincludesjstinymcethemesadvancedskinswp_themecontentcss">trunk/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css</a></li>
<li><a href="#trunkwpincludesmediaphp">trunk/wp-includes/media.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpcontentthemestwentyeleveneditorstylecss"></a>
<div class="modfile"><h4>Modified: trunk/wp-content/themes/twentyeleven/editor-style.css (22153 => 22154)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-content/themes/twentyeleven/editor-style.css        2012-10-10 00:18:33 UTC (rev 22153)
+++ trunk/wp-content/themes/twentyeleven/editor-style.css        2012-10-10 06:47:22 UTC (rev 22154)
</span><span class="lines">@@ -254,7 +254,8 @@
</span><span class="cx"> .wp-caption {
</span><span class="cx">         margin-top: 0.4em;
</span><span class="cx"> }
</span><del>-img {
</del><ins>+img,
+.editor-attachment {
</ins><span class="cx">         border: 1px solid #ddd;
</span><span class="cx">         padding: 6px;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkwpcontentthemestwentytwelveeditorstylecss"></a>
<div class="modfile"><h4>Modified: trunk/wp-content/themes/twentytwelve/editor-style.css (22153 => 22154)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-content/themes/twentytwelve/editor-style.css        2012-10-10 00:18:33 UTC (rev 22153)
+++ trunk/wp-content/themes/twentytwelve/editor-style.css        2012-10-10 06:47:22 UTC (rev 22154)
</span><span class="lines">@@ -289,7 +289,8 @@
</span><span class="cx"> /* =Images
</span><span class="cx"> -------------------------------------------------------------- */
</span><span class="cx"> 
</span><del>-img {
</del><ins>+img,
+.editor-attachment {
</ins><span class="cx">         border: 0;
</span><span class="cx">         border-radius: 3px;
</span><span class="cx">         box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
</span></span></pre></div>
<a id="trunkwpincludesjstinymcethemesadvancedskinswp_themecontentcss"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css (22153 => 22154)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css        2012-10-10 00:18:33 UTC (rev 22153)
+++ trunk/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css        2012-10-10 06:47:22 UTC (rev 22154)
</span><span class="lines">@@ -142,40 +142,112 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /* WordPress TinyMCE Previews */
</span><del>-div.wp-view-wrap,
-div.wp-view {
</del><ins>+.wp-view-wrap {
</ins><span class="cx">         position: relative;
</span><span class="cx">         display: inline-block;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-div.wp-view-wrap img {
</del><ins>+.wp-view-wrap * {
+        font-family: sans-serif;
+        font-weight: normal;
+}
+
+.wp-view-wrap img {
</ins><span class="cx">         display: block;
</span><span class="cx">         border: 0;
</span><span class="cx">         padding: 0;
</span><span class="cx">         margin: 0;
</span><ins>+        border-radius: 0;
+        box-shadow: none;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-.spinner {
</del><ins>+.wp-view-wrap .overlay {
+        opacity: 0;
+        display: block;
+        content: '';
+        position: absolute;
+        top: 0;
+        left: 0;
+        right: 0;
+        bottom: 0;
+        box-shadow: inset 0 0 45px rgba( 0, 0, 0, 0.3 );
+        /*box-shadow:
+                inset 0 60px 30px -30px rgba( 0, 0, 0, 0.2 ),
+                inset 0 -60px 30px -30px rgba( 0, 0, 0, 0.2 );*/
+        overflow: hidden;
+
+        -webkit-transition: opacity 100ms ease-in-out;
+        -moz-transition:    opacity 100ms ease-in-out;
+        -ms-transition:     opacity 100ms ease-in-out;
+        -o-transition:      opacity 100ms ease-in-out;
+        transition:         opacity 100ms ease-in-out;
+}
+
+.wp-view-wrap:hover .overlay {
+        opacity: 1;
+}
+
+.wp-view-wrap .spinner {
</ins><span class="cx">         background: #fff url(&quot;../../../../../../../wp-admin/images/wpspin_light.gif&quot;) no-repeat center center;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.close {
-        display: none;
</del><ins>+.wp-view-wrap .button {
</ins><span class="cx">         position: absolute;
</span><del>-        top: 0;
-        right: 0;
-        height: 26px;
-        width: 26px;
-        font-size: 26px;
</del><ins>+        height: 22px;
</ins><span class="cx">         line-height: 22px;
</span><ins>+        font-size: 14px;
</ins><span class="cx">         text-align: center;
</span><span class="cx">         cursor: pointer;
</span><span class="cx">         color: #464646;
</span><ins>+
+        background: #f3f3f3;
+        background-image: -webkit-gradient(linear, left top, left bottom, from(#fefefe), to(#f4f4f4));
+        background-image: -webkit-linear-gradient(top, #fefefe, #f4f4f4);
+        background-image:    -moz-linear-gradient(top, #fefefe, #f4f4f4);
+        background-image:     -ms-linear-gradient(top, #fefefe, #f4f4f4);
+        background-image:      -o-linear-gradient(top, #fefefe, #f4f4f4);
+        background-image:   linear-gradient(to bottom, #fefefe, #f4f4f4);
+
+        box-shadow: 0 0 0 1px rgba( 0, 0, 0, 0.2 );
+        border-radius: 2px;
+}
+
+.wp-view-wrap .button:hover {
+        box-shadow:
+                0 0 0 1px rgba( 0, 0, 0, 0.6 ),
+                0 0 10px rgba( 255, 255, 255, 0.4 );
</ins><span class="cx">         background: #fff;
</span><ins>+        background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#f3f3f3));
+        background-image: -webkit-linear-gradient(top, #fff, #f3f3f3);
+        background-image:    -moz-linear-gradient(top, #fff, #f3f3f3);
+        background-image:     -ms-linear-gradient(top, #fff, #f3f3f3);
+        background-image:      -o-linear-gradient(top, #fff, #f3f3f3);
+        background-image:   linear-gradient(to bottom, #fff, #f3f3f3);
+        color: #333;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.wp-view-wrap .close,
+.wp-view-wrap .edit {
+        display: none;
+}
+
+.wp-view-wrap .close {
+        top: 5px;
+        right: 5px;
+        width: 22px;
+        font-size: 22px;
+        line-height: 20px;
+}
+
+.wp-view-wrap .edit {
+        bottom: 5px;
+        right: 5px;
+        padding: 0 10px;
+}
+
</ins><span class="cx"> .editor-attachment:hover .close,
</span><del>-.editor-gallery:hover .close {
</del><ins>+.editor-gallery:hover .close,
+.editor-gallery:hover .edit {
</ins><span class="cx">         display: block;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -183,8 +255,7 @@
</span><span class="cx">         position: relative;
</span><span class="cx">         margin-top: 10px;
</span><span class="cx">         margin-right: 10px;
</span><del>-        padding: 4px;
-        border: 1px solid #dfdfdf;
</del><ins>+        overflow: hidden;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> .editor-attachment,
</span><span class="lines">@@ -193,19 +264,25 @@
</span><span class="cx">         min-width: 100px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.editor-attachment img,
+.editor-attachment .overlay {
+        border-radius: inherit;
+}
+
+.editor-attachment-preview {
+        position: relative;
+}
+
</ins><span class="cx"> .editor-gallery {
</span><ins>+        position: relative;
</ins><span class="cx">         min-height: 150px;
</span><span class="cx">         min-width: 150px;
</span><del>-        margin: 1px;
-        border: 4px solid #fff;
</del><ins>+        margin: 5px 15px 15px 5px;
</ins><span class="cx">         box-shadow:
</span><del>-            0 0 0 1px #ccc,
-            5px 5px 0 0 #fff,
-            5px 5px 0 1px #ccc,
-            10px 10px 0 0 #fff,
-            10px 10px 0 1px #ccc;
</del><ins>+            0 0 0 4px #fff,
+            0 0 0 5px #ccc,
+            5px 5px 0 4px #fff,
+            5px 5px 0 5px #ccc,
+            10px 10px 0 4px #fff,
+            10px 10px 0 5px #ccc;
</ins><span class="cx"> }
</span><del>-.editor-gallery .close {
-        top: 1px;
-        right: 1px;
-}
</del><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesmediaphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/media.php (22153 => 22154)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/media.php        2012-10-10 00:18:33 UTC (rev 22153)
+++ trunk/wp-includes/media.php        2012-10-10 06:47:22 UTC (rev 22154)
</span><span class="lines">@@ -1362,14 +1362,18 @@
</span><span class="cx">         &lt;/script&gt;
</span><span class="cx"> 
</span><span class="cx">         &lt;script type=&quot;text/html&quot; id=&quot;tmpl-editor-attachment&quot;&gt;
</span><del>-                &lt;% if ( url ) { %&gt;
-                        &lt;img src=&quot;&lt;%- url %&gt;&quot; width=&quot;&lt;%- width %&gt;&quot; height=&quot;&lt;%- height %&gt;&quot; draggable=&quot;false&quot; /&gt;
-                &lt;% } %&gt;
</del><ins>+                &lt;div class=&quot;editor-attachment-preview&quot;&gt;
+                        &lt;% if ( url ) { %&gt;
+                                &lt;img src=&quot;&lt;%- url %&gt;&quot; width=&quot;&lt;%- width %&gt;&quot; height=&quot;&lt;%- height %&gt;&quot; draggable=&quot;false&quot; /&gt;
+                        &lt;% } %&gt;
</ins><span class="cx"> 
</span><del>-                &lt;% if ( uploading ) { %&gt;
-                        &lt;div class=&quot;media-progress-bar&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;
-                &lt;% } %&gt;
-                &lt;div class=&quot;close&quot;&gt;&amp;times;&lt;/div&gt;
</del><ins>+                        &lt;% if ( uploading ) { %&gt;
+                                &lt;div class=&quot;media-progress-bar&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;
+                        &lt;% } %&gt;
+                        &lt;div class=&quot;overlay&quot;&gt;
+                                &lt;div class=&quot;button close&quot;&gt;&amp;times;&lt;/div&gt;
+                        &lt;/div&gt;
+                &lt;/div&gt;
</ins><span class="cx">                 &lt;div class=&quot;describe&quot;&gt;&lt;/div&gt;
</span><span class="cx">         &lt;/script&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -1377,7 +1381,11 @@
</span><span class="cx">                 &lt;% if ( url ) { %&gt;
</span><span class="cx">                         &lt;img src=&quot;&lt;%- url %&gt;&quot; draggable=&quot;false&quot; /&gt;
</span><span class="cx">                 &lt;% } %&gt;
</span><del>-                &lt;div class=&quot;close&quot;&gt;&amp;times;&lt;/div&gt;
</del><ins>+
+                &lt;div class=&quot;overlay&quot;&gt;
+                        &lt;div class=&quot;button close&quot;&gt;&amp;times;&lt;/div&gt;
+                        &lt;div class=&quot;button edit&quot;&gt;&lt;?php _e('Edit'); ?&gt;&lt;/div&gt;
+                &lt;/div&gt;
</ins><span class="cx">         &lt;/script&gt;
</span><span class="cx">         &lt;?php
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>