diff --git a/webapp/public/js/domjudge.js b/webapp/public/js/domjudge.js index 05b6550e82..74528c6fa9 100644 --- a/webapp/public/js/domjudge.js +++ b/webapp/public/js/domjudge.js @@ -124,6 +124,21 @@ function applyEditorTheme(theme = undefined, isExternal = false) }); } +function isDiffSideBySide() +{ + let sideBySide = localStorage.getItem('domjudge_editor_side_by_side'); + if (sideBySide === undefined) { + return true; + } else { + return sideBySide == 'true'; + } +} + +function setDiffSideBySide(value) +{ + localStorage.setItem('domjudge_editor_side_by_side', value); +} + // Send a notification if notifications have been enabled. // The options argument is passed to the Notification constructor, // except that the following tags (if found) are interpreted and diff --git a/webapp/src/Twig/TwigExtension.php b/webapp/src/Twig/TwigExtension.php index 3a20dd765f..5ed73d6f14 100644 --- a/webapp/src/Twig/TwigExtension.php +++ b/webapp/src/Twig/TwigExtension.php @@ -929,6 +929,10 @@ protected function parseSourceDiff(string $difftext): string public function showDiff(string $id, SubmissionFile $newFile, SubmissionFile $oldFile): string { $editor = << + + +