client side cleanup
This commit is contained in:
parent
2825e84c48
commit
2900d797d0
2 changed files with 5 additions and 10 deletions
|
@ -3,18 +3,13 @@ window.$ = require('jquery')
|
||||||
|
|
||||||
# on load
|
# on load
|
||||||
$ ->
|
$ ->
|
||||||
# libs requiring full DOM
|
|
||||||
io = require 'socket.io-client'
|
|
||||||
|
|
||||||
# style sheet
|
# style sheet
|
||||||
require './style/custom.scss'
|
require './style/custom.scss'
|
||||||
|
|
||||||
# # init Socket.IO
|
|
||||||
# socket = io()
|
|
||||||
|
|
||||||
# reset forms
|
# reset forms
|
||||||
$('form').each ->
|
$('form').each ->
|
||||||
that = @
|
that = @
|
||||||
|
|
||||||
@fullReset = ->
|
@fullReset = ->
|
||||||
$('input', that).each ->
|
$('input', that).each ->
|
||||||
$(that).removeClass 'is-invalid'
|
$(that).removeClass 'is-invalid'
|
||||||
|
@ -22,7 +17,7 @@ $ ->
|
||||||
that.reset()
|
that.reset()
|
||||||
|
|
||||||
# login form
|
# login form
|
||||||
$('form[name="login"]').submit ->
|
$('form[name="login"]').submit (event) ->
|
||||||
# inhibit normal form submission
|
# inhibit normal form submission
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
|
|
||||||
|
@ -40,7 +35,7 @@ $ ->
|
||||||
# reset form
|
# reset form
|
||||||
@fullReset()
|
@fullReset()
|
||||||
|
|
||||||
# register form
|
# registration form
|
||||||
$('form[name="register"]').submit (event) ->
|
$('form[name="register"]').submit (event) ->
|
||||||
# inhibit normal form submission
|
# inhibit normal form submission
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
|
|
|
@ -31,7 +31,7 @@ html
|
||||||
input.form-control(name="password" type="password" required)
|
input.form-control(name="password" type="password" required)
|
||||||
|
|
||||||
div.form-group
|
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
|
div.col-md-3
|
||||||
h3 Register
|
h3 Register
|
||||||
|
@ -47,4 +47,4 @@ html
|
||||||
label(for="confirm") Confirm password:
|
label(for="confirm") Confirm password:
|
||||||
input.form-control(name="confirm" type="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
|
||||||
|
|
Reference in a new issue