Ticket #23497: 23497.11.diff
File 23497.11.diff, 70.3 KB (added by , 12 years ago) |
---|
-
wp-includes/post-template.php
1300 1300 if ( !in_array( $revision->post_type, array( 'post', 'page', 'revision' ) ) ) 1301 1301 return false; 1302 1302 1303 $author = get_the_author_meta( 'display_name', $revision->post_author ); 1303 1304 /* translators: revision date format, see http://php.net/date */ 1304 $datef = _x( 'j F, Y @ G:i', 'revision date format'); 1305 /* translators: 1: date */ 1305 $datef = _x( 'j F, Y @ G:i:s', 'revision date format'); 1306 1307 $gravatar = get_avatar( $revision->post_author, 18 ); 1308 1309 $date = date_i18n( $datef, strtotime( $revision->post_modified ) ); 1310 1311 $revision_date_author = sprintf( 1312 '%s %s, %s %s (%s)', 1313 $gravatar, 1314 $author, 1315 human_time_diff( strtotime( $revision->post_modified ), current_time( 'timestamp' ) ), 1316 __( ' ago ' ), 1317 $date 1318 ); 1319 1306 1320 $autosavef = __( '%1$s [Autosave]' ); 1307 /* translators: 1: date */1308 1321 $currentf = __( '%1$s [Current Revision]' ); 1309 1322 1310 $date = date_i18n( $datef, strtotime( $revision->post_modified ) );1311 if ( $link && current_user_can( 'edit_post', $revision->ID ) && $link = get_edit_post_link( $revision->ID ) )1312 $date = "<a href='$link'>$date</a>";1313 1314 1323 if ( !wp_is_post_revision( $revision ) ) 1315 $ date = sprintf( $currentf, $date);1324 $revision_date_author = sprintf( $currentf, $revision_date_author ); 1316 1325 elseif ( wp_is_post_autosave( $revision ) ) 1317 $ date = sprintf( $autosavef, $date);1326 $revision_date_author = sprintf( $autosavef, $revision_date_author ); 1318 1327 1319 return $ date;1328 return $revision_date_author; 1320 1329 } 1321 1330 1322 1331 /** … … 1461 1470 endif; 1462 1471 1463 1472 } 1473 1474 1475 /** 1476 * Display information about a post's revisions as well as a link into the revisions system 1477 * 1478 * 1479 * @package WordPress 1480 * @subpackage Post_Revisions 1481 * @since 3.6.0 1482 * 1483 * @uses wp_get_post_revisions() 1484 * @uses get_post() 1485 * @uses post_type_supports() 1486 * @uses wp_post_revision_title() 1487 * 1488 * @param int|object $post_id Post ID or post object. 1489 * @return null 1490 */ 1491 function wp_post_revisions_meta( $post_id = 0 ) { 1492 if ( !$post = get_post( $post_id ) ) 1493 return; 1494 1495 $the_revisions = wp_get_post_revisions( $post_id ); 1496 $the_revisions_count = count( $the_revisions ) - 1; 1497 if ( post_type_supports( $post->post_type, 'revisions' ) && $the_revisions_count ) { 1498 ?> 1499 <div id="post-revisions-meta"> 1500 <div id="revisions-meta-stored"> 1501 <?php printf( _n( 'There is %d stored revisions for this post.', 'There are %d stored revisions for this post.', $the_revisions_count ), $the_revisions_count ); ?> 1502 </div> 1503 <div id="revisions-meta-mostrecent"> 1504 <?php printf( __( ' Most recent revision by %s.' ), wp_post_revision_title( array_shift( $the_revisions ) ) ); ?> 1505 </div> 1506 <?php if ( $the_revisions_count > 1 ) { ?> 1507 <div id="revisions-meta-oldest"> 1508 <?php printf( __( ' Oldest revision by %s.' ), wp_post_revision_title( array_pop( $the_revisions ) ) ); ?> 1509 </div> 1510 <?php 1511 } //only show link if more than one revision, TODO get working with one revision only 1512 1513 if ( $restoredfrommeta = get_post_meta( $post->ID, '_post_restored_from', true ) ) { 1514 $author = get_the_author_meta( 'display_name', $restoredfrommeta[ 'restored_by_user' ] ); 1515 /* translators: revision date format, see http://php.net/date */ 1516 $datef = _x( 'j F, Y @ G:i:s', 'revision date format'); 1517 $date = date_i18n( $datef, strtotime( $restoredfrommeta[ 'restored_time' ] ) ); 1518 $timesince = human_time_diff( $restoredfrommeta[ 'restored_time' ], current_time( 'timestamp' ) ) . __( ' ago ' ); 1519 ?> 1520 <div id="revisions-meta-restored"> 1521 <?php 1522 printf( 'Previously restored from Revision ID %d, %s by %s (%s)', 1523 $restoredfrommeta[ 'restored_revision_id'], 1524 $timesince, 1525 $author, 1526 $date ); 1527 ?> 1528 </div> 1529 <?php 1530 } 1531 ?> 1532 1533 <div id="revisions-meta-link" ]> 1534 <a href="<?php printf( 'revision.php?revision=%s&postid=%s&action=edit', key( $the_revisions ), $post->ID )?>" class="edit-revisions hide-if-no-js"> 1535 <?php _e( 'View and compare revisions' ); ?> 1536 </a> 1537 1538 </div> 1539 </div> 1540 <?php 1541 1542 1543 } 1544 } -
wp-includes/js/template.js
1 window.wp = window.wp || {}; 2 3 (function ($) { 4 var template; 5 /** 6 * wp.template( id ) 7 * 8 * Fetches a template by id. 9 * 10 * @param {string} id A string that corresponds to a DOM element with an id prefixed with "tmpl-". 11 * For example, "attachment" maps to "tmpl-attachment". 12 * @return {function} A function that lazily-compiles the template requested. 13 */ 14 template = wp.template = _.memoize(function ( id ) { 15 var compiled, 16 options = { 17 evaluate: /<#([\s\S]+?)#>/g, 18 interpolate: /\{\{\{([\s\S]+?)\}\}\}/g, 19 escape: /\{\{([^\}]+?)\}\}(?!\})/g, 20 variable: 'data' 21 }; 22 23 return function ( data ) { 24 compiled = compiled || _.template( $( '#tmpl-' + id ).html(), null, options ); 25 return compiled( data ); 26 }; 27 }); 28 29 }(jQuery)); -
wp-includes/js/revisions.js
1 window.wp = window.wp || {}; 2 3 (function($) { 4 wp.revisions = { 5 6 views : {}, 7 8 Model : Backbone.Model.extend({ 9 defaults: { 10 ID : 0, 11 revision_date_author : '', 12 revisiondiff : '', 13 restoreaction: '', 14 diff_max : 0, 15 diff_count : 0, 16 diff_revision_to : 0, 17 revision_from_date_author : '', 18 } 19 }), 20 21 app: _.extend({}, Backbone.Events), 22 23 App : Backbone.Router.extend({ 24 _revisionDifflView : null, 25 _revisions : null, 26 _left_handle_revisions : null, 27 _right_handle_revisions : null, 28 _revisionsInteractions : null, 29 _revisionsOptions : null, 30 _left_diff : 0, 31 _right_diff : 1, 32 _autosaves : false, 33 _showsplitview : true, 34 _compareoneortwo : 1, 35 left_model_loading : false, //keep track of model loads 36 right_model_loading : false, //disallow slider interaction, also repeat loads, while loading 37 38 //TODO add ability to arrive on specific revision 39 routes : { 40 "viewrevision/:revision": "viewrevision", 41 }, 42 43 viewrevision : function( revision ) { 44 //coming soon 45 }, 46 47 start_left_model_loading : function() { 48 this.left_model_loading = true; 49 $('.revisiondiffcontainer').addClass('leftmodelloading'); 50 }, 51 52 stop_left_model_loading : function() { 53 this.left_model_loading = false; 54 $('.revisiondiffcontainer').removeClass('leftmodelloading'); 55 }, 56 57 start_right_model_loading : function() { 58 this.right_model_loading = true; 59 $('.revisiondiffcontainer').addClass('rightmodelloading'); 60 }, 61 62 stop_right_model_loading : function() { 63 this.right_model_loading = false; 64 $('.revisiondiffcontainer').removeClass('rightmodelloading'); 65 }, 66 67 reloadmodel : function() { 68 if ( 2 == this._compareoneortwo ) { 69 this.reloadleftright(); 70 } else { 71 this.reloadmodelsingle(); 72 } 73 }, 74 75 reloadmodelsingle : function() { 76 var self = this; 77 self._revisions.url = ajaxurl + '?action=revisions-data&compareto=' + postid + 78 '&showautosaves=' + self.self_autosaves + 79 '&showsplitview=' + REVAPP._showsplitview; 80 self.start_right_model_loading(); 81 this._revisions.fetch({ //reload revision data 82 success : function() { 83 self.stop_right_model_loading(); 84 var revisioncount = self._revisions.length; 85 if ( self._right_diff > revisioncount ) //if right handle past rightmost, move 86 self._right_diff = revisioncount; 87 //TODO add a test for matchind left revision and push left, testing 88 //also reset the slider values here 89 90 self._revisionView.render(); 91 $( '#slider' ).slider( 'option', 'max', revisioncount-1 ); //TODO test this 92 }, 93 94 error : function () { 95 self.stop_right_model_loading(); 96 window.console && console.log( 'Error loading revision data' ); 97 } 98 99 }); 100 }, 101 102 reloadleftright : function() { 103 var self = this; 104 self.start_left_model_loading(); 105 self.start_right_model_loading(); 106 107 self._left_handle_revisions = new wp.revisions.Collection(); 108 self._right_handle_revisions = new wp.revisions.Collection(); 109 110 if ( 0 == self._left_diff ) { 111 self._right_handle_revisions.url = 112 ajaxurl + 113 '?action=revisions-data&compareto=' + postid + 114 '&postid=' + postid + 115 '&showautosaves=' + self._autosaves + 116 '&showsplitview=' + self._showsplitview; 117 } else { 118 self._right_handle_revisions.url = 119 ajaxurl + 120 '?action=revisions-data&compareto=' + self._revisions.at( self._left_diff - 1 ).get( 'ID' ) + 121 '&postid=' + postid + 122 '&showautosaves=' + self._autosaves + 123 '&showsplitview=' + self._showsplitview; 124 } 125 126 self._left_handle_revisions.url = 127 ajaxurl + 128 '?action=revisions-data&compareto=' + self._revisions.at( self._right_diff - 1 ).get( 'ID' ) + 129 '&postid=' + postid + 130 '&showautosaves=' + self._autosaves + 131 '&showsplitview=' + self._showsplitview; 132 133 self._left_handle_revisions.fetch({ 134 135 xhr: function() { 136 var xhr = $.ajaxSettings.xhr(); 137 xhr.onprogress = self.handleProgress; 138 return xhr; 139 }, 140 141 handleProgress: function(evt){ 142 var percentComplete = 0; 143 if (evt.lengthComputable) { 144 percentComplete = evt.loaded / evt.total; 145 window.console && console.log( Math.round( percentComplete * 100) + "%" ); 146 } 147 }, 148 149 success : function(){ 150 self.stop_left_model_loading(); 151 }, 152 153 error : function () { 154 window.console && console.log( 'Error loading revision data' ); 155 self.stop_left_model_loading(); 156 } 157 }); 158 159 self._right_handle_revisions.fetch({ 160 161 success : function(){ 162 self.stop_right_model_loading(); 163 }, 164 165 error : function () { 166 window.console && console.log( 'Error loading revision data' ); 167 self.stop_right_model_loading(); 168 } 169 }); 170 }, 171 172 /* 173 * initialize the revision appl;ication 174 */ 175 initialize : function( options ) { 176 var self = this; //store the application instance 177 if (this._revisions === null) { 178 self._autosaves = ''; 179 self._revisions = new wp.revisions.Collection(); //set up collection 180 self.start_right_model_loading(); 181 self._revisions.fetch({ //load revision data 182 183 success : function() { 184 self.stop_right_model_loading(); 185 self.revisionDiffSetup(); 186 } 187 }); 188 } 189 return this; 190 }, 191 192 revisionDiffSetup : function() { 193 var self = this, slider; 194 195 this._revisionView = new wp.revisions.views.View({ 196 model : this._revisions 197 }); 198 this._revisionView.render(); 199 200 this._revisionsInteractions = new wp.revisions.views.Interact({ 201 model : this._revisions 202 }); 203 this._revisionsInteractions.render(); 204 205 this._revisionsOptions = new wp.revisions.views.Options({ 206 model : this._revisions 207 }); 208 this._revisionsOptions.render(); 209 210 } 211 }) 212 }; 213 214 wp.revisions.Collection = Backbone.Collection.extend({ 215 model : wp.revisions.Model, 216 url : ajaxurl + '?action=revisions-data&compareto=' + postid + '&showautosaves=false&showsplitview=true' 217 }); 218 219 _.extend(wp.revisions.views, { 220 // 221 //primary revision diff view 222 // 223 View : Backbone.View.extend({ 224 el : $('#backbonerevisionsdiff')[0], 225 tagName : 'revisionvview', 226 className : 'revisionview-container', 227 template : wp.template('revision'), 228 revvapp : null, 229 comparetwochecked : '', 230 draggingleft : false, 231 232 initialize : function(){ 233 }, 234 235 // 236 //render the revisions 237 // 238 render : function() { 239 var addhtml = ''; 240 //compare two revisions mode? 241 if ( 2 == REVAPP._compareoneortwo ) { 242 this.comparetwochecked = 'checked'; 243 if ( this.draggingleft ) { 244 if ( this.model.at( REVAPP._left_diff ) ) { 245 addhtml = this.template( _.extend( 246 this.model.at( REVAPP._left_diff ).toJSON(), 247 { comparetwochecked : this.comparetwochecked } //keep the checkmark checked 248 ) ); 249 } 250 } else { //dragging right handle 251 var thediff = REVAPP._right_diff; 252 if ( this.model.at( thediff ) ) { 253 addhtml = this.template( _.extend( 254 this.model.at( thediff ).toJSON(), 255 { comparetwochecked : this.comparetwochecked } //keep the checkmark checked 256 ) ); 257 } 258 } 259 } else { //end compare two revisions mode, eg only one slider handel 260 this.comparetwochecked = ''; 261 if ( this.model.at( REVAPP._right_diff - 1 ) ) { 262 addhtml = this.template( _.extend( 263 this.model.at( REVAPP._right_diff-1 ).toJSON(), 264 { comparetwochecked : this.comparetwochecked } //keep the checkmark checked 265 ) ); 266 } 267 } 268 this.$el.html( addhtml ); 269 return this; 270 }, 271 272 //the compare two button is in this view, add the interaction here 273 events : { 274 'click #comparetwo' : 'clickcomparetwo' 275 }, 276 277 // 278 //turn on/off the compare two mmode 279 // 280 clickcomparetwo : function(){ 281 self = this; 282 if ( $( 'input#comparetwo' ).is( ':checked' ) ) { 283 REVAPP._compareoneortwo = 2 ; 284 REVAPP.reloadleftright(); 285 } else { 286 REVAPP._compareoneortwo = 1 ; 287 REVAPP._revisionView.draggingleft = false; 288 REVAPP._left_diff = 0; 289 REVAPP.reloadmodelsingle(); 290 } 291 REVAPP._revisionsInteractions.render(); 292 } 293 }), 294 295 // 296 //options view for show autosaves and show split view options 297 // 298 Options : Backbone.View.extend({ 299 el : $('#backbonerevisionsoptions')[0], 300 tagName : 'revisionoptionsview', 301 className : 'revisionoptions-container', 302 template : wp.template('revisionoptions'), 303 304 initialize : function() { 305 }, 306 307 //render the options view 308 render : function() { 309 var addhtml = this.template; 310 this.$el.html( addhtml ); 311 return this; 312 }, 313 314 //add options interactions 315 events : { 316 'click #toggleshowautosaves' : 'toggleshowautosaves', 317 'click #showsplitview' : 'showsplitview' 318 }, 319 320 // 321 //toggle include autosaves 322 // 323 toggleshowautosaves : function() { 324 var self = this; 325 if ( $( '#toggleshowautosaves' ).is( ':checked' ) ) { 326 REVAPP._autosaves = true ; 327 } else { 328 REVAPP._autosaves = false ; 329 } 330 //refresh the model data 331 332 REVAPP.reloadmodel(); 333 //TODO check for two handle mode 334 335 }, 336 337 // 338 //toggle showing the split diff view 339 // 340 showsplitview : function() { 341 var self = this; 342 343 if ( $( 'input#showsplitview' ).is( ':checked' ) ) { 344 REVAPP._showsplitview = 'true'; 345 $('.revisiondiffcontainer').addClass('diffsplit'); 346 } else { 347 REVAPP._showsplitview = ''; 348 $('.revisiondiffcontainer').removeClass('diffsplit'); 349 } 350 351 REVAPP.reloadmodel(); 352 } 353 }), 354 355 // 356 //main interactions view 357 // 358 Interact : Backbone.View.extend({ 359 el : $('#backbonerevisionsinteract')[0], 360 tagName : 'revisionvinteract', 361 className : 'revisionvinteract-container', 362 template : wp.template('revisionvinteract'), 363 364 initialize : function() { 365 }, 366 367 render : function() { 368 var self = this; 369 370 var addhtml = this.template; 371 this.$el.html( addhtml ); 372 $( '#diff_max, #diff_maxof' ).html( this.model.length ); 373 $( '#diff_count' ).html( REVAPP._right_diff ); 374 $( '#diff_left_count_inner' ).html( 0 == REVAPP._left_diff ? '' : 'revision' + REVAPP._left_diff ); 375 376 var modelcount = REVAPP._revisions.length; 377 378 slider = $("#slider"); 379 if ( 1 == REVAPP._compareoneortwo ) { 380 //set up the slider with a single handle 381 slider.slider({ 382 value : REVAPP._right_diff-1, 383 min : 0, 384 max : modelcount-1, 385 step : 1, 386 387 //slide interactions for one handles slider 388 slide : function( event, ui ) { 389 if ( REVAPP.right_model_loading ) //left model stoll loading, prevent sliding left handle 390 return false; 391 392 REVAPP._right_diff =( ui.value+1 ); 393 $( '#diff_count' ).html( REVAPP._right_diff ); 394 REVAPP._revisionView.render(); 395 } 396 }); 397 $( '.revisiondiffcontainer' ).removeClass( 'comparetwo' ); 398 } else { //comparing more than one, eg 2 399 //set up the slider with two handles 400 slider.slider({ 401 values : [ REVAPP._left_diff, REVAPP._right_diff + 1 ], 402 min : 1, 403 max : modelcount+1, 404 step : 1, 405 range: true, 406 407 //in two handled mode when user starts dragging, swap in precalculated diff for handle 408 start : function (event, ui ) { 409 var index = $( ui.handle ).index(); //0 (left) or 1 (right) 410 411 switch ( index ) { 412 case 1: //left handle drag 413 if ( REVAPP.left_model_loading ) //left model stoll loading, prevent sliding left handle 414 return false; 415 416 if ( REVAPP._revisionView.model !== REVAPP._left_handle_revisions && 417 null != REVAPP._left_handle_revisions ) 418 REVAPP._revisionView.model = REVAPP._left_handle_revisions; 419 420 REVAPP._revisionView.draggingleft = true; 421 break; 422 423 case 2: //right 424 if ( REVAPP.right_model_loading ) //right model stoll loading, prevent sliding right handle 425 return false; 426 427 //one extra spot at left end when comparing two 428 if ( REVAPP._revisionView.model !== REVAPP._right_handle_revisions && 429 null != REVAPP._right_handle_revisions ) 430 REVAPP._revisionView.model = REVAPP._right_handle_revisions; 431 432 REVAPP._revisionView.draggingleft = false; 433 REVAPP._right_diff = ui.values[1] - 1 ; 434 break; 435 } 436 }, 437 438 //when sliding in two handled mode change appropriate value 439 slide : function( event, ui ) { 440 if ( ui.values[0] == ui.values[1] ) //prevent compare to self 441 return false; 442 443 var index = $( ui.handle ).index(); //0 (left) or 1 (right) 444 445 switch ( index ) { 446 case 1: //left 447 if ( REVAPP.left_model_loading ) //left model stoll loading, prevent sliding left handle 448 return false; 449 450 REVAPP._left_diff = ui.values[0] - 1; //one extra spot at left end when comparing two 451 break; 452 453 case 2: //right 454 if ( REVAPP.right_model_loading ) //right model stoll loading, prevent sliding right handle 455 return false; 456 457 REVAPP._right_diff = ui.values[1] - 1 ; 458 break; 459 } 460 461 $( '#diff_count' ).html( REVAPP._right_diff ); 462 463 if ( 0 == REVAPP._left_diff ) { 464 $( '.revisiondiffcontainer' ).addClass( 'currentversion' ); 465 466 } else { 467 $( '.revisiondiffcontainer' ).removeClass( 'currentversion' ); 468 $( '#diff_left_count_inner' ).html( REVAPP._left_diff ); 469 } 470 471 REVAPP._revisionView.render(); //render the diff view 472 }, 473 474 //when the user stops sliding in 2 handle mode, recalculate diffs 475 stop : function( event, ui ) { 476 if ( 2 == REVAPP._compareoneortwo ) { 477 //calculate and generate a diff for comparing to the left handle 478 //and the right handle, swap out when dragging 479 if ( ! (REVAPP.left_model_loading && REVAPP.right_model.loading ) ) { 480 REVAPP.reloadleftright(); 481 } 482 } 483 } 484 }); 485 $( '.revisiondiffcontainer' ).addClass( 'comparetwo' ); 486 } 487 488 return this; 489 }, 490 491 //next and previous buttons, only available in compare one mode 492 events : { 493 'click #next' : 'nextrevision', 494 'click #previous' : 'previousrevision' 495 }, 496 497 //go to the next revision 498 nextrevision : function() { 499 if ( REVAPP._right_diff < this.model.length ) //unless at right boundry 500 REVAPP._right_diff = REVAPP._right_diff + 1 ; 501 502 REVAPP._revisionView.render(); 503 504 $( '#diff_count' ).html( REVAPP._right_diff ); 505 $( '#slider' ).slider( 'value', REVAPP._right_diff - 1 ).trigger( 'slide' ); 506 }, 507 508 //go the the previous revision 509 previousrevision : function() { 510 if ( REVAPP._right_diff > 1 ) //unless at left boundry 511 REVAPP._right_diff = REVAPP._right_diff - 1 ; 512 513 REVAPP._revisionView.render(); 514 515 $( '#diff_count' ).html( REVAPP._right_diff ); 516 $( '#slider' ).slider( 'value', REVAPP._right_diff - 1 ).trigger( 'slide' ); 517 } 518 }) 519 }); 520 521 //instantiate Revision Application 522 REVAPP = new wp.revisions.App(); 523 //TODO consider enable back button to step back thru states? 524 Backbone.history.start(); 525 526 }(jQuery)); -
wp-includes/wp-diff.php
59 59 */ 60 60 var $inline_diff_renderer = 'WP_Text_Diff_Renderer_inline'; 61 61 62 var $_showsplitview = null; 63 62 64 /** 63 65 * Constructor - Call parent constructor with params array. 64 66 * … … 70 72 */ 71 73 function __construct( $params = array() ) { 72 74 parent::__construct( $params ); 75 if ( isset( $params[ 'showsplitview' ] ) ) 76 $this -> _showsplitview = $params[ 'showsplitview' ]; 73 77 } 74 78 75 79 /** … … 98 102 * @return string 99 103 */ 100 104 function addedLine( $line ) { 101 return "<td>+</td><td class='diff-addedline'>{$line}</td>"; 105 return "<td class='diff-addedline'>{$line}</td>"; 106 102 107 } 103 108 104 109 /** … … 108 113 * @return string 109 114 */ 110 115 function deletedLine( $line ) { 111 return "<td >-</td><tdclass='diff-deletedline'>{$line}</td>";116 return "<td class='diff-deletedline'>{$line}</td>"; 112 117 } 113 118 114 119 /** … … 118 123 * @return string 119 124 */ 120 125 function contextLine( $line ) { 121 return "<td > </td><tdclass='diff-context'>{$line}</td>";126 return "<td class='diff-context'>{$line}</td>"; 122 127 } 123 128 124 129 /** … … 127 132 * @return string 128 133 */ 129 134 function emptyLine() { 130 return '<td colspan="2"> </td>';135 return '<td> </td>'; 131 136 } 132 137 133 138 /** … … 142 147 $r = ''; 143 148 foreach ($lines as $line) { 144 149 if ( $encode ) 145 $line = htmlspecialchars( $line ); 146 $r .= '<tr>' . $this->emptyLine() . $this->addedLine( $line ) . "</tr>\n"; 150 $line = wp_kses_post( $line ); 151 if ( ! $this->_showsplitview ) { 152 $r .= '<tr>' . $this->addedLine( $line ) . "</tr>\n"; 153 } else { 154 $r .= '<tr>' . $this->emptyLine() . $this->emptyLine() . $this->addedLine( $line ) . "</tr>\n"; 155 } 147 156 } 148 157 return $r; 149 158 } … … 160 169 $r = ''; 161 170 foreach ($lines as $line) { 162 171 if ( $encode ) 163 $line = htmlspecialchars( $line ); 164 $r .= '<tr>' . $this->deletedLine( $line ) . $this->emptyLine() . "</tr>\n"; 172 $line = wp_kses_post( $line ); 173 if ( ! $this->_showsplitview ) { 174 $r .= '<tr>' . $this->deletedLine( $line ) . "</tr>\n"; 175 } else { 176 $r .= '<tr>' . $this->deletedLine( $line ) . $this->emptyLine() . $this->emptyLine() . "</tr>\n"; 177 } 178 165 179 } 166 180 return $r; 167 181 } … … 178 192 $r = ''; 179 193 foreach ($lines as $line) { 180 194 if ( $encode ) 181 $line = htmlspecialchars( $line ); 182 $r .= '<tr>' . 183 $this->contextLine( $line ) . $this->contextLine( $line ) . "</tr>\n"; 195 $line = wp_kses_post( $line ); 196 if ( ! $this->_showsplitview ) { 197 $r .= '<tr>' . $this->contextLine( $line ) . "</tr>\n"; 198 } else { 199 $r .= '<tr>' . $this->contextLine( $line ) . $this->emptyLine() . $this->contextLine( $line ) . "</tr>\n"; 200 } 184 201 } 185 202 return $r; 186 203 } … … 264 281 } elseif ( $final_rows[$row] < 0 ) { // Final is blank. This is really a deleted row. 265 282 $r .= $this->_deleted( array($orig_line), false ); 266 283 } else { // A true changed row. 267 $r .= '<tr>' . $this->deletedLine( $orig_line ) . $this->addedLine( $final_line ) . "</tr>\n"; 284 if ( ! $this->_showsplitview ) { 285 $r .= '<tr>' . $this->deletedLine( $orig_line ) . "</tr><tr>" . $this->addedLine( $final_line ) . "</tr>\n"; 286 } else { 287 $r .= '<tr>' . $this->deletedLine( $orig_line ) . $this->emptyLine() . $this->addedLine( $final_line ) . "</tr>\n"; 288 } 268 289 } 269 290 } 270 291 -
wp-includes/css/jquery-ui-slider.css
1 /*! jQuery UI - v1.10.1 - 2013-02-15 2 * http://jqueryui.com 3 * Includes: jquery.ui.core.css, jquery.ui.slider.css 4 * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS%2CTahoma%2CVerdana%2CArial%2Csans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=gloss_wave&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=highlight_soft&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=glass&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=glass&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=highlight_soft&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=diagonals_thick&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=diagonals_thick&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=flat&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px 5 * Copyright (c) 2013 jQuery Foundation and other contributors Licensed MIT */ 6 7 /* Layout helpers 8 ----------------------------------*/ 9 .ui-helper-hidden { 10 display: none; 11 } 12 .ui-helper-hidden-accessible { 13 border: 0; 14 clip: rect(0 0 0 0); 15 height: 1px; 16 margin: -1px; 17 overflow: hidden; 18 padding: 0; 19 position: absolute; 20 width: 1px; 21 } 22 .ui-helper-reset { 23 margin: 0; 24 padding: 0; 25 border: 0; 26 outline: 0; 27 line-height: 1.3; 28 text-decoration: none; 29 font-size: 100%; 30 list-style: none; 31 } 32 .ui-helper-clearfix:before, 33 .ui-helper-clearfix:after { 34 content: ""; 35 display: table; 36 border-collapse: collapse; 37 } 38 .ui-helper-clearfix:after { 39 clear: both; 40 } 41 .ui-helper-clearfix { 42 min-height: 0; /* support: IE7 */ 43 } 44 .ui-helper-zfix { 45 width: 100%; 46 height: 100%; 47 top: 0; 48 left: 0; 49 position: absolute; 50 opacity: 0; 51 filter:Alpha(Opacity=0); 52 } 53 54 .ui-front { 55 z-index: 100; 56 } 57 58 59 /* Interaction Cues 60 ----------------------------------*/ 61 .ui-state-disabled { 62 cursor: default !important; 63 } 64 65 66 /* Icons 67 ----------------------------------*/ 68 69 /* states and images */ 70 .ui-icon { 71 display: block; 72 text-indent: -99999px; 73 overflow: hidden; 74 background-repeat: no-repeat; 75 } 76 77 78 /* Misc visuals 79 ----------------------------------*/ 80 81 /* Overlays */ 82 .ui-widget-overlay { 83 position: fixed; 84 top: 0; 85 left: 0; 86 width: 100%; 87 height: 100%; 88 } 89 .ui-slider { 90 position: relative; 91 text-align: left; 92 } 93 .ui-slider .ui-slider-handle { 94 position: absolute; 95 z-index: 2; 96 width: 1.2em; 97 height: 1.2em; 98 cursor: default; 99 } 100 .ui-slider .ui-slider-range { 101 position: absolute; 102 z-index: 1; 103 font-size: .7em; 104 display: block; 105 border: 0; 106 background-position: 0 0; 107 } 108 109 /* For IE8 - See #6727 */ 110 .ui-slider.ui-state-disabled .ui-slider-handle, 111 .ui-slider.ui-state-disabled .ui-slider-range { 112 filter: inherit; 113 } 114 115 .ui-slider-horizontal { 116 height: .8em; 117 } 118 .ui-slider-horizontal .ui-slider-handle { 119 top: -.3em; 120 margin-left: -.6em; 121 } 122 .ui-slider-horizontal .ui-slider-range { 123 top: 0; 124 height: 100%; 125 } 126 .ui-slider-horizontal .ui-slider-range-min { 127 left: 0; 128 } 129 .ui-slider-horizontal .ui-slider-range-max { 130 right: 0; 131 } 132 133 .ui-slider-vertical { 134 width: .8em; 135 height: 100px; 136 } 137 .ui-slider-vertical .ui-slider-handle { 138 left: -.3em; 139 margin-left: 0; 140 margin-bottom: -.6em; 141 } 142 .ui-slider-vertical .ui-slider-range { 143 left: 0; 144 width: 100%; 145 } 146 .ui-slider-vertical .ui-slider-range-min { 147 bottom: 0; 148 } 149 .ui-slider-vertical .ui-slider-range-max { 150 top: 0; 151 } 152 153 /* Component containers 154 ----------------------------------*/ 155 .ui-widget { 156 font-family: Trebuchet MS,Tahoma,Verdana,Arial,sans-serif; 157 font-size: 1.1em; 158 } 159 .ui-widget .ui-widget { 160 font-size: 1em; 161 } 162 .ui-widget input, 163 .ui-widget select, 164 .ui-widget textarea, 165 .ui-widget button { 166 font-family: Trebuchet MS,Tahoma,Verdana,Arial,sans-serif; 167 font-size: 1em; 168 } 169 .ui-widget-content { 170 border: 1px solid #dddddd; 171 background: #eeeeee url(../images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x; 172 color: #333333; 173 } 174 .ui-widget-content a { 175 color: #333333; 176 } 177 .ui-widget-header { 178 border: 1px solid #e78f08; 179 background: #f6a828 url(../images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x; 180 color: #ffffff; 181 font-weight: bold; 182 } 183 .ui-widget-header a { 184 color: #ffffff; 185 } 186 187 /* Interaction states 188 ----------------------------------*/ 189 .ui-state-default, 190 .ui-widget-content .ui-state-default, 191 .ui-widget-header .ui-state-default { 192 border: 1px solid #cccccc; 193 background: #f6f6f6 url(../images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x; 194 font-weight: bold; 195 color: #1c94c4; 196 } 197 .ui-state-default a, 198 .ui-state-default a:link, 199 .ui-state-default a:visited { 200 color: #1c94c4; 201 text-decoration: none; 202 } 203 .ui-state-hover, 204 .ui-widget-content .ui-state-hover, 205 .ui-widget-header .ui-state-hover, 206 .ui-state-focus, 207 .ui-widget-content .ui-state-focus, 208 .ui-widget-header .ui-state-focus { 209 border: 1px solid #fbcb09; 210 background: #fdf5ce url(../images/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x; 211 font-weight: bold; 212 color: #c77405; 213 } 214 .ui-state-hover a, 215 .ui-state-hover a:hover, 216 .ui-state-hover a:link, 217 .ui-state-hover a:visited { 218 color: #c77405; 219 text-decoration: none; 220 } 221 .ui-state-active, 222 .ui-widget-content .ui-state-active, 223 .ui-widget-header .ui-state-active { 224 border: 1px solid #fbd850; 225 background: #ffffff url(../images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; 226 font-weight: bold; 227 color: #eb8f00; 228 } 229 .ui-state-active a, 230 .ui-state-active a:link, 231 .ui-state-active a:visited { 232 color: #eb8f00; 233 text-decoration: none; 234 } 235 236 /* Interaction Cues 237 ----------------------------------*/ 238 .ui-state-highlight, 239 .ui-widget-content .ui-state-highlight, 240 .ui-widget-header .ui-state-highlight { 241 border: 1px solid #fed22f; 242 background: #ffe45c url(../images/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x; 243 color: #363636; 244 } 245 .ui-state-highlight a, 246 .ui-widget-content .ui-state-highlight a, 247 .ui-widget-header .ui-state-highlight a { 248 color: #363636; 249 } 250 .ui-state-error, 251 .ui-widget-content .ui-state-error, 252 .ui-widget-header .ui-state-error { 253 border: 1px solid #cd0a0a; 254 background: #b81900 url(../images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat; 255 color: #ffffff; 256 } 257 .ui-state-error a, 258 .ui-widget-content .ui-state-error a, 259 .ui-widget-header .ui-state-error a { 260 color: #ffffff; 261 } 262 .ui-state-error-text, 263 .ui-widget-content .ui-state-error-text, 264 .ui-widget-header .ui-state-error-text { 265 color: #ffffff; 266 } 267 .ui-priority-primary, 268 .ui-widget-content .ui-priority-primary, 269 .ui-widget-header .ui-priority-primary { 270 font-weight: bold; 271 } 272 .ui-priority-secondary, 273 .ui-widget-content .ui-priority-secondary, 274 .ui-widget-header .ui-priority-secondary { 275 opacity: .7; 276 filter:Alpha(Opacity=70); 277 font-weight: normal; 278 } 279 .ui-state-disabled, 280 .ui-widget-content .ui-state-disabled, 281 .ui-widget-header .ui-state-disabled { 282 opacity: .35; 283 filter:Alpha(Opacity=35); 284 background-image: none; 285 } 286 .ui-state-disabled .ui-icon { 287 filter:Alpha(Opacity=35); /* For IE8 - See #6059 */ 288 } 289 290 /* Icons 291 ----------------------------------*/ 292 293 /* states and images */ 294 .ui-icon { 295 width: 16px; 296 height: 16px; 297 background-position: 16px 16px; 298 } 299 .ui-icon, 300 .ui-widget-content .ui-icon { 301 background-image: url(../images/ui-icons_222222_256x240.png); 302 } 303 .ui-widget-header .ui-icon { 304 background-image: url(../images/ui-icons_ffffff_256x240.png); 305 } 306 .ui-state-default .ui-icon { 307 background-image: url(../images/ui-icons_ef8c08_256x240.png); 308 } 309 .ui-state-hover .ui-icon, 310 .ui-state-focus .ui-icon { 311 background-image: url(../images/ui-icons_ef8c08_256x240.png); 312 } 313 .ui-state-active .ui-icon { 314 background-image: url(../images/ui-icons_ef8c08_256x240.png); 315 } 316 .ui-state-highlight .ui-icon { 317 background-image: url(../images/ui-icons_228ef1_256x240.png); 318 } 319 .ui-state-error .ui-icon, 320 .ui-state-error-text .ui-icon { 321 background-image: url(../images/ui-icons_ffd27a_256x240.png); 322 } 323 324 /* positioning */ 325 .ui-icon-carat-1-n { background-position: 0 0; } 326 .ui-icon-carat-1-ne { background-position: -16px 0; } 327 .ui-icon-carat-1-e { background-position: -32px 0; } 328 .ui-icon-carat-1-se { background-position: -48px 0; } 329 .ui-icon-carat-1-s { background-position: -64px 0; } 330 .ui-icon-carat-1-sw { background-position: -80px 0; } 331 .ui-icon-carat-1-w { background-position: -96px 0; } 332 .ui-icon-carat-1-nw { background-position: -112px 0; } 333 .ui-icon-carat-2-n-s { background-position: -128px 0; } 334 .ui-icon-carat-2-e-w { background-position: -144px 0; } 335 .ui-icon-triangle-1-n { background-position: 0 -16px; } 336 .ui-icon-triangle-1-ne { background-position: -16px -16px; } 337 .ui-icon-triangle-1-e { background-position: -32px -16px; } 338 .ui-icon-triangle-1-se { background-position: -48px -16px; } 339 .ui-icon-triangle-1-s { background-position: -64px -16px; } 340 .ui-icon-triangle-1-sw { background-position: -80px -16px; } 341 .ui-icon-triangle-1-w { background-position: -96px -16px; } 342 .ui-icon-triangle-1-nw { background-position: -112px -16px; } 343 .ui-icon-triangle-2-n-s { background-position: -128px -16px; } 344 .ui-icon-triangle-2-e-w { background-position: -144px -16px; } 345 .ui-icon-arrow-1-n { background-position: 0 -32px; } 346 .ui-icon-arrow-1-ne { background-position: -16px -32px; } 347 .ui-icon-arrow-1-e { background-position: -32px -32px; } 348 .ui-icon-arrow-1-se { background-position: -48px -32px; } 349 .ui-icon-arrow-1-s { background-position: -64px -32px; } 350 .ui-icon-arrow-1-sw { background-position: -80px -32px; } 351 .ui-icon-arrow-1-w { background-position: -96px -32px; } 352 .ui-icon-arrow-1-nw { background-position: -112px -32px; } 353 .ui-icon-arrow-2-n-s { background-position: -128px -32px; } 354 .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } 355 .ui-icon-arrow-2-e-w { background-position: -160px -32px; } 356 .ui-icon-arrow-2-se-nw { background-position: -176px -32px; } 357 .ui-icon-arrowstop-1-n { background-position: -192px -32px; } 358 .ui-icon-arrowstop-1-e { background-position: -208px -32px; } 359 .ui-icon-arrowstop-1-s { background-position: -224px -32px; } 360 .ui-icon-arrowstop-1-w { background-position: -240px -32px; } 361 .ui-icon-arrowthick-1-n { background-position: 0 -48px; } 362 .ui-icon-arrowthick-1-ne { background-position: -16px -48px; } 363 .ui-icon-arrowthick-1-e { background-position: -32px -48px; } 364 .ui-icon-arrowthick-1-se { background-position: -48px -48px; } 365 .ui-icon-arrowthick-1-s { background-position: -64px -48px; } 366 .ui-icon-arrowthick-1-sw { background-position: -80px -48px; } 367 .ui-icon-arrowthick-1-w { background-position: -96px -48px; } 368 .ui-icon-arrowthick-1-nw { background-position: -112px -48px; } 369 .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } 370 .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } 371 .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } 372 .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } 373 .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } 374 .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } 375 .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } 376 .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } 377 .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } 378 .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } 379 .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } 380 .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } 381 .ui-icon-arrowreturn-1-w { background-position: -64px -64px; } 382 .ui-icon-arrowreturn-1-n { background-position: -80px -64px; } 383 .ui-icon-arrowreturn-1-e { background-position: -96px -64px; } 384 .ui-icon-arrowreturn-1-s { background-position: -112px -64px; } 385 .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } 386 .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } 387 .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } 388 .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } 389 .ui-icon-arrow-4 { background-position: 0 -80px; } 390 .ui-icon-arrow-4-diag { background-position: -16px -80px; } 391 .ui-icon-extlink { background-position: -32px -80px; } 392 .ui-icon-newwin { background-position: -48px -80px; } 393 .ui-icon-refresh { background-position: -64px -80px; } 394 .ui-icon-shuffle { background-position: -80px -80px; } 395 .ui-icon-transfer-e-w { background-position: -96px -80px; } 396 .ui-icon-transferthick-e-w { background-position: -112px -80px; } 397 .ui-icon-folder-collapsed { background-position: 0 -96px; } 398 .ui-icon-folder-open { background-position: -16px -96px; } 399 .ui-icon-document { background-position: -32px -96px; } 400 .ui-icon-document-b { background-position: -48px -96px; } 401 .ui-icon-note { background-position: -64px -96px; } 402 .ui-icon-mail-closed { background-position: -80px -96px; } 403 .ui-icon-mail-open { background-position: -96px -96px; } 404 .ui-icon-suitcase { background-position: -112px -96px; } 405 .ui-icon-comment { background-position: -128px -96px; } 406 .ui-icon-person { background-position: -144px -96px; } 407 .ui-icon-print { background-position: -160px -96px; } 408 .ui-icon-trash { background-position: -176px -96px; } 409 .ui-icon-locked { background-position: -192px -96px; } 410 .ui-icon-unlocked { background-position: -208px -96px; } 411 .ui-icon-bookmark { background-position: -224px -96px; } 412 .ui-icon-tag { background-position: -240px -96px; } 413 .ui-icon-home { background-position: 0 -112px; } 414 .ui-icon-flag { background-position: -16px -112px; } 415 .ui-icon-calendar { background-position: -32px -112px; } 416 .ui-icon-cart { background-position: -48px -112px; } 417 .ui-icon-pencil { background-position: -64px -112px; } 418 .ui-icon-clock { background-position: -80px -112px; } 419 .ui-icon-disk { background-position: -96px -112px; } 420 .ui-icon-calculator { background-position: -112px -112px; } 421 .ui-icon-zoomin { background-position: -128px -112px; } 422 .ui-icon-zoomout { background-position: -144px -112px; } 423 .ui-icon-search { background-position: -160px -112px; } 424 .ui-icon-wrench { background-position: -176px -112px; } 425 .ui-icon-gear { background-position: -192px -112px; } 426 .ui-icon-heart { background-position: -208px -112px; } 427 .ui-icon-star { background-position: -224px -112px; } 428 .ui-icon-link { background-position: -240px -112px; } 429 .ui-icon-cancel { background-position: 0 -128px; } 430 .ui-icon-plus { background-position: -16px -128px; } 431 .ui-icon-plusthick { background-position: -32px -128px; } 432 .ui-icon-minus { background-position: -48px -128px; } 433 .ui-icon-minusthick { background-position: -64px -128px; } 434 .ui-icon-close { background-position: -80px -128px; } 435 .ui-icon-closethick { background-position: -96px -128px; } 436 .ui-icon-key { background-position: -112px -128px; } 437 .ui-icon-lightbulb { background-position: -128px -128px; } 438 .ui-icon-scissors { background-position: -144px -128px; } 439 .ui-icon-clipboard { background-position: -160px -128px; } 440 .ui-icon-copy { background-position: -176px -128px; } 441 .ui-icon-contact { background-position: -192px -128px; } 442 .ui-icon-image { background-position: -208px -128px; } 443 .ui-icon-video { background-position: -224px -128px; } 444 .ui-icon-script { background-position: -240px -128px; } 445 .ui-icon-alert { background-position: 0 -144px; } 446 .ui-icon-info { background-position: -16px -144px; } 447 .ui-icon-notice { background-position: -32px -144px; } 448 .ui-icon-help { background-position: -48px -144px; } 449 .ui-icon-check { background-position: -64px -144px; } 450 .ui-icon-bullet { background-position: -80px -144px; } 451 .ui-icon-radio-on { background-position: -96px -144px; } 452 .ui-icon-radio-off { background-position: -112px -144px; } 453 .ui-icon-pin-w { background-position: -128px -144px; } 454 .ui-icon-pin-s { background-position: -144px -144px; } 455 .ui-icon-play { background-position: 0 -160px; } 456 .ui-icon-pause { background-position: -16px -160px; } 457 .ui-icon-seek-next { background-position: -32px -160px; } 458 .ui-icon-seek-prev { background-position: -48px -160px; } 459 .ui-icon-seek-end { background-position: -64px -160px; } 460 .ui-icon-seek-start { background-position: -80px -160px; } 461 /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ 462 .ui-icon-seek-first { background-position: -80px -160px; } 463 .ui-icon-stop { background-position: -96px -160px; } 464 .ui-icon-eject { background-position: -112px -160px; } 465 .ui-icon-volume-off { background-position: -128px -160px; } 466 .ui-icon-volume-on { background-position: -144px -160px; } 467 .ui-icon-power { background-position: 0 -176px; } 468 .ui-icon-signal-diag { background-position: -16px -176px; } 469 .ui-icon-signal { background-position: -32px -176px; } 470 .ui-icon-battery-0 { background-position: -48px -176px; } 471 .ui-icon-battery-1 { background-position: -64px -176px; } 472 .ui-icon-battery-2 { background-position: -80px -176px; } 473 .ui-icon-battery-3 { background-position: -96px -176px; } 474 .ui-icon-circle-plus { background-position: 0 -192px; } 475 .ui-icon-circle-minus { background-position: -16px -192px; } 476 .ui-icon-circle-close { background-position: -32px -192px; } 477 .ui-icon-circle-triangle-e { background-position: -48px -192px; } 478 .ui-icon-circle-triangle-s { background-position: -64px -192px; } 479 .ui-icon-circle-triangle-w { background-position: -80px -192px; } 480 .ui-icon-circle-triangle-n { background-position: -96px -192px; } 481 .ui-icon-circle-arrow-e { background-position: -112px -192px; } 482 .ui-icon-circle-arrow-s { background-position: -128px -192px; } 483 .ui-icon-circle-arrow-w { background-position: -144px -192px; } 484 .ui-icon-circle-arrow-n { background-position: -160px -192px; } 485 .ui-icon-circle-zoomin { background-position: -176px -192px; } 486 .ui-icon-circle-zoomout { background-position: -192px -192px; } 487 .ui-icon-circle-check { background-position: -208px -192px; } 488 .ui-icon-circlesmall-plus { background-position: 0 -208px; } 489 .ui-icon-circlesmall-minus { background-position: -16px -208px; } 490 .ui-icon-circlesmall-close { background-position: -32px -208px; } 491 .ui-icon-squaresmall-plus { background-position: -48px -208px; } 492 .ui-icon-squaresmall-minus { background-position: -64px -208px; } 493 .ui-icon-squaresmall-close { background-position: -80px -208px; } 494 .ui-icon-grip-dotted-vertical { background-position: 0 -224px; } 495 .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } 496 .ui-icon-grip-solid-vertical { background-position: -32px -224px; } 497 .ui-icon-grip-solid-horizontal { background-position: -48px -224px; } 498 .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } 499 .ui-icon-grip-diagonal-se { background-position: -80px -224px; } 500 501 502 /* Misc visuals 503 ----------------------------------*/ 504 505 /* Corner radius */ 506 .ui-corner-all, 507 .ui-corner-top, 508 .ui-corner-left, 509 .ui-corner-tl { 510 border-top-left-radius: 4px; 511 } 512 .ui-corner-all, 513 .ui-corner-top, 514 .ui-corner-right, 515 .ui-corner-tr { 516 border-top-right-radius: 4px; 517 } 518 .ui-corner-all, 519 .ui-corner-bottom, 520 .ui-corner-left, 521 .ui-corner-bl { 522 border-bottom-left-radius: 4px; 523 } 524 .ui-corner-all, 525 .ui-corner-bottom, 526 .ui-corner-right, 527 .ui-corner-br { 528 border-bottom-right-radius: 4px; 529 } 530 531 /* Overlays */ 532 .ui-widget-overlay { 533 background: #666666 url(../images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat; 534 opacity: .5; 535 filter: Alpha(Opacity=50); 536 } 537 .ui-widget-shadow { 538 margin: -5px 0 0 -5px; 539 padding: 5px; 540 background: #000000 url(../images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; 541 opacity: .2; 542 filter: Alpha(Opacity=20); 543 border-radius: 5px; 544 } -
wp-includes/pluggable.php
1713 1713 1714 1714 $left_lines = explode("\n", $left_string); 1715 1715 $right_lines = explode("\n", $right_string); 1716 1717 1716 $text_diff = new Text_Diff($left_lines, $right_lines); 1718 $renderer = new WP_Text_Diff_Renderer_Table( );1717 $renderer = new WP_Text_Diff_Renderer_Table( $args ); 1719 1718 $diff = $renderer->render($text_diff); 1720 1719 1721 1720 if ( !$diff ) 1722 1721 return ''; 1723 1722 1724 1723 $r = "<table class='diff'>\n"; 1725 $r .= "<col class='ltype' /><col class='content' /><col class='ltype' /><col class='content' />";1726 1724 1725 if ( isset( $args[ 'showsplitview' ] ) && 'true' == $args[ 'showsplitview' ] ) { 1726 $r .= "<col class='content diffsplit left' /><col class='content diffsplit middle' /><col class='content diffsplit right' />"; 1727 } else { 1728 $r .= "<col class='content' />"; 1729 } 1730 1727 1731 if ( $args['title'] || $args['title_left'] || $args['title_right'] ) 1728 1732 $r .= "<thead>"; 1729 1733 if ( $args['title'] ) -
wp-includes/script-loader.php
270 270 $scripts->add( 'json2', "/wp-includes/js/json2$suffix.js", array(), '2011-02-23'); 271 271 272 272 $scripts->add( 'underscore', '/wp-includes/js/underscore.min.js', array(), '1.4.4', 1 ); 273 $scripts->add( 'backbone', '/wp-includes/js/backbone.min.js', array('underscore','jquery'), '0.9.2', 1 ); 273 $scripts->add( 'template', "/wp-includes/js/template$suffix.js", array('underscore'), '1.4.4', 1 ); 274 $scripts->add( 'backbone', '/wp-includes/js/backbone.min.js', array('underscore','jquery', 'template'), '0.9.2', 1 ); 274 275 276 $scripts->add( 'revisions', "/wp-includes/js/revisions$suffix.js", array('backbone'), '', 1 ); 277 275 278 $scripts->add( 'imgareaselect', "/wp-includes/js/imgareaselect/jquery.imgareaselect$suffix.js", array('jquery'), '0.9.8', 1 ); 276 279 277 280 $scripts->add( 'password-strength-meter', "/wp-admin/js/password-strength-meter$suffix.js", array('jquery'), false, 1 ); … … 539 542 $styles->add( 'customize-controls', "/wp-admin/css/customize-controls$suffix.css", array( 'wp-admin', 'colors', 'ie' ) ); 540 543 $styles->add( 'media-views', "/wp-includes/css/media-views$suffix.css", array( 'buttons' ) ); 541 544 $styles->add( 'buttons', "/wp-includes/css/buttons$suffix.css" ); 545 $styles->add( 'revisions', "/wp-admin/css/revisions$suffix.css" ); 546 $styles->add( 'wp-jquery-ui-slider', "/wp-includes/css/jquery-ui-slider$suffix.css" ); 542 547 543 548 foreach ( $rtl_styles as $rtl_style ) { 544 549 $styles->add_data( $rtl_style, 'rtl', true ); -
wp-admin/admin-ajax.php
42 42 43 43 $core_actions_get = array( 44 44 'fetch-list', 'ajax-tag-search', 'wp-compression-test', 'imgedit-preview', 'oembed-cache', 45 'autocomplete-user', 'dashboard-widgets', 'logged-in', 45 'autocomplete-user', 'dashboard-widgets', 'logged-in', 'revisions-data' 46 46 ); 47 47 48 48 $core_actions_post = array( … … 56 56 'save-widget', 'set-post-thumbnail', 'date_format', 'time_format', 'wp-fullscreen-save-post', 57 57 'wp-remove-post-lock', 'dismiss-wp-pointer', 'upload-attachment', 'get-attachment', 58 58 'query-attachments', 'save-attachment', 'save-attachment-compat', 'send-link-to-editor', 59 'send-attachment-to-editor', 'save-attachment-order', 'heartbeat' ,59 'send-attachment-to-editor', 'save-attachment-order', 'heartbeat' 60 60 ); 61 61 62 62 // Register core Ajax calls. -
wp-admin/includes/ajax-actions.php
1379 1379 global $wp_list_table; 1380 1380 1381 1381 check_ajax_referer( 'taxinlineeditnonce', '_inline_edit' ); 1382 1382 1383 1383 $post_data = wp_unslash( $_POST ); 1384 1384 1385 1385 $taxonomy = sanitize_key( $post_data['taxonomy'] ); … … 2134 2134 wp_send_json($response); 2135 2135 } 2136 2136 2137 function wp_ajax_revisions_data() { 2138 2139 $compareto = isset( $_GET['compareto'] ) ? $_GET['compareto'] : 0; 2140 $showautosaves = isset( $_GET['showautosaves'] ) ? $_GET['showautosaves'] : ''; 2141 $showsplitview = isset( $_GET['showsplitview'] ) ? $_GET['showsplitview'] : ''; 2142 $postid = isset( $_GET['postid'] ) ? $_GET['postid'] : ''; 2143 2144 $comparetwomode = ( '' == $postid ) ? false : true; 2145 // 2146 //TODO: currently code returns all possible comparisons for the indicated 'compareto' revision 2147 //however, the front end prevents users from pulling the right handle past the left or the left pass the right, 2148 //so only the possible diffs need be generated 2149 // 2150 $alltherevisions = array(); 2151 2152 if ( '' == $postid ) 2153 $postid = $compareto; 2154 2155 if ( ! $revisions = wp_get_post_revisions( $postid ) ) 2156 return; 2157 2158 //if we are comparing two revisions, the first 'revision' represented by the leftmost 2159 //slider position is the current revision, prepend a comparison to this revision 2160 if ( $comparetwomode ) 2161 array_unshift( $revisions, get_post( $postid ) ); 2162 2163 $count = 1; 2164 foreach ( $revisions as $revision ) : 2165 if ( 'true' != $showautosaves && wp_is_post_autosave( $revision ) ) 2166 continue; 2167 2168 $revision_from_date_author = ''; 2169 2170 2171 //if ( current_user_can( 'read_post', $revision->ID ) ) 2172 // continue; 2173 $left_revision = get_post( $compareto ); 2174 $right_revision = get_post( $revision ); 2175 2176 $author = get_the_author_meta( 'display_name', $revision->post_author ); 2177 /* translators: revision date format, see http://php.net/date */ 2178 $datef = _x( 'j F, Y @ G:i:s', 'revision date format'); 2179 2180 $gravatar = get_avatar( $revision->post_author, 18 ); 2181 2182 $date = date_i18n( $datef, strtotime( $revision->post_modified ) ); 2183 $revision_date_author = sprintf( 2184 '%s %s, %s %s (%s)', 2185 $gravatar, 2186 $author, 2187 human_time_diff( strtotime( $revision->post_modified ), current_time( 'timestamp' ) ), 2188 __( ' ago ' ), 2189 $date 2190 ); 2191 2192 if ( $comparetwomode ) { 2193 $compareto_gravatar = get_avatar( $left_revision->post_author, 18 ); 2194 $compareto_author = get_the_author_meta( 'display_name', $left_revision->post_author ); 2195 $compareto_date = date_i18n( $datef, strtotime( $left_revision->post_modified ) ); 2196 2197 $revision_from_date_author = sprintf( 2198 '%s %s, %s %s (%s)', 2199 $compareto_gravatar, 2200 $compareto_author, 2201 human_time_diff( strtotime( $left_revision->post_modified ), current_time( 'timestamp' ) ), 2202 __( ' ago ' ), 2203 $compareto_date 2204 ); 2205 } 2206 2207 $restoreaction = wp_nonce_url( 2208 add_query_arg( 2209 array( 'revision' => $revision->ID, 2210 'action' => 'restore' ), 2211 '/wp-admin/revision.php' 2212 ), 2213 "restore-post_$compareto|$revision->ID" 2214 ); 2215 2216 // 2217 //make sure the left revision is the most recent 2218 // 2219 if ( strtotime( $right_revision->post_modified_gmt ) < strtotime( $left_revision->post_modified_gmt ) ) { 2220 $temp = $left_revision; 2221 $left_revision = $right_revision; 2222 $right_revision = $temp; 2223 } 2224 2225 // 2226 //compare from left to right, passed from application 2227 // 2228 $content=''; 2229 foreach ( array_keys( _wp_post_revision_fields() ) as $field ) { 2230 $left_content = apply_filters( "_wp_post_revision_field_$field", $left_revision->$field, $field, $left_revision, 'left' ); 2231 $right_content = apply_filters( "_wp_post_revision_field_$field", $right_revision->$field, $field, $right_revision, 'right' ); 2232 2233 add_filter( "_wp_post_revision_field_$field", 'wp_kses_post' ); 2234 2235 $args = array(); 2236 2237 if ( 'true' == $showsplitview ) 2238 $args = array( 'showsplitview' => 'true' ); 2239 2240 $content .= wp_text_diff( $left_content, $right_content, $args ); 2241 } 2242 2243 //if we are comparing two revisions 2244 //and we are on the matching revision 2245 //add an error revision indicating unable to compare to self 2246 if ( $comparetwomode && $compareto == $revision->ID ) 2247 $alltherevisions[] = array ( 2248 'ID' => $revision->ID, 2249 'revision_date_author' => $revision_date_author, 2250 'revisiondiff' => sprintf('<div id="selfcomparisonerror">%s</div>', __( 'Cannot compare revision to itself' ) ), 2251 'restoreaction' => urldecode( $restoreaction ), 2252 'revision_from_date_author' => '' 2253 ); 2254 2255 //add to the return data only if there is a difference 2256 if ( '' != $content ) 2257 $alltherevisions[] = array ( 2258 'ID' => $revision->ID, 2259 'revision_date_author' => $revision_date_author, 2260 'revisiondiff' => $content, 2261 'restoreaction' => urldecode( $restoreaction ), 2262 'revision_from_date_author' => $revision_from_date_author 2263 ); 2264 2265 endforeach; 2266 2267 //remove initial revision that only contains 2268 //post title 2269 //TODO remove if this is fixed and initial revision not created 2270 array_pop( $alltherevisions ); 2271 echo json_encode( $alltherevisions ); 2272 exit(); 2273 } -
wp-admin/includes/meta-boxes.php
603 603 * @param object $post 604 604 */ 605 605 function post_revisions_meta_box($post) { 606 wp_ list_post_revisions();606 wp_post_revisions_meta(); 607 607 } 608 608 609 609 // -- Page related Meta Boxes -
wp-admin/revision.php
8 8 9 9 /** WordPress Administration Bootstrap */ 10 10 require_once('./admin.php'); 11 wp_reset_vars( array( 'postid', 'revision', 'action' ) ); 11 12 12 wp_enqueue_script('list-revisions'); 13 $postid = absint( $postid ); 14 $redirect = ''; 13 15 14 wp_reset_vars(array('revision', 'left', 'right', 'action')); 15 16 $revision_id = absint($revision); 17 $left = absint($left); 18 $right = absint($right); 19 20 $redirect = 'edit.php'; 21 22 switch ( $action ) : 16 switch ( $action ) { 23 17 case 'restore' : 24 if ( !$ revision = wp_get_post_revision( $revision_id) )18 if ( !$arevision = wp_get_post_revision( $revision ) ) 25 19 break; 26 if ( !current_user_can( 'edit_post', $ revision->post_parent ) )20 if ( !current_user_can( 'edit_post', $arevision->post_parent ) ) 27 21 break; 28 if ( !$post = get_post( $ revision->post_parent ) )22 if ( !$post = get_post( $arevision->post_parent ) ) 29 23 break; 30 24 31 25 // Revisions disabled and we're not looking at an autosave 32 if ( ( ! WP_POST_REVISIONS || !post_type_supports($post->post_type, 'revisions') ) && ! wp_is_post_autosave( $revision ) ) {26 if ( ( ! WP_POST_REVISIONS || !post_type_supports($post->post_type, 'revisions') ) && ! wp_is_post_autosave( $arevision ) ) { 33 27 $redirect = 'edit.php?post_type=' . $post->post_type; 34 28 break; 35 29 } 30 check_admin_referer( "restore-post_$post->ID|$arevision->ID" ); 36 31 37 check_admin_referer( "restore-post_$post->ID|$revision->ID" ); 32 //store revision event in post meta 33 $restore_details = array( 34 'restored_revision_id' => $arevision->ID, 35 'restored_by_user' => get_current_user_id(), 36 'restored_time' => time() 37 ); 38 38 39 wp_restore_post_revision( $revision->ID ); 40 $redirect = add_query_arg( array( 'message' => 5, 'revision' => $revision->ID ), get_edit_post_link( $post->ID, 'url' ) ); 41 break; 42 case 'diff' : 43 if ( !$left_revision = get_post( $left ) ) 44 break; 45 if ( !$right_revision = get_post( $right ) ) 46 break; 39 wp_add_post_meta( $post->ID, '_post_restored_from', $restore_details, true ); 47 40 48 if ( !current_user_can( 'read_post', $left_revision->ID ) || !current_user_can( 'read_post', $right_revision->ID ) ) 49 break; 41 wp_update_post_meta( $post->ID, '_edit_last', get_current_user_id() ); 50 42 51 // If we're comparing a revision to itself, redirect to the 'view' page for that revision or the edit page for that post 52 if ( $left_revision->ID == $right_revision->ID ) { 53 $redirect = get_edit_post_link( $left_revision->ID ); 54 include( './js/revisions-js.php' ); 55 break; 56 } 43 $post->post_author = get_current_user_id(); 57 44 58 // Don't allow reverse diffs? 59 if ( strtotime($right_revision->post_modified_gmt) < strtotime($left_revision->post_modified_gmt) ) { 60 $redirect = add_query_arg( array( 'left' => $right, 'right' => $left ) ); 61 break; 62 } 63 64 if ( $left_revision->ID == $right_revision->post_parent ) // right is a revision of left 65 $post =& $left_revision; 66 elseif ( $left_revision->post_parent == $right_revision->ID ) // left is a revision of right 67 $post =& $right_revision; 68 elseif ( $left_revision->post_parent == $right_revision->post_parent ) // both are revisions of common parent 69 $post = get_post( $left_revision->post_parent ); 70 else 71 break; // Don't diff two unrelated revisions 72 73 if ( ! WP_POST_REVISIONS || !post_type_supports($post->post_type, 'revisions') ) { // Revisions disabled 74 if ( 75 // we're not looking at an autosave 76 ( !wp_is_post_autosave( $left_revision ) && !wp_is_post_autosave( $right_revision ) ) 77 || 78 // we're not comparing an autosave to the current post 79 ( $post->ID !== $left_revision->ID && $post->ID !== $right_revision->ID ) 80 ) { 81 $redirect = 'edit.php?post_type=' . $post->post_type; 82 break; 83 } 84 } 85 86 if ( 87 // They're the same 88 $left_revision->ID == $right_revision->ID 89 || 90 // Neither is a revision 91 ( !wp_get_post_revision( $left_revision->ID ) && !wp_get_post_revision( $right_revision->ID ) ) 92 ) 93 break; 94 95 $post_title = '<a href="' . get_edit_post_link() . '">' . get_the_title() . '</a>'; 96 $h2 = sprintf( __( 'Compare Revisions of “%1$s”' ), $post_title ); 97 $title = __( 'Revisions' ); 98 99 $left = $left_revision->ID; 100 $right = $right_revision->ID; 101 102 $redirect = false; 45 wp_restore_post_revision( $arevision->ID ); 46 $redirect = add_query_arg( array( 'message' => 5, 'revision' => $arevision->ID ), get_edit_post_link( $post->ID, 'url' ) ); 47 wp_redirect( $redirect ); 103 48 break; 104 case 'view' : 105 default : 106 if ( !$revision = wp_get_post_revision( $revision_id ) ) 107 break; 108 if ( !$post = get_post( $revision->post_parent ) ) 109 break; 49 } 110 50 111 if ( !current_user_can( 'read_post', $revision->ID ) || !current_user_can( 'read_post', $post->ID ) ) 112 break; 51 if ( ! current_user_can( 'edit_post', $postid ) ) { 52 wp_redirect( 'edit.php' ); 53 exit; 54 } 113 55 114 // Revisions disabled and we're not looking at an autosave 115 if ( ( ! WP_POST_REVISIONS || !post_type_supports($post->post_type, 'revisions') ) && !wp_is_post_autosave( $revision ) ) { 116 $redirect = 'edit.php?post_type=' . $post->post_type; 117 break; 118 } 119 120 $post_title = '<a href="' . get_edit_post_link() . '">' . get_the_title() . '</a>'; 121 $revision_title = wp_post_revision_title( $revision, false ); 122 $h2 = sprintf( __( 'Revision for “%1$s” created on %2$s' ), $post_title, $revision_title ); 123 $title = __( 'Revisions' ); 124 125 // Sets up the diff radio buttons 126 $left = $revision->ID; 127 $right = $post->ID; 128 129 $redirect = false; 130 break; 131 endswitch; 132 133 // Empty post_type means either malformed object found, or no valid parent was found. 134 if ( !$redirect && empty($post->post_type) ) 135 $redirect = 'edit.php'; 136 137 if ( !empty($redirect) ) { 138 wp_redirect( $redirect ); 56 if ( ! WP_POST_REVISIONS || ! post_type_supports( get_post( $postid )->post_type, 'revisions') ) { // Revisions disabled 57 wp_redirect( get_edit_post_link( $postid , '') ); 139 58 exit; 140 59 } 141 60 142 // This is so that the correct "Edit" menu item is selected. 143 if ( !empty($post->post_type) && 'post' != $post->post_type ) 144 $parent_file = $submenu_file = 'edit.php?post_type=' . $post->post_type; 145 else 146 $parent_file = $submenu_file = 'edit.php'; 61 wp_enqueue_style( 'revisions' ); 62 wp_enqueue_style( 'wp-jquery-ui-slider' ); 147 63 148 require_once( './admin-header.php' ); 64 wp_enqueue_script( 'jquery-ui-slider' ); 65 wp_enqueue_script( 'backbone' ); 66 wp_enqueue_script( 'revisions' ); 149 67 150 ?> 68 require( './admin-header.php' ); 151 69 152 <div class="wrap"> 70 $post_title = sprintf ('<a href="%s">%s</a>', get_edit_post_link( $postid ), get_the_title( $postid ) ); 71 $h2 = sprintf( __( 'Compare Revisions of “%1$s”' ), $post_title ); 153 72 154 <h2 class="long-header"><?php echo $h2; ?></h2>155 156 <table class="form-table ie-fixed">157 <col class="th" />158 <?php if ( 'diff' == $action ) : ?>159 <tr id="revision">160 <th scope="row"></th>161 <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>164 </th>165 </tr>166 <?php endif;167 168 // use get_post_to_edit filters?169 $identical = true;170 foreach ( _wp_post_revision_fields() as $field => $field_title ) :171 if ( 'diff' == $action ) {172 $left_content = apply_filters( "_wp_post_revision_field_$field", $left_revision->$field, $field, $left_revision, 'left' );173 $right_content = apply_filters( "_wp_post_revision_field_$field", $right_revision->$field, $field, $right_revision, 'right' );174 if ( !$content = wp_text_diff( $left_content, $right_content ) )175 continue; // There is no difference between left and right176 $identical = false;177 } else {178 add_filter( "_wp_post_revision_field_$field", 'htmlspecialchars' );179 $content = apply_filters( "_wp_post_revision_field_$field", $revision->$field, $field, $revision, '' );180 }181 ?>182 183 <tr id="revision-field-<?php echo $field; ?>">184 <th scope="row"><?php echo esc_html( $field_title ); ?></th>185 <td><div class="pre"><?php echo $content; ?></div></td>186 </tr>187 188 <?php189 190 endforeach;191 192 if ( 'diff' == $action && $identical ) :193 194 ?>195 196 <tr><td colspan="2"><div class="updated"><p><?php _e( 'These revisions are identical.' ); ?></p></div></td></tr>197 198 <?php199 200 endif;201 202 73 ?> 74 <script type="text/javascript"> 75 var postid = <?php echo $postid; ?>; 76 </script> 203 77 204 < /table>78 <div id="backbonerevisionsoptions"></div> 205 79 206 <br class="clear" /> 207 208 <h3><?php echo $title; ?></h3> 209 80 <br class="clear"/> 81 <div class="wrap"> 82 <div class="icon32 icon32-posts-post" id="icon-edit"><br></div> 83 <div class="revisiondiffcontainer diffsplit currentversion rightmodelloading"> 84 <div id="modelsloading" class="updated message"><span class="spinner" ></span> <?php _e( 'Calculating revision diffs' ); ?></div> 85 <h2 class="long-header"><?php echo $h2; ?></h2> 86 <div id="backbonerevisionsinteract"></div> 87 <div id="backbonerevisionsdiff"></div> 88 <hr /> 210 89 <?php 90 $comparetworevisionslink = admin_url ( sprintf( 'revision.php?revision=%d&action=edit', $revision ) ); 91 ?> 92 </div> 93 </div> 211 94 212 $args = array( 'format' => 'form-table', 'parent' => true, 'right' => $right, 'left' => $left ); 213 if ( ! WP_POST_REVISIONS || !post_type_supports($post->post_type, 'revisions') ) 214 $args['type'] = 'autosave'; 95 <script id="tmpl-revision" type="text/html"> 96 <div id="diffsubheader"> 97 <span id="diff_from_current_revision"><?php _e( 'Current version' ); ?><?php _e( ' - compared to -' ); ?></span> 98 <div id="difftitlefrom">{{{ data.revision_from_date_author }}} <?php _e( ' - compared to -' ); ?></div> 99 <div id="difftitle">{{{ data.revision_date_author }}}</div> 100 <div id="diffcancel"><input class="button" onClick="document.location='<?php echo get_edit_post_link( $postid ); ?>'" type="submit" id="cancel" value="<?php esc_attr_e( 'Cancel' )?>" /></div> 101 <div id="diffrestore"><input class="button button-primary" onClick="document.location='{{{ data.restoreaction }}}'" type="submit" id="restore" value="<?php esc_attr_e( 'Restore' )?>" /></div> 102 <div id="comparetworevisions"><input type="checkbox" id="comparetwo" value="comparetwo" {{{ data.comparetwochecked }}} name="comparetwo"/> <?php esc_attr_e( 'Compare two revisions' )?></div> 103 </div> 104 <div id="removedandadded"> 105 <div id="removed"><?php _e( 'Removed -' ); ?></div> 106 <div id="added"><?php _e( 'Added +' ); ?></div> 107 </div 108 <div>{{{ data.revisiondiff }}}</div> 109 </script> 215 110 216 wp_list_post_revisions( $post, $args ); 111 <script id="tmpl-revisionvinteract" type="text/html"> 112 <div id="diffheader"> 113 <div id="diffprevious"><input class="button" type="submit" id="previous" value="Previous" /></div> 114 <div id="diffnext"><input class="button" type="submit" id="next" value="Next" /></div> 115 <div id="diffslider"> 116 <div id="revisioncount"> 117 <?php _e( 'Comparing' ); ?> 118 <span id="diff_left_count"> <?php _e( 'revision' ); ?></span> <span id="diff_left_count_inner"></span> 119 <span id="diff_left_current_revision"><?php _e( ' current version ' ); ?></span> 120 <span id="diff_revision_from">{{{ data.diff_revision_from }}}</span> 121 <?php _e( ' to revision' ); ?> 122 <span id="diff_count">{{{ data.current_diff }}}</span> 123 <?php _e( ' of ' ); ?> 124 <span id="diff_max" ></span> 125 </div> 217 126 218 ?> 127 <div id="slider"></div> 128 </div> 129 </div> 130 </script> 219 131 220 </div> 132 <script id="tmpl-revisionoptions" type="text/html"> 133 <div id="revisionoptions"> 134 <div id="showsplitviewoption"> 135 <input type='checkbox' id="showsplitview" checked="checked" value="1" /> <?php _e( 'Show split diff view' ); ?> 136 </div> 137 <div id="toggleshowautosavesoption"> 138 <input type='checkbox' id="toggleshowautosaves" value="1" /> <?php _e( 'Show autosaves' ); ?> 139 </div> 140 </div> 141 </script> 221 142 222 143 <?php 223 require_once( './admin-footer.php' ); 144 145 require( './admin-footer.php' ); -
wp-admin/edit-form-advanced.php
168 168 add_meta_box('authordiv', __('Author'), 'post_author_meta_box', null, 'normal', 'core'); 169 169 } 170 170 171 if ( post_type_supports($post_type, 'revisions') && 0 < $post_ID && wp_get_post_revisions( $post_ID ))171 if ( post_type_supports($post_type, 'revisions') && 0 < $post_ID && count ( wp_get_post_revisions( $post_ID ) ) > 1 ) 172 172 add_meta_box('revisionsdiv', __('Revisions'), 'post_revisions_meta_box', null, 'normal', 'core'); 173 173 174 174 do_action('add_meta_boxes', $post_type, $post); -
wp-admin/css/colors-fresh.css
1299 1299 1300 1300 /* Diff */ 1301 1301 table.diff .diff-deletedline { 1302 background-color: #fdd; 1302 background-color: #ffe5e6; 1303 color: #f2001f; 1304 text-decoration: line-through; 1303 1305 } 1304 1306 1305 1307 table.diff .diff-deletedline del { 1306 1308 background-color: #f99; 1307 1309 } 1308 1310 1311 table.diff .diff-deletedline-symbol { 1312 color: #f2001f; 1313 } 1314 1309 1315 table.diff .diff-addedline { 1310 background-color: #dfd; 1316 background-color: #e9f6ea; 1317 color: #00a500; 1311 1318 } 1312 1319 1320 table.diff .diff-addedline-symbol { 1321 color: #00a500; 1322 } 1323 1313 1324 table.diff .diff-addedline ins { 1314 1325 background-color: #9f9; 1315 1326 } -
wp-admin/css/wp-admin.css
3495 3495 } 3496 3496 3497 3497 table.diff col.content { 3498 width: 50%;3498 width: auto; 3499 3499 } 3500 3500 3501 table.diff col.content.diffsplit { 3502 width: 48%; 3503 } 3504 3505 table.diff col.diffsplit.middle { 3506 width: 4%; 3507 } 3508 3509 table.diff col.ltype { 3510 width: 30px; 3511 } 3512 3501 3513 table.diff tr { 3502 3514 background-color: transparent; 3503 3515 } … … 8722 8734 .locale-lt-lt .inline-edit-row fieldset label span.input-text-wrap { 8723 8735 margin-left: 8em; 8724 8736 } 8737 8738 #revisions-meta-mostrecent, 8739 #revisions-meta-stored, 8740 #revisions-meta-oldest, 8741 #revisions-meta-link, 8742 #revisions-meta-restored { 8743 line-height: 30px; 8744 height: 30px; 8745 vertical-align: middle; 8746 padding-right: 10px; 8747 } 8748 #revisions-meta-mostrecent img, 8749 #revisions-meta-oldest img { 8750 vertical-align: middle; 8751 } -
wp-admin/css/revisions.css
1 /* Styles for the revision screen */ 2 3 .revisiondiffcontainer { 4 width: 96%; 5 } 6 7 .revisiondiffcontainer input.button { 8 margin: 2px; 9 } 10 11 #diffrestore, #diffnext, #diffcancel { 12 float: right; 13 margin-right: 5px; 14 } 15 16 #diffprevious, #difftitle, #difftitlefrom, #diff_from_current_revision { 17 float: left; 18 margin-left: 5px; 19 height: 35px; 20 } 21 22 #diffprevious, #diffnext { 23 margin-top: 7px; 24 height: 30px; 25 } 26 27 #diffheader, #diffsubheader { 28 clear: both; 29 width: 100%; 30 } 31 32 #diffheader { 33 border-bottom: 2px solid #999; 34 width: 100%; 35 height: 45px; 36 line-height: 45px; 37 padding-top: 10px; 38 } 39 40 #diffsubheader { 41 background-color: #eee; 42 border-bottom: 2px solid #999; 43 width: 100%; 44 height:35px; 45 line-height: 35px; 46 } 47 48 #diffslider { 49 width: 70%; 50 margin-left: auto; 51 margin-right: auto; 52 text-align: center; 53 height: 3.5em; 54 55 } 56 57 #revisioncount { 58 width: 50%; 59 margin-left: auto; 60 margin-right: auto; 61 margin-top: 0; 62 line-height: 1em; 63 height: 1em; 64 text-align: center; 65 clear: none; 66 padding: 5px; 67 } 68 69 .revisiondiffcontainer { 70 margin-top: 10px; 71 } 72 73 #diffsliderwrap { 74 width: 80%; 75 margin-left: auto; 76 margin-right: auto; 77 } 78 79 #diffsliderwrap #sliderinner { 80 position: relative; 81 top: 47px; 82 } 83 84 #removedandadded { 85 width: 100% 86 padding-bottom: 30px; 87 padding-top: 3px; 88 font-size: 16px; 89 } 90 91 #removed, #added { 92 width: auto; 93 text-align: left; 94 padding-left: 5px; 95 padding-right: 5px; 96 padding-top: 5px; 97 padding-bottom: 5px; 98 float: left; 99 } 100 101 .diffsplit #added { 102 float: right; 103 width: 47%; 104 text-align: left; 105 } 106 107 .diffsplit #removedandadded { 108 width: 100%; 109 } 110 111 #added { 112 padding-left: 10px; 113 } 114 115 #removed { 116 padding-left: 0px; 117 } 118 119 #removed { 120 color: #d2281f; 121 } 122 123 #added { 124 color: #00a100; 125 } 126 127 #comparetworevisions { 128 float: right; 129 line-height: 35px; 130 padding-right: 5px; 131 } 132 133 #comparetworevisions input{ 134 margin-right: 2px; 135 } 136 137 #difftitle img, #difftitlefrom img { 138 vertical-align: middle; 139 margin-left: 5px; 140 } 141 142 #showsplitviewoption, #toggleshowautosavesoption { 143 float: right; 144 padding-left: 10px; 145 padding-right: 10px; 146 } 147 148 #revisionoptions { 149 margin-top: 0px; 150 line-height: 40px; 151 clear: both; 152 width: 100%; 153 } 154 155 .comparetwo #diffprevious, .comparetwo #diffnext { 156 display: none; 157 } 158 159 .comparetwo #diffslider { 160 width: 95%; 161 } 162 163 .currentversion span#diff_left_current_revision { 164 display: inline; 165 } 166 167 span#diff_left_current_revision, span#diff_from_current_revision { 168 display: none; 169 } 170 171 span#diff_left_count, span#diff_left_count_inner { 172 display: inline; 173 } 174 175 .currentversion span#diff_left_count, 176 .currentversion span#diff_left_count_inner, 177 .currentversion #difftitlefrom { 178 display: none; 179 } 180 181 #difftitlefrom { 182 float: left; 183 display: none; 184 } 185 186 .comparetwo #difftitlefrom, .comparetwo.currentversion span#diff_from_current_revision { 187 display: inline; 188 } 189 .comparetwo.currentversion #difftitlefrom { 190 display: none; 191 } 192 193 #modelsloading { 194 float: right; 195 line-height: 30px; 196 display: none; 197 clear: none; 198 margin: 0; 199 margin-top: -40px; 200 } 201 202 #modelsloading .spinner { 203 float: left; 204 } 205 206 .leftmodelloading #modelsloading, 207 .rightmodelloading #modelsloading, 208 .leftmodelloading #modelsloading .spinner, 209 .rightmodelloading #modelsloading .spinner { 210 display: inline; 211 } 212 213