<!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>[28062] trunk/src: Fix TinyMCE Views in IE8 and 7:</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/28062">28062</a></dd>
<dt>Author</dt> <dd>azaozz</dd>
<dt>Date</dt> <dd>2014-04-09 00:57:46 +0000 (Wed, 09 Apr 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Fix TinyMCE Views in IE8 and 7:
- Add fallback background images for dashicons.
- Fix hiding the clipboard while still allowing the contents to be selected.
- Work around lack of border-box in gallery styles.
(Includes precommit cleanup for theme.js)
Props gcorne, fixes 27546</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminjsthemejs">trunk/src/wp-admin/js/theme.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginswpviewpluginjs">trunk/src/wp-includes/js/tinymce/plugins/wpview/plugin.js</a></li>
<li><a href="#trunksrcwpincludesjstinymceskinswordpresswpcontentcss">trunk/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesjstinymceskinswordpressimagesdashiconeditpng">trunk/src/wp-includes/js/tinymce/skins/wordpress/images/dashicon-edit.png</a></li>
<li><a href="#trunksrcwpincludesjstinymceskinswordpressimagesdashiconnoaltpng">trunk/src/wp-includes/js/tinymce/skins/wordpress/images/dashicon-no-alt.png</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminjsthemejs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/js/theme.js (28061 => 28062)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/js/theme.js 2014-04-08 19:08:59 UTC (rev 28061)
+++ trunk/src/wp-admin/js/theme.js 2014-04-09 00:57:46 UTC (rev 28062)
</span><span class="lines">@@ -551,7 +551,7 @@
</span><span class="cx"> });
</span><span class="cx">
</span><span class="cx"> this.listenTo( preview, 'preview:close', function() {
</span><del>- self.current = self.model
</del><ins>+ self.current = self.model;
</ins><span class="cx"> });
</span><span class="cx"> },
</span><span class="cx">
</span><span class="lines">@@ -755,8 +755,8 @@
</span><span class="cx"> html: themes.template( 'theme-preview' ),
</span><span class="cx">
</span><span class="cx"> render: function() {
</span><del>- var data = this.model.toJSON(),
- self = this;
</del><ins>+ var data = this.model.toJSON();
+
</ins><span class="cx"> this.$el.html( this.html( data ) );
</span><span class="cx">
</span><span class="cx"> themes.router.navigate( themes.router.baseUrl( '?theme=' + this.model.get( 'id' ) ), { replace: true } );
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginswpviewpluginjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/tinymce/plugins/wpview/plugin.js (28061 => 28062)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/wpview/plugin.js 2014-04-08 19:08:59 UTC (rev 28061)
+++ trunk/src/wp-includes/js/tinymce/plugins/wpview/plugin.js 2014-04-09 00:57:46 UTC (rev 28062)
</span><span class="lines">@@ -265,12 +265,20 @@
</span><span class="cx"> });
</span><span class="cx">
</span><span class="cx"> editor.dom.bind( editor.getBody(), 'mousedown mouseup click', function( event ) {
</span><del>- var view = getParentView( event.target );
</del><ins>+ var view = getParentView( event.target ),
+ deselectEventType;
</ins><span class="cx">
</span><span class="cx"> // Contain clicks inside the view wrapper
</span><span class="cx"> if ( view ) {
</span><span class="cx"> event.stopPropagation();
</span><span class="cx">
</span><ins>+ // Hack to try and keep the block resize handles from appearing. They will show on mousedown and then be removed on mouseup.
+ if ( tinymce.Env.ie <= 10 ) {
+ deselect();
+ }
+
+ select( view );
+
</ins><span class="cx"> if ( event.type === 'click' && ! event.metaKey && ! event.ctrlKey ) {
</span><span class="cx"> if ( editor.dom.hasClass( event.target, 'edit' ) ) {
</span><span class="cx"> wp.mce.views.edit( view );
</span><span class="lines">@@ -278,12 +286,20 @@
</span><span class="cx"> editor.dom.remove( view );
</span><span class="cx"> }
</span><span class="cx"> }
</span><del>- select( view );
</del><span class="cx"> // Returning false stops the ugly bars from appearing in IE11 and stops the view being selected as a range in FF.
</span><span class="cx"> // Unfortunately, it also inhibits the dragging of views to a new location.
</span><span class="cx"> return false;
</span><span class="cx"> } else {
</span><del>- if ( event.type === 'mousedown' ) {
</del><ins>+
+ // Fix issue with deselecting a view in IE8. Without this hack, clicking content above the view wouldn't actually deselect it
+ // and the caret wouldn't be placed at the mouse location
+ if( tinymce.Env.ie <= 8 ) {
+ deselectEventType = 'mouseup';
+ } else {
+ deselectEventType = 'mousedown';
+ }
+
+ if ( event.type === deselectEventType ) {
</ins><span class="cx"> deselect();
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymceskinswordpressimagesdashiconeditpng"></a>
<div class="binary"><h4>Added: trunk/src/wp-includes/js/tinymce/skins/wordpress/images/dashicon-edit.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/src/wp-includes/js/tinymce/skins/wordpress/images/dashicon-edit.png
</span><span class="cx">===================================================================
</span><del>--- trunk/src/wp-includes/js/tinymce/skins/wordpress/images/dashicon-edit.png 2014-04-08 19:08:59 UTC (rev 28061)
</del><ins>+++ trunk/src/wp-includes/js/tinymce/skins/wordpress/images/dashicon-edit.png 2014-04-09 00:57:46 UTC (rev 28062)
</ins><span class="cx">Property changes on: trunk/src/wp-includes/js/tinymce/skins/wordpress/images/dashicon-edit.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+image/png
</ins><span class="cx">\ No newline at end of property
</span><a id="trunksrcwpincludesjstinymceskinswordpressimagesdashiconnoaltpng"></a>
<div class="binary"><h4>Added: trunk/src/wp-includes/js/tinymce/skins/wordpress/images/dashicon-no-alt.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/src/wp-includes/js/tinymce/skins/wordpress/images/dashicon-no-alt.png
</span><span class="cx">===================================================================
</span><del>--- trunk/src/wp-includes/js/tinymce/skins/wordpress/images/dashicon-no-alt.png 2014-04-08 19:08:59 UTC (rev 28061)
</del><ins>+++ trunk/src/wp-includes/js/tinymce/skins/wordpress/images/dashicon-no-alt.png 2014-04-09 00:57:46 UTC (rev 28062)
</ins><span class="cx">Property changes on: trunk/src/wp-includes/js/tinymce/skins/wordpress/images/dashicon-no-alt.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+image/png
</ins><span class="cx">\ No newline at end of property
</span><a id="trunksrcwpincludesjstinymceskinswordpresswpcontentcss"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css (28061 => 28062)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css 2014-04-08 19:08:59 UTC (rev 28061)
+++ trunk/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css 2014-04-09 00:57:46 UTC (rev 28062)
</span><span class="lines">@@ -198,10 +198,14 @@
</span><span class="cx"> top: 0;
</span><span class="cx"> left: 0;
</span><span class="cx"> z-index: -1;
</span><ins>+ clip: rect(1px 1px 1px 1px); /* IE7 */
</ins><span class="cx"> clip: rect(1px, 1px, 1px, 1px);
</span><span class="cx"> overflow: hidden;
</span><span class="cx"> outline: 0;
</span><del>- width: 100%;
</del><ins>+ padding: 0;
+ border: 0;
+ width: 1px;
+ height: 1px;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="lines">@@ -214,12 +218,16 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> .wpview-wrap.selected {
</span><del>- background-color: #f2f8ff; /* fallback to old blue */
</del><span class="cx"> background-color: rgba(0,0,0,0.1);
</span><del>- border-color: #777;
</del><span class="cx"> border-color: rgba(0,0,0,0.3);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+.ie8 .wpview-wrap.selected,
+.ie7 .wpview-wrap.selected {
+ background-color: #e5e5e5;
+ border-color: #777;
+}
+
</ins><span class="cx"> .wpview-overlay {
</span><span class="cx"> position: absolute;
</span><span class="cx"> top: 0;
</span><span class="lines">@@ -263,6 +271,25 @@
</span><span class="cx"> font-size: 30px;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+.ie8 .wpview-wrap .toolbar div,
+.ie7 .wpview-wrap .toolbar div,
+.ie8 #wp-image-toolbar div,
+.ie7 #wp-image-toolbar div {
+ display: inline;
+ padding: 0;
+}
+
+.ie8 .dashicons-edit,
+.ie7 .dashicons-edit {
+ background-image: url(images/dashicon-edit.png);
+}
+
+.ie8 .dashicons-no-alt,
+.ie7 .dashicons-no-alt {
+ background-image: url(images/dashicon-no-alt.png);
+}
+
+
</ins><span class="cx"> .wpview-wrap .toolbar div:hover,
</span><span class="cx"> #wp-image-toolbar div:hover {
</span><span class="cx"> box-shadow: 0 1px 3px rgba(0,0,0,0.8);
</span><span class="lines">@@ -318,6 +345,11 @@
</span><span class="cx"> overflow-x: hidden;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+.ie7 .gallery,
+.ie8 .gallery {
+ margin: auto;
+}
+
</ins><span class="cx"> .gallery-error {
</span><span class="cx"> border: 1px solid #dedede;
</span><span class="cx"> padding: 20px 0;
</span><span class="lines">@@ -352,6 +384,11 @@
</span><span class="cx"> box-sizing: border-box;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+.ie7 .gallery .gallery-item,
+.ie8 .gallery .gallery-item {
+ padding: 6px 0;
+}
+
</ins><span class="cx"> .gallery .gallery-caption,
</span><span class="cx"> .gallery .gallery-icon {
</span><span class="cx"> margin: 0;
</span><span class="lines">@@ -374,6 +411,11 @@
</span><span class="cx"> width: 33.333%;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+.ie8 .gallery-columns-3 .gallery-item,
+.ie7 .gallery-columns-3 .gallery-item {
+ width: 33%;
+}
+
</ins><span class="cx"> .gallery-columns-4 .gallery-item {
</span><span class="cx"> width: 25%;
</span><span class="cx"> }
</span><span class="lines">@@ -383,7 +425,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> .gallery-columns-6 .gallery-item {
</span><del>- width: 16.667%;
</del><ins>+ width: 16.665%;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> .gallery-columns-7 .gallery-item {
</span></span></pre>
</div>
</div>
</body>
</html>