[Fencommits] fenserve: mark focus

Benja Fallenstein benja.fallenstein at gmail.com
Wed Jun 20 18:23:29 EEST 2007


Wed Jun 20 18:23:21 EEST 2007  Benja Fallenstein <benja.fallenstein at gmail.com>
  * mark focus
diff -rN -u old-fenserve/fendata/Main.hs new-fenserve/fendata/Main.hs
--- old-fenserve/fendata/Main.hs	2007-06-20 18:23:28.000000000 +0300
+++ new-fenserve/fendata/Main.hs	2007-06-20 18:23:28.000000000 +0300
@@ -41,6 +41,7 @@
   , ".potion {"
   , "    border: dashed black 1px; padding: 2px;"
   , "    margin: 2px; line-height: 1.8em }"
+  , ".focus { font-weight: bold; color: maroon }"
   , "span.potion { background: #eee }"
   , "span.potion span.potion { background: #ddd }"
   , "span.potion span.potion span.potion { background: #ccc }"
diff -rN -u old-fenserve/fendata/Potions.hs new-fenserve/fendata/Potions.hs
--- old-fenserve/fendata/Potions.hs	2007-06-20 18:23:28.000000000 +0300
+++ new-fenserve/fendata/Potions.hs	2007-06-20 18:23:28.000000000 +0300
@@ -153,7 +153,8 @@
     
 renderExp' :: (?db :: DB, ?time :: Int64) => Exp -> RenderExp [(Bool, HTML)]
 renderExp' (Question ty) = ren ( "[which ", renderType ty, "?]" )
-renderExp' (Focus exp) = ren ( I $ E 0 exp )
+renderExp' (Focus exp) = do h <- liftM (catMap snd) $ renderOne $ E 0 exp
+                            return [(True, tag "span" [P "class" "focus"] h)]
 renderExp' exp@(Exp n arg) = f (getPotion n) where
     f (Potion _ f) = let (r,_) = f (fromMaybe (error "renderExp") $ cast arg) in ren r
 




More information about the Fencommits mailing list