]> gitweb @ CieloNegro.org - Rakka.git/blobdiff - Rakka/Wiki/Interpreter/Base.hs
Fixing build breakage...
[Rakka.git] / Rakka / Wiki / Interpreter / Base.hs
index f461027dc339e1049f9543fe36b401f7cf8a275e..1af5c77e9844f7e5497b8c4ba364f3ac8440d101 100644 (file)
@@ -3,8 +3,6 @@ module Rakka.Wiki.Interpreter.Base
     )
     where
 
-import           Control.Arrow
-import           Control.Arrow.ListArrow
 import           Data.Map (Map)
 import qualified Data.Map as M
 import           Data.Maybe
@@ -12,8 +10,7 @@ import           Rakka.Page
 import           Rakka.SystemConfig
 import           Rakka.Wiki
 import           Rakka.Wiki.Interpreter
-import           Text.XML.HXT.Arrow.XmlArrow
-import           Text.XML.HXT.Arrow.XmlNodeSet
+import           Text.XML.HXT.XPath
 
 
 interpreters :: [Interpreter]
@@ -25,6 +22,8 @@ interpreters = [ lineBreakInterp
                , newPageInterp
                , editPageInterp
                , loginInterp
+               , searchFieldInterp
+               , configurationInterp
                ]
 
 
@@ -94,7 +93,7 @@ otherLangsInterp
                                (langName, name) : mergeTables m xs
 
       mkLangList :: [(LanguageName, PageName)] -> BlockElement
-      mkLangList xs = List Bullet (map mkLangLink xs)
+      mkLangList = List Bullet . map mkLangLink
 
       mkLangLink :: (LanguageName, PageName) -> ListItem
       mkLangLink (langName, name)
@@ -104,7 +103,7 @@ otherLangsInterp
 -- <input type="button"
 --        value="Create new page"
 --        onclick="Rakka.newPage()"
---        class="newButton" />
+--        class="newButton controls" />
 newPageInterp :: Interpreter
 newPageInterp 
     = InlineCommandInterpreter {
@@ -115,7 +114,7 @@ newPageInterp
                 attrs = [ ("type"   , "button")
                         , ("value"  , label)
                         , ("onclick", "Rakka.newPage()")
-                        , ("class"  , "newButton")
+                        , ("class"  , "newButton controls")
                         ]
             in
               return (Input attrs)
@@ -125,7 +124,7 @@ newPageInterp
 -- <input type="button"
 --        value="Edit"
 --        onclick="Rakka.editPage(\"Foo\")"
---        class="editButton" />
+--        class="editButton controls" />
 editPageInterp :: Interpreter
 editPageInterp 
     = InlineCommandInterpreter {
@@ -137,7 +136,7 @@ editPageInterp
                 attrs = [ ("type"   , "button")
                         , ("value"  , label)
                         , ("onclick", "Rakka.editPage(\"" ++ name ++ "\")")
-                        , ("class"  , "editButton")
+                        , ("class"  , "editButton controls")
                         ]
             in
               return (Input attrs)
@@ -146,17 +145,50 @@ editPageInterp
 
 -- <input type="button"
 --        value="Login"
---        class="loginButton" />
+--        class="loginButton controls" />
 loginInterp :: Interpreter
 loginInterp 
     = InlineCommandInterpreter {
         iciName = "login"
       , iciInterpret
           = \ _ _ ->
-            let attrs = [ ("type"   , "button")
-                        , ("value"  , "Login")
-                        , ("class"  , "loginButton")
+            let attrs = [ ("type" , "button")
+                        , ("value", "Login")
+                        , ("class", "loginButton controls")
                         ]
             in
               return (Input attrs)
-      }
\ No newline at end of file
+      }
+
+
+-- <input type="text"
+--        class="searchField" />
+searchFieldInterp :: Interpreter
+searchFieldInterp 
+    = InlineCommandInterpreter {
+        iciName = "searchField"
+      , iciInterpret
+          = \ _ _ ->
+            let attrs = [ ("type" , "text")
+                        , ("class", "searchField")
+                        ]
+            in
+              return (Input attrs)
+      }
+
+-- <input type="button"
+--        value="Configuration"
+--        class="configButton controls" />
+configurationInterp :: Interpreter
+configurationInterp 
+    = InlineCommandInterpreter {
+        iciName = "configuration"
+      , iciInterpret
+          = \ _ _ ->
+            let attrs = [ ("type" , "button")
+                        , ("value", "Configuration")
+                        , ("class", "configButton controls")
+                        ]
+            in
+              return (Input attrs)
+      }