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

Function dumbSetup

public/lemon.js:28–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26 }
27
28 function dumbSetup() {
29 listenForButtons();
30
31 window.addEventListener(
32 "message",
33 function (event) {
34 if (typeof event.data === "object" && event.data !== null) {
35 const payload = event.data;
36
37 // Check if "event" exists in the payload, if it does then we know it's an LS event
38 if (payload.event !== null) {
39 globalEventHandler(payload);
40 }
41 }
42
43 // Primative events
44 if (event.data === "mounted") {
45 hideLoader();
46 }
47 if (event.data === "close") {
48 close();
49 }
50 }.bind(this),
51 false
52 );
53 }
54
55 /**
56 * Handles all incoming LS iframe events

Callers

nothing calls this directly

Calls 4

listenForButtonsFunction · 0.85
globalEventHandlerFunction · 0.85
hideLoaderFunction · 0.85
closeFunction · 0.85

Tested by

no test coverage detected