Changelog
=========
All notable changes to this project will be documented in this file.
This project mostly adheres to [Semantic Versioning](http://semver.org/).
Unreleased
----------
### Compatible changes
### Breaking changes
0.25.0
------
### Compatible changes
- New modal default [`up.modal.config.sticky`](/up.modal.config)
- New experimental function [`up.modal.flavor`](/up.modal.flavor) to register modal variants (like drawers).
- Fix a bug where [compilers](/up.compiler) and [macros](/up.macro) with higher priorities were executed last (instead of first like it says in the docs).
- Fix a bug that would occur if two compiled elements, that were nested within each other, would raise an error if the outer element was destroyed and both compilers have destructor functions.
- Fix a bug where replacing the `body` tag would raise an error if any element in the old `
` had a destructor function.
- The promise returned by [`up.replace`](/up.replace) now waits for transitions to complete before resolving
- Fix a bug where an error would be shown when opening a modal while another modal was still loading
- Fix a bug where two popups would be shown when opening a popup while another popup was still loading
- New options for [up.popup.config](/up.popup.config):
- `up.popup.config.openDuration`
- `up.popup.config.closeDuration`
- `up.popup.config.openEasing`
- `up.popup.config.closeEasing`
- Modals now longer addsa right padding to the `` if the document has no vertical scroll bars
- Animations now wait until the browser signals completion of the CSS transition. Previously
animations were canceled after its duration, which might or might not have matched to the actual
last animation frame.
### Breaking changes
- When opening a modal while another modal is open, the first modal will be closed (with animation) before the second modal opens (with animation)
- When opening a popup while another popup is open, the first popup will be closed (with animation) before the second popup opens (with animation)
- User-defined macros are now always run *before* built-in macros.
This way you can set [`[up-dash]`](/up-dash) and [`[up-expand]`](/up-expand) from your own macros.
0.24.1
------
### Compatible changes
- Fix a bug that would stop transitions from working.
0.24.0
------
### Compatible changes
- New function [`up.modal.extract`](/up.modal.extract) to open a modal from an
existing HTML string.
- [`up.ajax`](/up.ajax) now also accepts the URL as a first string argument.
- [Expanded](/up.expand) links to modals or popups now get a pointer cursor via CSS
- New options for [up.modal.config](/up.modal.config):
- `up.modal.config.openDuration`
- `up.modal.config.closeDuration`
- `up.modal.config.openEasing`
- `up.modal.config.closeEasing`
- `up.modal.config.backdropOpenAnimation`
- `up.modal.config.backdropCloseAnimation`
- Also see the breaking changes regarding modal structure below.
- Calling [`up.motion.finish`](/up.motion.finish) without arguments will now
complete all animations and transitions on the screen.
- Fix a bug where [`up.motion.finish`](/up.motion.finish) would not cancel CSS transitions that were still in progress.
- Fix a bug where [`up-active`](/up-active) classes where not removed from links when the destination
was already [preloaded](/up.preload).
### Breaking changes
- Animations when opening or closing a [modal](/up.modal) now only affect the viewport around the dialog.
The backdrop is animated separately. This allows animations like "zoom in", which would look strange if
the backdrop would zoom in together with the dialog.
- The modal's HTML structure has been changed to include a `.up-modal-backdrop` element:
```
```
- The `z-index` properties for modal elements have been [changed](https://github.com/unpoly/unpoly/blob/master/lib/assets/stylesheets/unpoly/modal.css.sass).
They might change again in the future.
- The modal will now take over the document's scrollbars after the open animation has finished.
In earlier versions the modal took over as soon as the animation had started.
- Calling [`up.motion.finish`](/up.motion.finish) with an element will now also
complete animations/transitions on children of the given element.
0.23.1
------
### Compatible changes
- [Animations](/up.motion) `move-to-*` and `move-from-*` now use CSS transforms instead of manipulating the
bounding box margins.
- Fix [`up.util.trim`](/up.util.trim) not working properly.
- [`up.morph`](/up.morph) no longer throws an error if called without an `options` object
- Custom transitions can now call [`up.morph`](/up.morph) to refer to other transitions
- Fix a bug where following a link to a [preloaded](/up-preload) destination would keep the
link marked with a [up-active](/up-active) class forever.
0.23.0
------
### Compatible changes
- Unpoly forms can now [submit](/up.submit) file uploads via AJAX.
- You can now position [tooltips](/up-tooltip) on the left or right side of an element.
### Breaking changes
- Tooltips have a darker background color.
- The tooltip CSS has been changed to be easier to override.
0.22.1
------
### Compatible changes
- Fix a bug where the document title wasn't restored when using the back
and forward buttons
- Fix a bug where links would be followed multiple times if the link
had an [`up-dash`](/up-dash) attribute without a value and also an `up-target` attribute.
- Fix a bug where a link would be followed multiple times if the link's
click area was expanded using [`[up-expand]`](/up-expand) and if the
link also had an [`up-dash`](/up-dash) attribute.
- [`up.destroy`](/up.destroy) now returns a resolved deferred if the given selector or jQuery collection does not exist
0.22.0
------
### Compatible changes
- Fix a bug where using the `up-confirm` attribute would result in an infinite loop
- Unpoly no longer displays confirmation dialogs when [preloading](/up-preload) a link that
has both [`up-preload`](/up-preload) and `up-confirm` attributes.
### Breaking changes
- `up.proxy.idle()` is now [`up.proxy.isIdle()`](/up.proxy.isIdle)
- `up.proxy.busy()` is now [`up.proxy.isBusy()`](/up.proxy.isBusy)
- Event `up:proxy:busy` is now [`up:proxy:slow`](/up:proxy:slow)
- Event `up:proxy:idle` is now [`up:proxy:idle`](/up:proxy:recover)
0.21.0
------
### Compatible changes
- New function `up.macro`. This registers a [compiler](/up.compiler) that is run before all other compilers.
- [`up.compiler`](/up.compiler) has a new options `{ priority }`. Compilers with higher priorities are run first.
- Fix a bug where trying to apply another transition on an element could throw a *Maximum call stack exceeded*
error if the element was already transitioning.
### Breaking changes
- `up-toggle` has been renamed to `up-switch`
0.20.0
------
- The project has been renamed to *Unpoly*.
- All functions remain in the `up` namespace, so e.g. `up.replace` is still called `up.replace`.
- All UJS functionality remains unchanged, so e.g. `up-target` is still called `up-target`.
- The Bower package has been renamed to `unpoly`.
- The Ruby gem for the Rails bindings has been renamed to `unpoly-rails`.
- The new Javascript and stylesheet assets are:
- [`unpoly.js`](https://raw.githubusercontent.com/unpoly/unpoly/master/dist/unpoly.js)
- [`unpoly.min.js`](https://raw.githubusercontent.com/unpoly/unpoly/master/dist/unpoly.min.js)
- [`unpoly.css`](https://raw.githubusercontent.com/unpoly/unpoly/master/dist/unpoly.css)
- [`unpoly.min.css`](https://raw.githubusercontent.com/unpoly/unpoly/master/dist/unpoly.min.css)
- If you're using the Bootstrap integration the new assets are:
- [`unpoly-bootstrap3.js`](https://raw.githubusercontent.com/unpoly/unpoly/master/dist/unpoly-bootstrap3.js)
- [`unpoly-bootstrap3.min.js`](https://raw.githubusercontent.com/unpoly/unpoly/master/dist/unpoly-bootstrap3.min.js)
- [`unpoly-bootstrap3.css`](https://raw.githubusercontent.com/unpoly/unpoly/master/dist/unpoly-bootstrap3.css)
- [`unpoly-bootstrap3.min.css`](https://raw.githubusercontent.com/unpoly/unpoly/master/dist/unpoly-bootstrap3.min.css)
0.19.0
------
### Compatible changes
- Elements can now be persisted during page updates using the [`up-keep`](/up-keep) attribute.
- `up.proxy.ajax` is now available as [`up.ajax`](/up.ajax).
- `up.ajax` can now handle nested objects as `{ data }` option (used to pass form parameters).
### Breaking changes
- `up.implant` has been renamed to [`up.extract`](/up.extract).
0.18.1
------
### Compatible changes
- The logging output to the developer console is now much quieter and more useful
0.18.0
------
### Compatible changes
- New UJS attribute [`[up-toggle]`](/up-toggle) to show or hide part of a form if certain options are selected or boxes are checked.
- Links can now have an optional `up-confirm` attribute. This opens a confirmation dialog with the given message
before the link is followed or the modal/popup is opened.
- New function [`up.off`](/up.off). This unregisters an event listener previously bound with [`up.on`](/up.on).
- If a container contains more than one link, you can now set the value of the [`up-expand`](/up-expand)
attribute to a CSS selector to define which link should be expanded.
- You can now configure a list of idempotent HTTP methods in [`up.proxy.config.safeMethods`](/up.proxy.config).
The proxy cache will only cache idempotent requests and will clear the entire
cache after a non-idempotent request.
- Loading modals and popups will now open if there is a fragment update between the modal/popup's
request and response.
- [`up.follow`](/up.follow) and [`up.replace`](/up.replace) now have an option `{ failTarget }`.
Use it to define the selector to replace if the server responds with a non-200 status code.
- [`[up-target]`](/up-target) and [`up-follow`](/up.replace) now have a modifying attribute `up-fail-target`.
Use it to define the selector to replace if the server responds with a non-200 status code.
- New utility method [`up.util.reject`](/up.util.reject)
- New utility method [`up.util.only`](/up.util.only)
- New utility method [`up.util.except`](/up.util.except)
- Fix a bug where modals could no longer be opened on some browsers
### Breaking changes
- By default Unpoly now converts `PUT`, `PATCH` and `DELETE` requests to `POST` requests
that carry their original method in a form parameter named `_method`.
This is to [prevent unexpected redirect behavior](https://makandracards.com/makandra/38347).
Web frameworks like Ruby on Rails or Sinatra are aware of the `_method` parameter and use
its value as the method for routing.
You can configure this behavior in [`up.proxy.config.wrapMethods`](/up.proxy.config)
and [`up.proxy.config.wrapMethodParam`](/up.proxy.config).
- The requested selector is now sent to the server as a request header `X-Up-Target`
(this used to be `X-Up-Selector`). If you are using `unpoly-rails`, you can access it
through `up.target` (this used to be `up.selector`).
0.17.0
------
### Compatible changes
- When used with the [Ruby on Rails unobtrusive scripting adapter](https://github.com/rails/jquery-ujs) (`rails_ujs.js`),
now prevents duplicate form submission when Unpoly attributes are mixed with `data-method` attributes.
- [`[up-instant]`](/up-instant) now works with modals and popups
- [`[up-expand]`](/up-expand) now works with modals and popups
### Breaking changes
- When [`up.observe`](/up.observe) is used with a delay of zero, the callback is invoked instantly (instead of
being invoked in the next animation frame).
0.16.0
------
### Compatible changes
- You can now configure [`up.proxy.config.maxRequests`](/up.proxy.config) to limit
the maximum number of concurrent requests. Additional
requests are queued. This currently ignores preloading requests.
You might find it useful to set this to `1` in full-stack integration
tests (e.g. Selenium).
- Allow to disable animations globally with `up.motion.enabled = false`.
This can be useful in full-stack integration tests like a Selenium test suite.
- New function [`up.motion.isEnabled`](/up.motion.isEnabled) to check if animations will be performed.
- [`up.popup.attach`](/up.popup.attach) now throws a helpful error when trying to attach a popup to a non-existing element
- New option [`up.modal.config.history`](/up.modal.config) to configure if modals change the browser URL (defaults to `true`)
- New option [`up.popup.config.history`](/up.popup.config) to configure if popup change the browser URL (defaults to `false`).
- Fix CSS for popups with a position of `"bottom-left"`.
### Breaking changes
- Popups and modals used to close automatically whenever an element behind the overlay was replaced.
This behavior is still in effect, but only if the replacement was triggered by a link or element from
within the popup or modal.
- Popups and modals no longer raise an error if their (hidden) overlay was closed before the
response was received.
- Popups and modals are now compiled before they are animated.
0.15.1
------
### Compatible changes
- Fix an error where `up.form.config` was not published. This caused `unpoly-bootstrap3.js` to throw an error.
0.15.0
------
### Compatible changes
- New function [`up.autosubmit`](/up.autosubmit) and selector [`[up-autosubmit]`](/up-autosubmit) to
observe a form or field and submit the form when a value changes.
- [`up.observe`](/up.observe) and [`[up-observe]`](/up-observe) can now be applied
to `