From 7f9b8bf0c113f08f48a941af08000342f13127e1 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Tue, 27 Aug 2024 17:40:07 +0100 Subject: [PATCH] Fixes suggested by @pmario --- core/modules/info/mediaquerytracker.js | 2 +- .../{DarkLightSwitch.tid => DarkLightPreferred.tid} | 2 +- editions/tw5.com/tiddlers/mechanisms/InfoMechanism.tid | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename core/wiki/config/MediaQueryTrackers/{DarkLightSwitch.tid => DarkLightPreferred.tid} (69%) diff --git a/core/modules/info/mediaquerytracker.js b/core/modules/info/mediaquerytracker.js index 3750b6c33..4c48780d4 100644 --- a/core/modules/info/mediaquerytracker.js +++ b/core/modules/info/mediaquerytracker.js @@ -35,7 +35,7 @@ exports.getInfoTiddlerFields = function(updateInfoTiddlersCallback) { return tiddlers; }; infoTiddlerFields.push.apply(infoTiddlerFields,getResultTiddlers()); - mqList.addListener(function(event) { + mqList.addEventListener("change",function(event) { updateInfoTiddlersCallback(getResultTiddlers()); }); } diff --git a/core/wiki/config/MediaQueryTrackers/DarkLightSwitch.tid b/core/wiki/config/MediaQueryTrackers/DarkLightPreferred.tid similarity index 69% rename from core/wiki/config/MediaQueryTrackers/DarkLightSwitch.tid rename to core/wiki/config/MediaQueryTrackers/DarkLightPreferred.tid index bc3cfa3e1..6b5e9f26c 100644 --- a/core/wiki/config/MediaQueryTrackers/DarkLightSwitch.tid +++ b/core/wiki/config/MediaQueryTrackers/DarkLightPreferred.tid @@ -1,4 +1,4 @@ -title: $:/core/wiki/config/MediaQueryTrackers/DarkLightSwitch +title: $:/core/wiki/config/MediaQueryTrackers/DarkLightPreferred tags: $:/tags/MediaQueryTracker media-query: (prefers-color-scheme: dark) info-tiddler: $:/info/browser/darkmode diff --git a/editions/tw5.com/tiddlers/mechanisms/InfoMechanism.tid b/editions/tw5.com/tiddlers/mechanisms/InfoMechanism.tid index ffd3377a9..77ae1ec74 100644 --- a/editions/tw5.com/tiddlers/mechanisms/InfoMechanism.tid +++ b/editions/tw5.com/tiddlers/mechanisms/InfoMechanism.tid @@ -19,7 +19,7 @@ System tiddlers in the namespace `$:/info/` are used to expose information about |[[$:/info/browser/language]] |<<.from-version "5.1.20">> Language as reported by browser (note that some browsers report two character codes such as `en` while others report full codes such as `en-GB`) | |[[$:/info/browser/screen/width]] |Screen width in pixels | |[[$:/info/browser/screen/height]] |Screen height in pixels | -|[[$:/info/browser/darkmode]] |<<.from-version "5.3.6">> Is dark mode enabled? ("yes" or "no") | +|[[$:/info/browser/darkmode]] |<<.from-version "5.3.6">> Is dark mode preferred? ("yes" or "no") | |[[$:/info/darkmode]] |<<.deprecated-since "5.3.6">> Alias for $:/info/browser/darkmode | |[[$:/info/node]] |Running under [[Node.js]]? ("yes" or "no") | |[[$:/info/url/full]] |<<.from-version "5.1.14">> Full URL of wiki (eg, ''<>'') |