ariatemplates/ariatemplates — pull request #913 by jakub-g (2014-01-03 17:19:50+00:00)
Title: feat #102 timeout for `sendJsonRequest`/`submitJsonRequest`

It's been always possible to pass a `timeout` to the calls of
`aria.core.IO.asyncRequest`
`aria.core.IO.asyncFormSubmit`
but not to the calls of
`aria.modules.RequestMgr.submitJsonRequest`
`aria.modules.RequestMgr.sendJsonRequest`

The latter only had the `aria.core.IO.defaultTimeout` applied.

This commit makes it possible to pass `timeout` as the key of the request
parameter object (first parameter) of them.

Also, an optional error handler was added, to be consistent with
`IO.asyncRequest`, and can be set with `cb.onerror` and `cb.onerrorScope`
(`cb` is the third parameter of those methods).
Until now, error could have only been handled in the `cb.fn` callback,
checking for `resp.error` inside the callback.

Close #102. Close #913.