jqr-helpers 1.0.60 → 1.0.61
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/assets/javascripts/jqr-helpers.js +40 -41
- 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
|
+
OWM4N2E5ODBjYWFmYWRlMTA4MTFhYWFiZDdlZThmNTljMjQzNjI3YQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MzkxMDc2NTA1ZTM5NWUwYzhlMDYzZGI4N2NjMDQ5YjA3ZjgyYzBhZA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NmViMTNhOTJlOGIxZmY2Yjk5MjEzZGU3M2IyMDgxN2ZjM2VhMWM3MTQ5YTlk
|
10
|
+
MmM1YmFlZDI5ZDBjMDVlM2M1MzNhZWRhMWIxMzdmMjZhNGFmNjM4ODJmMWI4
|
11
|
+
NmVkNGI5ZWJjYzEwODRjOTYxNGNjNWU5NmQ2YzI0NGRmM2NmNWQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YzM1OGY2MzUxYmViNTY5MjFlYmFlNGIxMTg3MzE1OTQ3YzAxMzY2NTQxYzAw
|
14
|
+
MDFjODQxZjY3OWJiYjNhYjhjNjg4YTAxNGIwOGI1YmU2MjAzNTNlMDMzZDQ4
|
15
|
+
YTlmYmRmMjc1YTJmZmJlYjI0MDg4M2ZiYjkyYTVlZDVhZTAxY2U=
|
@@ -415,50 +415,47 @@
|
|
415
415
|
}
|
416
416
|
}
|
417
417
|
|
418
|
-
function
|
419
|
-
|
420
|
-
|
418
|
+
function addHiddenField(form, name, value) {
|
419
|
+
var input = $('<input type="hidden">');
|
420
|
+
input.attr('name', name);
|
421
|
+
input.attr('value', value);
|
422
|
+
form.append(input);
|
423
|
+
}
|
421
424
|
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
425
|
+
function ujsExternalClick(event) {
|
426
|
+
event.stopImmediatePropagation();
|
427
|
+
var button = $(this);
|
428
|
+
if (!$.rails.allowAction(button)) {
|
429
|
+
return false;
|
430
|
+
}
|
431
|
+
if (button.data('disable-with')) {
|
432
|
+
button.html(button.data('disable-with'));
|
433
|
+
button.attr('disabled', 'disabled');
|
434
|
+
button.attr('autocomplete', 'off');
|
435
|
+
}
|
436
|
+
var form = $('<form>');
|
437
|
+
var method = button.data('method');
|
438
|
+
if (method == 'put' || method == 'delete') {
|
439
|
+
form.attr('method', 'post');
|
440
|
+
addHiddenField(form, '_method', method);
|
427
441
|
}
|
442
|
+
else {
|
443
|
+
form.attr('method', method);
|
444
|
+
}
|
445
|
+
form.attr('action', button.data('url'));
|
446
|
+
form.attr('target', button.data('target'));
|
447
|
+
if (method != 'get') {
|
448
|
+
form.attr('rel', 'nofollow');
|
449
|
+
addHiddenField(form, button.data('token-name'),
|
450
|
+
button.data('token-value'));
|
451
|
+
}
|
452
|
+
$('body').append(form);
|
453
|
+
form.submit();
|
454
|
+
return false;
|
455
|
+
}
|
456
|
+
|
457
|
+
function ujsLoadPlugins(event) {
|
428
458
|
|
429
|
-
$('.ujs-external-button').each(function() {
|
430
|
-
var button = $(this);
|
431
|
-
var form = $('<form>');
|
432
|
-
var method = button.data('method');
|
433
|
-
if (method == 'put' || method == 'delete') {
|
434
|
-
form.attr('method', 'post');
|
435
|
-
addHiddenField(form, '_method', method);
|
436
|
-
}
|
437
|
-
else {
|
438
|
-
form.attr('method', method);
|
439
|
-
}
|
440
|
-
form.attr('action', button.data('url'));
|
441
|
-
form.attr('target', button.data('target'));
|
442
|
-
if (method != 'get') {
|
443
|
-
form.attr('rel', 'nofollow');
|
444
|
-
addHiddenField(form, button.data('token-name'),
|
445
|
-
button.data('token-value'));
|
446
|
-
}
|
447
|
-
$('body').append(form);
|
448
|
-
button.click(function(event) {
|
449
|
-
event.stopImmediatePropagation();
|
450
|
-
if (!$.rails.allowAction(button)) {
|
451
|
-
return false;
|
452
|
-
}
|
453
|
-
if (button.data('disable-with')) {
|
454
|
-
button.html(button.data('disable-with'));
|
455
|
-
button.attr('disabled', 'disabled');
|
456
|
-
button.attr('autocomplete', 'off');
|
457
|
-
}
|
458
|
-
form.submit();
|
459
|
-
return false;
|
460
|
-
});
|
461
|
-
});
|
462
459
|
$('.ujs-date-picker', event.target).each(function() {
|
463
460
|
var options = $(this).data('date-options');
|
464
461
|
$(this).datepicker(options);
|
@@ -527,6 +524,7 @@
|
|
527
524
|
$(document).on('mouseenter mouseleave', '.ujs-quick-buttonset label',
|
528
525
|
ujsQuickButtonHover);
|
529
526
|
$(document).on('click', '.ujs-toggle', ujsToggleClick);
|
527
|
+
$(document).on('click', '.ujs-external-button', ujsExternalClick);
|
530
528
|
}
|
531
529
|
else {
|
532
530
|
$('body').live('jqr.load', ujsLoadPlugins);
|
@@ -543,6 +541,7 @@
|
|
543
541
|
$('.ujs-quick-buttonset label').live('mouseenter mouseleave',
|
544
542
|
ujsQuickButtonHover);
|
545
543
|
$('.ujs-toggle').live('click', ujsToggleClick);
|
544
|
+
$('.ujs-external-button').live('click', ujsExternalClick);
|
546
545
|
}
|
547
546
|
$('body').trigger('jqr.beforeload').trigger('jqr.load');
|
548
547
|
});
|
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 = '2014-
|
4
|
+
s.version = '1.0.61'
|
5
|
+
s.date = '2014-10-01'
|
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
@@ -334,6 +334,7 @@ module JqrHelpers
|
|
334
334
|
def quick_radio_set(name, values, selected=nil, html_options={})
|
335
335
|
html_options[:class] ||= ''
|
336
336
|
html_options[:class] << ' ujs-quick-buttonset ui-buttonset'
|
337
|
+
html_options[:autocomplete] = 'off'
|
337
338
|
content = ''
|
338
339
|
last_key = values.keys.length - 1
|
339
340
|
values.each_with_index do |(value, label), i|
|
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.61
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Orner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|