From aa35c0542348c206c1d95ba576fd981e18f50a33 Mon Sep 17 00:00:00 2001 From: Chris Wells Date: Thu, 27 Feb 2025 11:24:25 -0600 Subject: Added some javascript stuff --- js/colors.js | 2 +- js/katex-opts.js | 14 ++++++++++++++ js/toggle.js | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 js/katex-opts.js (limited to 'js') diff --git a/js/colors.js b/js/colors.js index 158ad52..2cc6a18 100644 --- a/js/colors.js +++ b/js/colors.js @@ -1,4 +1,4 @@ -// @license http://www.wtfpl.net/txt/copying/" WTFPL +// @license "http://www.wtfpl.net/txt/copying/" WTFPL if ( localStorage.getItem("color-mode") === "dark" || ( !localStorage.getItem("color-mode") && window.matchMedia('(prefers-color-scheme: dark)').matches ) diff --git a/js/katex-opts.js b/js/katex-opts.js new file mode 100644 index 0000000..4909687 --- /dev/null +++ b/js/katex-opts.js @@ -0,0 +1,14 @@ +// @license "http://www.wtfpl.net/txt/copying/" WTFPL + +document.addEventListener("DOMContentLoaded", function() { + renderMathInElement(document.body, { + delimiters: [ + { left: "$$", right: "$$", display: true }, + { left: "\\[", right: "\\]", display: true }, + { left: "$", right: "$", display: false }, + { left: "\\(", right: "\\)", display: false }, + ] + }); +}); + +// @license-end diff --git a/js/toggle.js b/js/toggle.js index 884e0bf..46e4b6a 100644 --- a/js/toggle.js +++ b/js/toggle.js @@ -1,4 +1,4 @@ -// @license http://www.wtfpl.net/txt/copying/" WTFPL +// @license "http://www.wtfpl.net/txt/copying/" WTFPL function toggle(divid) { var cont = document.getElementById(divid); -- cgit v1.2.3