r105472 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105471‎ | r105472 | r105473 >
Date:22:43, 7 December 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Added highlighting for the current index
Modified paths:
  • /trunk/extensions/VisualEditor/modules/sandbox/sandbox.css (modified) (history)
  • /trunk/extensions/VisualEditor/modules/sandbox/sandbox.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/modules/sandbox/sandbox.css
@@ -42,7 +42,7 @@
4343 }
4444 .es-showData #es-visual {
4545 float: left;
46 - width: 48%;
 46+ width: 49%;
4747 overflow: hidden;
4848 }
4949 #es-panels {
@@ -158,4 +158,11 @@
159159 #es-panel-history div {
160160 border-bottom: solid 1px #dddddd;
161161 padding: 0.5em 0;
 162+ color: #666666;
 163+ background-color: #f3f3f3;
 164+}
 165+
 166+#es-panel-history div.es-panel-history-active {
 167+ color: #000000;
 168+ background-color: white;
162169 }
\ No newline at end of file
Index: trunk/extensions/VisualEditor/modules/sandbox/sandbox.js
@@ -488,11 +488,15 @@
489489 end = Math.max( 0, i - 25 ),
490490 action,
491491 ops,
492 - data;
 492+ data,
 493+ attr;
493494 while ( --i >= end ) {
 495+ attr = i === surfaceModel.historyIndex ?
 496+ ' class="es-panel-history-active"' : '';
494497 action = surfaceModel.history[i];
495498 if ( action instanceof es.Range ) {
496 - events += '<div>sel( ' + action.from + ', ' + action.to + ' )</div>';
 499+ events += '<div' + attr + '>sel(' + action.from + ', ' + action.to +
 500+ ')</div>';
497501 } else {
498502 ops = action.getOperations().slice( 0 );
499503 for ( var j = 0; j < ops.length; j++ ) {
@@ -506,9 +510,9 @@
507511 if ( typeof data !== 'string' && typeof data !== 'number' ) {
508512 data = '-';
509513 }
510 - ops[j] = ops[j].type.substr( 0, 3 ) + '( ' + data + ' )';
 514+ ops[j] = ops[j].type.substr( 0, 3 ) + '(' + data + ')';
511515 }
512 - events += '<div>' + ops.join( ', ' ) + '</div>';
 516+ events += '<div' + attr + '>' + ops.join( ', ' ) + '</div>';
513517 }
514518 }
515519 this.$panel.html( events );

Status & tagging log