Ticket #23497: 23497.7.diff
File 23497.7.diff, 56.4 KB (added by , 12 years ago) |
---|
-
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 36 //TODO add ability to arrive on specific revision 37 routes : { 38 "viewrevision/:revision": "viewrevision", 39 }, 40 41 getcompareoneortwo : function() { 42 return this._compareoneortwo; 43 }, 44 45 setcompareoneortwo : function(oneortwo) { 46 this._compareoneortwo = oneortwo; 47 }, 48 49 viewrevision : function(revision) { 50 }, 51 52 getrightdiff : function() { 53 return this._right_diff; 54 }, 55 56 setrightdiff : function(right) { 57 this._right_diff = right; 58 }, 59 60 getautosaves : function() { 61 return this._autosaves; 62 }, 63 64 setautosaves : function(autosaves) { 65 this._autosaves = autosaves; 66 }, 67 68 getleftdiff : function() { 69 return this._left_diff; 70 }, 71 72 setleftdiff : function(left) { 73 this._left_diff = left; 74 }, 75 76 getsplitview : function() { 77 return this._showsplitview; 78 }, 79 80 setsplitview : function(splitview){ 81 this._showsplitview = splitview; 82 }, 83 84 /* 85 * initialize the revision appl;ication 86 */ 87 initialize : function(options) { 88 var self = this; //store the application instance 89 if (this._revisions === null) { 90 self._autosaves = ''; 91 self._revisions = new wp.revisions.Collection(); //set up collection 92 self._revisions.fetch({ //load revision data 93 success : function() { 94 self.revisionDiffSetup(); 95 } 96 }); 97 } 98 99 return this; 100 }, 101 102 revisionDiffSetup : function() { 103 var self = this, slider; 104 105 this._revisionView = new wp.revisions.views.View({ 106 model : this._revisions 107 }); 108 this._revisionView.render(); 109 110 this._revisionsInteractions = new wp.revisions.views.Interact({ 111 model : this._revisions 112 }); 113 this._revisionsInteractions.render(); 114 115 this._revisionsOptions = new wp.revisions.views.Options({ 116 model : this._revisions 117 }); 118 this._revisionsOptions.render(); 119 120 } 121 }) 122 }; 123 124 wp.revisions.Collection = Backbone.Collection.extend({ 125 model : wp.revisions.Model, 126 url : ajaxurl + '?action=revisions-data&compareto=' + postid + '&showautosaves=false&showsplitview=true' 127 }); 128 129 _.extend(wp.revisions.views, { 130 // 131 //primary revision diff view 132 // 133 View : Backbone.View.extend({ 134 el : $('#backbonerevisionsdiff')[0], 135 tagName : 'revisionvview', 136 className : 'revisionview-container', 137 template : wp.template('revision'), 138 revvapp : null, 139 comparetwochecked : '', 140 draggingleft : false, 141 142 initialize : function(){ 143 }, 144 145 // 146 //render the revisions 147 // 148 render : function() { 149 var addhtml = ''; 150 //compare two revisions mode? 151 if ( 2 == REVAPP.getcompareoneortwo() ) { 152 this.comparetwochecked = 'checked'; 153 if ( this.draggingleft ) { 154 if ( this.model.at( REVAPP.getleftdiff() ) ) { 155 addhtml = this.template( _.extend( 156 this.model.at( REVAPP.getleftdiff() ).toJSON(), 157 { comparetwochecked : this.comparetwochecked } //keep the checkmark checked 158 ) ); 159 } 160 } else { //dragging right handle 161 var thediff = REVAPP.getrightdiff() + REVAPP.getleftdiff() - 1; 162 if ( this.model.at( thediff ) ) { 163 addhtml = this.template( _.extend( 164 this.model.at( thediff ).toJSON(), 165 { comparetwochecked : this.comparetwochecked } //keep the checkmark checked 166 ) ); 167 } 168 } 169 } else { //end compare two revisions mode, eg only one slider handel 170 this.comparetwochecked = ''; 171 if ( this.model.at( REVAPP.getrightdiff() - 1 ) ) { 172 addhtml = this.template( _.extend( 173 this.model.at( REVAPP.getrightdiff()-1 ).toJSON(), 174 { comparetwochecked : this.comparetwochecked } //keep the checkmark checked 175 ) ); 176 } 177 } 178 this.$el.html( addhtml ); 179 return this; 180 }, 181 182 //the compare two button is in this view, add the interaction here 183 events : { 184 'click #comparetwo' : 'clickcomparetwo' 185 }, 186 187 // 188 //turn on/off the compare two mmode 189 // 190 clickcomparetwo : function(){ 191 self = this; 192 if ( $( 'input#comparetwo' ).is( ':checked' ) ) { 193 REVAPP.setcompareoneortwo( 2 ); 194 } else { 195 REVAPP.setcompareoneortwo( 1 ); 196 REVAPP._revisionView.draggingleft = false; 197 REVAPP.setleftdiff( 0 ); 198 this.model.url = ajaxurl + '?action=revisions-data&compareto=' + postid + 199 '&showautosaves=' + REVAPP.getautosaves() + 200 '&showsplitview=' + REVAPP.getsplitview(); 201 this.model.fetch({ //reload revision data 202 success : function() { 203 self.render(); 204 } 205 }); 206 } 207 REVAPP._revisionsInteractions.render(); 208 } 209 }), 210 211 // 212 //options view for show autosaves and show split view options 213 // 214 Options : Backbone.View.extend({ 215 el : $('#backbonerevisionsoptions')[0], 216 tagName : 'revisionoptionsview', 217 className : 'revisionoptions-container', 218 template : wp.template('revisionoptions'), 219 220 initialize : function() { 221 }, 222 223 //render the options view 224 render : function() { 225 var addhtml = this.template; 226 this.$el.html( addhtml ); 227 return this; 228 }, 229 230 //add options interactions 231 events : { 232 'click #toggleshowautosaves' : 'toggleshowautosaves', 233 'click #showsplitview' : 'showsplitview' 234 }, 235 236 // 237 //toggle include autosaves in the fetched revisions? 238 //passed to ajax call 239 // 240 toggleshowautosaves : function() { 241 var self = this; 242 if ( $( '#toggleshowautosaves' ).is( ':checked' ) ) { 243 REVAPP.setautosaves( true ); 244 } else { 245 REVAPP.setautosaves( false ); 246 } 247 //refresh the model data 248 //TODO check for two handle mode 249 this.model.url = ajaxurl + '?action=revisions-data&compareto=' + postid + 250 '&showautosaves=' + REVAPP.getautosaves() + 251 '&showsplitview=' + REVAPP.getsplitview(); 252 this.model.fetch({ //reload revision data 253 success : function() { 254 var revisioncount = self.model.length; 255 if ( REVAPP.getrightdiff() > revisioncount ) //if right handle past rightmost, move 256 REVAPP.setrightdiff( revisioncount ); 257 //TODO add a test for matchind left revision and push left, testing 258 //also reset the slider values here 259 260 REVAPP._revisionView.render(); 261 $( '#slider' ).slider( 'option', 'max', revisioncount-1 ); //TODO test this 262 } 263 }); 264 }, 265 266 // 267 //toggle showing the split diff view 268 // 269 showsplitview : function() { 270 var self = this; 271 272 if ( $( 'input#showsplitview' ).is( ':checked' ) ) { 273 REVAPP.setsplitview( 'true' ); 274 $('.revisiondiffcontainer').addClass('diffsplit'); 275 } else { 276 REVAPP.setsplitview( '' ); 277 $('.revisiondiffcontainer').removeClass('diffsplit'); 278 } 279 280 this.model.url = 281 ajaxurl + '?action=revisions-data&compareto=' + postid + 282 '&showautosaves=' + REVAPP.getautosaves() + 283 '&showsplitview=' + REVAPP.getsplitview(); 284 this.model.fetch({ //reload revision data 285 286 success : function() { 287 REVAPP._revisionView.render(); 288 } 289 290 }); 291 } 292 }), 293 294 // 295 //main interactions view 296 // 297 Interact : Backbone.View.extend({ 298 el : $('#backbonerevisionsinteract')[0], 299 tagName : 'revisionvinteract', 300 className : 'revisionvinteract-container', 301 template : wp.template('revisionvinteract'), 302 303 initialize : function() { 304 }, 305 306 render : function() { 307 var self = this; 308 309 var addhtml = this.template; 310 this.$el.html( addhtml ); 311 $( '#diff_max, #diff_maxof' ).html( this.model.length ); 312 $( '#diff_count' ).html( REVAPP.getrightdiff() ); 313 $( '#diff_left_count_inner' ).html( 0 == REVAPP.getleftdiff() ? '' : 'revision' + REVAPP.getleftdiff() ); 314 315 var modelcount = REVAPP._revisions.length; 316 317 slider = $("#slider"); 318 if ( 1 == REVAPP.getcompareoneortwo() ) { 319 //set up the slider with a single handle 320 slider.slider({ 321 value : REVAPP.getrightdiff()-1, 322 min : 0, 323 max : modelcount-1, 324 step : 1, 325 326 //slide interactions for one handles slider 327 slide : function( event, ui ) { 328 REVAPP.setrightdiff( ui.value+1 ); 329 $( '#diff_count' ).html( REVAPP.getrightdiff() ); 330 REVAPP._revisionView.render(); 331 } 332 }); 333 $( '.revisiondiffcontainer' ).removeClass( 'comparetwo' ); 334 } else { //comparing more than one, eg 2 335 //set up the slider with two handles 336 slider.slider({ 337 values : [ REVAPP.getleftdiff(), REVAPP.getrightdiff() + 1 ], 338 min : 1, 339 max : modelcount+1, 340 step : 1, 341 range: true, 342 343 //in two handled mode when user starts dragging, swap in precalculated diff for handle 344 start : function (event, ui ) { 345 var index = $( ui.handle ).index(); //0 (left) or 1 (right) 346 347 switch ( index ) { 348 case 1: //left handle drag 349 if ( REVAPP._revisionView.model !== REVAPP._left_handle_revisions && 350 null != REVAPP._left_handle_revisions ) 351 REVAPP._revisionView.model = REVAPP._left_handle_revisions; 352 353 REVAPP._revisionView.draggingleft = true; 354 break; 355 356 case 2: //right 357 //one extra spot at left end when comparing two 358 if ( REVAPP._revisionView.model !== REVAPP._right_handle_revisions && 359 null != REVAPP._right_handle_revisions ) 360 REVAPP._revisionView.model = REVAPP._right_handle_revisions; 361 362 REVAPP._revisionView.draggingleft = false; 363 REVAPP.setrightdiff( ui.values[1] - 1 ); 364 break; 365 } 366 }, 367 368 //when sliding in two handled mode change appropriate value 369 slide : function( event, ui ) { 370 if ( ui.values[0] == ui.values[1] ) //prevent compare to self 371 return false; 372 373 var index = $( ui.handle ).index(); //0 (left) or 1 (right) 374 375 switch ( index ) { 376 case 1: //left 377 REVAPP.setleftdiff( ui.values[0] - 1 ); //one extra spot at left end when comparing two 378 break; 379 380 case 2: //right 381 REVAPP.setrightdiff( ui.values[1] - 1 ); 382 break; 383 } 384 385 $( '#diff_count' ).html( REVAPP.getrightdiff() ); 386 387 if ( 0 == REVAPP.getleftdiff() ) { 388 $( '.revisiondiffcontainer' ).addClass( 'currentversion' ); 389 390 } else { 391 $( '.revisiondiffcontainer' ).removeClass( 'currentversion' ); 392 $( '#diff_left_count_inner' ).html( REVAPP.getleftdiff() ); 393 } 394 395 REVAPP._revisionView.render(); //render the diff view 396 }, 397 398 //when the user stops sliding in 2 handle mode, recalculate diffs 399 stop : function( event, ui ) { 400 if ( 2 == REVAPP.getcompareoneortwo() ) { 401 402 //calculate and generate a diff for comparing to the left handle 403 //and the right handle, swap out when dragging 404 //TODO: cache these models after fetching? 405 REVAPP._left_handle_revisions = new wp.revisions.Collection(); 406 REVAPP._right_handle_revisions = new wp.revisions.Collection(); 407 408 if ( 0 == REVAPP.getleftdiff() ) { 409 REVAPP._right_handle_revisions.url = 410 ajaxurl + 411 '?action=revisions-data&compareto=' + postid + 412 '&showautosaves=' + REVAPP.getautosaves() + 413 '&showsplitview=' + REVAPP.getsplitview(); 414 } else { 415 REVAPP._right_handle_revisions.url = 416 ajaxurl + 417 '?action=revisions-data&compareto=' + self.model.at( REVAPP.getleftdiff() - 1 ).get( 'ID' ) + 418 '&postid=' + postid + '&showautosaves=' + REVAPP.getautosaves() + 419 '&showsplitview=' + REVAPP.getsplitview(); 420 } 421 422 REVAPP._left_handle_revisions.url = 423 ajaxurl + 424 '?action=revisions-data&compareto=' + self.model.at( REVAPP.getrightdiff() - 1 ).get( 'ID' ) + 425 '&postid=' + postid + '&showautosaves=' + REVAPP.getautosaves() + 426 '&showsplitview=' + REVAPP.getsplitview(); 427 428 REVAPP._left_handle_revisions.fetch(); 429 REVAPP._right_handle_revisions.fetch(); 430 } 431 } 432 }); 433 $( '.revisiondiffcontainer' ).addClass( 'comparetwo' ); 434 } 435 436 return this; 437 }, 438 439 //next and previous buttons, only available in compare one mode 440 events : { 441 'click #next' : 'nextrevision', 442 'click #previous' : 'previousrevision' 443 }, 444 445 //go to the next revision 446 nextrevision : function() { 447 if ( REVAPP.getrightdiff() < this.model.length ) //unless at right boundry 448 REVAPP.setrightdiff( REVAPP.getrightdiff() + 1 ); 449 450 REVAPP._revisionView.render(); 451 452 $( '#diff_count' ).html( REVAPP.getrightdiff() ); 453 $( '#slider' ).slider( 'value', REVAPP.getrightdiff() - 1 ).trigger( 'slide' ); 454 }, 455 456 //go the the previous revision 457 previousrevision : function() { 458 if ( REVAPP.getrightdiff() > 1 ) //unless at left boundry 459 REVAPP.setrightdiff( REVAPP.getrightdiff() - 1 ); 460 461 REVAPP._revisionView.render(); 462 463 $( '#diff_count' ).html( REVAPP.getrightdiff() ); 464 $( '#slider' ).slider( 'value', REVAPP.getrightdiff() - 1 ).trigger( 'slide' ); 465 } 466 }) 467 }); 468 469 //instantiate Revision Application 470 REVAPP = new wp.revisions.App(); 471 //TODO consider enable back button to step back thru states? 472 Backbone.history.start(); 473 474 }(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 ); … … 537 540 $styles->add( 'customize-controls', "/wp-admin/css/customize-controls$suffix.css", array( 'wp-admin', 'colors', 'ie' ) ); 538 541 $styles->add( 'media-views', "/wp-includes/css/media-views$suffix.css", array( 'buttons' ) ); 539 542 $styles->add( 'buttons', "/wp-includes/css/buttons$suffix.css" ); 543 $styles->add( 'revisions', "/wp-admin/css/revisions$suffix.css" ); 544 $styles->add( 'wp-jquery-ui-slider', "/wp-includes/css/jquery-ui-slider$suffix.css" ); 540 545 541 546 foreach ( $rtl_styles as $rtl_style ) { 542 547 $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 $compareto_author = get_the_author_meta( 'display_name', $left_revision->post_author ); 2178 /* translators: revision date format, see http://php.net/date */ 2179 $datef = _x( 'j F, Y @ G:i:s', 'revision date format'); 2180 2181 $gravatar = get_avatar( $revision->post_author, 18 ); 2182 $compareto_gravatar = get_avatar( $left_revision->post_author, 18 ); 2183 2184 $date = date_i18n( $datef, strtotime( $revision->post_modified ) ); 2185 $compareto_date = date_i18n( $datef, strtotime( $left_revision->post_modified ) ); 2186 $revision_date_author = sprintf( 2187 '%s %s, %s %s (%s)', 2188 $gravatar, 2189 $author, 2190 human_time_diff( strtotime( $revision->post_modified ), current_time( 'timestamp' ) ), 2191 __( ' ago ' ), 2192 $date 2193 ); 2194 2195 if ( $comparetwomode ) { 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, 'action' => 'restore' ), 2210 '/wp-admin/revision.php' 2211 ), 2212 "restore-post_$compareto|$revision->ID" 2213 ); 2214 2215 // 2216 //make sure the left revision is the most recent 2217 // 2218 if ( strtotime( $right_revision->post_modified_gmt ) < strtotime( $left_revision->post_modified_gmt ) ) { 2219 $temp = $left_revision; 2220 $left_revision = $right_revision; 2221 $right_revision = $temp; 2222 } 2223 2224 // 2225 //compare from left to right, passed from application 2226 // 2227 $content=''; 2228 foreach ( array_keys( _wp_post_revision_fields() ) as $field ) { 2229 $left_content = apply_filters( "_wp_post_revision_field_$field", $left_revision->$field, $field, $left_revision, 'left' ); 2230 $right_content = apply_filters( "_wp_post_revision_field_$field", $right_revision->$field, $field, $right_revision, 'right' ); 2231 2232 add_filter( "_wp_post_revision_field_$field", 'wp_kses_post' ); 2233 2234 $args = array(); 2235 2236 if ( 'true' == $showsplitview ) 2237 $args = array( 'showsplitview' => 'true' ); 2238 2239 $content .= wp_text_diff( $left_content, $right_content, $args ); 2240 } 2241 2242 //if we are comparing two revisions 2243 //and we are on the matching revision 2244 //add an error revision indicating unable to compare to self 2245 if ( $comparetwomode && $compareto == $revision->ID ) 2246 $alltherevisions[] = array ( 2247 'ID' => $revision->ID, 2248 'revision_date_author' => $revision_date_author, 2249 'revisiondiff' => sprintf('<div id="selfcomparisonerror">%s</div>', __( 'Cannot compare revision to itself' ) ), 2250 'restoreaction' => urldecode( $restoreaction ), 2251 'revision_from_date_author' => '' 2252 ); 2253 2254 //add to the return data only if there is a difference 2255 if ( '' != $content ) 2256 $alltherevisions[] = array ( 2257 'ID' => $revision->ID, 2258 'revision_date_author' => $revision_date_author, 2259 'revisiondiff' => $content, 2260 'restoreaction' => urldecode( $restoreaction ), 2261 'revision_from_date_author' => $revision_from_date_author 2262 ); 2263 2264 endforeach; 2265 2266 //remove initial revision that only contains 2267 //post title 2268 //TODO remove if this is fixed and initial revision not created 2269 array_pop( $alltherevisions ); 2270 echo json_encode( $alltherevisions ); 2271 exit(); 2272 } -
wp-admin/includes/meta-boxes.php
178 178 <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js"><?php _e('Edit') ?></a> 179 179 <div id="timestampdiv" class="hide-if-js"><?php touch_time(($action == 'edit'), 1); ?></div> 180 180 </div><?php // /misc-pub-section ?> 181 <?php endif; 182 183 $the_revisions = wp_get_post_revisions( $post->ID ); 184 185 if ( post_type_supports( $post_type, 'revisions' ) && count( $the_revisions ) ) : 186 ?> 187 <div id="post-revisions-link" class="misc-pub-section" > 188 <span id="revisions-link"><?php _e( 'Revisions:' ) ?></span> 189 <a href="<?php printf( 'revisions.php?revision=%s&postid=%s&action=edit', key( $the_revisions ), $post->ID )?>" class="edit-revisions hide-if-no-js"> 190 <?php _e( 'View' ); ?> 191 </a> 192 </div> 181 193 <?php endif; ?> 182 194 183 195 <?php do_action('post_submitbox_misc_actions'); ?> … … 979 991 function post_thumbnail_meta_box( $post ) { 980 992 $thumbnail_id = get_post_meta( $post->ID, '_thumbnail_id', true ); 981 993 echo _wp_post_thumbnail_html( $thumbnail_id, $post->ID ); 982 } 983 No newline at end of file 994 } -
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 } -
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 -
wp-admin/revisions.php
1 <?php 2 /** 3 * Revisions administration panel. 4 * 5 * @package WordPress 6 * @subpackage Administration 7 */ 8 9 /** WordPress Administration Bootstrap */ 10 require( './admin.php' ); 11 wp_reset_vars( array( 'postid', 'revision', 'action' ) ); 12 13 $postid = absint( $postid ); 14 if ( ! current_user_can( 'edit_post', $postid ) ) { 15 wp_redirect( 'edit.php' ); 16 exit; 17 } 18 19 if ( ! WP_POST_REVISIONS || ! post_type_supports( get_post( $postid )->post_type, 'revisions') ) { // Revisions disabled 20 wp_redirect( get_edit_post_link( $postid , '') ); 21 exit; 22 } 23 24 wp_enqueue_style( 'revisions' ); 25 wp_enqueue_style( 'wp-jquery-ui-slider' ); 26 27 wp_enqueue_script( 'jquery-ui-slider' ); 28 wp_enqueue_script( 'backbone' ); 29 wp_enqueue_script( 'revisions' ); 30 31 require( './admin-header.php' ); 32 33 $post_title = sprintf ('<a href="%s">%s</a>', get_edit_post_link( $postid ), get_the_title( $postid ) ); 34 $h2 = sprintf( __( 'Compare Revisions of “%1$s”' ), $post_title ); 35 36 ?> 37 <script type="text/javascript"> 38 var postid = <?php echo $postid; ?>; 39 </script> 40 41 42 <div id="backbonerevisionsoptions"></div> 43 44 <br class="clear"/> 45 <div class="wrap"> 46 <div class="icon32 icon32-posts-post" id="icon-edit"><br></div> 47 <h2 class="long-header"><?php echo $h2; ?></h2> 48 <div class="revisiondiffcontainer diffsplit currentversion"> 49 50 <div id="backbonerevisionsinteract"></div> 51 <div id="backbonerevisionsdiff"></div> 52 <hr /> 53 <?php 54 $comparetworevisionslink = admin_url ( sprintf( 'revision.php?revision=%d&action=edit', $revision ) ); 55 ?> 56 </div> 57 </div> 58 59 <script id="tmpl-revision" type="text/html"> 60 <div id="diffsubheader"> 61 <span id="diff_from_current_revision"><?php _e( 'Current version' ); ?><?php _e( ' - compared to -' ); ?></span> 62 <div id="difftitlefrom">{{{ data.revision_from_date_author }}} <?php _e( ' - compared to -' ); ?></div> 63 <div id="difftitle">{{{ data.revision_date_author }}}</div> 64 <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> 65 <div id="diffrestore"><input class="button button-primary" onClick="document.location='{{{ data.restoreaction }}}'" type="submit" id="restore" value="<?php esc_attr_e( 'Restore' )?>" /></div> 66 <div id="comparetworevisions"><input type="checkbox" id="comparetwo" value="comparetwo" {{{ data.comparetwochecked }}} name="comparetwo"/> <?php esc_attr_e( 'Compare two revisions' )?></div> 67 </div> 68 <div id="removedandadded"> 69 <div id="removed"><?php _e( 'Removed -' ); ?></div> 70 <div id="added"><?php _e( 'Added +' ); ?></div> 71 </div 72 <div>{{{ data.revisiondiff }}}</div> 73 </script> 74 75 <script id="tmpl-revisionvinteract" type="text/html"> 76 <div id="diffheader"> 77 <div id="diffprevious"><input class="button" type="submit" id="previous" value="Previous" /></div> 78 <div id="diffnext"><input class="button" type="submit" id="next" value="Next" /></div> 79 <div id="diffslider"> 80 <div id="revisioncount"> 81 <?php _e( 'Comparing' ); ?> 82 <span id="diff_left_count"> <?php _e( 'revision' ); ?></span> <span id="diff_left_count_inner"></span> 83 <span id="diff_left_current_revision"><?php _e( ' current version ' ); ?></span> 84 <span id="diff_revision_from">{{{ data.diff_revision_from }}}</span> 85 <?php _e( ' to revision' ); ?> 86 <span id="diff_count">{{{ data.current_diff }}}</span> 87 <?php _e( ' of ' ); ?> 88 <span id="diff_max" ></span> 89 </div> 90 <div id="slider"></div></div> 91 </div> 92 </script> 93 94 <script id="tmpl-revisionoptions" type="text/html"> 95 <div id="revisionoptions"> 96 <div id="showsplitviewoption"> 97 <input type='checkbox' id="showsplitview" checked="checked" value="1" /> <?php _e( 'Show split diff view' ); ?> 98 </div> 99 <div id="toggleshowautosavesoption"> 100 <input type='checkbox' id="toggleshowautosaves" value="1" /> <?php _e( 'Show autosaves' ); ?> 101 </div> 102 </div> 103 </script> 104 105 <?php 106 107 require( './admin-footer.php' );