Add very basic 1-up HTML renderer support

Summary:
  - Add a query parameter to select the diff renderer.
  - When we populate diffs, use the 1-up renderer if the device isn't a desktop. Don't switch renderers once the page has loaded since it will be a tremendous mess. We can add an "always use 1-up" preference later.
  - Tweak JX.Device so we avoid a race condition, where `JX.Device.getDevice()` may not be valid when other behaviors run.
  - Implement enough of the 1-up HTML renderer to provide a vague hint that it actually works.
  - Fix a couple of bugs with primitive construction.

Test Plan:
{F29168}
{F29169}

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2009

Differential Revision: https://secure.phabricator.com/D4423
This commit is contained in:
epriestley
2013-01-14 14:20:35 -08:00
parent 2de107f21b
commit ea8faedf0b
5 changed files with 112 additions and 44 deletions

View File

@@ -157,6 +157,11 @@ final class DifferentialChangesetViewController extends DifferentialController {
$parser->setLeftSideCommentMapping($left_source, $left_new);
$parser->setWhitespaceMode($request->getStr('whitespace'));
if ($request->getStr('renderer') == '1up') {
$parser->setRenderer(new DifferentialChangesetOneUpRenderer());
}
if ($left && $right) {
$parser->setOriginals($left, $right);
}