active_scaffold 3.6.4.1 → 3.6.8

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: 335d7ad205e19c251d006398597bad619cc5499efa8a0815017cf27aa5df0b65
4
- data.tar.gz: 940135dfbc68e1c3d70aa02132a3d9f3873162dc4964b6d9cdc04a2b73feed97
3
+ metadata.gz: 4d63c8ce5c055421403fdf35bce2cc09fa4797ad8ccf282fd0ab96b80a254b56
4
+ data.tar.gz: af6eea7aa4e45b55bfafcdc1c2cedbd2e3880bf71af800fd2720a291fde329a8
5
5
  SHA512:
6
- metadata.gz: 436fed807f06fb66d908dd913a54f06173fb7304ebbb59ea15c0952165570c6fd16ba243794dc147140445beb9e03e9f6e28ca9564d5bedb402f28e2dbdd565e
7
- data.tar.gz: 7dec63250eee9943823e9ffc14fd45ac7dd2edb5aef15f901a564ba0bc60101b93a41cfca09e58dd29936ef7aebe3e534adb9cfb850abdeb21bb88b7567b028d
6
+ metadata.gz: edd5caa3ba54351a67da98599a5bf684eb1e6cdc573c951a5318d25cbb6f36fceabfb963f0a6e4c64a21320c75aecfcefb07c6f4f049fd4f49a585ff3e74c09c
7
+ data.tar.gz: 7a1a1ed5fb94ded3584468ccec6ec7321d781f0ae90efd767a6723c8ff5cd29b11a5f67620599e32a44becd5c6ec322835056c5f1baf1430802c132db16f42c9
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,17 @@
1
+ = 3.6.8
2
+ - Add depend_on available translations in app to data picker bridge JS
3
+ - Fix live search with rails-ujs
4
+ - Replace delayedObserver with $.debounce
5
+
6
+ = 3.6.7
7
+ - Upgrade jquery ui timepicker addon to 1.6.3
8
+
9
+ = 3.6.6
10
+ - Fix format string for timezone in jquery timepicker
11
+
12
+ = 3.6.5
13
+ - Support timezone in jquery timepicker
14
+
1
15
  = 3.6.4.1
2
16
  - Actually fix country_select bridge for latest gem version
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.map { |locale| Rails.root.join("config/locales/#{locale}.yml") }.select(&:exist?).each { |path| depend_on path.to_s } %>
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), {
@@ -41,6 +41,7 @@ de:
41
41
  closeText: Schließen
42
42
  currentText: Jetzt
43
43
  timeText: Uhrzeit
44
+ timezoneText: Timezone
44
45
  days: Tage
45
46
  delete: Löschen
46
47
  deleted_model: "%{model} gelöscht"
@@ -41,6 +41,7 @@ en:
41
41
  closeText: Close
42
42
  currentText: Now
43
43
  timeText: Hour
44
+ timezoneText: Timezone
44
45
  days: Days
45
46
  delete: Delete
46
47
  deleted_model: Deleted %{model}
@@ -41,6 +41,7 @@ es:
41
41
  closeText: Cerrar
42
42
  currentText: Ahora
43
43
  timeText: Hora
44
+ timezoneText: Zona horaria
44
45
  days: Días
45
46
  delete: Borrar
46
47
  deleted_model: "%{model} borrado"
@@ -41,6 +41,7 @@ fr:
41
41
  closeText: Fermer
42
42
  currentText: Maintenant
43
43
  timeText: Heure
44
+ timezoneText: Timezone
44
45
  days: Jours
45
46
  delete: Supprimer
46
47
  deleted_model: Suppression de %{model}
@@ -40,7 +40,8 @@ hu:
40
40
  datetime_picker_options:
41
41
  closeText:
42
42
  currentText:
43
- timeText:
43
+ timeText:
44
+ timezoneText: Timezone
44
45
  days: Days
45
46
  delete: Törlés
46
47
  deleted_model: "%{model} törölve"
@@ -40,7 +40,8 @@ ja:
40
40
  datetime_picker_options:
41
41
  closeText:
42
42
  currentText:
43
- timeText:
43
+ timeText:
44
+ timezoneText: Timezone
44
45
  days: Days
45
46
  delete: 削除
46
47
  deleted_model: "%{model}を削除しました"
@@ -40,7 +40,8 @@ ru:
40
40
  datetime_picker_options:
41
41
  closeText: Закрыть
42
42
  currentText: Текущее время
43
- timeText:
43
+ timeText:
44
+ timezoneText: Timezone
44
45
  days: дней
45
46
  delete: Удалить
46
47
  deleted_model: "%{model}: запись удалена"
@@ -18,7 +18,8 @@ module ActiveScaffold::Bridges
18
18
  /%M/ => 'mm',
19
19
  /%p/ => 'tt',
20
20
  /%S/ => 'ss',
21
- /%[cUWwxXZz]/ => ''
21
+ /%z/ => 'z',
22
+ /%[cUWwxXZ]/ => ''
22
23
  }.freeze
23
24
 
24
25
  def self.date_options_for_locales
@@ -82,13 +83,14 @@ module ActiveScaffold::Bridges
82
83
 
83
84
  def self.to_datepicker_format(rails_format)
84
85
  return nil if rails_format.nil?
85
- if rails_format =~ /%[cUWwxXZz]/
86
+ unsupported = DATE_FORMAT_CONVERSION.index ''
87
+ if rails_format =~ unsupported
88
+ options = unsupported.to_s.scan(/\[(.*)\]/).dig(0, 0)&.each_char&.map { |c| "%#{c}" }
86
89
  Rails.logger.warn(
87
90
  "AS DatePicker::Helper: rails date format #{rails_format} includes options "\
88
91
  "which can't be converted to jquery datepicker format. "\
89
- 'Options %c, %U, %W, %w, %x %X, %z, %Z are not supported by datepicker and will be removed'
92
+ "Options #{options.join(', ')} are not supported by datepicker and will be removed"
90
93
  )
91
- nil
92
94
  end
93
95
  js_format = rails_format.dup
94
96
  js_format.gsub!(/([ ]|^)([^% ]\S*)/, " '\\2'")
@@ -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') {
@@ -2,7 +2,7 @@ module ActiveScaffold
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 6
5
- PATCH = '4.1'
5
+ PATCH = 8
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end