From b0d74b14664b44113218a8413dc59655c5494afc Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Mon, 14 Jul 2014 14:30:30 -0700 Subject: [PATCH] web: support more than 2 postings in the add form - ctrl plus/ctrl minus adds/removes posting fields - clicking the more link or pressing tab in the last field also works - the focus is adjusted sensibly - the add form is reset if closed and reopened, except the number of postings - keyboard shortcuts should be less dependent on focus now - tested in recent firefox, chrome, safari - things should be robust with typeahead, with one notable exception: typeahead is not enabled in the new account fields when you add postings. I tried hard, help welcome. --- hledger-web/Foundation.hs | 82 ++++------- hledger-web/Handler/Post.hs | 115 ++++++++++----- hledger-web/static/hledger.js | 268 ++++++++++++++++++++++++---------- 3 files changed, 299 insertions(+), 166 deletions(-) diff --git a/hledger-web/Foundation.hs b/hledger-web/Foundation.hs index a3e84c6cf..fa67ac502 100644 --- a/hledger-web/Foundation.hs +++ b/hledger-web/Foundation.hs @@ -280,64 +280,44 @@ getMessageOr mnewmsg = do -- | Add transaction form. addform :: Text -> ViewData -> HtmlUrl AppRoute addform _ vd@VD{..} = [hamlet| +