-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathglobals.js
More file actions
39 lines (30 loc) · 850 Bytes
/
globals.js
File metadata and controls
39 lines (30 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
if (typeof window.globalsLoaded === "undefined") {
console.log("globals.js loaded");
window.globalsLoaded = true;
// Global state management
const GlobalState = {
shiftPressed: false,
lastCheckedCheckbox: null,
// State setters
setShiftPressed(pressed) {
this.shiftPressed = pressed;
},
setLastCheckedCheckbox(checkbox) {
this.lastCheckedCheckbox = checkbox;
},
// State getters
isShiftPressed() {
return this.shiftPressed;
},
getLastCheckedCheckbox() {
return this.lastCheckedCheckbox;
}
};
// Export to global scope
window.GlobalState = GlobalState;
// For backward compatibility
window.shiftPressed = false;
window.lastCheckedCheckbox = null;
} else {
console.log("globals.js already loaded, skipping re-initialization");
}