- makeRef :: (CGIMonad cgi, Monad m) => String -> WithHTML x m () -> cgi (WithHTML y m ())
- makePopupRef :: CGIMonad cgi => String -> String -> HTMLCons x y cgi ()
- makeA :: CGIMonad cgi => String -> String -> HTMLField cgi x y ()
- data VALID = VALID
- data INVALID = INVALID
- data InputField a x = InputField {}
- concatFields :: (Reason c, Read c) => InputField c INVALID -> InputField Text INVALID -> InputField c INVALID
- concatFieldsWith :: (Reason c, Read c) => (String -> [String] -> String) -> InputField c INVALID -> [InputField Text INVALID] -> InputField c INVALID
- feither :: (a -> b) -> (c -> d) -> Either a c -> Either b d
- propagate :: Either [err] a -> Either [err] b -> Either [err] (a, b)
- data ValidationError = ValidationError {}
- data InputType
- textual :: InputType -> Bool
- type HTMLField cgi x y a = WithHTML x cgi () -> WithHTML y cgi a
- resetField :: CGIMonad cgi => HTMLField cgi x y (InputField () INVALID)
- submitField :: CGIMonad cgi => cgi () -> HTMLField cgi x y ()
- defaultSubmitField :: CGIMonad cgi => cgi () -> HTMLField cgi x y ()
- activeInputField :: (CGIMonad cgi, Reason a, Read a) => (a -> cgi ()) -> HTMLField cgi x y ()
- activateI :: CGIMonad cgi => (a -> cgi ()) -> HTMLField cgi x y (InputField a INVALID) -> HTMLField cgi x y ()
- inputField :: (CGIMonad cgi, Reason a, Read a) => HTMLField cgi x y (InputField a INVALID)
- maybeRead :: Read a => String -> Maybe a
- textInputField :: CGIMonad cgi => HTMLField cgi x y (InputField String INVALID)
- checkedTextInputField :: CGIMonad cgi => (Maybe String -> Maybe String) -> HTMLField cgi x y (InputField String INVALID)
- passwordInputField :: (CGIMonad cgi, Reason a, Read a) => HTMLField cgi x y (InputField a INVALID)
- checkboxInputField :: CGIMonad cgi => HTMLField cgi x y (InputField Bool INVALID)
- fileInputField :: CGIMonad cgi => HTMLField cgi x y (InputField FileReference INVALID)
- checkedFileInputField :: CGIMonad cgi => (Maybe FileReference -> Maybe FileReference) -> HTMLField cgi x y (InputField FileReference INVALID)
- genericField :: (Reason a, CGIMonad cgi) => InputType -> (Maybe String -> Maybe a) -> HTMLField cgi x y (InputField a INVALID)
- internalSubmitLink :: CGIMonad cgi => Bool -> Either [ValidationError] (cgi ()) -> HTMLCons x y cgi ()
- imageField :: CGIMonad cgi => Image -> HTMLField cgi x y (InputField (Int, Int) INVALID)
- data RadioGroup a x = RadioGroup {
- radioName :: String
- radioToken :: CGIFieldName
- radioString :: Maybe String
- radioValue :: Maybe a
- radioBound :: Bool
- radioGroup :: (CGIMonad cgi, Read a) => WithHTML x cgi (RadioGroup a INVALID)
- radioButton :: (Show a, Monad cgi) => RadioGroup a INVALID -> a -> HTMLField cgi x y ()
- radioError :: CGIMonad cgi => RadioGroup a INVALID -> WithHTML x cgi ()
- makeButton :: CGIMonad cgi => HTMLField cgi x y (InputField Bool INVALID)
- makeForm :: CGIMonad cgi => WithHTML x cgi a -> WithHTML y cgi ()
- makeTextarea :: CGIMonad cgi => String -> HTMLField cgi x y (InputField String INVALID)
- selectMultiple :: (CGIMonad cgi, Eq a) => (a -> String) -> [a] -> [a] -> (Int, Int) -> HTMLField cgi x y (InputField [a] INVALID)
- selectSingle :: (CGIMonad cgi, Eq a) => (a -> String) -> Maybe a -> [a] -> HTMLField cgi x y (InputField a INVALID)
- selectBounded :: (CGIMonad cgi, Enum a, Bounded a, Read a, Show a, Eq a) => Maybe a -> HTMLField cgi x y (InputField a INVALID)
- fieldSIZE :: Monad m => Int -> WithHTML x m ()
- fieldMAXLENGTH :: Monad m => Int -> WithHTML x m ()
- fieldVALUE :: (Monad m, Show a) => a -> WithHTML x m ()
- data Image = Image {}
- internalImage :: CGIMonad cgi => FreeForm -> String -> WithHTML x cgi Image
- dataImage :: CGIMonad cgi => FreeForm -> String -> WithHTML x cgi Image
- jsImage :: CGIMonad cgi => FreeForm -> String -> WithHTML x cgi Image
- externalImage :: CGIMonad cgi => URL -> String -> WithHTML x cgi Image
- makeImg :: Monad cgi => Image -> HTMLField cgi x y ()
- popuplink :: Monad m => String -> URL -> HTMLCons x y m ()
- restart :: CGIMonad cgi => cgi ()
- standardQuery :: CGIMonad cgi => String -> WithHTML x cgi a -> cgi ()
- getPathInfo :: CGIMonad cgi => cgi String
Documentation
:: (CGIMonad cgi, Monad m) | |
=> String | internal name of entity |
-> WithHTML x m () | body of the reference |
-> cgi (WithHTML y m ()) |
Create a hyperlink to internal entity.
:: CGIMonad cgi | |
=> String | name of popup window |
-> String | internal name of entity |
-> HTMLCons x y cgi () |
Create a popup hyperlink to internal entity.
makeA :: CGIMonad cgi => String -> String -> HTMLField cgi x y ()Source
Create hyperlink to internal entity /path?name
.
data InputField a x Source
HasValue InputField | |
InputHandle (InputField a) | |
StripHandle (InputField a x) a |
concatFields :: (Reason c, Read c) => InputField c INVALID -> InputField Text INVALID -> InputField c INVALIDSource
create a virtual input field from the concatenation of two input fields
concatFieldsWith :: (Reason c, Read c) => (String -> [String] -> String) -> InputField c INVALID -> [InputField Text INVALID] -> InputField c INVALIDSource
Create a virtual input field from the result of applying a function to two input fields. Parsing is applied to the result of the function call.
feither :: (a -> b) -> (c -> d) -> Either a c -> Either b dSource
Combine the values of separately parsed fields
data ValidationError Source
type HTMLField cgi x y a = WithHTML x cgi () -> WithHTML y cgi aSource
Every input widget maps the content generator for the widget (which may produce HTML elements or attributes) to the content generator of the widget.
resetField :: CGIMonad cgi => HTMLField cgi x y (InputField () INVALID)Source
Creates a reset button that clears all fields of a form.
submitField :: CGIMonad cgi => cgi () -> HTMLField cgi x y ()Source
Creates a submit button. Unsafe. Internal use only.
:: (CGIMonad cgi, Reason a, Read a) | |
=> (a -> cgi ()) | Function that maps input data to a CGI action. |
-> HTMLField cgi x y () |
Creates an input field that submits the field to the browser when data is entered into this field.
activateI :: CGIMonad cgi => (a -> cgi ()) -> HTMLField cgi x y (InputField a INVALID) -> HTMLField cgi x y ()Source
Attach a CGI action to the value returned by the input field. Activation means that data is submitted as soon as it is entered.
inputField :: (CGIMonad cgi, Reason a, Read a) => HTMLField cgi x y (InputField a INVALID)Source
textInputField :: CGIMonad cgi => HTMLField cgi x y (InputField String INVALID)Source
Create a textual input field that returns the string entered. (Avoids having to put quotes around a string.)
checkedTextInputField :: CGIMonad cgi => (Maybe String -> Maybe String) -> HTMLField cgi x y (InputField String INVALID)Source
Creates a textual input field that takes a custom validation function.
passwordInputField :: (CGIMonad cgi, Reason a, Read a) => HTMLField cgi x y (InputField a INVALID)Source
Like inputField
but the characters are not echoed on the screen.
checkboxInputField :: CGIMonad cgi => HTMLField cgi x y (InputField Bool INVALID)Source
Creates a checkbox. Returns True
if box was checked.
fileInputField :: CGIMonad cgi => HTMLField cgi x y (InputField FileReference INVALID)Source
Creates a file input field. Returns a temporary FileReference
. The
fileReferenceName
of the result is *not* guaranteed to be persistent. The
application is responsible for filing it away at a safe place.
checkedFileInputField :: CGIMonad cgi => (Maybe FileReference -> Maybe FileReference) -> HTMLField cgi x y (InputField FileReference INVALID)Source
Creates a file input field. Like fileInputField
but has an additional
parameter for additional validation of the input.
genericField :: (Reason a, CGIMonad cgi) => InputType -> (Maybe String -> Maybe a) -> HTMLField cgi x y (InputField a INVALID)Source
internalSubmitLink :: CGIMonad cgi => Bool -> Either [ValidationError] (cgi ()) -> HTMLCons x y cgi ()Source
generates a hyperlink that submits the current form.
imageField :: CGIMonad cgi => Image -> HTMLField cgi x y (InputField (Int, Int) INVALID)Source
Create an input field from an image. Returns (x,y) position clicked in the image.
data RadioGroup a x Source
RadioGroup | |
|
HasValue RadioGroup | |
InputHandle (RadioGroup a) | |
StripHandle (RadioGroup a x) a |
radioGroup :: (CGIMonad cgi, Read a) => WithHTML x cgi (RadioGroup a INVALID)Source
Create a handle for a new radio group. This handle is invisible on the screen!
radioButton :: (Show a, Monad cgi) => RadioGroup a INVALID -> a -> HTMLField cgi x y ()Source
Create a new radio button and attach it to an existing RadioGroup
.
radioError :: CGIMonad cgi => RadioGroup a INVALID -> WithHTML x cgi ()Source
Create and place the error indicator for an existing RadioGroup
. Becomes
visible only if no button of a radio group is pressed.
makeButton :: CGIMonad cgi => HTMLField cgi x y (InputField Bool INVALID)Source
Create a single button.
makeForm :: CGIMonad cgi => WithHTML x cgi a -> WithHTML y cgi ()Source
Wraps an HTML form around its arguments. All standard attributes are computed and need not be supplied explicitly.
makeTextarea :: CGIMonad cgi => String -> HTMLField cgi x y (InputField String INVALID)Source
Create a text area with a preset string.
:: (CGIMonad cgi, Eq a) | |
=> (a -> String) | function to display values of type a |
-> [a] | list of preselected entries |
-> [a] | list of all possible entries |
-> (Int, Int) | (min, max) number of fields that must be selected |
-> HTMLField cgi x y (InputField [a] INVALID) |
Create a selection box where multiple entries can be selected.
:: (CGIMonad cgi, Eq a) | |
=> (a -> String) | function to display values of type a |
-> Maybe a | optional preselected value |
-> [a] | list of all possible values |
-> HTMLField cgi x y (InputField a INVALID) |
Create a selection box where exactly one entry can be selected.
selectBounded :: (CGIMonad cgi, Enum a, Bounded a, Read a, Show a, Eq a) => Maybe a -> HTMLField cgi x y (InputField a INVALID)Source
Selection box for elements of a Bounded type. Argument is the optional preselected value.
fieldVALUE :: (Monad m, Show a) => a -> WithHTML x m ()Source
Create a VALUE
attribute from any Show
able.
Reference to internal image.
Reference to internal image via data URL (small images, only).
Reference to internal image via javascript URL (does not seem to work).
Reference to image by URL.
popuplink :: Monad m => String -> URL -> HTMLCons x y m ()Source
Hyperlink that creates a named popup window from an URL string.
standardQuery :: CGIMonad cgi => String -> WithHTML x cgi a -> cgi ()Source
Convenient workhorse. Takes the title of a page and a monadic HTML value for the contents of the page. Wraps the contents in a form so that input fields and buttons may be used inside.
getPathInfo :: CGIMonad cgi => cgi StringSource