From 6937c0a04fc25cf9ac26f8210d3984173fc67b6d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 24 Jun 2024 08:50:26 +0000 Subject: [PATCH] v1.7.7 ci: update workflows config. a3e55a07133dbb1192690a55fbe4187ac3e5826d --- badges.svg | 8 +++---- index.html | 24 ++++++++++---------- js/giscus.js | 34 +++++++++++++++++++++++++++++ lcov-report/index.html | 2 +- lcov-report/src/index.html | 2 +- lcov-report/src/index.ts.html | 2 +- lcov-report/src/loader/index.html | 2 +- lcov-report/src/loader/ini.ts.html | 2 +- lcov-report/src/loader/js.ts.html | 2 +- lcov-report/src/loader/json.ts.html | 2 +- lcov-report/src/loader/toml.ts.html | 2 +- lcov-report/src/loader/yaml.ts.html | 2 +- lcov-report/src/utils.ts.html | 2 +- 13 files changed, 60 insertions(+), 26 deletions(-) create mode 100644 js/giscus.js diff --git a/badges.svg b/badges.svg index a1bbd78..6c750c5 100644 --- a/badges.svg +++ b/badges.svg @@ -1,14 +1,14 @@ coverage: 100% - + - - + + - + - - - - - - + + + + + + - - - + + + top
@@ -573,13 +573,13 @@

- + diff --git a/js/giscus.js b/js/giscus.js new file mode 100644 index 0000000..729dd0b --- /dev/null +++ b/js/giscus.js @@ -0,0 +1,34 @@ +;(() => { + const targetElement = document.documentElement; + const defaultTheme = targetElement.getAttribute("data-color-mode"); + changeGiscusTheme(defaultTheme) + const observer = new MutationObserver((mutationsList, observer) => { + for(const mutation of mutationsList) { + if (mutation.type === 'attributes') { + const value = targetElement.getAttribute("data-color-mode"); + changeGiscusTheme(value) + } + } + }); + + observer.observe(targetElement, { + attributes: true, + attributeOldValue: true + }); + + function changeGiscusTheme(theme = "light") { + const iframe = document.querySelector('.giscus-frame'); + if (iframe) { + const config = { + giscus: { + setConfig: { + theme: theme.toLocaleLowerCase(), + }, + } + }; + iframe.contentWindow.postMessage(config, 'https://giscus.app'); + const script = document.querySelector("script[data-script-id=\"giscus\"]") + script.setAttribute("data-theme", theme) + } + } +})(); diff --git a/lcov-report/index.html b/lcov-report/index.html index 14391a7..06fbda7 100644 --- a/lcov-report/index.html +++ b/lcov-report/index.html @@ -116,7 +116,7 @@

All files