redirect_on_back 0.0.6 → 1.0.0

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,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZWMxNzdmZGQ0ZTFlZThkY2Y3YmQyZjk0YTk1Y2M3MmE3ODUwYzJmMw==
5
- data.tar.gz: !binary |-
6
- YjczZTlhNTdhMjc0NzVlNmUwYTFlZmZmY2U3YmRjZTk5Yjk1NzEzZA==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- ZWI3ZmRmODg0NWFkNmI5N2Y0ODE2OWQwZDA3ZjNmZjI3Nzg0NDcxYjljOWY1
10
- Y2U0OTBhNWM1YzY0ZTFiNGE5YjAzZDAyODQ1NGRjMWJmNDc1Y2ZmYjdmMWNh
11
- YzMyZGYyZWQwOWI1MjU1NGNhMGJmZWI1YWNkYjU0YzFjMDNlNTQ=
12
- data.tar.gz: !binary |-
13
- Y2RlOGJkZGQ3MjRiOWRiZGIzZGZhYjMwZmRhN2YyYmU1NjcxOGE3YzM3ODZh
14
- ZWFmZmM0Njc2N2E0OTY5MGEwOWNiNjM1Y2U5ZjNiODY4MTg1ODE5YmQ2ZDU3
15
- NTkxMDE5NWIwYTU3M2YzZjNmNTY4YzU4NWFiODkwYzQ4MWZjZmY=
2
+ SHA1:
3
+ metadata.gz: d9ac9c33c26183f6cca1258fc1d3c90949f1ce09
4
+ data.tar.gz: 2f6619b8036073aa8803862b49678bb8931af479
5
+ SHA512:
6
+ metadata.gz: c932511353093aa0a18d3f66493a57d4597374fa286bb1f3ea9676290a8cd61075448b97f967b25ac726ab9e92c7ffd0e55d00c16d379c10fb5d2c69167368b8
7
+ data.tar.gz: 7b9fbc236f12dfd6b2ddd80ac71d2fe815b98d7cda4b5f9d0feee38c8c987e1ddb8aad59a3298c3cb701848b7525b53eee8899ce71d5e4fd7ff5d5538d436dbf
@@ -20,17 +20,19 @@
20
20
  return c_value;
21
21
  }
22
22
 
23
- var redirectIfNeeded = $('input[name=_usec]').each(function () {
24
- var redirect_path, token;
25
- if (token = $(this).val()) {
26
- redirect_path = getCookie("redirect_" + token);
27
- if (redirect_path && redirect_path.length) {
28
- $('body').hide();
29
- return window.location.href = redirect_path;
23
+ var redirectIfNeeded = function() {
24
+ $('input[name=_usec]').each(function () {
25
+ var redirect_path, token;
26
+ if (token = $(this).val()) {
27
+ redirect_path = getCookie("redirect_" + token);
28
+ if (redirect_path && redirect_path.length) {
29
+ $('body').hide();
30
+ return window.location.href = redirect_path;
31
+ }
30
32
  }
31
- }
32
- });
33
+ });
34
+ };
33
35
 
34
36
  $(redirectIfNeeded);
35
- $(window).on('page:load', redirectIfNeeded); // turbolinks support
37
+ $(document).on('page:change', redirectIfNeeded); // turbolinks support
36
38
  })();
@@ -1,3 +1,3 @@
1
1
  module RedirectOnBack
2
- VERSION = "0.0.6"
2
+ VERSION = "1.0.0"
3
3
  end
@@ -8,7 +8,7 @@ Gem::Specification.new do |gem|
8
8
  gem.version = RedirectOnBack::VERSION
9
9
  gem.authors = ["yossi-shasho"]
10
10
  gem.email = ["jozard00@gmail.com"]
