)
where
-import Control.Arrow
-import Control.Arrow.ListArrow
import Data.Map (Map)
import qualified Data.Map as M
import Data.Maybe
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]
, newPageInterp
, editPageInterp
, loginInterp
+ , searchFieldInterp
+ , configurationInterp
]
(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)
-- <input type="button"
-- value="Create new page"
-- onclick="Rakka.newPage()"
--- class="newButton" />
+-- class="newButton controls" />
newPageInterp :: Interpreter
newPageInterp
= InlineCommandInterpreter {
attrs = [ ("type" , "button")
, ("value" , label)
, ("onclick", "Rakka.newPage()")
- , ("class" , "newButton")
+ , ("class" , "newButton controls")
]
in
return (Input attrs)
-- <input type="button"
-- value="Edit"
-- onclick="Rakka.editPage(\"Foo\")"
--- class="editButton" />
+-- class="editButton controls" />
editPageInterp :: Interpreter
editPageInterp
= InlineCommandInterpreter {
attrs = [ ("type" , "button")
, ("value" , label)
, ("onclick", "Rakka.editPage(\"" ++ name ++ "\")")
- , ("class" , "editButton")
+ , ("class" , "editButton controls")
]
in
return (Input attrs)
-- <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)
+ }