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
- nthStepResult :: AsValue s => Int -> Text -> Maybe s -> Maybe StepResult
- data StepResult
- resultId :: Lens' StepResult Text
- name :: Lens' StepResult Text
- baseName :: Lens' StepResult Text
- extension :: Lens' StepResult Text
- mime :: Lens' StepResult Text
- field :: Lens' StepResult Text
- url :: Lens' StepResult Text
- sslUrl :: Lens' StepResult Text
- 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
nthStepResult :: AsValue s => Int -> Text -> Maybe s -> Maybe StepResult Source
Helper method to pull the nth StepResult
for a given key from the Transloadit response
url :: Lens' StepResult Text Source