X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=Rakka%2FWiki%2FInterpreter%2FBase.hs;h=8a3ada996290f8e1e1e2c00e7932974b52b50d95;hb=f19a294d54f38faaeab0027ecb5d85388243b924;hp=f461027dc339e1049f9543fe36b401f7cf8a275e;hpb=dc29dc9081156af3b536b19ffd828cdd67ddd84a;p=Rakka.git diff --git a/Rakka/Wiki/Interpreter/Base.hs b/Rakka/Wiki/Interpreter/Base.hs index f461027..8a3ada9 100644 --- a/Rakka/Wiki/Interpreter/Base.hs +++ b/Rakka/Wiki/Interpreter/Base.hs @@ -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.Arrow 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 -- +-- 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 -- +-- 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 -- +-- 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 + } + + +-- +searchFieldInterp :: Interpreter +searchFieldInterp + = InlineCommandInterpreter { + iciName = "searchField" + , iciInterpret + = \ _ _ -> + let attrs = [ ("type" , "text") + , ("class", "searchField") + ] + in + return (Input attrs) + } + +-- +configurationInterp :: Interpreter +configurationInterp + = InlineCommandInterpreter { + iciName = "configuration" + , iciInterpret + = \ _ _ -> + let attrs = [ ("type" , "button") + , ("value", "Configuration") + , ("class", "configButton controls") + ] + in + return (Input attrs) + }