Socket
Socket
Sign inDemoInstall

jquery-ujs

Package Overview
Dependencies
1
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.2 to 1.2.3

4

package.json
{
"name": "jquery-ujs",
"version": "1.2.2",
"version": "1.2.3",
"description": "Unobtrusive scripting adapter for jQuery",

@@ -23,5 +23,5 @@ "main": "src/rails.js",

"homepage": "https://github.com/rails/jquery-ujs#readme",
"dependencies": {
"peerDependencies": {
"jquery": ">=1.8.0"
}
}

@@ -50,2 +50,17 @@ Unobtrusive scripting adapter for jQuery

Installation using Rails and Webpacker
------------
If you're using [webpacker](https://github.com/rails/webpacker) (introduced in [Rails 5.1](http://edgeguides.rubyonrails.org/5_1_release_notes.html#optional-webpack-support)) to manage JavaScript assets, then you can add the jquery-ujs npm package to your project using the [yarn](https://yarnpkg.com/en/) CLI.
```
$ yarn add jquery-ujs
```
Then, from any of your included files (e.g. `app/javascript/packs/application.js`, or from a JavaScript file imported by such a pack), you need only import the package for jquery-ujs to be initialized:
```js
import {} from 'jquery-ujs'
```
Installation using Bower

@@ -52,0 +67,0 @@ ------------

@@ -1,2 +0,2 @@

(function($, undefined) {
/* jshint node: true */

@@ -13,6 +13,9 @@ /**

(function() {
'use strict';
var jqueryUjsInit = function($, undefined) {
// Cut down on the number of issues from people inadvertently including jquery_ujs twice
// by detecting and raising an error when it happens.
'use strict';
if ( $.rails !== undefined ) {

@@ -37,6 +40,6 @@ $.error('jquery-ujs has already been loaded!');

// Form elements bound by jquery-ujs
formSubmitSelector: 'form',
formSubmitSelector: 'form:not([data-turbo=true])',
// Form input elements bound by jquery-ujs
formInputClickSelector: 'form input[type=submit], form input[type=image], form button[type=submit], form button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])',
formInputClickSelector: 'form:not([data-turbo=true]) input[type=submit], form:not([data-turbo=true]) input[type=image], form:not([data-turbo=true]) button[type=submit], form:not([data-turbo=true]) button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])',

@@ -377,3 +380,3 @@ // Form input elements disabled during form submission

element.bind('click.railsDisable', function(e) { // prevent further clicking
element.on('click.railsDisable', function(e) { // prevent further clicking
return rails.stopEverything(e);

@@ -390,3 +393,3 @@ });

}
element.unbind('click.railsDisable'); // enable element
element.off('click.railsDisable'); // enable element
element.removeData('ujs:disabled');

@@ -559,2 +562,9 @@ }

})( jQuery );
};
if (window.jQuery) {
jqueryUjsInit(jQuery);
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = jqueryUjsInit;
}
})();
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc