Safe Haskell | None |
---|---|
Language | Haskell2010 |
- class YesodTransloadit master where
- transloaditRoot :: master -> Text
- mkParams :: UTCTime -> Key -> Template -> Text -> Secret -> ParamsResult
- transloadIt :: (YesodJquery m, YesodTransloadit m) => TransloaditParams -> WidgetT m IO Signature
- handleTransloadit :: (RenderMessage m FormMessage, YesodJquery m, YesodTransloadit m) => WidgetT m IO (Maybe Text)
- tokenText :: (YesodJquery m, YesodTransloadit m) => WidgetT m IO Text
- extractFirstResult :: AsValue s => Text -> Maybe s -> Maybe Value
- extractNthResult :: AsValue s => Int -> Text -> Maybe s -> Maybe Value
- type ParamsResult = Either ParamsError TransloaditParams
- data ParamsError = UnknownError
- newtype Key = Key {}
- newtype Template = Template {}
- newtype Secret = Secret {
- secret :: ByteString
- data TransloaditParams
- type Signature = Text
Documentation
class YesodTransloadit master where Source
Typeclass for your website to enable using Transloadit.
Nothing
transloaditRoot :: master -> Text Source
Override the transloaditRoot
to point at a different base Javascript directory.
The default settings will load assets from assets.transloadit.com.
:: UTCTime | When the Transloadit signature should expire |
-> Key | Transloadit key |
-> Template | The Template to use in Transloadit |
-> Text | The id of the form to attach to |
-> Secret | Transloadit Secret |
-> ParamsResult |
Smart constructor for Transloadit params
transloadIt :: (YesodJquery m, YesodTransloadit m) => TransloaditParams -> WidgetT m IO Signature Source
Calculate the signature, and embed Javascript to attach Transloadit to the form.
handleTransloadit :: (RenderMessage m FormMessage, YesodJquery m, YesodTransloadit m) => WidgetT m IO (Maybe Text) Source
Helper method to pull the Transloadit response and the CSRF token (named _token
) from the request.
tokenText :: (YesodJquery m, YesodTransloadit m) => WidgetT m IO Text Source
extractFirstResult :: AsValue s => Text -> Maybe s -> Maybe Value Source
Helper method to pull the first ssl_url
from the Transloadit response.