hide and seek

This commit is contained in:
nek0 2016-12-03 21:53:55 +01:00
parent 5b5d48613a
commit 07e01fd053
5 changed files with 17 additions and 9 deletions

View file

@ -4,7 +4,7 @@ import Prelude (Unit, bind, not, pure, show, unit, ($), (&&), (<>), (=<<), (==))
import Control.Monad.Aff (runAff) import Control.Monad.Aff (runAff)
import Control.Monad.Eff (Eff) import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (CONSOLE, log) import Control.Monad.Eff.Console (CONSOLE, log)
import Control.Monad.Eff.JQuery (JQuery, JQueryEvent, getValue, on, preventDefault, ready, select) import Control.Monad.Eff.JQuery (JQuery, JQueryEvent, display, hide, getValue, on, preventDefault, ready, select)
import DOM (DOM) import DOM (DOM)
@ -32,6 +32,8 @@ main :: forall eff. Eff ( ajax :: AJAX
main = main =
ready $ do ready $ do
log "activating" log "activating"
display =<< select ".js-hidden"
hide =<< select ".noscript"
activate <- select "#activate" activate <- select "#activate"
on "click" (onActivateClick activate) activate on "click" (onActivateClick activate) activate

View file

@ -4,7 +4,7 @@ import Prelude (Unit, bind, not, pure, show, unit, ($), (&&), (<$>), (<>), (=<<)
import Control.Monad.Aff (runAff) import Control.Monad.Aff (runAff)
import Control.Monad.Eff (Eff) import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (CONSOLE, log) import Control.Monad.Eff.Console (CONSOLE, log)
import Control.Monad.Eff.JQuery (JQuery, JQueryEvent, getValue, hide, on, preventDefault, ready, select, setProp) import Control.Monad.Eff.JQuery (JQuery, JQueryEvent, display, getValue, hide, on, preventDefault, ready, select, setProp)
import DOM (DOM) import DOM (DOM)
@ -36,6 +36,8 @@ main :: forall eff. Eff ( ajax :: AJAX
main = main =
ready $ do ready $ do
log "logging in" log "logging in"
display =<< select ".js-hidden"
hide =<< select ".noscript"
login <- select "#login" login <- select "#login"
on "click" (onLoginClick login) login on "click" (onLoginClick login) login

View file

@ -197,6 +197,10 @@ ul, ol {
text-align: left; text-align: left;
} }
.js-hidden {
display: none;
}
@media (max-width: 755px) { @media (max-width: 755px) {
#main { #main {
margin-top: 120px; margin-top: 120px;

View file

@ -1,18 +1,18 @@
$newline always $newline always
<div .medium> <div .medium>
<noscript>You need to have Javascript enabled <div .noscript .btn .btn-danger>You need to have Javascript enabled
<form .js-hidden>
<h3>Activate your account <h3>Activate your account
<form>
<div .form-group .required> <div .form-group .required>
<label for="password1">Password: <label for="password1">Password:
<input #password1 type="password" required> <input #password1 type="password" required>
<div .form-group .required> <div .form-group .required>
<label for="password2">Confirm your password: <label for="password2">Confirm your password:
<input #password2 type="password" required> <input #password2 type="password" required>
<p #progress>
<div .form-group .optional> <div .form-group .optional>
<button #activate type="submit" data-token="#{token}" data-salt="#{hexSalt}">Activate <button #activate type="submit" data-token="#{token}" data-salt="#{hexSalt}">Activate
<div #progress>
<script src="/static/js/jquery.min.js" type="text/javascript"> <script src="/static/js/jquery.min.js" type="text/javascript">
<script src="/static/js/jsSHA.js" type="text/javascript"> <!--<script src="/static/js/jsSHA.js" type="text/javascript">-->
<script src="/static/js/purs_activate.js" type="text/javascript"> <script src="/static/js/purs_activate.js" type="text/javascript">

View file

@ -1,8 +1,8 @@
$newline always $newline always
<div .medium> <div .medium>
<noscript>Please enable Javascript <div .noscript .btn .btn-danger>Please enable Javascript to log in
<h3>Login <form .js-hidden>
<form> <h3>Login
<div .form-group .required> <div .form-group .required>
<label for="username">User: <label for="username">User:
<input .form-control #username type="text" required> <input .form-control #username type="text" required>