ic-trigger-on
now supports multiple event names, separated by commas
ic-sse-with-credentials
attribute enables SSE requests to be made with credentials
ic-push-params
attribute allows you to include parameter values in the pushed
URL
ic-enhance
attribute, which enhances standard anchor and form tags with the intercooler
equivalent attributes, allowing for graceful degradation in non-javascript environments.
ic-global-indicator
attribute, which sets a global indicator to be shown when a request
is in flight, even along side any local indicators specified by the triggering element.
ic-switch-class
attribute, which switches a class between siblings when an intercooler request
is caused within one. This can be uses, for example, to update the "active" state of tabs without replacing
the tab UI.
LeadDyno.startPolling()
and LeadDyno.stopPolling()
were added to the Javascript API
X-IC-Title-Encoded
response header to handle URI encoded titles for international users
once
modifier to the ic-trigger-on
attribute, to allow an event to trigger one and only one request.
ic-transform-response
attribute to
allow transforming JSON responses from a server into HTML on the client side.
ic-on-beforeTrigger
from
working properly
ic-disable-when-doc-hidden
and
ic-disable-when-doc-inactive
attributes to allow short-circuiting polling when a document isn't focused or active
ic-fix-ids
attribute to replace the IDs of any added elements
with globally unique IDs so that they don't conflict with any existing IDs on the page.
timeout:
syntax for ic-trigger-on
attribute
action
attributes:
ic-action-beforeSend
ic-action-success
ic-action-error
ic-action-complete
ic-action-target
attribute, allowing for a distinct target for the ic-action
attribute.
ic-sse-src
attribute, allowing intercooler to utilize Server Sent Events .
ic-swap-style
attribute, making append/prepend explicit attribute-driven behaviors.
ic-poll
attribute now does not ignore dependencies.
ic-trigger-from
attribute, to allow specifying the element to listen to for the
event that triggers an intercooler request.
X-IC-Title
response header
localStorage
using
the ic-local-vars
attribute and X-IC-Set-Local-Vars
response
header.
autofocus
attribute in intercooler AJAX responses.
ic-last-request
parameter to avoid cache busting. Server-side cookies should be used
for more consistent refresh timing information.
ic-prompt
attribute now
stops intercooler from issuing an ajax request.
data-*
prefix on attributes via the
<meta name="intercoolerjs:use-data-prefix" content="true"/>
meta-tag.
beforeAjaxSend.ic
, which allows programmers to modify the setting hash passed
to $.ajax()
to do thinks like add headers, set content type, remove parameters, etc.
Intercooler
object.
ic-action
attribute, allowing
for pure declarative client-side operations in intercooler.
ic-select-from-response
now takes the inner HTML content of the given element, rather than
the entire element. This makes the API more natural to work with, but unfortuantely breaks backwards compatibility.
ic-indicator
class will now work on next sibling of element firing request
ic-patch-to
attribute was added to suppor the PATCH
action
Intercooler.defaultTransition()
and
Intercooler.defineTransition()
have been deprecated and now have no effect.
Intercooler.addURLHandler()
and Intercooler.setRemote()
have been deprecated
and now have no effect.
ic-add-class
and ic-remove-class
were added to make it easy to create CSS transition
based easements in your Intercooler application.
ic-global-include
allows you to include data with requests made by every element on a page.
ic-beforeTrigger
allows you execute logic before Intercooler fires a request (and potentially
cancel the trigger).
ic-pause-polling
allows you issue an element with an ic-poll
attribute in it that
is in a paused state.
X-IC-ResumePolling
response header allows you to restart polling for an element.
ic-post-errors-to
allows you specify a URL for intercooler to post client side errors to.
ic-prompt
allows you to prompt the user for input before a request, asking for input.
ic-remove-after
allows you to remove an element after a given time period.
ic-scroll-to-target
and ic-scroll-offset
allow you to scroll to the top of a target
if it is not visible in the viewport.
ic-transition-duration
allows you to tell intercooler to wait some amount of time for a CSS
transition to complete before a swap is done.
ic-target-id
, ic-trigger-id
and ic-trigger-name
parameters were all
added to intercooler requests, to make it easier to dynamically determine which partial to render in response
to a given url
X-IC-Trigger-Data
has been deprecated. The X-IC-Trigger
attribute can now be
either a plain string for the event name, or a JSON object that satisfies the jQuery
parseJSon()
requirements, where each property
is an event name to trigger, and the value of each property is an array of arguments to pass to that
event.
ic-select-from-response
attribute, allowing people to select sub-elements from a
server response to swap in.
ic-include
attribute to allow for JSON name/value pairs to be included in a
request.
ic-always-update
to true, so you have to opt out of content swapping now.
ic-remove-after
attribute, allowing people to remove an element after a given
interval of time cleanly.
ic-push-url
attribute. Renamed the X-IC-SetLocation
response header to X-IC-PushURL
to be consistent with the new attribute.
ic-current-url
parameter.
ic-trigger-delay
attribute to delay firing a request.
ic-replace-target
attribute, allowing full replacement of target elements
for situations like replacing a table row.
ic-target
attribute
via the closest
prefix.
ic-on-beforeSend
, ic-on-success
, ic-on-error
and
ic-on-complete
attributes.
script
element, so things are properly reevaluated.
Intercooler.processElements()
in the Javascript APIX-HTTP-Method-Override
header up in intercooler requestsX-IC-Request
header up in intercooler requestsX-IC-Trigger
response header to trigger client
side event
handlers.
ic-confirm
attribute.
The big enhancement in this release (small code change, but big functionality boost!) is the X-IC-Trigger
response header, which finally solves a tricky problem I've been wrestling with: How do you communicate server side state
changes that have client-side UI ramifications that fall outside the usual Intercooler request-and-replace
partial view flow?
This new mechanism allows you to cleanly separate your server side and client-side logic even in cases where the simple content-swapping approach isn't enough.
A great example is if you want to hide a modal if and only if a form in the modal submits valid data to the
server. You can now easily fire an server.accountCreated
event (as an example) from the server side
and respond to that on the client side by hiding the modal. Clean, crisp and very little code!
You can download the latest intercooler.js
from the Downloads page.
Enjoy!