yesod-transloadit-0.4.0.0: Transloadit support for Yesod

Safe HaskellNone
LanguageHaskell2010

Yesod.Transloadit

Synopsis

Documentation

class YesodTransloadit master where Source

Typeclass for your website to enable using Transloadit.

Minimal complete definition

Nothing

Methods

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.

mkParams Source

Arguments

:: 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

Helper method to grab the current CSRF token from the session. Returns mempty if Nothing could be found.

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

data StepResult Source

The result of the execution of a single step

Instances

data ParamsError Source

Constructors

UnknownError 

newtype Key Source

Constructors

Key 

Fields

key :: Text
 

Instances

newtype Template Source

Constructors

Template 

Fields

template :: Text
 

Instances

newtype Secret Source

Constructors

Secret 

Fields

secret :: ByteString
 

Instances