yesod-transloadit-0.2.1.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.

extractFirstResult :: AsValue s => Text -> Maybe s -> Maybe Value Source

Helper method to pull the first ssl_url from the Transloadit response.

extractNthResult :: AsValue s => Int -> Text -> Maybe s -> Maybe Value Source

Helper method to pull the nth ssl_url from the Transloadit response.

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