Hi everyone,
I’m working on a JavaScript script for my wiki that will check if a page is up-to-date. The script uses a countdown timer and a status indicator that toggles between “Outdated” and “Updated.” Essentially, how it works is:
The countdown loops, defined in seconds.
Initially, the status is shown as “Outdated.”
Upon pressing an edit button (which simulates a page update), the status changes to “Updated.”
The status resets to “Outdated” when the timer reaches zero, and the edit button is a one-way toggle to mark the page as updated.
What I need help for with is, how do I detect the editing of a page?
Is there an existing Fandom JavaScript function or event handler that detects when a page (the page the script is used in) is edited?
If not, how can I implement something like that this in my script to track real page edits?
The current code can be found in the HTML file linked below, you can see the logic for yourself. Any help will be greatly appreciated! Thank you in advance.
Best regards, Ozoo
HTML file: https://drive.google.com/file/d/161130VuGWPLfNUxRoxg4E4I2bOuXEAlC/view?usp=sharing
Output: