Skip to content

Commit

Permalink
Include jquery-ui widgets we use
Browse files Browse the repository at this point in the history
and remove the jquery-ui-rails gem, because it does not
have the latest jquery-ui with security fixes.

(cherry picked from commit 9ae02ef)
  • Loading branch information
tvdeyen committed Oct 24, 2023
1 parent 0328963 commit 155914e
Show file tree
Hide file tree
Showing 13 changed files with 4,143 additions and 2 deletions.
1 change: 0 additions & 1 deletion alchemy_cms.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ Gem::Specification.new do |gem|
gem.add_runtime_dependency "handlebars_assets", ["~> 0.23"]
gem.add_runtime_dependency "importmap-rails", ["~> 1.2", ">= 1.2.1"]
gem.add_runtime_dependency "jquery-rails", ["~> 4.0", ">= 4.0.4"]
gem.add_runtime_dependency "jquery-ui-rails", ["~> 6.0"]
gem.add_runtime_dependency "kaminari", ["~> 1.1"]
gem.add_runtime_dependency "originator", ["~> 3.1"]
gem.add_runtime_dependency "ransack", [">= 1.8", "< 5.0"]
Expand Down
1 change: 0 additions & 1 deletion lib/alchemy_cms.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
require "handlebars_assets"
require "importmap-rails"
require "jquery-rails"
require "jquery-ui-rails"
require "kaminari"
require "non_stupid_digest_assets"
require "ransack"
Expand Down
45 changes: 45 additions & 0 deletions vendor/assets/javascripts/jquery-ui/data.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
//= require jquery-ui/version

/*!
* jQuery UI :data 1.13.0
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*/

//>>label: :data Selector
//>>group: Core
//>>description: Selects elements which have data stored under the specified key.
//>>docs: http://api.jqueryui.com/data-selector/

( function( factory ) {
"use strict";

if ( typeof define === "function" && define.amd ) {

// AMD. Register as an anonymous module.
define( [ "jquery", "./version" ], factory );
} else {

// Browser globals
factory( jQuery );
}
} )( function( $ ) {
"use strict";

return $.extend( $.expr.pseudos, {
data: $.expr.createPseudo ?
$.expr.createPseudo( function( dataName ) {
return function( elem ) {
return !!$.data( elem, dataName );
};
} ) :

// Support: jQuery <1.8
function( elem, i, match ) {
return !!$.data( elem, match[ 3 ] );
}
} );
} );
20 changes: 20 additions & 0 deletions vendor/assets/javascripts/jquery-ui/ie.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//= require jquery-ui/version

( function( factory ) {
"use strict";

if ( typeof define === "function" && define.amd ) {

// AMD. Register as an anonymous module.
define( [ "jquery", "./version" ], factory );
} else {

// Browser globals
factory( jQuery );
}
} )( function( $ ) {
"use strict";

// This file is deprecated
return $.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
} );
49 changes: 49 additions & 0 deletions vendor/assets/javascripts/jquery-ui/plugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
//= require jquery-ui/version

( function( factory ) {
"use strict";

if ( typeof define === "function" && define.amd ) {

// AMD. Register as an anonymous module.
define( [ "jquery", "./version" ], factory );
} else {

// Browser globals
factory( jQuery );
}
} )( function( $ ) {
"use strict";

// $.ui.plugin is deprecated. Use $.widget() extensions instead.
return $.ui.plugin = {
add: function( module, option, set ) {
var i,
proto = $.ui[ module ].prototype;
for ( i in set ) {
proto.plugins[ i ] = proto.plugins[ i ] || [];
proto.plugins[ i ].push( [ option, set[ i ] ] );
}
},
call: function( instance, name, args, allowDisconnected ) {
var i,
set = instance.plugins[ name ];

if ( !set ) {
return;
}

if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode ||
instance.element[ 0 ].parentNode.nodeType === 11 ) ) {
return;
}

for ( i = 0; i < set.length; i++ ) {
if ( instance.options[ set[ i ][ 0 ] ] ) {
set[ i ][ 1 ].apply( instance.element, args );
}
}
}
};

} );
46 changes: 46 additions & 0 deletions vendor/assets/javascripts/jquery-ui/safe-active-element.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
//= require jquery-ui/version

( function( factory ) {
"use strict";

if ( typeof define === "function" && define.amd ) {

// AMD. Register as an anonymous module.
define( [ "jquery", "./version" ], factory );
} else {

// Browser globals
factory( jQuery );
}
} )( function( $ ) {
"use strict";

return $.ui.safeActiveElement = function( document ) {
var activeElement;

// Support: IE 9 only
// IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
try {
activeElement = document.activeElement;
} catch ( error ) {
activeElement = document.body;
}

// Support: IE 9 - 11 only
// IE may return null instead of an element
// Interestingly, this only seems to occur when NOT in an iframe
if ( !activeElement ) {
activeElement = document.body;
}

// Support: IE 11 only
// IE11 returns a seemingly empty object in some cases when accessing
// document.activeElement from an <iframe>
if ( !activeElement.nodeName ) {
activeElement = document.body;
}

return activeElement;
};

} );
27 changes: 27 additions & 0 deletions vendor/assets/javascripts/jquery-ui/safe-blur.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//= require jquery-ui/version

( function( factory ) {
"use strict";

if ( typeof define === "function" && define.amd ) {

// AMD. Register as an anonymous module.
define( [ "jquery", "./version" ], factory );
} else {

// Browser globals
factory( jQuery );
}
} )( function( $ ) {
"use strict";

return $.ui.safeBlur = function( element ) {

// Support: IE9 - 10 only
// If the <body> is blurred, IE will switch windows, see #9420
if ( element && element.nodeName.toLowerCase() !== "body" ) {
$( element ).trigger( "blur" );
}
};

} );
50 changes: 50 additions & 0 deletions vendor/assets/javascripts/jquery-ui/scroll-parent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
//= require jquery-ui/version

/*!
* jQuery UI Scroll Parent 1.13.0
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*/

//>>label: scrollParent
//>>group: Core
//>>description: Get the closest ancestor element that is scrollable.
//>>docs: http://api.jqueryui.com/scrollParent/

( function( factory ) {
"use strict";

if ( typeof define === "function" && define.amd ) {

// AMD. Register as an anonymous module.
define( [ "jquery", "./version" ], factory );
} else {

// Browser globals
factory( jQuery );
}
} )( function( $ ) {
"use strict";

return $.fn.scrollParent = function( includeHidden ) {
var position = this.css( "position" ),
excludeStaticParent = position === "absolute",
overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,
scrollParent = this.parents().filter( function() {
var parent = $( this );
if ( excludeStaticParent && parent.css( "position" ) === "static" ) {
return false;
}
return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) +
parent.css( "overflow-x" ) );
} ).eq( 0 );

return position === "fixed" || !scrollParent.length ?
$( this[ 0 ].ownerDocument || document ) :
scrollParent;
};

} );
20 changes: 20 additions & 0 deletions vendor/assets/javascripts/jquery-ui/version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
( function( factory ) {
"use strict";

if ( typeof define === "function" && define.amd ) {

// AMD. Register as an anonymous module.
define( [ "jquery" ], factory );
} else {

// Browser globals
factory( jQuery );
}
} )( function( $ ) {
"use strict";

$.ui = $.ui || {};

return $.ui.version = "1.13.0";

} );
Loading

0 comments on commit 155914e

Please sign in to comment.