active_scaffold 3.6.6 → 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: db4ded41b22bcb1ff0c1f9d2e59499bd37127ffc4600e53fc24856a9ef525897
4
- data.tar.gz: e3b57c93d2250d0ac83f618ee38c04b8514d56817555bace633a2a9efb05d3ed
3
+ metadata.gz: 4d63c8ce5c055421403fdf35bce2cc09fa4797ad8ccf282fd0ab96b80a254b56
4
+ data.tar.gz: af6eea7aa4e45b55bfafcdc1c2cedbd2e3880bf71af800fd2720a291fde329a8
5
5
  SHA512:
6
- metadata.gz: c1a48c8654117d2829cdde939ab632b797287312dfe37fe88d73594b70ef2d48b4cac5872158fb56a090808daa6334310ab3ac8efc73de0109850760ed5673ee
7
- data.tar.gz: 58052fce6e32e54e28cc3d77c43f2a952b32be8c6a314a07047537a1d3c62931476d30c787a0cd239329c099e8dbdff6032d31610fb93cd83e79192ec27c192d
6
+ metadata.gz: edd5caa3ba54351a67da98599a5bf684eb1e6cdc573c951a5318d25cbb6f36fceabfb963f0a6e4c64a21320c75aecfcefb07c6f4f049fd4f49a585ff3e74c09c
7
+ data.tar.gz: 7a1a1ed5fb94ded3584468ccec6ec7321d781f0ae90efd767a6723c8ff5cd29b11a5f67620599e32a44becd5c6ec322835056c5f1baf1430802c132db16f42c9
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,11 @@
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
+
1
9
  = 3.6.6
2
10
  - Fix format string for timezone in jquery timepicker
3
11
 
@@ -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), {
@@ -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 = 6
5
+ PATCH = 8
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end