Ticket #23497: backbone-revisions-10.diff
File backbone-revisions-10.diff, 49.0 KB (added by , 12 years ago) |
---|
-
wp-includes/js/revisions.js
1 jQuery(function() { 2 /** 3 * Model 4 */ 5 Revision = Backbone.Model.extend( { 6 defaults: { //include all fields for now, pair it down later 7 ID : 0, 8 revision_date_author : '', 9 revisiondiff : '', 10 restoreaction: '', 11 diff_max : 0, 12 diff_count : 0 13 }, 14 initialize : function(){ 15 } 16 }); 17 18 RevisionCollection = Backbone.Collection.extend({ 19 model : Revision, 20 url : 'data/revisions-data.php?action=get&postid=' + postid + '&showautosaves=false' 21 }); 22 23 var RevisionView = Backbone.View.extend({ 24 el : jQuery('#backbonerevisionsdiff'), 25 tagName : 'revisionvview', 26 className : 'revisionview-container', 27 template : jQuery('#revisionTemplate').html(), 28 current_diff : 1, 29 total_length : 0, 30 initialize : function(){ 31 this.total_length = this.model.length; 32 self = this; 33 }, 34 render : function() { 35 var tmpl = _.template( this.template ); 36 var addhtml = ''; 37 therevisions = this.model; 38 if ( therevisions.at( this.current_diff-1 ) ) { 39 addhtml = tmpl( therevisions.at( this.current_diff-1 ).toJSON() ); 40 } 41 this.$el.html( addhtml ); 42 jQuery( '#diff_max' ).html( this.model.length ); 43 jQuery( '#diff_count' ).html( this.current_diff ); 44 return this; 45 } 46 }); 47 48 /* 49 * set up revision page as application 50 */ 51 52 var RevisionApplication = Backbone.Router.extend({ 53 _revisionListView : null, 54 _revisionDifflView : null, 55 _revisions : null, 56 routes : { 57 "*actions": "revisionDiff", 58 "revisiondetail/:id": "revisionDetail", 59 }, 60 showsplitview : '', 61 autosaves : false, 62 /* 63 * initialize the revision appl;ication 64 */ 65 initialize : function(options) { 66 var self = this; //store the application instance 67 if (this._revisions === null) { 68 self.autosaves=''; 69 self._revisions = new RevisionCollection(); //set up collection 70 self._revisions.autosaves='true'; 71 self._revisions.fetch({ //load revision data 72 success : function() { 73 self.revisionDiffSetup(); 74 }, 75 error : function() { 76 console.log( 'Error loading revision data' ); 77 } 78 }); 79 80 } 81 return this; 82 }, 83 84 revisionDiffSetup : function() { 85 var modelcount = this._revisions.length; 86 var self = this; 87 88 this._revisionView = new RevisionView({ 89 model : this._revisions 90 }); 91 this._revisionView.render(); 92 93 //set up slider 94 jQuery( "#slider" ).slider({ 95 value:0, 96 min : 0, 97 max : modelcount-1, 98 step : 1, 99 slide : function( event, ui ) { 100 self._revisionView.current_diff = ui.value+1; 101 self._revisionView.render(); 102 } 103 }); 104 105 //set up buttons 106 jQuery( 'input#previous' ).on("click", function() { 107 self._revisionView.current_diff--; 108 if ( self._revisionView.current_diff <= 1) 109 self._revisionView.current_diff = 1; 110 111 self._revisionView.render(); 112 jQuery( '#slider' ).slider( 'value', self._revisionView.current_diff-1); 113 jQuery( '#slider' ).trigger( 'slide' ); 114 }); 115 116 jQuery( 'input#next' ).on( 'click', function() { 117 self._revisionView.current_diff++; 118 if ( self._revisionView.current_diff >= self._revisionView.total_length ) 119 self._revisionView.current_diff = self._revisionView.total_length; 120 121 self._revisionView.render(); 122 jQuery('#slider').slider('value', self._revisionView.current_diff-1); 123 jQuery('#slider').trigger('slide'); 124 }); 125 126 //set up autosave toggle 127 jQuery( 'input#toggleshowautosaves' ).on( 'click', function() { 128 if ( jQuery ( 'input#toggleshowautosaves' ).is( ':checked' ) ) { 129 self.autosaves = true; 130 } else { 131 self.autosaves = false; 132 } 133 self._revisions.url = 'data/revisions-data.php?action=get&postid=' + postid + '&showautosaves=' + self.autosaves + '&showsplitview=' + self.showsplitview; 134 135 self._revisions.fetch({ //reload revision data 136 success : function() { 137 var revisioncount = self._revisionView.model.length; 138 if ( self._revisionView.current_diff > revisioncount ) 139 self._revisionView.current_diff = revisioncount; 140 self._revisionView.render(); 141 jQuery( '#slider' ).slider( 'option', 'max', revisioncount-1 ); 142 } 143 }); 144 } ); 145 146 //set up showsplitview toggle 147 jQuery( 'input#showsplitview' ).on( 'click', function() { 148 if ( jQuery ( 'input#showsplitview' ).is( ':checked' ) ) { 149 self.showsplitview = 'true'; 150 jQuery ( '.revisiondiffcontainer' ).addClass( 'diffsplit' ); 151 } else { 152 self.showsplitview = ''; 153 jQuery ( '.revisiondiffcontainer' ).removeClass( 'diffsplit' ); 154 155 } 156 self._revisions.url = 'data/revisions-data.php?action=get&postid=' + postid + '&showautosaves=' + self.autosaves + '&showsplitview=' + self.showsplitview; 157 self._revisions.fetch({ //reload revision data 158 success : function() { 159 self._revisionView.render(); 160 } 161 }); 162 } ); 163 164 165 } 166 }); 167 168 //instantiate RevisionApplication object 169 revapp = new RevisionApplication(); 170 Backbone.history.start(); 171 172 var RevsionListView = Backbone.View.extend({ 173 el : jQuery('#backbonerevisionslist'), 174 events : { 175 176 }, 177 render : function() { 178 addhtml=''; 179 var self = this; 180 therevisions = self.model; 181 therevisions.each( function( arevision ) { 182 addhtml = addhtml + '<br />' + (arevision.get("revision_date_author")); 183 }); 184 self.$el.html( addhtml ); 185 return this; 186 }, 187 clear : function() { 188 this.model.destroy(); 189 } 190 }); 191 192 }(jQuery)); -
wp-includes/wp-diff.php
59 59 */ 60 60 var $inline_diff_renderer = 'WP_Text_Diff_Renderer_inline'; 61 61 62 var $_showsplitview = false; 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-symbol'>+</td><td class='diff-addedline'>{$line}</td>"; 102 106 } 103 107 104 108 /** … … 108 112 * @return string 109 113 */ 110 114 function deletedLine( $line ) { 111 return "<td >-</td><td class='diff-deletedline'>{$line}</td>";115 return "<td class='diff-deletedline-symbol'>-</td><td class='diff-deletedline'>{$line}</td>"; 112 116 } 113 117 114 118 /** … … 118 122 * @return string 119 123 */ 120 124 function contextLine( $line ) { 121 return "<td ></td><td class='diff-context'>{$line}</td>";125 return "<td class='diff-context-symbol'>=</td><td class='diff-context'>{$line}</td>"; 122 126 } 123 127 124 128 /** … … 142 146 $r = ''; 143 147 foreach ($lines as $line) { 144 148 if ( $encode ) 145 $line = htmlspecialchars( $line ); 146 $r .= '<tr>' . $this->emptyLine() . $this->addedLine( $line ) . "</tr>\n"; 149 $line = wp_kses_post( $line ); 150 if ( ! $this->_showsplitview ) { 151 $r .= '<tr>' . $this->addedLine( $line ) . "</tr>\n"; 152 } else { 153 $r .= '<tr>' . $this->emptyLine() . $this->addedLine( $line ) . "</tr>\n"; 154 } 147 155 } 148 156 return $r; 149 157 } … … 160 168 $r = ''; 161 169 foreach ($lines as $line) { 162 170 if ( $encode ) 163 $line = htmlspecialchars( $line ); 164 $r .= '<tr>' . $this->deletedLine( $line ) . $this->emptyLine() . "</tr>\n"; 171 $line = wp_kses_post( $line ); 172 if ( ! $this->_showsplitview ) { 173 $r .= '<tr>' . $this->deletedLine( $line ) . "</tr>\n"; 174 } else { 175 $r .= '<tr>' . $this->deletedLine( $line ) . $this->emptyLine() . "</tr>\n"; 176 } 177 165 178 } 166 179 return $r; 167 180 } … … 178 191 $r = ''; 179 192 foreach ($lines as $line) { 180 193 if ( $encode ) 181 $line = htmlspecialchars( $line ); 182 $r .= '<tr>' . 183 $this->contextLine( $line ) . $this->contextLine( $line ) . "</tr>\n"; 194 $line = wp_kses_post( $line ); 195 if ( ! $this->_showsplitview ) { 196 $r .= '<tr>' . $this->contextLine( $line ) . "</tr>\n"; 197 } else { 198 $r .= '<tr>' . $this->contextLine( $line ) . $this->contextLine( $line ) . "</tr>\n"; 199 } 184 200 } 185 201 return $r; 186 202 } … … 264 280 } elseif ( $final_rows[$row] < 0 ) { // Final is blank. This is really a deleted row. 265 281 $r .= $this->_deleted( array($orig_line), false ); 266 282 } else { // A true changed row. 267 $r .= '<tr>' . $this->deletedLine( $orig_line ) . $this->addedLine( $final_line ) . "</tr>\n";283 $r .= '<tr>' . $this->deletedLine( $orig_line ) . "</tr><tr>" . $this->addedLine( $final_line ) . "</tr>\n"; 268 284 } 269 285 } 270 286 -
wp-includes/css/jquery-ui-slider.css
Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: wp-includes/images/ui-bg_gloss-wave_35_f6a828_500x100.png ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: wp-includes/images/ui-icons_ef8c08_256x240.1.png ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: wp-includes/images/ui-icons_ef8c08_256x240.2.png ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: wp-includes/images/ui-bg_flat_10_000000_40x100.png ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: wp-includes/images/ui-bg_diagonals-thick_20_666666_40x40.png ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: wp-includes/images/ui-icons_228ef1_256x240.png ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: wp-includes/images/ui-icons_ffd27a_256x240.png ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: wp-includes/images/ui-bg_diagonals-thick_18_b81900_40x40.png ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: wp-includes/images/ui-icons_ffffff_256x240.png ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: wp-includes/images/ui-bg_highlight-soft_75_ffe45c_1x100.png ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: wp-includes/images/ui-bg_glass_65_ffffff_1x400.png ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: wp-includes/images/ui-bg_highlight-soft_100_eeeeee_1x100.png ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: wp-includes/images/ui-icons_222222_256x240.png ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: wp-includes/images/ui-icons_ef8c08_256x240.png ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: wp-includes/images/animated-overlay.gif ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: wp-includes/images/ui-bg_glass_100_fdf5ce_1x400.png ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: wp-includes/images/ui-bg_glass_100_f6f6f6_1x400.png ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream
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='ltype' /><col class='content diffsplit' /><col class='ltype' /><col class='content diffsplit' />"; 1727 } else { 1728 $r .= "<col class='ltype' /><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
271 271 272 272 $scripts->add( 'underscore', '/wp-includes/js/underscore.min.js', array(), '1.4.4', 1 ); 273 273 $scripts->add( 'backbone', '/wp-includes/js/backbone.min.js', array('underscore','jquery'), '0.9.2', 1 ); 274 $scripts->add( 'revisions', "/wp-includes/js/revisions.js", array ('backbone'), '', 1 ); 274 275 275 276 $scripts->add( 'imgareaselect', "/wp-includes/js/imgareaselect/jquery.imgareaselect$suffix.js", array('jquery'), '0.9.8', 1 ); 276 277 … … 535 536 $styles->add( 'customize-controls', "/wp-admin/css/customize-controls$suffix.css", array( 'wp-admin', 'colors', 'ie' ) ); 536 537 $styles->add( 'media-views', "/wp-includes/css/media-views$suffix.css", array( 'buttons' ) ); 537 538 $styles->add( 'buttons', "/wp-includes/css/buttons$suffix.css" ); 539 $styles->add( 'revisions', "/wp-admin/css/revisions$suffix.css" ); 540 $styles->add( 'wp-jquery-ui-slider', "/wp-includes/css/jquery-ui-slider$suffix.css" ); 538 541 539 542 foreach ( $rtl_styles as $rtl_style ) { 540 543 $styles->add_data( $rtl_style, 'rtl', true ); -
wp-admin/includes/meta-boxes.php
1 <?php1 <?php 2 2 3 3 // -- Post related Meta Boxes 4 4 … … 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 $revision_count = count( $the_revisions ); 185 if ( post_type_supports( $post_type, 'revisions' ) && 0 < $revision_count ) : 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( 'revision2.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/revision2.php
1 <?php 2 /** 3 * Revisions administration panel. 4 * 5 * @package WordPress 6 * @subpackage Administration 7 */ 8 9 /** WordPress Administration Bootstrap */ 10 require_once( './admin.php' ); 11 wp_enqueue_script( 'backbone' ); 12 wp_enqueue_script( 'revisions' ); 13 wp_enqueue_script( 'jquery-ui-slider' ); 14 wp_enqueue_style( 'revisions' ); 15 wp_enqueue_style( 'wp-jquery-ui-slider' ); 16 17 require_once( './admin-header.php' ); 18 wp_reset_vars( array( 'postid', 'revision', 'action' ) ); 19 20 $post_title = '<a href="' . get_edit_post_link( $postid ) . '">' . get_the_title( $postid ) . '</a>'; 21 $h2 = sprintf( __( 'Compare Revisions of “%1$s”' ), $post_title ); 22 ?> 23 <script type="text/javascript"> 24 var postid = <?php echo $postid; ?>; 25 </script> 26 <div class="wrap"> 27 <div class="icon32 icon32-posts-post" id="icon-edit"><br></div> 28 <h2 class="long-header"><?php echo $h2; ?></h2> 29 <div class="revisiondiffcontainer"> 30 <div id="diffheader"> 31 <div id="diffprevious"><input class="button" type="submit" id="previous" value="Previous" /></div> 32 <div id="diffnext"><input class="button" type="submit" id="next" value="Next" /></div> 33 <div id="diffslider"><div id="revisioncount"><?php _e( 'Revision' ); ?> <span id="diff_count"></span> <?php _e( ' of ' ); ?><span id="diff_max" ></span></div><div id="slider"></div></div> 34 </div> 35 <div id="backbonerevisionsdiff"></div> 36 </div> 37 </div> 38 <script id="revisionTemplate" type="text/template"> 39 <div id="diffsubheader"> 40 <div id="difftitle"><%= revision_date_author %></div> 41 <div id="diffrestore"><input class="button button-primary" onClick="document.location='<%= restoreaction %>'" type="submit" id="restore" value="<?php esc_attr_e( 'Restore this Revision' )?>" /></div> 42 </div> 43 <div id="removedandadded"> 44 <div id="removed"><?php _e( '- Removed' ); ?></div> 45 <div id="unchanged"><?php _e( '= Unchanged' ); ?></div> 46 <div id="added"><?php _e( '+ Added' ); ?></div> 47 </div 48 <div><%= revisiondiff %></div> 49 </script> 50 51 <div id="backbonerevisionslist"></div> 52 53 <div id="revisionoptions"> 54 <input type='checkbox' id="showsplitview" value="1" /> <?php _e( 'Show split diff view' ); ?> 55 <br /> 56 <input type='checkbox' id="toggleshowautosaves" value="1" /> <?php _e( 'Show autosaves' ); ?> 57 </div> 58 <div id="previousrevisioninterfacelink"> 59 <?php 60 $old_revisions_link = admin_url ( sprintf( 'revision.php?revision=%d&action=edit', $revision ) ); 61 printf( '<a href="%s">%s</a>', $old_revisions_link, __( 'Use previous revisions interface' ) ) 62 ?> 63 </div> 64 65 <script type="text/javascript"> 66 jQuery( document ).ready( function () { 67 68 }); 69 </script> 70 71 <?php 72 require_once( './admin-footer.php' ); -
wp-admin/data/revisions-data.php
1 <?php 2 require_once( '../admin.php' ); 3 $alltherevisions = array(); 4 wp_reset_vars( array( 'postid', 'revision', 'left', 'right', 'action', 'showautosaves', 'showsplitview' ) ); 5 switch ( $action ) : 6 case 'get' : 7 if ( !$revisions = wp_get_post_revisions( $postid ) ) 8 return; 9 $count=1; 10 foreach ( $revisions as $revision ) : 11 if ( !current_user_can( 'read_post', $revision->ID ) ) 12 continue; 13 if ( 'true' != $showautosaves && wp_is_post_autosave( $revision ) ) 14 continue; 15 $author = get_the_author_meta( 'display_name', $revision->post_author ); 16 //$avatar = get_avatar( $revision->post_author, 22 ); 17 //$link = get_edit_post_link( $revision->ID ); 18 $link = $revision->ID ; 19 /* translators: revision date format, see http://php.net/date */ 20 $datef = _x( 'j F, Y @ G:i', 'revision date format'); 21 /* translators: 1: date */ 22 $autosavef = __( '%1$s [Autosave]' ); 23 /* translators: 1: date */ 24 $currentf = __( '%1$s [Current Revision]' ); 25 $date = date_i18n( $datef, strtotime( $revision->post_modified ) ); 26 $revision_date_author = human_time_diff( strtotime( $revision->post_modified ), current_time( 'timestamp' ) ); 27 $revision_date_author = sprintf('%s %s %s %s (%s)', __( 'Viewing revision from' ), $revision_date_author, __( ' ago, by ' ), $author, $date ); 28 $restoreaction = wp_nonce_url( add_query_arg( 29 array( 'revision' => $revision->ID, 'action' => 'restore' ), '/wp-admin/revision.php' ), 30 "restore-post_$postid|$revision->ID" ); 31 32 $alltherevisions[] = array ( 33 'ID' => $revision->ID, 34 'revision_date_author' => $revision_date_author, 35 'revisiondiff' => '', 36 'restoreaction' => urldecode( $restoreaction ) 37 ); 38 endforeach; 39 break; 40 endswitch; 41 $x=0; 42 $alltherevisionsreversed = array_reverse( $alltherevisions, true ); //reverse to iterate backwards calculating diff for each revision 43 44 foreach ( $alltherevisionsreversed as $revkey => $arevision ) { 45 $content = ''; 46 47 if ( $x++ < 1 ){ 48 $revision_previous = $arevision; 49 } else { 50 if ( ! $left_revision = get_post( $revision_previous[ 'ID' ] ) ) 51 break; 52 if ( ! $right_revision = get_post( $arevision[ 'ID' ] ) ) 53 break; 54 if ( ! $left_revision->post_parent == $right_revision->post_parent ) // both are revisions of common parent 55 break; 56 if ( $left_revision->ID == $right_revision->ID || ( !wp_get_post_revision( $left_revision->ID ) && ! wp_get_post_revision( $right_revision->ID ) ) ) 57 break; 58 59 foreach ( _wp_post_revision_fields() as $field => $field_title ) { 60 $left_content = apply_filters( "_wp_post_revision_field_$field", $left_revision->$field, $field, $left_revision, 'left' ); 61 $right_content = apply_filters( "_wp_post_revision_field_$field", $right_revision->$field, $field, $right_revision, 'right' ); 62 add_filter( "_wp_post_revision_field_$field", 'wp_kses_post' ); 63 64 $args = array(); 65 if ( $showsplitview ) 66 $args = array( 'showsplitview' => 'true' ); 67 if ( $content = wp_text_diff( $left_content, $right_content, $args ) ) { 68 $alltherevisionsreversed[ $revkey ][ 'revisiondiff' ] .= $content; 69 } 70 } 71 if ( "" == $alltherevisionsreversed[ $revkey ][ 'revisiondiff' ] ) { 72 unset( $alltherevisionsreversed[ $revkey ] ); 73 } 74 75 $revision_previous = $arevision; 76 } 77 } 78 $alltherevisions = array_reverse( $alltherevisionsreversed ); //reverse again before returning 79 80 array_pop( $alltherevisions ); 81 82 echo json_encode( $alltherevisions ); 83 84 85 ?> -
wp-admin/css/colors-fresh.css
1299 1299 1300 1300 /* Diff */ 1301 1301 table.diff .diff-deletedline { 1302 background-color: #fdd; 1302 background-color: #FAE6E6; 1303 color: #D2281F; 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: #D2281F; 1313 } 1314 1309 1315 table.diff .diff-addedline { 1310 background-color: #dfd; 1316 background-color: #EDF5EA; 1317 color: #00A100; 1311 1318 } 1312 1319 1320 table.diff .diff-addedline-symbol { 1321 color: #00A100; 1322 } 1323 1313 1324 table.diff .diff-addedline ins { 1314 1325 background-color: #9f9; 1315 1326 } -
wp-admin/css/wp-admin.css
3427 3427 } 3428 3428 3429 3429 table.diff col.content { 3430 width: auto; 3431 } 3432 3433 table.diff col.content.diffsplit { 3430 3434 width: 50%; 3431 3435 } 3432 3436 3437 table.diff col.ltype { 3438 width: 30px; 3439 } 3440 3433 3441 table.diff tr { 3434 3442 background-color: transparent; 3435 3443 } -
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 { 12 float: right; 13 margin-right: 5px; 14 } 15 16 #diffprevious, #difftitle { 17 float: left; 18 margin-left: 5px; 19 } 20 21 #diffheader, #diffsubheader { 22 clear: both; 23 width: 100%; 24 } 25 26 #diffheader { 27 border-bottom: 2px solid #999; 28 width: 100%; 29 height: 55px; 30 line-height: 55px; 31 padding-top: 10px; 32 } 33 34 #diffsubheader { 35 background-color: #EEE; 36 border-bottom: 2px solid #999; 37 width: 100%; 38 height: 2.8em; 39 line-height: 2.8em; 40 } 41 42 #diffslider { 43 width: 70%; 44 margin-left: auto; 45 margin-right: auto; 46 text-align: center; 47 height: 3.5em; 48 49 } 50 51 #revisioncount { 52 width: 50%; 53 margin-left: auto; 54 margin-right: auto; 55 margin-top: 0; 56 line-height: 1em; 57 height: 1em; 58 text-align: center; 59 clear: none; 60 padding: 5px; 61 } 62 63 .revisiondiffcontainer { 64 margin-top: 10px; 65 } 66 67 #diffsliderwrap { 68 width: 80%; 69 margin-left: auto; 70 margin-right: auto; 71 } 72 73 #diffsliderwrap #sliderinner { 74 position: relative; 75 top: 47px; 76 } 77 78 #removedandadded { 79 width: 96%; 80 padding-left: 10px; 81 padding-right: 20px; 82 padding-bottom: 30px; 83 padding-top: 3px; 84 font-size: 16px; 85 } 86 87 #removed, #added, #unchanged { 88 width: auto; 89 text-align: left; 90 padding-left: 5px; 91 padding-right: 5px; 92 padding-top: 5px; 93 padding-bottom: 5px; 94 float: left; 95 } 96 .diffsplit #added { 97 float: right; 98 } 99 100 .diffsplit #unchanged { 101 float: left; 102 margin-left: 40%; 103 } 104 105 #unchanged, #added { 106 padding-left: 10px; 107 } 108 109 #removed { 110 padding-left: 0px; 111 } 112 113 #removed { 114 color: #D2281F; 115 } 116 117 #added { 118 color: #00A100; 119 } 120 121 #revisionoptions { 122 margin-top: 30px; 123 line-height: 40px; 124 } 125 126 #previousrevisioninterfacelink { 127 margin-top: 30px; 128 }