-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththompson.js
More file actions
33 lines (29 loc) 路 948 Bytes
/
Copy paththompson.js
File metadata and controls
33 lines (29 loc) 路 948 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
/**
* thompson.js - A funny DOM Ready Wrapper
* "Ja sam du拧a hrvatskih developera!"
*/
const za = {
/**
* DOM ready handler - properly handles all document ready states
* @param {string} x - Must be "spremni" (ready)
* @param {Function} cb - Function to execute when DOM is ready
*/
DOM: (x, cb) => {
if (x !== "spremni") {
window.location.href = 'https://youtu.be/CWtU9FAclmk?list=RDCWtU9FAclmk&t=64';
return;
}
// If DOM is already interactive or complete, execute immediately
if (document.readyState !== "loading")
cb();
// Otherwise, wait for DOMContentLoaded
else
document.addEventListener("DOMContentLoaded", cb);
}
};
// Globalization: when everyone鈥檚 connected, and nobody鈥檚 responsible.
if (typeof window !== "undefined") {
window.za = za;
}
// Export/import diaspora - everybody now turbomania! https://www.youtube.com/watch?v=9PSb2uYLCio
export default za;