redirect_on_back 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZGE2OWE2OWUzMzA1NjNiODYwODJjM2E1ZjYyMDUxODg2OTc1YmVlMw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MmU0ZDQ1ZWQ4M2RiMGJlMmMwOTFmMDBiODVmODFkOWZiNDExN2U1NA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OGFhMDEyNjQ0MzYzNjk1Y2VhMjZhZTYwMDcyN2M3MGZkYmI5NmUzMmUzNTZl
|
10
|
+
OTc4ZTNkNjMyZmQwZGM4NDc2ZDZkMzRlOGZlNDUzZGVlZWMyZmFjYmJkMDJj
|
11
|
+
ZTc1YjFjM2E0MTVjZWEzNzQ1YTE3ZDFlYjRkYjJkNjg3MjgwNzg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OWNlNDVjMGNkYzZkN2NkYmJiNjg1ZDI3YjdhZjhkMGYyMjhlZWIyMTJhNmI0
|
14
|
+
NjM3ZTAxYTBjZDY2MWFiNmE0ZTQwODE5N2E0MzViM2E4ODRiZWIxYzcyZTY4
|
15
|
+
ZGQ3OWM0MjEwZWFiNTJhNzhmMjE3NzNkMjgzMjk4ZDBkZTZkZTc=
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
(function () {
|
2
2
|
|
3
3
|
function getCookie(c_name) {
|
4
4
|
var c_value = document.cookie;
|
@@ -20,7 +20,7 @@ $(function () {
|
|
20
20
|
return c_value;
|
21
21
|
}
|
22
22
|
|
23
|
-
|
23
|
+
var redirectIfNeeded = $('input[name=_usec]').each(function () {
|
24
24
|
var redirect_path, token;
|
25
25
|
if (token = $(this).val()) {
|
26
26
|
redirect_path = getCookie("redirect_" + token);
|
@@ -30,4 +30,7 @@ $(function () {
|
|
30
30
|
}
|
31
31
|
}
|
32
32
|
});
|
33
|
-
|
33
|
+
|
34
|
+
$(redirectIfNeeded);
|
35
|
+
$(window).on('page:load', redirectIfNeeded); // turbolinks support
|
36
|
+
})();
|
@@ -8,7 +8,10 @@ module RedirectOnBack
|
|
8
8
|
|
9
9
|
def extra_tags_for_form(html_options)
|
10
10
|
orig_tags = orig_extra_tags_for_form(html_options)
|
11
|
-
|
11
|
+
unless html_options.delete(:disable_redirect_on_back)
|
12
|
+
orig_tags << "<input name='_usec' type='hidden' value='#{Time.now.usec}' />".html_safe
|
13
|
+
end
|
14
|
+
orig_tags
|
12
15
|
end
|
13
16
|
end
|
14
17
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redirect_on_back
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yossi-shasho
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|