MCPcopy Create free account
hub / github.com/Swizec/article-threader / handleClick

Function handleClick

public/lemon.js:95–106  ·  view source on GitHub ↗

* Handles the click event for the LS buttons, creates an iframe

(e)

Source from the content-addressed store, hash-verified

93 * Handles the click event for the LS buttons, creates an iframe
94 */
95 function handleClick(e) {
96 e.preventDefault();
97 if (document.body.classList.contains("lemonsqueezy-open")) {
98 return;
99 }
100 document.body.classList.add("lemonsqueezy-open");
101 const isDark = new URL(e.currentTarget.href).searchParams.get(
102 "dark"
103 );
104 const url = buildUrl(e.currentTarget.href);
105 openUrl(url, isDark);
106 }
107
108 function openUrl(url, isDark = false) {
109 // TODO: Validate URL is an LS url

Callers

nothing calls this directly

Calls 2

buildUrlFunction · 0.85
openUrlFunction · 0.85

Tested by

no test coverage detected