Ticket #23396: revisions-page-combinedview-WYSIWYG-2-alternate.diff
File revisions-page-combinedview-WYSIWYG-2-alternate.diff, 11.2 KB (added by , 12 years ago) |
---|
-
wp-includes/post-template.php
1371 1371 } 1372 1372 1373 1373 /* translators: post revision: 1: when, 2: author name */ 1374 $titlef = _x( ' %1$s by%2$s', 'post revision' );1374 $titlef = _x( '<strong>%1$s:</strong> %2$s', 'post revision' ); 1375 1375 1376 1376 if ( $parent ) 1377 1377 array_unshift( $revisions, $post ); … … 1387 1387 1388 1388 $date = wp_post_revision_title( $revision ); 1389 1389 $name = get_the_author_meta( 'display_name', $revision->post_author ); 1390 1390 1391 1391 1392 if ( 'form-table' == $format ) { 1392 1393 if ( $left ) … … 1402 1403 else 1403 1404 $actions = ''; 1404 1405 1406 $avatar = get_avatar( $revision->post_author, 24 ); 1405 1407 $rows .= "<tr$class>\n"; 1406 1408 $rows .= "\t<th style='white-space: nowrap' scope='row'><input type='radio' name='left' value='$revision->ID'$left_checked /></th>\n"; 1407 1409 $rows .= "\t<th style='white-space: nowrap' scope='row'><input type='radio' name='right' value='$revision->ID'$right_checked /></th>\n"; 1408 $rows .= "\t<td>$date</td>\n"; 1409 $rows .= "\t<td>$name</td>\n"; 1410 $rows .= "\t<td class='revision-details'>$avatar <strong>$name:</strong> $date</td>\n"; 1410 1411 $rows .= "\t<td class='action-links'>$actions</td>\n"; 1411 1412 $rows .= "</tr>\n"; 1412 1413 } else { 1413 $title = sprintf( $titlef, $date, $name ); 1414 $rows .= "\t<li>$title</li>\n"; 1414 $avatar = get_avatar( $revision->post_author, 18 ); 1415 $title = sprintf( $titlef, $name, $date ); 1416 $rows .= "\t<li>$avatar $title</li>\n"; 1415 1417 } 1416 1418 } 1417 1419 … … 1432 1434 <table class="widefat post-revisions" cellspacing="0" id="post-revisions"> 1433 1435 <col /> 1434 1436 <col /> 1435 <col style="width: 33%" /> 1436 <col style="width: 33%" /> 1437 <col style="width: 33%" /> 1437 <col style="width: 75%" /> 1438 <col style="width: 10%" /> 1438 1439 <thead> 1439 1440 <tr> 1440 1441 <th scope="col"><?php /* translators: column name in revisions */ _ex( 'Old', 'revisions column name' ); ?></th> 1441 1442 <th scope="col"><?php /* translators: column name in revisions */ _ex( 'New', 'revisions column name' ); ?></th> 1442 <th scope="col"><?php /* translators: column name in revisions */ _ex( 'Date Created', 'revisions column name' ); ?></th> 1443 <th scope="col"><?php _e( 'Author' ); ?></th> 1443 <th scope="col"><?php /* translators: column name in revisions */ _ex( 'Revision Details', 'revisions column name' ); ?></th> 1444 1444 <th scope="col" class="action-links"><?php _e( 'Actions' ); ?></th> 1445 1445 </tr> 1446 1446 </thead> -
wp-includes/wp-diff.php
98 98 * @return string 99 99 */ 100 100 function addedLine( $line ) { 101 return "<td> +</td><td class='diff-addedline'>{$line}</td>";101 return "<td><div class='diff-addedline-leftcol'>{$line}</div></td><td class='ltype'><div class='diff-addedline'>" . __("Added") . "</div></td>"; 102 102 } 103 103 104 104 /** … … 108 108 * @return string 109 109 */ 110 110 function deletedLine( $line ) { 111 return "<td> -</td><td class='diff-deletedline'>{$line}</td>";111 return "<td><div class='diff-deletedline-leftcol'>{$line}</div></td><td class='ltype'><div class='diff-deletedline'>" . __( "Removed" ) . "</div></td>"; 112 112 } 113 113 114 114 /** … … 118 118 * @return string 119 119 */ 120 120 function contextLine( $line ) { 121 return "<td> </td><td class='diff-context'>{$line}</td>";121 return "<td><div class='diff-context'>{$line}</div></td>"; 122 122 } 123 123 124 124 /** … … 127 127 * @return string 128 128 */ 129 129 function emptyLine() { 130 return '<td c olspan="2"> </td>';130 return '<td class="ltype"> </td>'; 131 131 } 132 132 133 133 /** … … 142 142 $r = ''; 143 143 foreach ($lines as $line) { 144 144 if ( $encode ) 145 $line = htmlspecialchars( $line );146 $r .= '<tr>' . $this-> emptyLine() . $this->addedLine( $line ) . "</tr>\n";145 $line = wp_kses_post( $line ); 146 $r .= '<tr>' . $this->addedLine( $line ) . "</tr>\n"; 147 147 } 148 148 return $r; 149 149 } … … 160 160 $r = ''; 161 161 foreach ($lines as $line) { 162 162 if ( $encode ) 163 $line = htmlspecialchars( $line );164 $r .= '<tr>' . $this->deletedLine( $line ) . $this->emptyLine() ."</tr>\n";163 $line = wp_kses_post( $line ); 164 $r .= '<tr>' . $this->deletedLine( $line ) . "</tr>\n"; 165 165 } 166 166 return $r; 167 167 } … … 178 178 $r = ''; 179 179 foreach ($lines as $line) { 180 180 if ( $encode ) 181 $line = htmlspecialchars( $line );181 $line = wp_kses_post( $line ); 182 182 $r .= '<tr>' . 183 $this->contextLine( $line ) . $this-> contextLine( $line) . "</tr>\n";183 $this->contextLine( $line ) . $this->emptyLine() . "</tr>\n"; 184 184 } 185 185 return $r; 186 186 } … … 248 248 if ( isset( $orig_diffs[$orig_rows[$row]] ) ) 249 249 $orig_line = $orig_diffs[$orig_rows[$row]]; 250 250 elseif ( isset( $orig[$orig_rows[$row]] ) ) 251 $orig_line = htmlspecialchars($orig[$orig_rows[$row]]);251 $orig_line = wp_kses_post($orig[$orig_rows[$row]]); 252 252 else 253 253 $orig_line = ''; 254 254 255 255 if ( isset( $final_diffs[$final_rows[$row]] ) ) 256 256 $final_line = $final_diffs[$final_rows[$row]]; 257 257 elseif ( isset( $final[$final_rows[$row]] ) ) 258 $final_line = htmlspecialchars($final[$final_rows[$row]]);258 $final_line = wp_kses_post($final[$final_rows[$row]]); 259 259 else 260 260 $final_line = ''; 261 261 … … 264 264 } elseif ( $final_rows[$row] < 0 ) { // Final is blank. This is really a deleted row. 265 265 $r .= $this->_deleted( array($orig_line), false ); 266 266 } else { // A true changed row. 267 $r .= '<tr>' . $this->deletedLine( $orig_line ) . $this->addedLine( $final_line ) . "</tr>\n";267 $r .= '<tr>' . $this->deletedLine( $orig_line ) . '</tr><tr>' . $this->addedLine( $final_line ) . "</tr>\n"; 268 268 } 269 269 } 270 270 -
wp-includes/pluggable.php
1722 1722 return ''; 1723 1723 1724 1724 $r = "<table class='diff'>\n"; 1725 $r .= "<col class=' ltype' /><col class='content' /><col class='ltype' /><col class='content' />";1725 $r .= "<col class='content' /><col class='ltype' />"; 1726 1726 1727 1727 if ( $args['title'] || $args['title_left'] || $args['title_right'] ) 1728 1728 $r .= "<thead>"; 1729 1729 if ( $args['title'] ) 1730 $r .= "<tr class='diff-title'><th colspan=' 4'>$args[title]</th></tr>\n";1730 $r .= "<tr class='diff-title'><th colspan='3'>$args[title]</th></tr>\n"; 1731 1731 if ( $args['title_left'] || $args['title_right'] ) { 1732 1732 $r .= "<tr class='diff-sub-title'>\n"; 1733 $r .= "\t<t d></td><th>$args[title_left]</th>\n";1734 $r .= "\t<t d></td><th>$args[title_right]</th>\n";1733 $r .= "\t<th>$args[title_left]</th>\n"; 1734 $r .= "\t<th>$args[title_right]</th>\n"; 1735 1735 $r .= "</tr>\n"; 1736 1736 } 1737 1737 if ( $args['title'] || $args['title_left'] || $args['title_right'] ) -
wp-admin/revision.php
153 153 154 154 <h2 class="long-header"><?php echo $h2; ?></h2> 155 155 156 <table class="form-table ie-fixed ">156 <table class="form-table ie-fixed revision-compare"> 157 157 <col class="th" /> 158 158 <?php if ( 'diff' == $action ) : ?> 159 159 <tr id="revision"> 160 <th scope="row"></th>161 160 <th scope="col" class="th-full"> 162 <span class="alignleft"><?php printf( __('Older: %s'), wp_post_revision_title( $left_revision ) ); ?></span> 163 <span class="alignright"><?php printf( __('Newer: %s'), wp_post_revision_title( $right_revision ) ); ?></span> 161 <span class="revision-details" ><?php 162 printf( __('<strong>Comparing from:</strong> %s, created by: '), wp_post_revision_title( $left_revision ) ); 163 echo get_avatar( $left_revision->post_author, 18 ) . get_the_author_meta( 'display_name', $left_revision->post_author ); 164 ?> 165 </span> <br /> 166 <span class="revision-details"><?php 167 printf( __('<strong>Comparing to:</strong> %s, created by: '), wp_post_revision_title( $right_revision ) ); 168 echo get_avatar( $right_revision->post_author, 18 ) .get_the_author_meta( 'display_name', $right_revision->post_author ); 169 ?> 164 170 </th> 165 171 </tr> 166 172 <?php endif; … … 175 181 continue; // There is no difference between left and right 176 182 $identical = false; 177 183 } else { 178 add_filter( "_wp_post_revision_field_$field", ' htmlspecialchars' );184 add_filter( "_wp_post_revision_field_$field", 'wp_kses_post' ); 179 185 $content = apply_filters( "_wp_post_revision_field_$field", $revision->$field, $field ); 180 186 } 181 187 ?> 182 188 183 189 <tr id="revision-field-<?php echo $field; ?>"> 184 <th scope="row"><?php echo esc_html( $field_title ); ?></th>185 190 <td><div class="pre"><?php echo $content; ?></div></td> 186 191 </tr> 187 192 … … 203 208 204 209 </table> 205 210 206 <br class="clear" /> 207 211 <div id="revisions-detail-list"> 208 212 <h3><?php echo $title; ?></h3> 209 213 210 214 <?php … … 216 220 wp_list_post_revisions( $post, $args ); 217 221 218 222 ?> 219 220 223 </div> 224 </div> 221 225 222 226 <?php 223 227 require_once( './admin-footer.php' ); -
wp-admin/css/colors-fresh.css
1350 1350 1351 1351 /* Diff */ 1352 1352 table.diff .diff-deletedline { 1353 background-color: #fdd; 1353 background-color: #c33; 1354 padding:10px; 1355 margin:2px; 1356 -webkit-border-radius: 5px; 1357 border-radius: 5px; 1358 color: #fff; 1359 text-align: center; 1354 1360 } 1361 table.diff .diff-deletedline-leftcol { 1362 color: #c33; 1363 padding:10px; 1364 margin:2px; 1365 -webkit-border-radius: 5px; 1366 border-radius: 5px; 1367 } 1355 1368 1369 table.diff .diff-context { 1370 padding:10px; 1371 margin:2px; 1372 -webkit-border-radius: 5px; 1373 border-radius: 5px; 1374 } 1375 1376 table.diff .diff-context:hover { 1377 background-color: #FFE; 1378 } 1379 1356 1380 table.diff .diff-deletedline del { 1357 background-color: #f 99;1381 background-color: #f33; 1358 1382 } 1359 1383 1360 1384 table.diff .diff-addedline { 1361 background-color: #dfd; 1385 background-color: #3a3; 1386 padding:10px; 1387 margin:2px; 1388 -webkit-border-radius: 5px; 1389 border-radius: 5px; 1390 color: #fff; 1391 text-align: center; 1362 1392 } 1363 1393 1394 table.diff .diff-addedline-leftcol { 1395 color: #3a3; 1396 padding:10px; 1397 margin:2px; 1398 -webkit-border-radius: 5px; 1399 border-radius: 5px; 1400 } 1401 1364 1402 table.diff .diff-addedline ins { 1365 background-color: # 9f9;1403 background-color: #3f3; 1366 1404 } 1367 1405 1368 1406 #att-info { -
wp-admin/css/wp-admin.css
3436 3436 } 3437 3437 3438 3438 table.diff col.content { 3439 width: 50%;3439 width: auto; 3440 3440 } 3441 3441 3442 3442 table.diff tr { … … 8585 8585 .locale-lt-lt .inline-edit-row fieldset label span.input-text-wrap { 8586 8586 margin-left: 8em; 8587 8587 } 8588 ul.post-revisions img { 8589 float: left; 8590 margin: 2px; 8591 } 8592 ul.post-revisions li { 8593 border-bottom: 1px solid #FFF; 8594 } 8595 ul.post-revisions li a { 8596 line-height: 24px; 8597 } 8598 table#post-revisions tr td.revision-details, span.revision-details { 8599 line-height: 30px; 8600 padding: 0; 8601 height: 30px; 8602 vertical-align: middle;; 8603 } 8604 .form-table #revision th{ 8605 padding-left: 28px; 8606 } 8607 table#post-revisions tr td img { 8608 float: left; 8609 margin: 4px; 8610 } 8611 span.revision-details img { 8612 margin: 1px; 8613 vertical-align: middle; 8614 } 8615 .diff .ltype { 8616 width: 100px; 8617 } 8618 tr#revision-field-post_title td div { 8619 font-size: 150%; 8620 font-weight: bold; 8621 } 8622 @media screen and (min-width: 1200px) { 8623 .revision-compare { 8624 float: right; 8625 width: 70%; 8626 } 8627 #revisions-detail-list { 8628 float: left; 8629 width: 30%; 8630 } 8631 } 8632 No newline at end of file