@@ -7,6 +7,17 @@ public function isOneUpRenderer() {
7
7
return false ;
8
8
}
9
9
10
+ private function renderColgroup () {
11
+ return phutil_tag ('colgroup ' , array (), array (
12
+ phutil_tag ('col ' , array ('class ' => 'num ' )),
13
+ phutil_tag ('col ' , array ('class ' => 'left ' )),
14
+ phutil_tag ('col ' , array ('class ' => 'num ' )),
15
+ phutil_tag ('col ' , array ('class ' => 'copy ' )),
16
+ phutil_tag ('col ' , array ('class ' => 'right ' )),
17
+ phutil_tag ('col ' , array ('class ' => 'cov ' )),
18
+ ));
19
+ }
20
+
10
21
public function renderTextChange (
11
22
$ range_start ,
12
23
$ range_len ,
@@ -31,6 +42,8 @@ public function renderTextChange(
31
42
}
32
43
33
44
$ html = array ();
45
+ $ html [] = $ this ->renderColgroup ();
46
+
34
47
$ old_lines = $ this ->getOldLines ();
35
48
$ new_lines = $ this ->getNewLines ();
36
49
$ gaps = $ this ->getGaps ();
@@ -184,22 +197,23 @@ public function renderTextChange(
184
197
}
185
198
186
199
$ o_num = null ;
187
- $ o_classes = 'left ' ;
200
+ $ o_classes = '' ;
188
201
$ o_text = null ;
189
202
if (isset ($ old_lines [$ ii ])) {
190
203
$ o_num = $ old_lines [$ ii ]['line ' ];
191
204
$ o_text = isset ($ old_render [$ ii ]) ? $ old_render [$ ii ] : null ;
192
205
if ($ old_lines [$ ii ]['type ' ]) {
193
206
if ($ old_lines [$ ii ]['type ' ] == '\\' ) {
194
207
$ o_text = $ old_lines [$ ii ]['text ' ];
195
- $ o_classes . = ' comment ' ;
208
+ $ o_class = 'comment ' ;
196
209
} else if ($ original_left && !isset ($ highlight_old [$ o_num ])) {
197
- $ o_classes . = ' old-rebase ' ;
210
+ $ o_class = 'old-rebase ' ;
198
211
} else if (empty ($ new_lines [$ ii ])) {
199
- $ o_classes . = ' old old-full ' ;
212
+ $ o_class = 'old old-full ' ;
200
213
} else {
201
- $ o_classes . = ' old ' ;
214
+ $ o_class = 'old ' ;
202
215
}
216
+ $ o_classes = $ o_class ;
203
217
}
204
218
}
205
219
@@ -265,7 +279,6 @@ public function renderTextChange(
265
279
}
266
280
}
267
281
}
268
- $ n_classes .= ' right ' .$ n_colspan ;
269
282
270
283
if (isset ($ hunk_starts [$ o_num ])) {
271
284
$ html [] = $ context_not_available ;
@@ -283,10 +296,11 @@ public function renderTextChange(
283
296
$ n_id = null ;
284
297
}
285
298
286
- // NOTE: This is a unicode zero-width space, which we use as a hint
287
- // when intercepting 'copy' events to make sure sensible text ends
288
- // up on the clipboard. See the 'phabricator-oncopy' behavior.
289
- $ zero_space = "\xE2\x80\x8B" ;
299
+ // NOTE: This is a unicode 'word joiner' (essentially a non-breaking
300
+ // zero-width space), which we use as a hint when intercepting 'copy'
301
+ // events to make sure sensible text ends up on the clipboard.
302
+ // See the 'phabricator-oncopy' behavior.
303
+ $ zero_space = "\xE2\x81\xA0" ;
290
304
291
305
// NOTE: The Javascript is sensitive to whitespace changes in this
292
306
// block!
@@ -326,9 +340,9 @@ public function renderTextChange(
326
340
}
327
341
$ html [] = phutil_tag ('tr ' , array ('class ' => 'inline ' ), array (
328
342
phutil_tag ('th ' , array ()),
329
- phutil_tag ('td ' , array (' class ' => ' left ' ), $ comment_html ),
343
+ phutil_tag ('td ' , array (), $ comment_html ),
330
344
phutil_tag ('th ' , array ()),
331
- phutil_tag ('td ' , array ('colspan ' => 3 , ' class ' => ' right3 ' ), $ new ),
345
+ phutil_tag ('td ' , array ('colspan ' => 3 ), $ new ),
332
346
));
333
347
}
334
348
}
@@ -338,11 +352,11 @@ public function renderTextChange(
338
352
$ on_right = true );
339
353
$ html [] = phutil_tag ('tr ' , array ('class ' => 'inline ' ), array (
340
354
phutil_tag ('th ' , array ()),
341
- phutil_tag ('td ' , array (' class ' => ' left ' )),
355
+ phutil_tag ('td ' , array ()),
342
356
phutil_tag ('th ' , array ()),
343
357
phutil_tag (
344
358
'td ' ,
345
- array ('colspan ' => 3 , ' class ' => ' right3 ' ),
359
+ array ('colspan ' => 3 ),
346
360
$ comment_html ),
347
361
));
348
362
}
@@ -391,9 +405,9 @@ public function renderFileChange($old_file = null,
391
405
$ comment_html = $ this ->renderInlineComment ($ comment , $ on_right = false );
392
406
$ html_old [] = phutil_tag ('tr ' , array ('class ' => 'inline ' ), array (
393
407
phutil_tag ('th ' , array ()),
394
- phutil_tag ('td ' , array (' class ' => ' left ' ), $ comment_html ),
408
+ phutil_tag ('td ' , array (), $ comment_html ),
395
409
phutil_tag ('th ' , array ()),
396
- phutil_tag ('td ' , array ('colspan ' => 3 , ' class ' => ' right3 ' )),
410
+ phutil_tag ('td ' , array ('colspan ' => 3 )),
397
411
));
398
412
}
399
413
}
@@ -402,11 +416,11 @@ public function renderFileChange($old_file = null,
402
416
$ comment_html = $ this ->renderInlineComment ($ comment , $ on_right = true );
403
417
$ html_new [] = phutil_tag ('tr ' , array ('class ' => 'inline ' ), array (
404
418
phutil_tag ('th ' , array ()),
405
- phutil_tag ('td ' , array (' class ' => ' left ' )),
419
+ phutil_tag ('td ' , array ()),
406
420
phutil_tag ('th ' , array ()),
407
421
phutil_tag (
408
422
'td ' ,
409
- array ('colspan ' => 3 , ' class ' => ' right3 ' ),
423
+ array ('colspan ' => 3 ),
410
424
$ comment_html ),
411
425
));
412
426
}
@@ -424,12 +438,15 @@ public function renderFileChange($old_file = null,
424
438
$ th_new = phutil_tag ('th ' , array ('id ' => "C {$ id }OL1 " ), 1 );
425
439
}
426
440
427
- $ output = hsprintf (
441
+ $ output = array ();
442
+ $ output [] = $ this ->renderColgroup ();
443
+
444
+ $ output [] = hsprintf (
428
445
'<tr class="differential-image-diff"> ' .
429
446
'%s ' .
430
- '<td class="left differential-old-image">%s</td> ' .
447
+ '<td class="differential-old-image">%s</td> ' .
431
448
'%s ' .
432
- '<td class="right3 differential-new-image" colspan="3">%s</td> ' .
449
+ '<td class="differential-new-image" colspan="3">%s</td> ' .
433
450
'</tr> ' .
434
451
'%s ' .
435
452
'%s ' ,
0 commit comments