diff options
author | Alexis Hovorka <[email protected]> | 2022-01-09 19:53:09 -0700 |
---|---|---|
committer | Alexis Hovorka <[email protected]> | 2022-01-09 19:53:09 -0700 |
commit | 0278a785d3ae63117215050899ac4b053bfe3e55 (patch) | |
tree | 04aab7d3741107980433d4316eef5f7e0e4926ff /app/public/main.js |
Initial commit
Diffstat (limited to 'app/public/main.js')
-rw-r--r-- | app/public/main.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/app/public/main.js b/app/public/main.js new file mode 100644 index 0000000..ff960c2 --- /dev/null +++ b/app/public/main.js @@ -0,0 +1,18 @@ +document.addEventListener("DOMContentLoaded", async () => { "use strict"; + +const secure = location.protocol === "https:"; +const $ = (s,c) => (c||document).querySelector(s); +function $$(x,y,z,a){a=(z||document).querySelectorAll(x);if(typeof y=="function")[].forEach.call(a,y);return a} +function m(a,b,c){c=document;b=c.createElement(b||"p");b.innerHTML=a.trim();for(a=c.createDocumentFragment();c=b.firstChild;)a.appendChild(c);return a.firstChild} + +//sock.init(`ws${secure?"s":""}://${location.host}/ws`); +//sock.on("hello", e => { +// console.log("hello", e); +// sock.send("world", {foo:"bar"}); +//}); + +//if ("serviceWorker" in navigator) { +// navigator.serviceWorker.register("sw.js") +// .then(() => console.log("Service worker registered")); +//} +}); |