11
- gem.description = %q{Rails 3 and above: redirect after user has clicked the back button, e.g. to edit the newly created record instead of creating a new one.}
11
+ gem.description = %q{Prevent form re-submition when hitting 'back'. Instead, choose where to redirect the user if she hits 'back', e.g. to the edit page of the record that was created.}
12
12
  gem.summary = %q{Prevent re-submission of a form by redirecting after hitting the back button. }
13
13
  gem.homepage = "https://github.com/yossi-shasho/redirect_on_back"
14
14
  gem.licenses = ['MIT', 'GPL-2']
@@ -18,7 +18,6 @@ Gem::Specification.new do |gem|
18
18
  gem.test_files = gem.files.grep(%r{^(spec)/})
19
19
  gem.require_paths = ["lib"]
20
20
 
21
- gem.add_dependency "rails", ">= 3.1"
22
- gem.add_dependency "railties", ">= 3.1"
23
- gem.add_dependency "jquery-rails"
21
+ gem.add_runtime_dependency "railties", ">= 3.1"
22
+ gem.add_runtime_dependency "jquery-rails"
24
23
  end
metadata CHANGED
@@ -1,66 +1,53 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redirect_on_back
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 1.0.0
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-08-30 00:00:00.000000000 Z
11
+ date: 2014-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: rails
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ! '>='
18
- - !ruby/object:Gem::Version
19
- version: '3.1'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ! '>='
25
- - !ruby/object:Gem::Version
26
- version: '3.1'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: railties
29
15
  requirement: !ruby/object:Gem::Requirement
30
16
  requirements:
31
- - - ! '>='
17
+ - - ">="
32
18
  - !ruby/object:Gem::Version
33
19
  version: '3.1'
34
20
  type: :runtime
35
21
  prerelease: false
36
22
  version_requirements: !ruby/object:Gem::Requirement
37
23
  requirements:
38
- - - ! '>='
24
+ - - ">="
39
25
  - !ruby/object:Gem::Version
40
26
  version: '3.1'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: jquery-rails
43
29
  requirement: !ruby/object:Gem::Requirement
44
30
  requirements:
45
- - - ! '>='
31
+ - - ">="
46
32
  - !ruby/object:Gem::Version
47
33
  version: '0'
48
34
  type: :runtime
49
35
  prerelease: false
50
36
  version_requirements: !ruby/object:Gem::Requirement
51
37
  requirements:
52
- - - ! '>='
38
+ - - ">="
53
39
  - !ruby/object:Gem::Version
54
40
  version: '0'
55
- description: ! 'Rails 3 and above: redirect after user has clicked the back button,
56
- e.g. to edit the newly created record instead of creating a new one.'
41
+ description: Prevent form re-submition when hitting 'back'. Instead, choose where
42
+ to redirect the user if she hits 'back', e.g. to the edit page of the record that
43
+ was created.
57
44
  email:
58
45
  - jozard00@gmail.com
59
46
  executables: []
60
47
  extensions: []
61
48
  extra_rdoc_files: []
62
49
  files:
63
- - .gitignore
50
+ - ".gitignore"
64
51
  - Gemfile
65
52
  - LICENSE.txt
66
53
  - README.md
@@ -83,17 +70,17 @@ require_paths:
83
70
  - lib
84
71
  required_ruby_version: !ruby/object:Gem::Requirement
85
72
  requirements:
86
- - - ! '>='
73
+ - - ">="
87
74
  - !ruby/object:Gem::Version
88
75
  version: '0'
89
76
  required_rubygems_version: !ruby/object:Gem::Requirement
90
77
  requirements:
91
- - - ! '>='
78
+ - - ">="
92
79
  - !ruby/object:Gem::Version
93
80
  version: '0'
94
81
  requirements: []
95
82
  rubyforge_project:
96
- rubygems_version: 2.0.3
83
+ rubygems_version: 2.2.2
97
84
  signing_key:
98
85
  specification_version: 4
99
86
  summary: Prevent re-submission of a form by redirecting after hitting the back button.