Skip to content

Instantly share code, notes, and snippets.

@benjie
Last active February 19, 2024 11:50
Show Gist options
  • Save benjie/4f844fa6d90674d2f6b0ab1ed5f31046 to your computer and use it in GitHub Desktop.
Save benjie/4f844fa6d90674d2f6b0ab1ed5f31046 to your computer and use it in GitHub Desktop.
GitHub pull request JS snippet to mark all ".mermaid" files as viewed (substitute for any file extension)
((suffix) => {let abort = false; [...$$(`a[title$="${suffix}"]`)].map(el => {const checks = el.parentNode.parentNode.parentNode.querySelectorAll('.js-reviewed-checkbox');if (checks.length !== 1) { throw new Error("Script out of date?");} return checks[0]}).forEach((inpt, i) => setTimeout(() => {if (abort || inpt.checked) return; inpt.click();}, i * 1000))})(".mermaid")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment