<!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>[29317] trunk/src/wp-includes: TinyMCE:</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/29317">29317</a></dd>
<dt>Author</dt> <dd>azaozz</dd>
<dt>Date</dt> <dd>2014-07-28 23:44:28 +0000 (Mon, 28 Jul 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>TinyMCE:
- Use `data-wp-*` for processing and styling of the `more` and `nextpage` placeholders, keep the class names for back-compat. Makes them "immune" to "Clear formatting".
- Translate the titles of the placeholders.
Fixes <a href="http://core.trac.wordpress.org/ticket/28772">#28772</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesclasswpeditorphp">trunk/src/wp-includes/class-wp-editor.php</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginswordpresspluginjs">trunk/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js</a></li>
<li><a href="#trunksrcwpincludesjstinymceskinswordpresswpcontentcss">trunk/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesclasswpeditorphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/class-wp-editor.php (29316 => 29317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/class-wp-editor.php 2014-07-28 19:54:50 UTC (rev 29316)
+++ trunk/src/wp-includes/class-wp-editor.php 2014-07-28 23:44:28 UTC (rev 29317)
</span><span class="lines">@@ -944,6 +944,7 @@
</span><span class="cx"> 'Keyboard Shortcuts' => __( 'Keyboard Shortcuts' ),
</span><span class="cx"> 'Toolbar Toggle' => __( 'Toolbar Toggle' ),
</span><span class="cx"> 'Insert Read More tag' => __( 'Insert Read More tag' ),
</span><ins>+ 'Read more...' => __( 'Read more...' ), // Title on the placeholder inside the editor
</ins><span class="cx"> 'Distraction Free Writing' => __( 'Distraction Free Writing' ),
</span><span class="cx"> );
</span><span class="cx">
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginswordpresspluginjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js (29316 => 29317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js 2014-07-28 19:54:50 UTC (rev 29316)
+++ trunk/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js 2014-07-28 23:44:28 UTC (rev 29317)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx"> }
</span><span class="cx"> });
</span><span class="cx">
</span><del>- if ( pixels && ! initial ) {
</del><ins>+ if ( pixels && ! initial ) {
</ins><span class="cx"> // Resize iframe, not needed in iOS
</span><span class="cx"> if ( ! tinymce.Env.iOS ) {
</span><span class="cx"> iframe = editor.getContentAreaContainer().firstChild;
</span><span class="lines">@@ -83,18 +83,24 @@
</span><span class="cx">
</span><span class="cx"> // Replace Read More/Next Page tags with images
</span><span class="cx"> editor.on( 'BeforeSetContent', function( e ) {
</span><ins>+ var title;
+
</ins><span class="cx"> if ( e.content ) {
</span><span class="cx"> if ( e.content.indexOf( '<!--more' ) !== -1 ) {
</span><ins>+ title = editor.editorManager.i18n.translate( 'Read more...' );
+
</ins><span class="cx"> e.content = e.content.replace( /<!--more(.*?)-->/g, function( match, moretext ) {
</span><del>- return '<img src="' + tinymce.Env.transparentSrc + '" data-wp-more="' + moretext + '" ' +
- 'class="wp-more-tag mce-wp-more" title="Read More..." data-mce-resize="false" data-mce-placeholder="1" />';
</del><ins>+ return '<img src="' + tinymce.Env.transparentSrc + '" data-wp-more="more" data-wp-more-text="' + moretext + '" ' +
+ 'class="wp-more-tag mce-wp-more" title="' + title + '" data-mce-resize="false" data-mce-placeholder="1" />';
</ins><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if ( e.content.indexOf( '<!--nextpage-->' ) !== -1 ) {
</span><ins>+ title = editor.editorManager.i18n.translate( 'Page break' );
+
</ins><span class="cx"> e.content = e.content.replace( /<!--nextpage-->/g,
</span><del>- '<img src="' + tinymce.Env.transparentSrc + '" class="wp-more-tag mce-wp-nextpage" ' +
- 'title="Page break" data-mce-resize="false" data-mce-placeholder="1" />' );
</del><ins>+ '<img src="' + tinymce.Env.transparentSrc + '" data-wp-more="nextpage" class="wp-more-tag mce-wp-nextpage" ' +
+ 'title="' + title + '" data-mce-resize="false" data-mce-placeholder="1" />' );
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> });
</span><span class="lines">@@ -105,16 +111,14 @@
</span><span class="cx"> e.content = e.content.replace(/<img[^>]+>/g, function( image ) {
</span><span class="cx"> var match, moretext = '';
</span><span class="cx">
</span><del>- if ( image.indexOf('wp-more-tag') !== -1 ) {
- if ( image.indexOf('mce-wp-more') !== -1 ) {
- if ( match = image.match( /data-wp-more="([^"]+)"/ ) ) {
- moretext = match[1];
- }
</del><ins>+ if ( image.indexOf( 'data-wp-more="more"' ) !== -1 ) {
+ if ( match = image.match( /data-wp-more-text="([^"]+)"/ ) ) {
+ moretext = match[1];
+ }
</ins><span class="cx">
</span><del>- image = '<!--more' + moretext + '-->';
- } else if ( image.indexOf('mce-wp-nextpage') !== -1 ) {
- image = '<!--nextpage-->';
- }
</del><ins>+ image = '<!--more' + moretext + '-->';
+ } else if ( image.indexOf( 'data-wp-more="nextpage"' ) !== -1 ) {
+ image = '<!--nextpage-->';
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> return image;
</span><span class="lines">@@ -123,16 +127,11 @@
</span><span class="cx"> });
</span><span class="cx">
</span><span class="cx"> // Display the tag name instead of img in element path
</span><del>- editor.on( 'ResolveName', function( e ) {
- var dom = editor.dom,
- target = e.target;
</del><ins>+ editor.on( 'ResolveName', function( event ) {
+ var attr;
</ins><span class="cx">
</span><del>- if ( target.nodeName === 'IMG' && dom.hasClass( target, 'wp-more-tag' ) ) {
- if ( dom.hasClass( target, 'mce-wp-more' ) ) {
- e.name = 'more';
- } else if ( dom.hasClass( target, 'mce-wp-nextpage' ) ) {
- e.name = 'nextpage';
- }
</del><ins>+ if ( event.target.nodeName === 'IMG' && ( attr = editor.dom.getAttrib( event.target, 'data-wp-more' ) ) ) {
+ event.name = attr;
</ins><span class="cx"> }
</span><span class="cx"> });
</span><span class="cx">
</span><span class="lines">@@ -145,9 +144,10 @@
</span><span class="cx">
</span><span class="cx"> tag = tag || 'more';
</span><span class="cx"> classname += ' mce-wp-' + tag;
</span><del>- title = tag === 'more' ? 'More...' : 'Next Page';
</del><ins>+ title = tag === 'more' ? 'Read more...' : 'Next page';
+ title = editor.editorManager.i18n.translate( title );
</ins><span class="cx"> html = '<img src="' + tinymce.Env.transparentSrc + '" title="' + title + '" class="' + classname + '" ' +
</span><del>- 'data-mce-resize="false" data-mce-placeholder="1" />';
</del><ins>+ 'data-wp-more="' + tag + '" data-mce-resize="false" data-mce-placeholder="1" />';
</ins><span class="cx">
</span><span class="cx"> // Most common case
</span><span class="cx"> if ( node.nodeName === 'BODY' || ( node.nodeName === 'P' && node.parentNode.nodeName === 'BODY' ) ) {
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymceskinswordpresswpcontentcss"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css (29316 => 29317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css 2014-07-28 19:54:50 UTC (rev 29316)
+++ trunk/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css 2014-07-28 23:44:28 UTC (rev 29317)
</span><span class="lines">@@ -122,8 +122,7 @@
</span><span class="cx"> padding: 0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-.mce-content-body img.mce-wp-nextpage,
-.mce-content-body img.mce-wp-more {
</del><ins>+.mce-content-body img[data-wp-more] {
</ins><span class="cx"> border: 0;
</span><span class="cx"> -webkit-box-shadow: none;
</span><span class="cx"> box-shadow: none;
</span><span class="lines">@@ -135,16 +134,15 @@
</span><span class="cx"> cursor: default;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-.mce-content-body img.mce-wp-nextpage[data-mce-selected],
-.mce-content-body img.mce-wp-more[data-mce-selected] {
</del><ins>+.mce-content-body img[data-wp-more][data-mce-selected] {
</ins><span class="cx"> outline: 1px dotted #888;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-.mce-content-body img.mce-wp-more {
</del><ins>+.mce-content-body img[data-wp-more="more"] {
</ins><span class="cx"> background: transparent url( images/more.png ) repeat-y scroll center center;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-.mce-content-body img.mce-wp-nextpage {
</del><ins>+.mce-content-body img[data-wp-more="nextpage"] {
</ins><span class="cx"> background: transparent url( images/pagebreak.png ) repeat-y scroll center center;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>