[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Gavin D. Smith |
Date: |
Sat, 5 Oct 2024 17:16:38 -0400 (EDT) |
branch: master
commit 27c96be6ce685a35f4e0e0833e7f5ecde5f8ac18
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sat Oct 5 22:16:30 2024 +0100
info.js start tracing option
* js/info.js (debug): add function.
(config): add DEBUG key.
(updater): log action type with debug
---
ChangeLog | 8 ++++++++
js/info.js | 16 +++++++++++++++-
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 5672278bf4..202a7cf886 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-10-05 Gavin Smith <gavinsmith0123@gmail.com>
+
+ info.js start tracing option
+
+ * js/info.js (debug): add function.
+ (config): add DEBUG key.
+ (updater): log action type with debug
+
2024-10-05 Gavin Smith <gavinsmith0123@gmail.com>
* js/info.js (updater): add a comment
diff --git a/js/info.js b/js/info.js
index 646eb7ef4d..50bdbb8127 100644
--- a/js/info.js
+++ b/js/info.js
@@ -50,7 +50,8 @@ var config = {
/** Define a function called after 'DOMContentLoaded' event in
the iframe context.
@type {(function (): void)} */
- on_iframe_load: null
+ on_iframe_load: null,
+ DEBUG: 0,
};
/*-------------------.
@@ -234,6 +235,7 @@ updater (state, action)
{
var result = Object.assign ({}, state, { action: action });
var linkid;
+ debug (action.type);
switch (action.type)
{
case "cache-links":
@@ -2141,6 +2143,18 @@ remove_highlight (elem)
}
}
+/*--------------.
+| Tracing. |
+`--------------*/
+
+function
+debug (msg)
+{
+ if (config.DEBUG) {
+ console.log (msg);
+ }
+}
+
/*--------------.
| Entry point. |
`--------------*/