diff --git a/spec.js b/spec.js index a488e5e..450f7cc 100644 --- a/spec.js +++ b/spec.js @@ -9,6 +9,11 @@ module.exports = [ source: "/assets/fonts/whitney-400.woff", target: "/static/whitney-400.woff", }, + { + type: "js", + source: "/js/main.js", + target: "/static/main.js", + }, { type: "js", source: "/js/basic.js", @@ -127,6 +132,6 @@ module.exports = [ { type: "pug", source: "/login.pug", - target: "/login.html", + target: "/login/index.html", }, ]; diff --git a/src/home.pug b/src/home.pug index 68bbd21..09a00c7 100644 --- a/src/home.pug +++ b/src/home.pug @@ -33,18 +33,14 @@ doctype html html head meta(charset="utf-8") + title Carbon // var static = !{JSON.stringify([...static.entries()].reduce((a, c) => (a[c[0]] = getRelative(c[1]), a), {}))} script | var staticFiles = new Map( != JSON.stringify([...static.keys()].map(k => [k, getStatic(k)])) | ) link(rel="stylesheet" type="text/css" href=getStatic("/sass/main.sass")) - script(type="module" src=getStatic("/js/groups.js")) - script(type="module" src=getStatic("/js/chat-input.js")) - script(type="module" src=getStatic("/js/room-picker.js")) - script(type="module" src=getStatic("/js/sync/sync.js")) - script(type="module" src=getStatic("/js/chat.js")) - title Carbon + script(type="module" src=getStatic("/js/main.js")) body main.main .c-groups @@ -56,4 +52,4 @@ html .c-chat__messages#c-chat-messages .c-chat__inner#c-chat .c-chat-input - textarea(placeholder="Send a message..." autocomplete="off").c-chat-input__textarea#c-chat-textarea \ No newline at end of file + textarea(placeholder="Send a message..." autocomplete="off").c-chat-input__textarea#c-chat-textarea diff --git a/src/js/main.js b/src/js/main.js new file mode 100644 index 0000000..98dd38b --- /dev/null +++ b/src/js/main.js @@ -0,0 +1,9 @@ +import $to_relative "/js/groups.js" +import $to_relative "/js/chat-input.js" +import $to_relative "/js/room-picker.js" +import $to_relative "/js/sync/sync.js" +import $to_relative "/js/chat.js" + +if (!localStorage.getItem("access_token")) { + location.assign("./login") +}