jqr-helpers 1.0.65 → 1.0.66
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 +8 -8
- data/Readme.md +7 -0
- data/app/assets/javascripts/jqr-helpers.js +3 -1
- data/jqr-helpers.gemspec +2 -2
- data/lib/jqr-helpers/helpers.rb +1 -0
- data/lib/jqr-helpers/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZjcyN2QzOGY3ZmZlYjhlNzM3MGE5NDNiMmY3N2YxMjY4MjJiODAyNA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NWRmMGYwY2JiODYzY2VmYzYwNWFmYTRhZTg3MDczMzdhYTgwZDhjNw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZDdjMjc1MGIxYmJiN2Y0NDRmYjYxMjQwNDg5NzQ2MmI0NGNhOWYxMTMyNDc4
|
10
|
+
Yzg5NDRjOGI3MmQ0MDBlNmM1YzdkM2JiZDc3MTNhZDRjOWI2OTdmZWFiZGZh
|
11
|
+
OTVmZjJiZWUwODRhYWE1ODQzYzdlZTRjNThkYmI5M2RhYTM4ODQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MjE1YTAyOWUyZjBiN2ZiZWRjZjYyMzExMjM0MGQ5YjZjNGNiM2ZlOTdjNjNl
|
14
|
+
Zjc3ODkxNDUyNDhiY2E2Yzc0ZDZkZDgwNzVhNjc3NDQ2YTE4ZTg1MjRiZTEw
|
15
|
+
ZjdkZmIyMzE1Y2FkMDVhZjA4YjNhZjA0NzFkYTdmYTIxMGQ0ZGU=
|
data/Readme.md
CHANGED
@@ -163,6 +163,9 @@ other elements.
|
|
163
163
|
this indicates that the dialog should be closed when the request completes
|
164
164
|
successfully. This is true by default for forms and false for
|
165
165
|
other elements.
|
166
|
+
* `:alert_message` (Boolean) - if true, a string response which is *not*
|
167
|
+
`success` will not be considered an error - it will be alerted to the user
|
168
|
+
but will not stop the normal functionality from proceeding.
|
166
169
|
* `:scroll_to` (Boolean) - if given, the element that was updated or inserted
|
167
170
|
will be scrolled into view (i.e. its top will be aligned with the top of the
|
168
171
|
page).
|
@@ -179,6 +182,10 @@ you would do this in your Rails controller by rendering a partial, or a view
|
|
179
182
|
with `:layout => false`. Conversely, when using `delete`, the JS expects a
|
180
183
|
simple text response of `success` since there it is simply deleting a row.
|
181
184
|
|
185
|
+
If you want to alert a message and *also* accomplish the default functionality
|
186
|
+
(such as updating HTML or closing a dialog box), simply use the `alert_message`
|
187
|
+
option in your Ajax link/button/form.
|
188
|
+
|
182
189
|
## Monitoring Fields ##
|
183
190
|
|
184
191
|
You can monitor a field for changes using the ``ajax_change`` method:
|
@@ -257,7 +257,9 @@
|
|
257
257
|
else if (!element.data('callback') && data &&
|
258
258
|
data.trim().charAt(0) != '<' && data != 'success') {
|
259
259
|
alert(data);
|
260
|
-
|
260
|
+
if (!element.data('alert-message')) {
|
261
|
+
return;
|
262
|
+
}
|
261
263
|
}
|
262
264
|
// if this was sent from a dialog, close the dialog and look at the
|
263
265
|
// element that opened it for update/append/delete callbacks.
|
data/jqr-helpers.gemspec
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'jqr-helpers'
|
3
3
|
s.require_paths = %w(. lib lib/jqr-helpers)
|
4
|
-
s.version = '1.0.
|
5
|
-
s.date = '
|
4
|
+
s.version = '1.0.66'
|
5
|
+
s.date = '2015-01-08'
|
6
6
|
s.summary = 'Helpers to print unobtrusive jQuery-UI tags.'
|
7
7
|
s.description = <<-EOF
|
8
8
|
This gem adds helper methods to create unobtrusive jQuery code. It outputs
|
data/lib/jqr-helpers/helpers.rb
CHANGED
@@ -575,6 +575,7 @@ module JqrHelpers
|
|
575
575
|
new_options[:'data-type'] = options[:return_type] || 'html'
|
576
576
|
new_options[:'data-callback'] = options.delete(:callback)
|
577
577
|
new_options[:'data-close-dialog'] = options.delete(:close_dialog)
|
578
|
+
new_options[:'data-alert-message'] = options.delete(:alert_message)
|
578
579
|
new_options[:'data-use-dialog-opener'] = options.delete(:use_dialog_opener)
|
579
580
|
new_options[:'data-refresh'] = true if options.delete(:refresh)
|
580
581
|
new_options[:'data-redirect'] = true if options.delete(:redirect)
|
data/lib/jqr-helpers/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jqr-helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.66
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Orner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|