active_scaffold 3.6.5 → 3.6.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.rdoc +14 -0
- data/app/assets/javascripts/active_scaffold.js.erb +1 -0
- data/app/assets/javascripts/jquery/active_scaffold.js +4 -44
- data/app/assets/javascripts/jquery/date_picker_bridge.js.erb +1 -0
- data/lib/active_scaffold/bridges/date_picker/helper.rb +1 -1
- data/lib/active_scaffold/bridges/date_picker.rb +4 -0
- data/lib/active_scaffold/bridges/shared/date_bridge.rb +2 -2
- data/lib/active_scaffold/finder.rb +3 -3
- data/lib/active_scaffold/version.rb +1 -1
- data/vendor/assets/javascripts/jquery-ui-timepicker-addon.js +2289 -1880
- data/vendor/assets/javascripts/jquery.ba-throttle-debounce.js +252 -0
- data/vendor/assets/stylesheets/jquery-ui-timepicker-addon.css +30 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1e1f178ccfe11c704e5064d0ee50bfa6a27d6aee4f478f478e6e0529a7e0683
|
4
|
+
data.tar.gz: de3fb5ad387969bc8c796ca9db23de2f311e8b16f6002316456b475953d66ae1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 175f49bcb07a4fd3fd313f5437b3d2b438a20d9a697e2cc481fcc7086a4a0add3e08fa342ed90f984fed13eff68bad632b8bd772bbbf6869319d1024ace9082d
|
7
|
+
data.tar.gz: 8db9c02a65266fc858910ecf180800c4adabe0913eb02cb3464db665f51ad3ab3230a5bc1e6d38a581d93a874d390e6e8fa7ae7f72ec5c09d54cbecfcb070a71
|
data/CHANGELOG.rdoc
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
- Support depend on .rb or .json locale files for date picker bridge
|
2
|
+
- Fix search with dates entered with timezone in datepicker
|
3
|
+
|
4
|
+
= 3.6.8
|
5
|
+
- Add depend_on available translations in app to data picker bridge JS
|
6
|
+
- Fix live search with rails-ujs
|
7
|
+
- Replace delayedObserver with $.debounce
|
8
|
+
|
9
|
+
= 3.6.7
|
10
|
+
- Upgrade jquery ui timepicker addon to 1.6.3
|
11
|
+
|
12
|
+
= 3.6.6
|
13
|
+
- Fix format string for timezone in jquery timepicker
|
14
|
+
|
1
15
|
= 3.6.5
|
2
16
|
- Support timezone in jquery timepicker
|
3
17
|
|
@@ -354,6 +354,10 @@ jQuery(document).ready(function($) {
|
|
354
354
|
}
|
355
355
|
});
|
356
356
|
|
357
|
+
jQuery(document).on('input paste', 'form.search.live input[type=search]', $.debounce((ActiveScaffold.config.live_search_delay || 0.5) * 1000, function() {
|
358
|
+
jQuery(this).parent().find('[type=submit]').click();
|
359
|
+
}));
|
360
|
+
|
357
361
|
jQuery(document).on('turbolinks:before-visit', function() {
|
358
362
|
if (history.state.active_scaffold) {
|
359
363
|
history.replaceState({turbolinks: true, url: document.location.href}, '', document.location.href);
|
@@ -459,44 +463,6 @@ jQuery(document).on('turbolinks:load', function($) {
|
|
459
463
|
};
|
460
464
|
})();
|
461
465
|
|
462
|
-
/*
|
463
|
-
$ delayed observer
|
464
|
-
(c) 2007 - Maxime Haineault (max@centdessin.com)
|
465
|
-
|
466
|
-
Special thanks to Stephen Goguen & Tane Piper.
|
467
|
-
|
468
|
-
Slight modifications by Elliot Winkler
|
469
|
-
*/
|
470
|
-
|
471
|
-
if (typeof(jQuery.fn.delayedObserver) === 'undefined') {
|
472
|
-
(function($){
|
473
|
-
$.extend($.fn, {
|
474
|
-
delayedObserver: function(callback, delay, options){
|
475
|
-
return this.each(function(){
|
476
|
-
var el = $(this);
|
477
|
-
var op = options || {};
|
478
|
-
el.data('oldval', el.val())
|
479
|
-
.data('delay', delay === 0 ? delay : (delay || 0.5))
|
480
|
-
.data('condition', op.condition || function() { return ($(this).data('oldval') == $(this).val()); })
|
481
|
-
.data('callback', callback)
|
482
|
-
[(op.event||'keyup')](function(){
|
483
|
-
if (el.data('condition').apply(el)) { return; }
|
484
|
-
else {
|
485
|
-
if (el.data('timer')) { clearTimeout(el.data('timer')); }
|
486
|
-
el.data('timer', setTimeout(function(){
|
487
|
-
var callback = el.data('callback')
|
488
|
-
if (callback) callback.apply(el);
|
489
|
-
}, el.data('delay') * 1000));
|
490
|
-
el.data('oldval', el.val());
|
491
|
-
}
|
492
|
-
});
|
493
|
-
});
|
494
|
-
}
|
495
|
-
});
|
496
|
-
})(jQuery);
|
497
|
-
};
|
498
|
-
|
499
|
-
|
500
466
|
/*
|
501
467
|
* Simple utility methods
|
502
468
|
*/
|
@@ -507,7 +473,6 @@ var ActiveScaffold = {
|
|
507
473
|
/* setup some elements on page/form load */
|
508
474
|
ActiveScaffold.load_embedded(container);
|
509
475
|
ActiveScaffold.enable_js_form_buttons(container);
|
510
|
-
ActiveScaffold.live_search(container);
|
511
476
|
ActiveScaffold.auto_paginate(container);
|
512
477
|
ActiveScaffold.draggable_lists('.draggable-lists', container);
|
513
478
|
ActiveScaffold.sliders(container);
|
@@ -530,11 +495,6 @@ var ActiveScaffold = {
|
|
530
495
|
}
|
531
496
|
ActiveScaffold.add_to_history(document.location.href, data, true);
|
532
497
|
},
|
533
|
-
live_search: function(element) {
|
534
|
-
jQuery('form.search.live input[type=search]', element).delayedObserver(function() {
|
535
|
-
jQuery(this).parent().trigger("submit");
|
536
|
-
}, ActiveScaffold.config.live_search_delay || 0.5);
|
537
|
-
},
|
538
498
|
auto_paginate: function(element) {
|
539
499
|
var paginate_link = jQuery('.active-scaffold-pagination.auto-paginate a:first', element);
|
540
500
|
if (paginate_link.length) {
|
@@ -1,4 +1,5 @@
|
|
1
1
|
<%# encoding: utf-8 %>
|
2
|
+
<% I18n.available_locales.each { |locale| Dir[Rails.root.join("config/locales/#{locale}.*")].each { |path| depend_on path } } %>
|
2
3
|
<%= ActiveScaffold::Bridges[:date_picker].localization %>
|
3
4
|
Object.getPrototypeOf(jQuery.datepicker)._attachDatepicker_without_inlineSettings = Object.getPrototypeOf(jQuery.datepicker)._attachDatepicker;
|
4
5
|
jQuery.extend(Object.getPrototypeOf(jQuery.datepicker), {
|
@@ -13,6 +13,10 @@ module ActiveScaffold::Bridges
|
|
13
13
|
Jquery::Rails.const_defined?('JQUERY_UI_VERSION') || Jquery.const_defined?('Ui') if Object.const_defined?('Jquery')
|
14
14
|
end
|
15
15
|
|
16
|
+
def self.stylesheets
|
17
|
+
'jquery-ui-timepicker-addon'
|
18
|
+
end
|
19
|
+
|
16
20
|
def self.localization
|
17
21
|
"jQuery(function($){
|
18
22
|
if (typeof($.datepicker) === 'object') {
|
@@ -122,9 +122,9 @@ module ActiveScaffold
|
|
122
122
|
if column.search_sql.is_a? Proc
|
123
123
|
column.search_sql.call(from_value, to_value, operator)
|
124
124
|
elsif operator.nil?
|
125
|
-
['%<search_sql>s BETWEEN ? AND ?', from_value
|
125
|
+
['%<search_sql>s BETWEEN ? AND ?', from_value, to_value] unless from_value.nil? || to_value.nil?
|
126
126
|
else
|
127
|
-
["%<search_sql>s #{value['opt']} ?", from_value
|
127
|
+
["%<search_sql>s #{value['opt']} ?", from_value] unless from_value.nil?
|
128
128
|
end
|
129
129
|
end
|
130
130
|
|
@@ -319,11 +319,11 @@ module ActiveScaffold
|
|
319
319
|
if from_value.nil? && to_value.nil?
|
320
320
|
nil
|
321
321
|
elsif !from_value
|
322
|
-
['%<search_sql>s <= ?', to_value
|
322
|
+
['%<search_sql>s <= ?', to_value]
|
323
323
|
elsif !to_value
|
324
|
-
['%<search_sql>s >= ?', from_value
|
324
|
+
['%<search_sql>s >= ?', from_value]
|
325
325
|
else
|
326
|
-
['%<search_sql>s BETWEEN ? AND ?', from_value
|
326
|
+
['%<search_sql>s BETWEEN ? AND ?', from_value, to_value]
|
327
327
|
end
|
328
328
|
end
|
329
329
|
|