https://www.mediawiki.org/wiki/Special:Code/MediaWiki/105472
Revision: 105472 Author: tparscal Date: 2011-12-07 22:43:53 +0000 (Wed, 07 Dec 2011) Log Message: ----------- Added highlighting for the current index Modified Paths: -------------- trunk/extensions/VisualEditor/modules/sandbox/sandbox.css trunk/extensions/VisualEditor/modules/sandbox/sandbox.js Modified: trunk/extensions/VisualEditor/modules/sandbox/sandbox.css =================================================================== --- trunk/extensions/VisualEditor/modules/sandbox/sandbox.css 2011-12-07 22:40:36 UTC (rev 105471) +++ trunk/extensions/VisualEditor/modules/sandbox/sandbox.css 2011-12-07 22:43:53 UTC (rev 105472) @@ -42,7 +42,7 @@ } .es-showData #es-visual { float: left; - width: 48%; + width: 49%; overflow: hidden; } #es-panels { @@ -158,4 +158,11 @@ #es-panel-history div { border-bottom: solid 1px #dddddd; padding: 0.5em 0; + color: #666666; + background-color: #f3f3f3; +} + +#es-panel-history div.es-panel-history-active { + color: #000000; + background-color: white; } \ No newline at end of file Modified: trunk/extensions/VisualEditor/modules/sandbox/sandbox.js =================================================================== --- trunk/extensions/VisualEditor/modules/sandbox/sandbox.js 2011-12-07 22:40:36 UTC (rev 105471) +++ trunk/extensions/VisualEditor/modules/sandbox/sandbox.js 2011-12-07 22:43:53 UTC (rev 105472) @@ -488,11 +488,15 @@ end = Math.max( 0, i - 25 ), action, ops, - data; + data, + attr; while ( --i >= end ) { + attr = i === surfaceModel.historyIndex ? + ' class="es-panel-history-active"' : ''; action = surfaceModel.history[i]; if ( action instanceof es.Range ) { - events += '<div>sel( ' + action.from + ', ' + action.to + ' )</div>'; + events += '<div' + attr + '>sel(' + action.from + ', ' + action.to + + ')</div>'; } else { ops = action.getOperations().slice( 0 ); for ( var j = 0; j < ops.length; j++ ) { @@ -506,9 +510,9 @@ if ( typeof data !== 'string' && typeof data !== 'number' ) { data = '-'; } - ops[j] = ops[j].type.substr( 0, 3 ) + '( ' + data + ' )'; + ops[j] = ops[j].type.substr( 0, 3 ) + '(' + data + ')'; } - events += '<div>' + ops.join( ', ' ) + '</div>'; + events += '<div' + attr + '>' + ops.join( ', ' ) + '</div>'; } } this.$panel.html( events ); _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs