From 73827b9bf7ed18ed9437b1214e9a01f81e227923 Mon Sep 17 00:00:00 2001 From: hallgren Date: Fri, 10 Feb 2012 17:26:02 +0000 Subject: gfse: stay on the same page when compiling grammars The link to the minibar (or compiler errors) are now shown below the grammar on the same page. If you go to the minibar, you only have to press the back button once to get back to the editor. Also some output formatting changes in GFServer.hs. --- src/compiler/GFServer.hs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/compiler') diff --git a/src/compiler/GFServer.hs b/src/compiler/GFServer.hs index 149cb1864..685b9d76f 100644 --- a/src/compiler/GFServer.hs +++ b/src/compiler/GFServer.hs @@ -224,18 +224,17 @@ handle state0 cache execute1 resultpage cwd dir cmd (ecode,stdout,stderr) files = unlines $ "": - "Uploaded": + wrap "title" "Uploaded": "": - "

Uploaded

": - "
":escape cmd:"":escape (rel stderr):escape (rel stdout):
-    "
": + wrap "h1" "Uploaded": + concatMap (pre.escape) [cmd,rel stderr,rel stdout]: (if ecode==ExitSuccess - then "

OK

":links + then wrap "h3" "OK":links else "

Error

":listing) where links = "
": ("
Minibar"): - "
Back to Editor": + "
Back to Editor": "
": [] @@ -246,12 +245,17 @@ resultpage cwd dir cmd (ecode,stdout,stderr) files = listing = concatMap listfile files listfile (name,source) = - ("

"++name++"

"):number source:"
":[] + (wrap "h4" name++"
"):number source:"
":[] number = unlines . zipWith num [1..] . lines num n s = pad (show n)++" "++escape s pad s = replicate (5-length s) ' '++s + pre = wrap "pre" + wrap t s = tag t++s++endtag t + tag t = "<"++t++">" + endtag t = tag ('/':t) + rel = unlines . map relative . lines -- remove absolute file paths from error messages: -- cgit v1.2.3