[Fencommits] fenserve: remove link decorations only from potion links

Benja Fallenstein benja.fallenstein at gmail.com
Wed May 23 22:18:41 EEST 2007


Wed May 23 22:18:34 EEST 2007  Benja Fallenstein <benja.fallenstein at gmail.com>
  * remove link decorations only from potion links
diff -rN -u old-fenserve/fendata/Main.hs new-fenserve/fendata/Main.hs
--- old-fenserve/fendata/Main.hs	2007-05-23 22:18:41.000000000 +0300
+++ new-fenserve/fendata/Main.hs	2007-05-23 22:18:41.000000000 +0300
@@ -17,7 +17,7 @@
 import qualified System.IO.Unsafe
 import qualified Control.Exception
 
-header = HTML "<head><style>a { text-decoration: none; color: inherit; }\
+header = HTML "<head><style>a.editLink { text-decoration: none; color: inherit; }\
          \button {cursor: pointer; background: none; border: none; font: inherit; margin: 0; padding: 0}</style></head>"
 
 type Id = Int
@@ -88,8 +88,9 @@
 expType (Str _) = string
 
 editLink :: (?link :: Bool, ToHTML a) => (Exp -> Exp) -> Exp -> Type -> a -> HTML
-editLink f old t s | not ?link = toHTML s | otherwise = flip link s $
-  "edit?exp="++(show $ f $ Var (-1))++"&old="++show old++"&type="++show t
+editLink f old t s | not ?link = toHTML s | otherwise =
+  flip (tag "a") s [("class", "editLink"), ("href",
+      "edit?exp="++(show $ f $ Var (-1))++"&old="++show old++"&type="++show t)]
                   
 renderMaybeExp (Just exp) cx ty = renderExp' exp cx ty
 renderMaybeExp Nothing cx ty = editLink cx (Var 0) ty $ surround $ bold $




More information about the Fencommits mailing list