From 2900d797d09d2b15e7e2e8ed532e890b23c20b4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= Date: Sun, 16 Dec 2018 03:19:27 +0100 Subject: [PATCH] client side cleanup --- src/index.coffee | 11 +++-------- views/index.pug | 4 ++-- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/index.coffee b/src/index.coffee index 9461f00..cc0c2ff 100644 --- a/src/index.coffee +++ b/src/index.coffee @@ -3,18 +3,13 @@ window.$ = require('jquery') # on load $ -> - # libs requiring full DOM - io = require 'socket.io-client' - # style sheet require './style/custom.scss' - # # init Socket.IO - # socket = io() - # reset forms $('form').each -> that = @ + @fullReset = -> $('input', that).each -> $(that).removeClass 'is-invalid' @@ -22,7 +17,7 @@ $ -> that.reset() # login form - $('form[name="login"]').submit -> + $('form[name="login"]').submit (event) -> # inhibit normal form submission event.preventDefault() @@ -40,7 +35,7 @@ $ -> # reset form @fullReset() - # register form + # registration form $('form[name="register"]').submit (event) -> # inhibit normal form submission event.preventDefault() diff --git a/views/index.pug b/views/index.pug index 9c15eeb..854bec9 100644 --- a/views/index.pug +++ b/views/index.pug @@ -31,7 +31,7 @@ html input.form-control(name="password" type="password" required) div.form-group - button.btn.btn-primary(type="submit") Login + button.btn.btn-primary.w-100.text-center(type="submit") Login div.col-md-3 h3 Register @@ -47,4 +47,4 @@ html label(for="confirm") Confirm password: input.form-control(name="confirm" type="password") - button.btn.btn-primary(type="submit") Register + button.btn.btn-primary.w-100.text-center(type="submit") Register