activeadmin 3.4.0 → 3.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -0
  3. data/app/assets/javascripts/active_admin/base.js +4 -1
  4. data/app/javascript/active_admin/initializers/datepicker.js +3 -0
  5. data/app/javascript/active_admin/lib/modal-dialog.js +1 -1
  6. data/lib/active_admin/dependency.rb +1 -1
  7. data/lib/active_admin/resource.rb +8 -2
  8. data/lib/active_admin/version.rb +1 -1
  9. data/vendor/assets/javascripts/jquery-ui/data.js +6 -12
  10. data/vendor/assets/javascripts/jquery-ui/disable-selection.js +1 -1
  11. data/vendor/assets/javascripts/jquery-ui/focusable.js +3 -13
  12. data/vendor/assets/javascripts/jquery-ui/form-reset-mixin.js +2 -4
  13. data/vendor/assets/javascripts/jquery-ui/keycode.js +1 -1
  14. data/vendor/assets/javascripts/jquery-ui/labels.js +4 -5
  15. data/vendor/assets/javascripts/jquery-ui/position.js +1 -1
  16. data/vendor/assets/javascripts/jquery-ui/scroll-parent.js +1 -1
  17. data/vendor/assets/javascripts/jquery-ui/tabbable.js +1 -1
  18. data/vendor/assets/javascripts/jquery-ui/unique-id.js +1 -1
  19. data/vendor/assets/javascripts/jquery-ui/version.js +1 -1
  20. data/vendor/assets/javascripts/jquery-ui/widget.js +4 -1
  21. data/vendor/assets/javascripts/jquery-ui/widgets/button.js +6 -6
  22. data/vendor/assets/javascripts/jquery-ui/widgets/checkboxradio.js +4 -4
  23. data/vendor/assets/javascripts/jquery-ui/widgets/controlgroup.js +2 -2
  24. data/vendor/assets/javascripts/jquery-ui/widgets/datepicker.js +11 -14
  25. data/vendor/assets/javascripts/jquery-ui/widgets/dialog.js +20 -34
  26. data/vendor/assets/javascripts/jquery-ui/widgets/draggable.js +4 -8
  27. data/vendor/assets/javascripts/jquery-ui/widgets/mouse.js +16 -31
  28. data/vendor/assets/javascripts/jquery-ui/widgets/resizable.js +73 -20
  29. data/vendor/assets/javascripts/jquery-ui/widgets/sortable.js +9 -17
  30. data/vendor/assets/javascripts/jquery-ui/widgets/tabs.js +53 -66
  31. metadata +3 -7
  32. data/vendor/assets/javascripts/jquery-ui/form.js +0 -25
  33. data/vendor/assets/javascripts/jquery-ui/ie.js +0 -20
  34. data/vendor/assets/javascripts/jquery-ui/safe-active-element.js +0 -46
  35. data/vendor/assets/javascripts/jquery-ui/safe-blur.js +0 -27
@@ -1,11 +1,10 @@
1
1
  //= require jquery-ui/keycode
2
- //= require jquery-ui/safe-active-element
3
2
  //= require jquery-ui/unique-id
4
3
  //= require jquery-ui/version
5
4
  //= require jquery-ui/widget
6
5
 
