From b4f615b62ae073a643a0772daff7c35c907faeb7 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Tue, 10 Aug 2010 01:13:14 +0000 Subject: [PATCH] web: a non-null "add" or "edit" query parameter shows the forms --- Hledger/Cli/Commands/Web.hs | 2 ++ data/web/static/hledger.js | 3 +++ hledger.cabal | 1 + 3 files changed, 6 insertions(+) diff --git a/Hledger/Cli/Commands/Web.hs b/Hledger/Cli/Commands/Web.hs index 67bb7e18b..d3f6f5e59 100644 --- a/Hledger/Cli/Commands/Web.hs +++ b/Hledger/Cli/Commands/Web.hs @@ -62,6 +62,7 @@ mkYesod "HledgerWebApp" [$parseRoutes| style_css = StaticRoute ["style.css"] hledger_js = StaticRoute ["hledger.js"] jquery_js = StaticRoute ["jquery.js"] +jquery_url_js = StaticRoute ["jquery.url.js"] dhtmlxcommon_js = StaticRoute ["dhtmlxcommon.js"] dhtmlxcombo_js = StaticRoute ["dhtmlxcombo.js"] @@ -752,6 +753,7 @@ pageLayout td@TD{title=title, msg=msg} content = [$hamlet| %title $title$ %meta!http-equiv=Content-Type!content=$metacontent$ %script!type=text/javascript!src=@StaticR.jquery_js@ + %script!type=text/javascript!src=@StaticR.jquery_url_js@ %script!type=text/javascript!src=@StaticR.dhtmlxcommon_js@ %script!type=text/javascript!src=@StaticR.dhtmlxcombo_js@ %script!type=text/javascript!src=@StaticR.hledger_js@ diff --git a/data/web/static/hledger.js b/data/web/static/hledger.js index 6e821734c..97f0f5922 100644 --- a/data/web/static/hledger.js +++ b/data/web/static/hledger.js @@ -3,6 +3,9 @@ $(document).ready(function() { + /* maybe show forms */ + if ($.url.param('add')) addformToggle(); + else if ($.url.param('edit')) editformToggle(); }); diff --git a/hledger.cabal b/hledger.cabal index edec2932a..43c2c5390 100644 --- a/hledger.cabal +++ b/hledger.cabal @@ -26,6 +26,7 @@ data-files: web/static/style.css web/static/hledger.js web/static/jquery.js + web/static/jquery.url.js web/static/dhtmlxcommon.js web/static/dhtmlxcombo.js web/static/images/combo_select.gif