From 84a323f0def0521b58c45fecd4599a458030654d Mon Sep 17 00:00:00 2001 From: Jordan Welch Date: Sun, 17 Sep 2023 08:59:24 -0500 Subject: [PATCH] Add color scheme to demo page --- .../templates/pages/demo/content.handlebars | 22 ++++++++++++++----- website/templates/pages/demo/demo.ts | 3 +++ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/website/templates/pages/demo/content.handlebars b/website/templates/pages/demo/content.handlebars index 813b9b1..1583195 100644 --- a/website/templates/pages/demo/content.handlebars +++ b/website/templates/pages/demo/content.handlebars @@ -33,7 +33,7 @@
-
+
-
+
+ +
+
-
+
-
+
-
+
- \ No newline at end of file + diff --git a/website/templates/pages/demo/demo.ts b/website/templates/pages/demo/demo.ts index 53c7019..7621573 100644 --- a/website/templates/pages/demo/demo.ts +++ b/website/templates/pages/demo/demo.ts @@ -200,6 +200,7 @@ type Elements = { }; options: { outputFormat: HTMLInputElement; + colorScheme: HTMLInputElement; matching: HTMLInputElement; wordsThreshold: HTMLInputElement; matchingMaxComparisons: HTMLInputElement; @@ -259,6 +260,7 @@ document.addEventListener('DOMContentLoaded', async () => { }, options: { outputFormat: getHTMLInputElementById('diff-url-options-output-format'), + colorScheme: getHTMLInputElementById('diff-url-options-color-scheme'), matching: getHTMLInputElementById('diff-url-options-matching'), wordsThreshold: getHTMLInputElementById('diff-url-options-match-words-threshold'), matchingMaxComparisons: getHTMLInputElementById('diff-url-options-matching-max-comparisons'), @@ -272,6 +274,7 @@ document.addEventListener('DOMContentLoaded', async () => { // Update HTML inputs from any changes in URL config.outputFormat && (elements.options.outputFormat.value = config.outputFormat); + config.colorScheme && (elements.options.colorScheme.value = config.colorScheme); config.drawFileList && (elements.checkboxes.drawFileList.checked = config.drawFileList); config.matching && (elements.options.matching.value = config.matching); config.matchWordsThreshold && (elements.options.wordsThreshold.value = config.matchWordsThreshold.toString());