Added Grunt to support asset pipelines and pre-processors; added SASS, Twig, and CoffeeScript to create the app

This commit is contained in:
2022-05-21 20:44:38 -04:00
parent 88c00043b7
commit 866754cf3f
15 changed files with 3056 additions and 103 deletions

View File

@ -0,0 +1,3 @@
window.onload = ->
document.getElementById('ldapHost').textContent = localStorage.getItem('ldap_hostname')
return

View File

@ -0,0 +1,23 @@
ldap = require('ldapjs')
loginForm = (event) ->
event.preventDefault()
bindHost = document.forms.loginForm.ldap_host.value
bindDn = document.forms.loginForm.bind_dn.value
bindPw = document.forms.loginForm.bind_pw.value
client = ldap.createClient(url: 'ldap://' + bindHost + '/')
client.bind bindDn, bindPw, (err) ->
if err
document.querySelector('h1').textContent = 'error'
else
document.querySelector('h1').textContent = 'Logged in!'
localStorage.setItem('ldap_hostname', document.forms.loginForm.ldap_host.value)
localStorage.setItem('ldap_bind_dn', document.forms.loginForm.bind_dn.value)
localStorage.setItem('ldap_bind_pw', document.forms.loginForm.bind_pw.value)
window.location.href = 'index.html'
return
return
window.onload = ->
document.getElementById('loginForm').addEventListener 'submit', loginForm
return