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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9669748f60be5817e4e654db635763351b986b914e85aff89d5b04b3f6ffe848
4
- data.tar.gz: 55a24b6c7ef8e4ac5e517db0d559fbdba43ba055c6eaaa5a5c70e73baa935841
3
+ metadata.gz: e1e1f178ccfe11c704e5064d0ee50bfa6a27d6aee4f478f478e6e0529a7e0683
4
+ data.tar.gz: de3fb5ad387969bc8c796ca9db23de2f311e8b16f6002316456b475953d66ae1
5
5
  SHA512:
6
- metadata.gz: 16dddca354bfaf6dcaa405f4dacb89c402563d06df115dc74ffba41d39e9ff8dadebaf4ec9b63a2a2830f1887ad43f640bd0873fede81c392c96fa5e06b128ac
7
- data.tar.gz: 0cc2b4014d79082b8d1f704913f1d22c4876072e3608ffef0dd27f38d237021ee607b280142ee0d5c4402020b3a9533eda56f19d6a0788d5ae27c18cc16ea073
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
 
@@ -3,6 +3,7 @@
3
3
  when :jquery
4
4
  jquery_ui = true
5
5
  require_asset "getprototypeof"
6
+ require_asset "jquery.ba-throttle-debounce"
6
7
  if Jquery::Rails.const_defined? 'JQUERY_UI_VERSION'
7
8
  require_asset "jquery-ui"
8
9
  elsif Jquery.const_defined? 'Ui'
@@ -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), {
@@ -18,7 +18,7 @@ module ActiveScaffold::Bridges
18
18
  /%M/ => 'mm',
19
19
  /%p/ => 'tt',
20
20
  /%S/ => 'ss',
21
- /%z/ => 'Z',
21
+ /%z/ => 'z',
22
22
  /%[cUWwxXZ]/ => ''
23
23
  }.freeze
24
24
 
@@ -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.to_s(:db), to_value.to_s(:db)] unless from_value.nil? || to_value.nil?
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.to_s(:db)] unless from_value.nil?
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.to_s(:db)]
322
+ ['%<search_sql>s <= ?', to_value]
323
323
  elsif !to_value
324
- ['%<search_sql>s >= ?', from_value.to_s(:db)]
324
+ ['%<search_sql>s >= ?', from_value]
325
325
  else
326
- ['%<search_sql>s BETWEEN ? AND ?', from_value.to_s(:db), to_value.to_s(:db)]
326
+ ['%<search_sql>s BETWEEN ? AND ?', from_value, to_value]
327
327
  end
328
328
  end
329
329
 
@@ -2,7 +2,7 @@ module ActiveScaffold
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 6
5
- PATCH = 5
5
+ PATCH = 9
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end