Ticket #23497: 23497.5.diff
File 23497.5.diff, 44.2 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 views : {}, 6 Model : Backbone.Model.extend({ 7 defaults: { //include all fields for now, pair it down later 8 ID : 0, 9 revision_date_author : '', 10 revisiondiff : '', 11 restoreaction: '', 12 diff_max : 0, 13 diff_count : 0 14 } 15 }), 16 App : Backbone.Router.extend({ 17 _revisionListView : null, 18 _revisionDifflView : null, 19 _revisions : null, 20 routes : { 21 "*actions": "revisionDiff", }, 22 _showsplitview : '', 23 autosaves : false, 24 /* 25 * initialize the revision appl;ication 26 */ 27 initialize : function (options) { 28 var self = this; //store the application instance 29 if (this._revisions === null) { 30 self.autosaves = ''; 31 self._revisions = new wp.revisions.Collection(); //set up collection 32 self._revisions.autosaves = 'true'; 33 self._revisions.fetch({ //load revision data 34 success : function () { 35 self.revisionDiffSetup(); 36 }, 37 error : function () { 38 window.console && console.log( 'Error loading revision data' ); 39 } 40 }); 41 42 } 43 return this; 44 }, 45 46 revisionDiffSetup : function () { 47 var modelcount = this._revisions.length, self = this, slider; 48 49 this._revisionView = new wp.revisions.views.View({ 50 model : this._revisions 51 }); 52 this._revisionView.render(); 53 54 slider = $("#slider"); 55 56 //set up slider 57 slider.slider({ 58 value:0, 59 min : 0, 60 max : modelcount-1, 61 step : 1, 62 slide : function ( event, ui ) { 63 self._revisionView.current_diff = ui.value+1; 64 self._revisionView.render(); 65 } 66 }); 67 68 //set up buttons 69 $( 'input#previous' ).on("click", function () { 70 self._revisionView.current_diff--; 71 if ( self._revisionView.current_diff <= 1) 72 self._revisionView.current_diff = 1; 73 74 self._revisionView.render(); 75 slider.slider('value', self._revisionView.current_diff - 1); 76 slider.trigger( 'slide' ); 77 }); 78 79 $( 'input#next' ).on( 'click', function () { 80 self._revisionView.current_diff++; 81 if ( self._revisionView.current_diff >= self._revisionView.total_length ) 82 self._revisionView.current_diff = self._revisionView.total_length; 83 84 self._revisionView.render(); 85 slider.slider('value', self._revisionView.current_diff-1); 86 slider.trigger('slide'); 87 }); 88 89 //set up autosave toggle 90 $( 'input#toggleshowautosaves' ).on( 'click', function () { 91 if ( $( 'input#toggleshowautosaves' ).is( ':checked' ) ) { 92 self.autosaves = true; 93 } else { 94 self.autosaves = false; 95 } 96 self._revisions.url = ajaxurl + '?action=revisions-data&compareto=' + postid + '&showautosaves=' + self.autosaves + '&showsplitview=' + self._showsplitview; 97 98 self._revisions.fetch({ //reload revision data 99 success : function () { 100 var revisioncount = self._revisionView.model.length; 101 if ( self._revisionView.current_diff > revisioncount ) 102 self._revisionView.current_diff = revisioncount; 103 self._revisionView.render(); 104 slider.slider( 'option', 'max', revisioncount-1 ); 105 } 106 }); 107 } ); 108 109 //set up showsplitview toggle 110 $( 'input#showsplitview' ).on( 'click', function () { 111 if ( $( 'input#showsplitview' ).is( ':checked' ) ) { 112 self._showsplitview = 'true'; 113 $('.revisiondiffcontainer').addClass('diffsplit'); 114 } else { 115 self._showsplitview = ''; 116 $('.revisiondiffcontainer').removeClass('diffsplit'); 117 } 118 self._revisions.url = ajaxurl + '?action=revisions-data&compareto=' + postid + '&showautosaves=' + self.autosaves + '&showsplitview=' + self._showsplitview; 119 self._revisions.fetch({ //reload revision data 120 success : function () { 121 self._revisionView.render(); 122 } 123 }); 124 } ); 125 } 126 }) 127 }; 128 129 wp.revisions.Collection = Backbone.Collection.extend({ 130 model : wp.revisions.Model, 131 url : ajaxurl + '?action=revisions-data&compareto=' + postid + '&showautosaves=false' 132 }); 133 134 _.extend(wp.revisions.views, { 135 View : Backbone.View.extend({ 136 el : $('#backbonerevisionsdiff')[0], 137 tagName : 'revisionvview', 138 className : 'revisionview-container', 139 template : wp.template('revision'), 140 current_diff : 1, 141 total_length : 0, 142 initialize : function (){ 143 this.total_length = this.model.length; 144 self = this; 145 }, 146 render : function () { 147 var addhtml = ''; 148 therevisions = this.model; 149 if ( therevisions.at( this.current_diff-1 ) ) { 150 addhtml = this.template( therevisions.at( this.current_diff-1 ).toJSON() ); 151 } 152 this.$el.html( addhtml ); 153 $( '#diff_max' ).html( this.model.length ); 154 $( '#diff_count' ).html( this.current_diff ); 155 return this; 156 } 157 }), 158 List : Backbone.View.extend({ 159 el : $('#backbonerevisionslist')[0], 160 render : function () { 161 var self = this, addhtml = '', therevisions = self.model; 162 therevisions.each(function ( arevision ) { 163 addhtml = addhtml + '<br />' + (arevision.get("revision_date_author")); 164 }); 165 self.$el.html( addhtml ); 166 return this; 167 }, 168 clear : function () { 169 this.model.destroy(); 170 } 171 }) 172 }); 173 174 //instantiate RevisionApplication object 175 revapp = new wp.revisions.App(); 176 Backbone.history.start(); 177 178 }(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 return $r ;157 return $r.$this->_showsplitview; 149 158 } 150 159 151 160 /** … … 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'] ); … … 2086 2086 $screen_id = sanitize_key($_POST['screenid']); 2087 2087 else 2088 2088 $screen_id = 'site'; 2089 2089 2090 2090 if ( ! empty($_POST['data']) ) { 2091 2091 $data = wp_unslash( (array) $_POST['data'] ); 2092 2092 // todo: how much to sanitize and preset and what to leave to be accessed from $data or $_POST..? … … 2112 2112 2113 2113 wp_send_json($response); 2114 2114 } 2115 2116 function wp_ajax_revisions_data() { 2117 2118 $compareto = isset( $_GET['compareto'] ) ? $_GET['compareto'] : 0; 2119 $showautosaves = isset( $_GET['showautosaves'] ) ? $_GET['showautosaves'] : ''; 2120 $showsplitview = isset( $_GET['showsplitview'] ) ? $_GET['showsplitview'] : ''; 2121 2122 $alltherevisions = array(); 2123 2124 if ( ! $revisions = wp_get_post_revisions( $compareto ) ) 2125 return; 2126 2127 $count = 1; 2128 foreach ( $revisions as $revision ) : 2129 if ( ! current_user_can( 'read_post', $revision->ID ) 2130 || 'true' != $showautosaves && wp_is_post_autosave( $revision ) 2131 ) 2132 continue; 2133 2134 $author = get_the_author_meta( 'display_name', $revision->post_author ); 2135 /* translators: revision date format, see http://php.net/date */ 2136 $datef = _x( 'j F, Y @ G:i', 'revision date format'); 2137 2138 $gravatar = get_avatar( $revision->post_author, 18 ); 2139 $date = date_i18n( $datef, strtotime( $revision->post_modified ) ); 2140 $revision_date_author = sprintf( 2141 '%s %s, %s %s (%s)', 2142 $gravatar, 2143 $author, 2144 human_time_diff( strtotime( $revision->post_modified ), current_time( 'timestamp' ) ), 2145 __( ' ago ' ), 2146 $date 2147 ); 2148 $restoreaction = wp_nonce_url( 2149 add_query_arg( 2150 array( 'revision' => $revision->ID, 'action' => 'restore' ), 2151 '/wp-admin/revision.php' 2152 ), 2153 "restore-post_$compareto|$revision->ID" 2154 ); 2155 $left_revision = get_post( $compareto ); 2156 $right_revision = get_post( $revision ); 2157 // 2158 //compare from left to right, passed from application 2159 $content=''; 2160 foreach ( array_keys( _wp_post_revision_fields() ) as $field ) { 2161 $left_content = apply_filters( "_wp_post_revision_field_$field", $left_revision->$field, $field, $left_revision, 'left' ); 2162 $right_content = apply_filters( "_wp_post_revision_field_$field", $right_revision->$field, $field, $right_revision, 'right' ); 2163 2164 add_filter( "_wp_post_revision_field_$field", 'wp_kses_post' ); 2165 2166 $args = array(); 2167 2168 if ( $showsplitview ) 2169 $args = array( 'showsplitview' => 'true' ); 2170 2171 $content .= wp_text_diff( $left_content, $right_content, $args ); 2172 } 2173 2174 if ( '' != $content ) 2175 $alltherevisions[] = array ( 2176 'ID' => $revision->ID, 2177 'revision_date_author' => $revision_date_author, 2178 'revisiondiff' => $content, 2179 'restoreaction' => urldecode( $restoreaction ) 2180 ); 2181 2182 endforeach; 2183 2184 2185 //array_pop( $allrevisions ); 2186 2187 echo json_encode( $alltherevisions ); 2188 exit(); 2189 } 2190 No newline at end of file -
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 { 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 #revisionoptions { 128 margin-top: 30px; 129 line-height: 40px; 130 } 131 132 #comparetworevisions { 133 float: right; 134 line-height: 35px; 135 padding-right: 5px; 136 } 137 138 #comparetworevisions input{ 139 margin-right: 2px; 140 } 141 142 #difftitle img { 143 vertical-align: middle; 144 margin-left: 5px; 145 } 146 -
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 = '<a href="' . get_edit_post_link( $postid ) . '">' . get_the_title( $postid ) . '</a>'; 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 <div class="wrap"> 41 <div class="icon32 icon32-posts-post" id="icon-edit"><br></div> 42 <h2 class="long-header"><?php echo $h2; ?></h2> 43 <div class="revisiondiffcontainer"> 44 <div id="diffheader"> 45 <div id="diffprevious"><input class="button" type="submit" id="previous" value="Previous" /></div> 46 <div id="diffnext"><input class="button" type="submit" id="next" value="Next" /></div> 47 <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> 48 </div> 49 <div id="backbonerevisionsdiff"></div> 50 <?php 51 $comparetworevisionslink = admin_url ( sprintf( 'revision.php?revision=%d&action=edit', $revision ) ); 52 ?> 53 </div> 54 </div> 55 <script id="tmpl-revision" type="text/html"> 56 <div id="diffsubheader"> 57 <div id="difftitle">{{{ data.revision_date_author }}}</div> 58 <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> 59 <div id="diffrestore"><input class="button button-primary" onClick="document.location='{{{ data.restoreaction }}}'" type="submit" id="restore" value="<?php esc_attr_e( 'Restore' )?>" /></div> 60 <div id="comparetworevisions"><input type="checkbox" id="comparetwo" value="comparetwo" name="comparetwo"/> <?php esc_attr_e( 'Compare two revisions' )?></div> 61 </div> 62 <div id="removedandadded"> 63 <div id="removed"><?php _e( 'Removed -' ); ?></div> 64 <div id="added"><?php _e( 'Added +' ); ?></div> 65 </div 66 <div>{{{ data.revisiondiff }}}</div> 67 </script> 68 69 <div id="backbonerevisionslist"></div> 70 71 <div id="revisionoptions"> 72 <input type='checkbox' id="showsplitview" value="1" /> <?php _e( 'Show split diff view' ); ?> 73 <br /> 74 <input type='checkbox' id="toggleshowautosaves" value="1" /> <?php _e( 'Show autosaves' ); ?> 75 </div> 76 77 <?php 78 79 require( './admin-footer.php' );