unpoly-rails 0.37.0 → 0.50.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of unpoly-rails might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +127 -25
- data/LICENSE +1 -1
- data/README_RAILS.md +4 -2
- data/Rakefile +6 -1
- data/dist/unpoly.js +3192 -2198
- data/dist/unpoly.min.js +4 -3
- data/lib/assets/javascripts/unpoly/browser.coffee +51 -63
- data/lib/assets/javascripts/unpoly/bus.coffee +58 -33
- data/lib/assets/javascripts/unpoly/classes/cache.coffee +117 -0
- data/lib/assets/javascripts/unpoly/{dom → classes}/extract_cascade.coffee +3 -3
- data/lib/assets/javascripts/unpoly/{dom → classes}/extract_plan.coffee +1 -1
- data/lib/assets/javascripts/unpoly/classes/field_observer.coffee +57 -0
- data/lib/assets/javascripts/unpoly/classes/follow_variant.coffee +52 -0
- data/lib/assets/javascripts/unpoly/classes/motion_tracker.coffee +95 -0
- data/lib/assets/javascripts/unpoly/classes/record.coffee +16 -0
- data/lib/assets/javascripts/unpoly/classes/request.coffee +228 -0
- data/lib/assets/javascripts/unpoly/classes/response.coffee +138 -0
- data/lib/assets/javascripts/unpoly/dom.coffee +151 -142
- data/lib/assets/javascripts/unpoly/feedback.coffee +67 -38
- data/lib/assets/javascripts/unpoly/form.coffee +156 -139
- data/lib/assets/javascripts/unpoly/history.coffee +22 -19
- data/lib/assets/javascripts/unpoly/layout.coffee +108 -90
- data/lib/assets/javascripts/unpoly/link.coffee +159 -158
- data/lib/assets/javascripts/unpoly/log.coffee +5 -5
- data/lib/assets/javascripts/unpoly/modal.coffee +93 -81
- data/lib/assets/javascripts/unpoly/motion.coffee +291 -250
- data/lib/assets/javascripts/unpoly/popup.coffee +67 -53
- data/lib/assets/javascripts/unpoly/protocol.coffee +67 -16
- data/lib/assets/javascripts/unpoly/proxy.coffee +282 -211
- data/lib/assets/javascripts/unpoly/rails.coffee +3 -14
- data/lib/assets/javascripts/unpoly/syntax.coffee +54 -49
- data/lib/assets/javascripts/unpoly/tooltip.coffee +18 -25
- data/lib/assets/javascripts/unpoly/util.coffee +236 -477
- data/lib/assets/javascripts/unpoly.coffee +1 -1
- data/lib/unpoly/rails/inspector.rb +67 -22
- data/lib/unpoly/rails/version.rb +1 -1
- data/package.json +1 -1
- data/spec_app/Gemfile.lock +13 -13
- data/spec_app/app/assets/javascripts/integration_test.coffee +1 -0
- data/spec_app/app/assets/javascripts/jasmine_specs.coffee +1 -1
- data/spec_app/app/assets/stylesheets/jasmine_specs.sass +10 -0
- data/spec_app/app/controllers/binding_test_controller.rb +19 -2
- data/spec_app/app/controllers/method_test_controller.rb +16 -0
- data/spec_app/app/views/layouts/jasmine_rails/spec_runner.html.erb +20 -0
- data/spec_app/app/views/method_test/form_target.erb +17 -0
- data/spec_app/app/views/method_test/page1.erb +11 -0
- data/spec_app/app/views/method_test/page2.erb +6 -0
- data/spec_app/app/views/pages/start.erb +33 -19
- data/spec_app/config/initializers/assets.rb +5 -0
- data/spec_app/config/routes.rb +3 -0
- data/spec_app/spec/controllers/binding_test_controller_spec.rb +82 -27
- data/spec_app/spec/javascripts/helpers/agent_detector.coffee +17 -0
- data/spec_app/spec/javascripts/helpers/async_sequence.js.coffee +102 -0
- data/spec_app/spec/javascripts/helpers/last_request.js.coffee +1 -1
- data/spec_app/spec/javascripts/helpers/mock_ajax.js.coffee +5 -2
- data/spec_app/spec/javascripts/helpers/promise_state.js +18 -0
- data/spec_app/spec/javascripts/helpers/protect_jasmine_runner.coffee +9 -0
- data/spec_app/spec/javascripts/helpers/reset_history.js.coffee +22 -0
- data/spec_app/spec/javascripts/helpers/reset_up.js.coffee +11 -3
- data/spec_app/spec/javascripts/helpers/show_lib_versions.coffee +10 -0
- data/spec_app/spec/javascripts/helpers/to_be_error.coffee +5 -0
- data/spec_app/spec/javascripts/helpers/to_match_url.coffee +13 -0
- data/spec_app/spec/javascripts/helpers/trigger.js.coffee +13 -6
- data/spec_app/spec/javascripts/up/browser_spec.js.coffee +92 -33
- data/spec_app/spec/javascripts/up/bus_spec.js.coffee +64 -15
- data/spec_app/spec/javascripts/up/classes/.keep +0 -0
- data/spec_app/spec/javascripts/up/classes/cache_spec.js.coffee +1 -0
- data/spec_app/spec/javascripts/up/dom_spec.js.coffee +759 -551
- data/spec_app/spec/javascripts/up/feedback_spec.js.coffee +155 -82
- data/spec_app/spec/javascripts/up/form_spec.js.coffee +490 -349
- data/spec_app/spec/javascripts/up/history_spec.js.coffee +226 -179
- data/spec_app/spec/javascripts/up/layout_spec.js.coffee +253 -185
- data/spec_app/spec/javascripts/up/link_spec.js.coffee +416 -270
- data/spec_app/spec/javascripts/up/modal_spec.js.coffee +459 -330
- data/spec_app/spec/javascripts/up/motion_spec.js.coffee +198 -153
- data/spec_app/spec/javascripts/up/namespace_spec.js.coffee +9 -0
- data/spec_app/spec/javascripts/up/popup_spec.js.coffee +240 -175
- data/spec_app/spec/javascripts/up/protocol_spec.js.coffee +38 -0
- data/spec_app/spec/javascripts/up/proxy_spec.js.coffee +777 -303
- data/spec_app/spec/javascripts/up/rails_spec.js.coffee +24 -8
- data/spec_app/spec/javascripts/up/syntax_spec.js.coffee +40 -23
- data/spec_app/spec/javascripts/up/tooltip_spec.js.coffee +80 -66
- data/spec_app/spec/javascripts/up/util_spec.js.coffee +227 -201
- data/spec_app/vendor/asset-libs/es6-promise-4.1.6/es6-promise.auto.js +1159 -0
- metadata +30 -7
- data/spec_app/spec/javascripts/helpers/reset_path.js.coffee +0 -7
- data/spec_app/spec/javascripts/helpers/to_equal_url.coffee +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ccf4b7d6145f93121c5acc9652dfef805bf053f7
|
4
|
+
data.tar.gz: 3fc6c14aea9fd2544948fea9603efd80aa391c23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14b9d6ebf35fc320a90a168f3975c158983eb0ffa8044b28e94f2d230da0197c071854dffb1de59002e570d27115fa7262e0b993621ade657b7042344fb17b28
|
7
|
+
data.tar.gz: b68eff54dc035c0fce2ca479b43ce5c5b89db06de7e9b52e83a16a9eb95399698e09ea77a0d6c1980a3499eab67f71580e97997379a51d79e50c3837b6e6e0c2
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,106 @@ Changes to this project will be documented in this file.
|
|
6
6
|
This project mostly adheres to [Semantic Versioning](http://semver.org/).
|
7
7
|
|
8
8
|
|
9
|
+
0.50.0
|
10
|
+
------
|
11
|
+
|
12
|
+
This is a major update with some breaking changes. Expect a few more updates like this as we move closer to our 1.0 release in 2018.
|
13
|
+
|
14
|
+
### General
|
15
|
+
|
16
|
+
- jQuery 3 is now supported in addition to jQuery 1.9+ and jQuery 2.
|
17
|
+
- Unpoly now uses [native Promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises) instead of jQuery deferreds.
|
18
|
+
- You can now help improve Unpoly's documentation by clicking an *Edit this page* link on any [unpoly.com](https://unpoly.com/) subpage (like [`a[up-target]`](/a-up-target)).
|
19
|
+
|
20
|
+
### Browser support
|
21
|
+
|
22
|
+
- To enable support for Internet Explorer 11 you need to install a Polyfill for `Promise`. We recommend [ES6-promise](https://github.com/stefanpenner/es6-promise) (2.4 KB gzipped).
|
23
|
+
- Fix a bug where Unpoly would not boot on Safari 9 and 10 if the initial page was loaded with a `POST` method.
|
24
|
+
|
25
|
+
### AJAX
|
26
|
+
|
27
|
+
- Unpoly now uses [native XMLHttpRequest](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) instead of `jQuery.ajax()`. If you have been hacking into Unpoly's networking through `jQuery.ajaxPrefilter()`, you must now use the [`up:proxy:load`](/up:proxy:load) event.
|
28
|
+
- [`up.ajax()`](/up.ajax) has been deprecated since its signature is incompatible with native promises. Please use [`up.request()`](/up.request) instead, whose promise fulfills with an [`up.Response`](/up.Response) object.
|
29
|
+
- The `up:proxy:received` event has been renamed to [`up:proxy:loaded`](/up:proxy:loaded).
|
30
|
+
- The [`up:proxy:load`](/up:proxy:load) event properties have changed. You can now access request properties through a key `{ request }`, e.g. `event.request.url`.
|
31
|
+
- The [`up:proxy:load`](/up:proxy:load) event can now be prevented to prevent a request from being sent to the network.
|
32
|
+
- The [`up:proxy:load`](/up:proxy:load) event now allows listeners to change request headers by manipulating the `event.request.headers` object.
|
33
|
+
- A new event [`up:proxy:fatal`](/up:proxy:fatal) will be [emitted](/up.emit) when an [AJAX request](/up.request) encounters fatal error like a timeout or loss of network connectivity.
|
34
|
+
|
35
|
+
### Links
|
36
|
+
|
37
|
+
- Links with unsafe HTTP methods like `POST` are no longer marked as [`.up-current`](/a.up-current), even if their `[href]` matches the current URL.
|
38
|
+
- New experimental function [`up.link.isSafe()`](/up.link.isSafe). It returns whether the given link has a [safe](https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.1.1) HTTP method like `GET`.
|
39
|
+
|
40
|
+
### Fragment updates
|
41
|
+
|
42
|
+
- When a selector was not found in the response, the error notification now offers a link to show the unexpected response.
|
43
|
+
- The event [`up:fragment:destroy`](/up:fragment:destroy) can no longer be prevented.
|
44
|
+
|
45
|
+
### History
|
46
|
+
|
47
|
+
- Clicking a link with an [`[up-restore-scroll]`](/a-up-target#up-restore-scroll) attribute will no longer crash if no previous scroll position for given URL is known ([#25](https://github.com/unpoly/unpoly/issues/25))
|
48
|
+
- Fix a bug where going back in history would sometimes not call destructors ([#24](https://github.com/unpoly/unpoly/issues/24))
|
49
|
+
|
50
|
+
### Forms
|
51
|
+
|
52
|
+
- [`up.observe()`](/up.observe) no longer sends multiple callbacks when a previous callback was slow to respond.
|
53
|
+
|
54
|
+
### Tooltips
|
55
|
+
|
56
|
+
- Fix a bug where tooltips would sometimes stay open when many tooltips are opened and closed concurrently.
|
57
|
+
|
58
|
+
### Server protocol
|
59
|
+
|
60
|
+
- When the server [signals a redirect with a `X-Up-Location` header](/up.protocol#redirect-detection), sending a `X-Up-Method` header is now optional. If it is missing, `GET` is assumed.
|
61
|
+
- Unpoly will often update a different selector in case the request fails. This second selector is now sent to the server as a `X-Up-Fail-Target` header.
|
62
|
+
- You can now [configure how CSRF tokens are sent your server-side framework](/up.protocol.config).
|
63
|
+
- CSRF tokens are no longer sent for cross-domain requests.
|
64
|
+
|
65
|
+
### Animation
|
66
|
+
|
67
|
+
- `up.motion.none()` has been removed without replacement. Just pass `false` or the string `'none'` to indicate a animation or transition which has no visual effects and completes instantly.
|
68
|
+
- [`up.motion.finish()`](/up.motion.finish) is now async. It returns a promise that fulfills when all animations are finished.
|
69
|
+
- [`up.motion.finish()`](/up.motion.finish) now also finishes animations in ancestors of the given element.
|
70
|
+
|
71
|
+
### Modals
|
72
|
+
|
73
|
+
- [`up.follow()`](/up.follow) will now open a modal if the given link has an [`[up-modal]`](/a-up-modal) attribute
|
74
|
+
- [`a[up-modal]`](/a-up-modal) links can now have an `[up-fail-target]` attribute to indicate which selector to replace for an non-200 response
|
75
|
+
- Fix a bug where preloading an up-modal link would create an invisible .up-modal container in the DOM.
|
76
|
+
|
77
|
+
### Popups
|
78
|
+
|
79
|
+
- [`up.follow()`](/up.follow) will now open a popup if the given link has [`[up-popup]`](/a-up-popup) attribute
|
80
|
+
- up-popup links can now have an up-fail-target attribute to indicate which selector to replace for an non-200 response
|
81
|
+
- Fix a bug where preloading an up-popup link would create an invisible .up-popup container in the DOM.
|
82
|
+
- [`up.popup.attach()`](/up.popup.attach) now throws an error if neither `{ url }` nor `{ html }` options are given.
|
83
|
+
|
84
|
+
### Events
|
85
|
+
|
86
|
+
- When async functions emit an event and that event is prevented, the async function now rejects with an [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error).
|
87
|
+
- When async functions are called wth `{ confirm: true }` and the user denies confirmation, the async function now rejects with an [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error).
|
88
|
+
|
89
|
+
### Utility functions
|
90
|
+
|
91
|
+
- [`up.util.setTimer()`](/up.util.setTimer) is now always async, even when called with a delay of `0` (zero). The function is now stable.
|
92
|
+
- `up.util.isHash()` has been removed without replacement. In your code you can replace `up.util.isHash(x)` with `up.util.isObject(x) && !up.util.isFunction(x)`.
|
93
|
+
- `up.util.resolvedDeferred()` has been removed without replacement. Use `Promise.resolve()` instead.
|
94
|
+
- `up.util.resolvedPromise()` has been removed without replacement. Use `Promise.resolve(`) instead.
|
95
|
+
- `up.util.rejectedPromise()` has been removed without replacement. Use `Promise.reject()` instead.
|
96
|
+
- `up.util.unresolvableDeferred()` has been removed without replacement. Use `new Promise(function() {})` instead.
|
97
|
+
- `up.motion.when()` has been removed without replacement. Use `Promise.all()` instead.
|
98
|
+
- [`up.util.isString()`](/up.util.isString) now also returns true for `String` instances (in addition to string literals)
|
99
|
+
- [`up.util.isNumber()`](/up.util.isNumber()) now also returns true for `Number` instances (in addition to number literals)
|
100
|
+
|
101
|
+
### Ruby on Rails bindings
|
102
|
+
|
103
|
+
- New method `up.fail_target` available in controllers, helpers and views. It returns the selector targeted for a failed response.
|
104
|
+
- New method `up.fail_target?(target)` available in controllers, helpers and views. It returns whether the given selector is targeted for a failed response.
|
105
|
+
- New method `up.any_target?(target)` available in controllers, helpers and views. It returns whether the given selector is targeted for a either a successful or failed response.
|
106
|
+
|
107
|
+
|
108
|
+
|
9
109
|
0.37.0
|
10
110
|
------
|
11
111
|
|
@@ -15,7 +115,7 @@ This project mostly adheres to [Semantic Versioning](http://semver.org/).
|
|
15
115
|
- Fix a bug where [`[up-layer]`](/up-layer) attributes or `{ layer }` options were ignored.
|
16
116
|
- [`a[up-target]`](/a-up-target) and [`form[up-target]`] get a new modifying attribute `[up-fail-layer]`.
|
17
117
|
Use it to set the layer to update if the server sends a non-200 status code. Valid values are `auto`, `page`, `modal` and `popup`.
|
18
|
-
- JavaScript functions like [`up.replace()`](/up.replace) or [`up.submit()`](/up.submit) now have a `{ failLayer }` option.
|
118
|
+
- JavaScript functions like [`up.replace()`](/up.replace) or [`up.submit()`](/up.submit) now have a `{ failLayer }` option.
|
19
119
|
|
20
120
|
|
21
121
|
0.36.2
|
@@ -23,7 +123,7 @@ This project mostly adheres to [Semantic Versioning](http://semver.org/).
|
|
23
123
|
|
24
124
|
### Compatible changes
|
25
125
|
|
26
|
-
- [Validating forms](https://unpoly.com/up-validate) will no longer change the scroll position.
|
126
|
+
- [Validating forms](https://unpoly.com/input-up-validate) will no longer change the scroll position.
|
27
127
|
|
28
128
|
|
29
129
|
0.36.1
|
@@ -33,7 +133,7 @@ This project mostly adheres to [Semantic Versioning](http://semver.org/).
|
|
33
133
|
|
34
134
|
- [npm package](/install/npm) now expresses Unpoly's dependency on `jquery`.
|
35
135
|
- [Modals](/up.modal) no longer close when clicking an element that exists outside the modal's DOM hierarchy.
|
36
|
-
- Fix a bug on IE11 where modals would immediately close after opening if the opening link had an [`[up-instant]`](/up-instant) attribute and the destination page was already cached.
|
136
|
+
- Fix a bug on IE11 where modals would immediately close after opening if the opening link had an [`[up-instant]`](/a-up-instant) attribute and the destination page was already cached.
|
37
137
|
|
38
138
|
|
39
139
|
0.36.0
|
@@ -43,7 +143,7 @@ This project mostly adheres to [Semantic Versioning](http://semver.org/).
|
|
43
143
|
|
44
144
|
- The [`[up-observe]`](/up-observe) attribute can now be set on a `<form>` to run a function if any
|
45
145
|
contained input field changes.
|
46
|
-
- Fix a bug where [`[up-autosubmit]`](/up-autosubmit) didn't honor an `[up-delay]` attribute if
|
146
|
+
- Fix a bug where [`[up-autosubmit]`](/form-up-autosubmit) didn't honor an `[up-delay]` attribute if
|
47
147
|
used on a form.
|
48
148
|
- When [submitting a form](/form-up-target), the `name` and `value` of the submit button is now included with the form parameters.
|
49
149
|
- [Going back in history](/up.history) after a [fragment update](/up.link) now always restores elements the page layer, never a selector in [modals](/up.modal) or [popups](/up.popup).
|
@@ -100,7 +200,7 @@ This project mostly adheres to [Semantic Versioning](http://semver.org/).
|
|
100
200
|
### Compatible changes
|
101
201
|
|
102
202
|
- Elements with [`up-show-for`](/up-show-for) and [`up-hide-for`](/up-hide-for) attributes
|
103
|
-
can now be inserted dynamically after its controlling [`up-switch`](/up-switch) field has been
|
203
|
+
can now be inserted dynamically after its controlling [`up-switch`](/input-up-switch) field has been
|
104
204
|
compiled.
|
105
205
|
- Unpoly no longer strips a trailing slash in the current URL during startup
|
106
206
|
|
@@ -180,7 +280,7 @@ This project mostly adheres to [Semantic Versioning](http://semver.org/).
|
|
180
280
|
- Fix a bug where [`up.reveal()`](/up.reveal) would not scroll to an element at the bottom edge of the visible area
|
181
281
|
if [`up.layout.config.snap`](/up.layout.config) is set.
|
182
282
|
- Several features have been promoted from experimental API to stable API:
|
183
|
-
- [`[up-drawer]`](/up-drawer)
|
283
|
+
- [`[up-drawer]`](/a-up-drawer)
|
184
284
|
- [`up.syntax.data()`](/up.syntax.data)
|
185
285
|
- [`up.extract()`](/up.extract)
|
186
286
|
- When [targeting](/up-target) an URL with a #hash, the viewport will now scroll to the first row of an element
|
@@ -210,7 +310,7 @@ This project mostly adheres to [Semantic Versioning](http://semver.org/).
|
|
210
310
|
|
211
311
|
### Compatible changes
|
212
312
|
|
213
|
-
- Drawers are now a built-in modal flavor! Use the [`[up-drawer]`](/up-drawer) attribute to open page fragements
|
313
|
+
- Drawers are now a built-in modal flavor! Use the [`[up-drawer]`](/a-up-drawer) attribute to open page fragements
|
214
314
|
in a modal drawer that slides in from the edge of the screen.
|
215
315
|
|
216
316
|
|
@@ -330,7 +430,7 @@ This project mostly adheres to [Semantic Versioning](http://semver.org/).
|
|
330
430
|
|
331
431
|
- Fix a bug where absolutely positioned elements would be offset incorrectly during transitions
|
332
432
|
- Fix a bug where inserted elements were not revealed within their viewport
|
333
|
-
- When [validating](/up-validate) a form with transitions, transitions are no longer applied
|
433
|
+
- When [validating](/input-up-validate) a form with transitions, transitions are no longer applied
|
334
434
|
|
335
435
|
|
336
436
|
### Breaking changes
|
@@ -367,7 +467,7 @@ This project mostly adheres to [Semantic Versioning](http://semver.org/).
|
|
367
467
|
|
368
468
|
- Tooltips now open and close much quicker.
|
369
469
|
- Popups now open and close much quicker.
|
370
|
-
- [`.up-current`](/up-current) now considers two URLs different if they have different query strings.
|
470
|
+
- [`.up-current`](/a.up-current) now considers two URLs different if they have different query strings.
|
371
471
|
|
372
472
|
|
373
473
|
|
@@ -378,7 +478,7 @@ This project mostly adheres to [Semantic Versioning](http://semver.org/).
|
|
378
478
|
|
379
479
|
- Popups anchored to fixed elements are now positioned correctly if the document is scrolled
|
380
480
|
- Tooltips can now be anchored to fixed elements
|
381
|
-
- [`up-modal`](/up-modal) and [`up-popup`](/up-popup) now support an `up-method` modifier.
|
481
|
+
- [`up-modal`](/a-up-modal) and [`up-popup`](/a-up-popup) now support an `up-method` modifier.
|
382
482
|
|
383
483
|
|
384
484
|
|
@@ -457,7 +557,7 @@ This project mostly adheres to [Semantic Versioning](http://semver.org/).
|
|
457
557
|
- When opening a modal while another modal is open, the first modal will be closed (with animation) before the second modal opens (with animation)
|
458
558
|
- When opening a popup while another popup is open, the first popup will be closed (with animation) before the second popup opens (with animation)
|
459
559
|
- User-defined macros are now always run *before* built-in macros.
|
460
|
-
This way you can set [`[up-dash]`](/up-dash) and [`[up-expand]`](/up-expand) from your own macros.
|
560
|
+
This way you can set [`a[up-dash]`](/a-up-dash) and [`[up-expand]`](/up-expand) from your own macros.
|
461
561
|
|
462
562
|
|
463
563
|
0.24.1
|
@@ -488,7 +588,7 @@ This project mostly adheres to [Semantic Versioning](http://semver.org/).
|
|
488
588
|
- Calling [`up.motion.finish()`](/up.motion.finish) without arguments will now
|
489
589
|
complete all animations and transitions on the screen.
|
490
590
|
- Fix a bug where [`up.motion.finish()`](/up.motion.finish) would not cancel CSS transitions that were still in progress.
|
491
|
-
- Fix a bug where [`up-active`](/up-active) classes where not removed from links when the destination
|
591
|
+
- Fix a bug where [`up-active`](/a.up-active) classes where not removed from links when the destination
|
492
592
|
was already [preloaded](/up.preload).
|
493
593
|
|
494
594
|
|
@@ -531,8 +631,8 @@ This project mostly adheres to [Semantic Versioning](http://semver.org/).
|
|
531
631
|
- Fix [`up.util.trim()`](/up.util.trim) not working properly.
|
532
632
|
- [`up.morph()`](/up.morph) no longer throws an error if called without an `options` object
|
533
633
|
- Custom transitions can now call [`up.morph()`](/up.morph) to refer to other transitions
|
534
|
-
- Fix a bug where following a link to a [preloaded](/up-preload) destination would keep the
|
535
|
-
link marked with a [up-active](/up-active) class forever.
|
634
|
+
- Fix a bug where following a link to a [preloaded](/a-up-preload) destination would keep the
|
635
|
+
link marked with a [up-active](/a.up-active) class forever.
|
536
636
|
|
537
637
|
|
538
638
|
0.23.0
|
@@ -558,10 +658,10 @@ This project mostly adheres to [Semantic Versioning](http://semver.org/).
|
|
558
658
|
- Fix a bug where the document title wasn't restored when using the back
|
559
659
|
and forward buttons
|
560
660
|
- Fix a bug where links would be followed multiple times if the link
|
561
|
-
had an [`up-dash`](/up-dash) attribute without a value and also an `up-target` attribute.
|
661
|
+
had an [`up-dash`](/a-up-dash) attribute without a value and also an `up-target` attribute.
|
562
662
|
- Fix a bug where a link would be followed multiple times if the link's
|
563
663
|
click area was expanded using [`[up-expand]`](/up-expand) and if the
|
564
|
-
link also had an [`up-dash`](/up-dash) attribute.
|
664
|
+
link also had an [`up-dash`](/a-up-dash) attribute.
|
565
665
|
- [`up.destroy()`](/up.destroy) now returns a resolved deferred if the given selector or jQuery collection does not exist
|
566
666
|
|
567
667
|
|
@@ -571,8 +671,8 @@ This project mostly adheres to [Semantic Versioning](http://semver.org/).
|
|
571
671
|
### Compatible changes
|
572
672
|
|
573
673
|
- Fix a bug where using the `up-confirm` attribute would result in an infinite loop
|
574
|
-
- Unpoly no longer displays confirmation dialogs when [preloading](/up-preload) a link that
|
575
|
-
has both [`up-preload`](/up-preload) and `up-confirm` attributes.
|
674
|
+
- Unpoly no longer displays confirmation dialogs when [preloading](/a-up-preload) a link that
|
675
|
+
has both [`up-preload`](/a-up-preload) and `up-confirm` attributes.
|
576
676
|
|
577
677
|
|
578
678
|
### Breaking changes
|
@@ -651,9 +751,9 @@ This project mostly adheres to [Semantic Versioning](http://semver.org/).
|
|
651
751
|
- New function [`up.off()`](/up.off). This unregisters an event listener previously bound with [`up.on()`](/up.on).
|
652
752
|
- If a container contains more than one link, you can now set the value of the [`up-expand`](/up-expand)
|
653
753
|
attribute to a CSS selector to define which link should be expanded.
|
654
|
-
- You can now configure a list of
|
655
|
-
The proxy cache will only cache
|
656
|
-
cache after a
|
754
|
+
- You can now configure a list of safe HTTP methods in [`up.proxy.config.safeMethods`](/up.proxy.config).
|
755
|
+
The proxy cache will only cache safe requests and will clear the entire
|
756
|
+
cache after a unsafe request.
|
657
757
|
- Loading modals and popups will now open if there is a fragment update between the modal/popup's
|
658
758
|
request and response.
|
659
759
|
- [`up.follow()`](/up.follow) and [`up.replace()`](/up.replace) now have an option `{ failTarget }`.
|
@@ -664,6 +764,8 @@ This project mostly adheres to [Semantic Versioning](http://semver.org/).
|
|
664
764
|
- New utility method [`up.util.only()`](/up.util.only)
|
665
765
|
- New utility method [`up.util.except()`](/up.util.except)
|
666
766
|
- Fix a bug where modals could no longer be opened on some browsers
|
767
|
+
- When preventing an event emitted by an async function, that function now rejects its promise.
|
768
|
+
- Async functions that encounter an error now prefer to reject promises with an [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object (instead of a string with the error message)
|
667
769
|
|
668
770
|
### Breaking changes
|
669
771
|
|
@@ -688,7 +790,7 @@ This project mostly adheres to [Semantic Versioning](http://semver.org/).
|
|
688
790
|
|
689
791
|
- When used with the [Ruby on Rails unobtrusive scripting adapter](https://github.com/rails/jquery-ujs) (`rails_ujs.js`),
|
690
792
|
now prevents duplicate form submission when Unpoly attributes are mixed with `data-method` attributes.
|
691
|
-
- [`[up-instant]`](/up-instant) now works with modals and popups
|
793
|
+
- [`a[up-instant]`](/a-up-instant) now works with modals and popups
|
692
794
|
- [`[up-expand]`](/up-expand) now works with modals and popups
|
693
795
|
|
694
796
|
### Breaking changes
|
@@ -739,7 +841,7 @@ This project mostly adheres to [Semantic Versioning](http://semver.org/).
|
|
739
841
|
|
740
842
|
### Compatible changes
|
741
843
|
|
742
|
-
- New function [`up.autosubmit()`](/up.autosubmit) and selector [`[up-autosubmit]`](/up-autosubmit) to
|
844
|
+
- New function [`up.autosubmit()`](/up.autosubmit) and selector [`[up-autosubmit]`](/form-up-autosubmit) to
|
743
845
|
observe a form or field and submit the form when a value changes.
|
744
846
|
- [`up.observe()`](/up.observe) and [`[up-observe]`](/up-observe) can now be applied
|
745
847
|
to `<form>` tags. The callback is run when any field in the form changes.
|
@@ -777,7 +879,7 @@ This project mostly adheres to [Semantic Versioning](http://semver.org/).
|
|
777
879
|
### Compatible changes
|
778
880
|
|
779
881
|
- Support for server-side live validation of forms
|
780
|
-
using the [`[up-validate]`](/up-validate) selector.
|
882
|
+
using the [`[up-validate]`](/input-up-validate) selector.
|
781
883
|
- Support for [non-standard CSS selectors from jQuery](https://api.jquery.com/category/selectors/),
|
782
884
|
such as [`:has`](http://api.jquery.com/has-selector/) or [`:visible`](http://api.jquery.com/visible-selector/).
|
783
885
|
- Allow to refer to the current element as `&` in target selectors. This is useful
|
@@ -991,7 +1093,7 @@ Refactored internals. No API changes.
|
|
991
1093
|
### Compatible changes
|
992
1094
|
|
993
1095
|
- Viewport scroll positions are saved when the URL changes and restored when the user hits the back/forward button
|
994
|
-
- Allow to link to the previous page using [`[up-back]`](/up-back)
|
1096
|
+
- Allow to link to the previous page using [`[up-back]`](/a-up-back)
|
995
1097
|
- Allow to restore previous scroll state using [`[up-restore-scroll]`](/a-up-target)
|
996
1098
|
- Instead of saying `<tag up-something="true">` you can now simply say `<tag up-something>`.
|
997
1099
|
- Create this Changelog.
|
data/LICENSE
CHANGED
data/README_RAILS.md
CHANGED
@@ -38,7 +38,7 @@ This is useful when you skip rendering the `<head>` in an Unpoly request.
|
|
38
38
|
|
39
39
|
### Detecting an Unpoly form validation
|
40
40
|
|
41
|
-
To test whether the current request is a [form validation](https://unpoly.com/up-validate):
|
41
|
+
To test whether the current request is a [form validation](https://unpoly.com/input-up-validate):
|
42
42
|
|
43
43
|
up.validate?
|
44
44
|
|
@@ -84,7 +84,9 @@ What you still need to do manually
|
|
84
84
|
|
85
85
|
Unpoly lets you submit forms via AJAX by using the [`form[up-target]`](https://unpoly.com/form-up-target) selector or [`up.submit()`](https://unpoly.com/up.submit) function.
|
86
86
|
|
87
|
-
For Unpoly to be able to detect a failed form submission,
|
87
|
+
For Unpoly to be able to detect a failed form submission,
|
88
|
+
the form must be re-rendered with a non-200 HTTP status code.
|
89
|
+
We recommend to use either 400 (bad request) or 422 (unprocessable entity).
|
88
90
|
|
89
91
|
To do so in Rails, pass a [`:status` option to `render`](http://guides.rubyonrails.org/layouts_and_rendering.html#the-status-option):
|
90
92
|
|
data/Rakefile
CHANGED
@@ -7,7 +7,12 @@ require 'json'
|
|
7
7
|
|
8
8
|
module Unpoly
|
9
9
|
module Tasks
|
10
|
-
SPROCKETS_MANIFESTS = %w(
|
10
|
+
SPROCKETS_MANIFESTS = %w(
|
11
|
+
unpoly.js
|
12
|
+
unpoly.css
|
13
|
+
unpoly-bootstrap3.js
|
14
|
+
unpoly-bootstrap3.css
|
15
|
+
)
|
11
16
|
SPROCKETS_SOURCES = %w(lib/assets/javascripts lib/assets/stylesheets)
|
12
17
|
SPROCKETS_OUTPUT_FOLDER = 'dist'
|
13
18
|
NPM_MANIFEST = 'package.json'
|