7
6
  /*!
8
- * jQuery UI Tabs 1.13.3
7
+ * jQuery UI Tabs 1.14.2
9
8
  * https://jqueryui.com
10
9
  *
11
10
  * Copyright OpenJS Foundation and other contributors
@@ -31,7 +30,6 @@
31
30
  define( [
32
31
  "jquery",
33
32
  "../keycode",
34
- "../safe-active-element",
35
33
  "../unique-id",
36
34
  "../version",
37
35
  "../widget"
@@ -45,7 +43,7 @@
45
43
  "use strict";
46
44
 
47
45
  $.widget( "ui.tabs", {
48
- version: "1.13.3",
46
+ version: "1.14.2",
49
47
  delay: 300,
50
48
  options: {
51
49
  active: null,
@@ -68,26 +66,19 @@ $.widget( "ui.tabs", {
68
66
  load: null
69
67
  },
70
68
 
71
- _isLocal: ( function() {
72
- var rhash = /#.*$/;
69
+ _isLocal: function( anchor ) {
70
+ var anchorUrl = new URL( anchor.href ),
71
+ locationUrl = new URL( location.href );
73
72
 
74
- return function( anchor ) {
75
- var anchorUrl, locationUrl;
73
+ return anchor.hash.length > 1 &&
76
74
 
77
- anchorUrl = anchor.href.replace( rhash, "" );
78
- locationUrl = location.href.replace( rhash, "" );
79
-
80
- // Decoding may throw an error if the URL isn't UTF-8 (#9518)
81
- try {
82
- anchorUrl = decodeURIComponent( anchorUrl );
83
- } catch ( error ) {}
84
- try {
85
- locationUrl = decodeURIComponent( locationUrl );
86
- } catch ( error ) {}
87
-
88
- return anchor.hash.length > 1 && anchorUrl === locationUrl;
89
- };
90
- } )(),
75
+ // `href` may contain a hash but also username & password;
76
+ // we want to ignore them, so we check the three fields
77
+ // below instead.
78
+ anchorUrl.origin === locationUrl.origin &&
79
+ anchorUrl.pathname === locationUrl.pathname &&
80
+ anchorUrl.search === locationUrl.search;
81
+ },
91
82
 
92
83
  _create: function() {
93
84
  var that = this,
@@ -128,7 +119,8 @@ $.widget( "ui.tabs", {
128
119
  _initialActive: function() {
129
120
  var active = this.options.active,
130
121
  collapsible = this.options.collapsible,
131
- locationHash = location.hash.substring( 1 );
122
+ locationHash = location.hash.substring( 1 ),
123
+ locationHashDecoded = decodeURIComponent( locationHash );
132
124
 
133
125
  if ( active === null ) {
134
126
 
@@ -140,6 +132,18 @@ $.widget( "ui.tabs", {
140
132
  return false;
141
133
  }
142
134
  } );
135
+
136
+ // If not found, decode the hash & try again.
137
+ // See the comment in `_processTabs` under the `_isLocal` check
138
+ // for more information.
139
+ if ( active === null ) {
140
+ this.tabs.each( function( i, tab ) {
141
+ if ( $( tab ).attr( "aria-controls" ) === locationHashDecoded ) {
142
+ active = i;
143
+ return false;
144
+ }
145
+ } );
146
+ }
143
147
  }
144
148
 
145
149
  // Check for a tab marked active via a class
@@ -177,7 +181,7 @@ $.widget( "ui.tabs", {
177
181
  },
178
182
 
179
183
  _tabKeydown: function( event ) {
180
- var focusedTab = $( $.ui.safeActiveElement( this.document[ 0 ] ) ).closest( "li" ),
184
+ var focusedTab = $( this.document[ 0 ].activeElement ).closest( "li" ),
181
185
  selectedIndex = this.tabs.index( focusedTab ),
182
186
  goingForward = true;
183
187
 
@@ -319,10 +323,6 @@ $.widget( "ui.tabs", {
319
323
  }
320
324
  },
321
325
 
322
- _sanitizeSelector: function( hash ) {
323
- return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : "";
324
- },
325
-
326
326
  refresh: function() {
327
327
  var options = this.options,
328
328
  lis = this.tablist.children( ":has(a[href])" );
@@ -414,18 +414,6 @@ $.widget( "ui.tabs", {
414
414
  if ( $( this ).is( ".ui-state-disabled" ) ) {
415
415
  event.preventDefault();
416
416
  }
417
- } )
418
-
419
- // Support: IE <9
420
- // Preventing the default action in mousedown doesn't prevent IE
421
- // from focusing the element, so if the anchor gets focused, blur.
422
- // We don't have to worry about focusing the previously focused
423
- // element since clicking on a non-focusable element should focus
424
- // the body anyway.
425
- .on( "focus" + this.eventNamespace, ".ui-tabs-anchor", function() {
426
- if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) {
427
- this.blur();
428
- }
429
417
  } );
430
418
 
431
419
  this.tabs = this.tablist.find( "> li:has(a[href])" )
@@ -453,9 +441,24 @@ $.widget( "ui.tabs", {
453
441
 
454
442
  // Inline tab
455
443
  if ( that._isLocal( anchor ) ) {
444
+
445
+ // The "scrolling to a fragment" section of the HTML spec:
446
+ // https://html.spec.whatwg.org/#scrolling-to-a-fragment
447
+ // uses a concept of document's indicated part:
448
+ // https://html.spec.whatwg.org/#the-indicated-part-of-the-document
449
+ // Slightly below there's an algorithm to compute the indicated
450
+ // part:
451
+ // https://html.spec.whatwg.org/#the-indicated-part-of-the-document
452
+ // First, the algorithm tries the hash as-is, without decoding.
453
+ // Then, if one is not found, the same is attempted with a decoded
454
+ // hash. Replicate this logic.
456
455
  selector = anchor.hash;
457
456
  panelId = selector.substring( 1 );
458
- panel = that.element.find( that._sanitizeSelector( selector ) );
457
+ panel = that.element.find( "#" + CSS.escape( panelId ) );
458
+ if ( !panel.length ) {
459
+ panelId = decodeURIComponent( panelId );
460
+ panel = that.element.find( "#" + CSS.escape( panelId ) );
461
+ }
459
462
 
460
463
  // remote tab
461
464
  } else {
@@ -741,7 +744,7 @@ $.widget( "ui.tabs", {
741
744
  // meta-function to give users option to provide a href string instead of a numerical index.
742
745
  if ( typeof index === "string" ) {
743
746
  index = this.anchors.index( this.anchors.filter( "[href$='" +
744
- $.escapeSelector( index ) + "']" ) );
747
+ CSS.escape( index ) + "']" ) );
745
748
  }
746
749
 
747
750
  return index;
@@ -863,32 +866,19 @@ $.widget( "ui.tabs", {
863
866
 
864
867
  this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) );
865
868
 
866
- // Support: jQuery <1.8
867
- // jQuery <1.8 returns false if the request is canceled in beforeSend,
868
- // but as of 1.8, $.ajax() always returns a jqXHR object.
869
- if ( this.xhr && this.xhr.statusText !== "canceled" ) {
869
+ if ( this.xhr.statusText !== "canceled" ) {
870
870
  this._addClass( tab, "ui-tabs-loading" );
871
871
  panel.attr( "aria-busy", "true" );
872
872
 
873
873
  this.xhr
874
874
  .done( function( response, status, jqXHR ) {
875
+ panel.html( response );
876
+ that._trigger( "load", event, eventData );
875
877
 
876
- // support: jQuery <1.8
877
- // https://bugs.jquery.com/ticket/11778
878
- setTimeout( function() {
879
- panel.html( response );
880
- that._trigger( "load", event, eventData );
881
-
882
- complete( jqXHR, status );
883
- }, 1 );
878
+ complete( jqXHR, status );
884
879
  } )
885
880
  .fail( function( jqXHR, status ) {
886
-
887
- // support: jQuery <1.8
888
- // https://bugs.jquery.com/ticket/11778
889
- setTimeout( function() {
890
- complete( jqXHR, status );
891
- }, 1 );
881
+ complete( jqXHR, status );
892
882
  } );
893
883
  }
894
884
  },
@@ -896,10 +886,7 @@ $.widget( "ui.tabs", {
896
886
  _ajaxSettings: function( anchor, event, eventData ) {
897
887
  var that = this;
898
888
  return {
899
-
900
- // Support: IE <11 only
901
- // Strip any hash that exists to prevent errors with the Ajax request
902
- url: anchor.attr( "href" ).replace( /#.*$/, "" ),
889
+ url: anchor.attr( "href" ),
903
890
  beforeSend: function( jqXHR, settings ) {
904
891
  return that._trigger( "beforeLoad", event,
905
892
  $.extend( { jqXHR: jqXHR, ajaxSettings: settings }, eventData ) );
@@ -909,13 +896,13 @@ $.widget( "ui.tabs", {
909
896
 
910
897
  _getPanelForTab: function( tab ) {
911
898
  var id = $( tab ).attr( "aria-controls" );
912
- return this.element.find( this._sanitizeSelector( "#" + id ) );
899
+ return this.element.find( "#" + CSS.escape( id ) );
913
900
  }
914
901
  } );
915
902
 
916
903
  // DEPRECATED
917
904
  // TODO: Switch return back to widget declaration at top of file when this is removed
918
- if ( $.uiBackCompat !== false ) {
905
+ if ( $.uiBackCompat === true ) {
919
906
 
920
907
  // Backcompat for ui-tab class (now ui-tabs-tab)
921
908
  $.widget( "ui.tabs", $.ui.tabs, {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.0
4
+ version: 3.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charles Maresh
@@ -482,14 +482,10 @@ files:
482
482
  - vendor/assets/javascripts/jquery-ui/disable-selection.js
483
483
  - vendor/assets/javascripts/jquery-ui/focusable.js
484
484
  - vendor/assets/javascripts/jquery-ui/form-reset-mixin.js
485
- - vendor/assets/javascripts/jquery-ui/form.js
486
- - vendor/assets/javascripts/jquery-ui/ie.js
487
485
  - vendor/assets/javascripts/jquery-ui/keycode.js
488
486
  - vendor/assets/javascripts/jquery-ui/labels.js
489
487
  - vendor/assets/javascripts/jquery-ui/plugin.js
490
488
  - vendor/assets/javascripts/jquery-ui/position.js
491
- - vendor/assets/javascripts/jquery-ui/safe-active-element.js
492
- - vendor/assets/javascripts/jquery-ui/safe-blur.js
493
489
  - vendor/assets/javascripts/jquery-ui/scroll-parent.js
494
490
  - vendor/assets/javascripts/jquery-ui/tabbable.js
495
491
  - vendor/assets/javascripts/jquery-ui/unique-id.js
@@ -524,14 +520,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
524
520
  requirements:
525
521
  - - ">="
526
522
  - !ruby/object:Gem::Version
527
- version: '2.6'
523
+ version: '3.0'
528
524
  required_rubygems_version: !ruby/object:Gem::Requirement
529
525
  requirements:
530
526
  - - ">="
531
527
  - !ruby/object:Gem::Version
532
528
  version: '0'
533
529
  requirements: []
534
- rubygems_version: 3.6.9
530
+ rubygems_version: 4.0.6
535
531
  specification_version: 4
536
532
  summary: Active Admin is a Ruby on Rails plugin for generating administration style
537
533
  interfaces. It abstracts common business application patterns to make it simple
@@ -1,25 +0,0 @@
1
- //= require jquery-ui/version
2
-
3
- ( function( factory ) {
4
- "use strict";
5
-
6
- if ( typeof define === "function" && define.amd ) {
7
-
8
- // AMD. Register as an anonymous module.
9
- define( [ "jquery", "./version" ], factory );
10
- } else {
11
-
12
- // Browser globals
13
- factory( jQuery );
14
- }
15
- } )( function( $ ) {
16
- "use strict";
17
-
18
- // Support: IE8 Only
19
- // IE8 does not support the form attribute and when it is supplied. It overwrites the form prop
20
- // with a string, so we need to find the proper form.
21
- return $.fn._form = function() {
22
- return typeof this[ 0 ].form === "string" ? this.closest( "form" ) : $( this[ 0 ].form );
23
- };
24
-
25
- } );
@@ -1,20 +0,0 @@
1
- //= require jquery-ui/version
2
-
3
- ( function( factory ) {
4
- "use strict";
5
-
6
- if ( typeof define === "function" && define.amd ) {
7
-
8
- // AMD. Register as an anonymous module.
9
- define( [ "jquery", "./version" ], factory );
10
- } else {
11
-
12
- // Browser globals
13
- factory( jQuery );
14
- }
15
- } )( function( $ ) {
16
- "use strict";
17
-
18
- // This file is deprecated
19
- return $.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
20
- } );
@@ -1,46 +0,0 @@
1
- //= require jquery-ui/version
2
-
3
- ( function( factory ) {
4
- "use strict";
5
-
6
- if ( typeof define === "function" && define.amd ) {
7
-
8
- // AMD. Register as an anonymous module.
9
- define( [ "jquery", "./version" ], factory );
10
- } else {
11
-
12
- // Browser globals
13
- factory( jQuery );
14
- }
15
- } )( function( $ ) {
16
- "use strict";
17
-
18
- return $.ui.safeActiveElement = function( document ) {
19
- var activeElement;
20
-
21
- // Support: IE 9 only
22
- // IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
23
- try {
24
- activeElement = document.activeElement;
25
- } catch ( error ) {
26
- activeElement = document.body;
27
- }
28
-
29
- // Support: IE 9 - 11 only
30
- // IE may return null instead of an element
31
- // Interestingly, this only seems to occur when NOT in an iframe
32
- if ( !activeElement ) {
33
- activeElement = document.body;
34
- }
35
-
36
- // Support: IE 11 only
37
- // IE11 returns a seemingly empty object in some cases when accessing
38
- // document.activeElement from an <iframe>
39
- if ( !activeElement.nodeName ) {
40
- activeElement = document.body;
41
- }
42
-
43
- return activeElement;
44
- };
45
-
46
- } );
@@ -1,27 +0,0 @@
1
- //= require jquery-ui/version
2
-
3
- ( function( factory ) {
4
- "use strict";
5
-
6
- if ( typeof define === "function" && define.amd ) {
7
-
8
- // AMD. Register as an anonymous module.
9
- define( [ "jquery", "./version" ], factory );
10
- } else {
11
-
12
- // Browser globals
13
- factory( jQuery );
14
- }
15
- } )( function( $ ) {
16
- "use strict";
17
-
18
- return $.ui.safeBlur = function( element ) {
19
-
20
- // Support: IE9 - 10 only
21
- // If the <body> is blurred, IE will switch windows, see #9420
22
- if ( element && element.nodeName.toLowerCase() !== "body" ) {
23
- $( element ).trigger( "blur" );
24
- }
25
- };
26
-
27
- } );