fixed jQuer dprecations

This commit is contained in:
Micha 2025-03-03 11:56:17 +01:00
parent 2d450fe257
commit 323de3b9e3
24 changed files with 6951 additions and 1299 deletions

Binary file not shown.

18
dist/README.md vendored

@ -1,3 +1,17 @@
This is a fork of: https://github.com/vitalets/x-editable
# X-Editable (Bootstrap 5 Fork)
I needed to work with Bootstrap 5
This project is a fork of [vitalets/x-editable](https://github.com/vitalets/x-editable), adapted to work with **Bootstrap 5** while maintaining compatibility with jQuery.
## Why This Fork?
The original **x-editable** library was designed for Bootstrap 3 and has not been actively maintained. This fork modernizes the codebase and updates it to support:
- **Bootstrap 5**
- **Bootstrap Icons** (replacing Glyphicons)
NOTE: This repo has not yet been completely tested and is not available via NPM right now!
Later:
### Using npm:
```sh
npm install x-editable-bootstrap5
```

Binary file not shown.

@ -1,7 +1,7 @@
/*! X-editable - v1.5.1
* In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
* http://github.com/vitalets/x-editable
* Copyright (c) 2025 Vitaliy Potapov; Licensed MIT */
/*! X-editable - v1.5.1_1
* A maintained fork of x-editable for Bootstrap 5 support.
* https://git.24unix.net/tracer/x-editable
* Copyright (c) 2025 Micha Espey; Licensed MIT */
.editableform {
margin-bottom: 0; /* overwrites bootstrap margin */
}

@ -1,7 +1,7 @@
/*! X-editable - v1.5.1
* In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
* http://github.com/vitalets/x-editable
* Copyright (c) 2025 Vitaliy Potapov; Licensed MIT */
/*! X-editable - v1.5.1_1
* A maintained fork of x-editable for Bootstrap 5 support.
* https://git.24unix.net/tracer/x-editable
* Copyright (c) 2025 Micha Espey; Licensed MIT */
/**
Form with single input element, two buttons and two states: normal/loading.
Applied as jQuery method to DIV tag (not to form tag!). This is because form can be in loading state when spinner shown.
@ -2610,7 +2610,7 @@ List - abstract class for inputs that have source option loaded from js array or
}
//if allready loaded just call success
if(this.options.sourceCache && $.isArray(this.sourceData)) {
if(this.options.sourceCache && Array.isArray(this.sourceData)) {
success.call(this);
return;
}
@ -2702,7 +2702,7 @@ List - abstract class for inputs that have source option loaded from js array or
} else { //options as json/array
this.sourceData = this.makeArray(source);
if($.isArray(this.sourceData)) {
if(Array.isArray(this.sourceData)) {
this.doPrepend();
success.call(this);
} else {
@ -2761,7 +2761,7 @@ List - abstract class for inputs that have source option loaded from js array or
return null;
}
if($.isArray(data)) { //array
if(Array.isArray(data)) { //array
/*
function to iterate inside item of array if item is object.
Caclulates count of keys in item and store in obj.

File diff suppressed because one or more lines are too long

@ -1,7 +1,7 @@
/*! X-editable - v1.5.1
* In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
* http://github.com/vitalets/x-editable
* Copyright (c) 2025 Vitaliy Potapov; Licensed MIT */
/*! X-editable - v1.5.1_1
* A maintained fork of x-editable for Bootstrap 5 support.
* https://git.24unix.net/tracer/x-editable
* Copyright (c) 2025 Micha Espey; Licensed MIT */
.editableform {
margin-bottom: 0; /* overwrites bootstrap margin */
}

@ -1,7 +1,7 @@
/*! X-editable - v1.5.1
* In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
* http://github.com/vitalets/x-editable
* Copyright (c) 2025 Vitaliy Potapov; Licensed MIT */
/*! X-editable - v1.5.1_1
* A maintained fork of x-editable for Bootstrap 5 support.
* https://git.24unix.net/tracer/x-editable
* Copyright (c) 2025 Micha Espey; Licensed MIT */
/**
Form with single input element, two buttons and two states: normal/loading.
Applied as jQuery method to DIV tag (not to form tag!). This is because form can be in loading state when spinner shown.
@ -2610,7 +2610,7 @@ List - abstract class for inputs that have source option loaded from js array or
}
//if allready loaded just call success
if(this.options.sourceCache && $.isArray(this.sourceData)) {
if(this.options.sourceCache && Array.isArray(this.sourceData)) {
success.call(this);
return;
}
@ -2702,7 +2702,7 @@ List - abstract class for inputs that have source option loaded from js array or
} else { //options as json/array
this.sourceData = this.makeArray(source);
if($.isArray(this.sourceData)) {
if(Array.isArray(this.sourceData)) {
this.doPrepend();
success.call(this);
} else {
@ -2761,7 +2761,7 @@ List - abstract class for inputs that have source option loaded from js array or
return null;
}
if($.isArray(data)) { //array
if(Array.isArray(data)) { //array
/*
function to iterate inside item of array if item is object.
Caclulates count of keys in item and store in obj.

File diff suppressed because one or more lines are too long

@ -1,7 +1,7 @@
/*! X-editable - v1.5.1
* In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
* http://github.com/vitalets/x-editable
* Copyright (c) 2025 Vitaliy Potapov; Licensed MIT */
/*! X-editable - v1.5.1_1
* A maintained fork of x-editable for Bootstrap 5 support.
* https://git.24unix.net/tracer/x-editable
* Copyright (c) 2025 Micha Espey; Licensed MIT */
.editableform {
margin-bottom: 0; /* overwrites bootstrap margin */
}

@ -1 +0,0 @@
!function(t){const n=t.fn.editableform.Constructor.prototype.initInput;t.extend(t.fn.editableform.Constructor.prototype,{initInput:function(){n.apply(this);const i=null===this.input.options.inputclass||!1===this.input.options.inputclass,s="input-sm",e="text,select,textarea,password,email,url,tel,number,range,time,typeaheadjs".split(",");~t.inArray(this.input.type,e)&&(this.input.$input.addClass("form-control editable"),i&&(this.input.options.inputclass=s,this.input.$input.addClass(s))),"select"===this.input.type&&setTimeout((()=>{this.input.$input.focus().click()}),50);const o=this.$form.find(".editable-buttons"),l=i?[s]:this.input.options.inputclass.split(" ");for(let t=0;t<l.length;t++)"input-lg"===l[t].toLowerCase()&&o.find("button").removeClass("btn-sm").addClass("btn-lg")}}),t.fn.editableform.buttons='<button type="submit" class="btn btn-primary btn-sm editable-submit"><i class="bi bi-check"></i></button><button type="button" class="btn btn-secondary btn-sm editable-cancel"><i class="bi bi-x"></i></button>',t.fn.editableform.errorGroupClass="has-error",t.fn.editableform.errorBlockClass=null,t.fn.editableform.engine="bs3"}(window.jQuery);

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

1189
dist/bundle.js vendored

File diff suppressed because one or more lines are too long

@ -1,7 +1,7 @@
/*! X-editable - v1.5.1
* In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
* http://github.com/vitalets/x-editable
* Copyright (c) 2025 Vitaliy Potapov; Licensed MIT */
/*! X-editable - v1.5.1_1
* A maintained fork of x-editable for Bootstrap 5 support.
* https://git.24unix.net/tracer/x-editable
* Copyright (c) 2025 Micha Espey; Licensed MIT */
.editableform {
margin-bottom: 0; /* overwrites bootstrap margin */
}

@ -1,7 +1,7 @@
/*! X-editable - v1.5.1
* In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
* http://github.com/vitalets/x-editable
* Copyright (c) 2025 Vitaliy Potapov; Licensed MIT */
/*! X-editable - v1.5.1_1
* A maintained fork of x-editable for Bootstrap 5 support.
* https://git.24unix.net/tracer/x-editable
* Copyright (c) 2025 Micha Espey; Licensed MIT */
/**
Form with single input element, two buttons and two states: normal/loading.
Applied as jQuery method to DIV tag (not to form tag!). This is because form can be in loading state when spinner shown.
@ -2610,7 +2610,7 @@ List - abstract class for inputs that have source option loaded from js array or
}
//if allready loaded just call success
if(this.options.sourceCache && $.isArray(this.sourceData)) {
if(this.options.sourceCache && Array.isArray(this.sourceData)) {
success.call(this);
return;
}
@ -2702,7 +2702,7 @@ List - abstract class for inputs that have source option loaded from js array or
} else { //options as json/array
this.sourceData = this.makeArray(source);
if($.isArray(this.sourceData)) {
if(Array.isArray(this.sourceData)) {
this.doPrepend();
success.call(this);
} else {
@ -2761,7 +2761,7 @@ List - abstract class for inputs that have source option loaded from js array or
return null;
}
if($.isArray(data)) { //array
if(Array.isArray(data)) { //array
/*
function to iterate inside item of array if item is object.
Caclulates count of keys in item and store in obj.

File diff suppressed because one or more lines are too long

@ -1,7 +1,7 @@
/*! X-editable - v1.5.1
* In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
* http://github.com/vitalets/x-editable
* Copyright (c) 2025 Vitaliy Potapov; Licensed MIT */
/*! X-editable - v1.5.1_1
* A maintained fork of x-editable for Bootstrap 5 support.
* https://git.24unix.net/tracer/x-editable
* Copyright (c) 2025 Micha Espey; Licensed MIT */
.editableform {
margin-bottom: 0; /* overwrites bootstrap margin */
}

@ -1,7 +1,7 @@
/*! X-editable - v1.5.1
* In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
* http://github.com/vitalets/x-editable
* Copyright (c) 2025 Vitaliy Potapov; Licensed MIT */
/*! X-editable - v1.5.1_1
* A maintained fork of x-editable for Bootstrap 5 support.
* https://git.24unix.net/tracer/x-editable
* Copyright (c) 2025 Micha Espey; Licensed MIT */
/**
Form with single input element, two buttons and two states: normal/loading.
Applied as jQuery method to DIV tag (not to form tag!). This is because form can be in loading state when spinner shown.
@ -2610,7 +2610,7 @@ List - abstract class for inputs that have source option loaded from js array or
}
//if allready loaded just call success
if(this.options.sourceCache && $.isArray(this.sourceData)) {
if(this.options.sourceCache && Array.isArray(this.sourceData)) {
success.call(this);
return;
}
@ -2702,7 +2702,7 @@ List - abstract class for inputs that have source option loaded from js array or
} else { //options as json/array
this.sourceData = this.makeArray(source);
if($.isArray(this.sourceData)) {
if(Array.isArray(this.sourceData)) {
this.doPrepend();
success.call(this);
} else {
@ -2761,7 +2761,7 @@ List - abstract class for inputs that have source option loaded from js array or
return null;
}
if($.isArray(data)) { //array
if(Array.isArray(data)) { //array
/*
function to iterate inside item of array if item is object.
Caclulates count of keys in item and store in obj.

File diff suppressed because one or more lines are too long

@ -2,7 +2,7 @@
"name": "@24unix/x-editable",
"title": "X-editable",
"description": "A maintained fork of x-editable for Bootstrap 5 support.",
"version": "1.5.1",
"version": "1.5.1_1",
"homepage": "https://git.24unix.net/tracer/x-editable",
"author": {
"name": "Micha Espey",
@ -61,4 +61,4 @@
"in-place-editing",
"x-editable"
]
}
}

@ -70,7 +70,7 @@ List - abstract class for inputs that have source option loaded from js array or
}
//if allready loaded just call success
if(this.options.sourceCache && $.isArray(this.sourceData)) {
if(this.options.sourceCache && Array.isArray(this.sourceData)) {
success.call(this);
return;
}
@ -162,7 +162,7 @@ List - abstract class for inputs that have source option loaded from js array or
} else { //options as json/array
this.sourceData = this.makeArray(source);
if($.isArray(this.sourceData)) {
if(Array.isArray(this.sourceData)) {
this.doPrepend();
success.call(this);
} else {
@ -221,7 +221,7 @@ List - abstract class for inputs that have source option loaded from js array or
return null;
}
if($.isArray(data)) { //array
if(Array.isArray(data)) { //array
/*
function to iterate inside item of array if item is object.
Caclulates count of keys in item and store in obj.

@ -476,7 +476,7 @@ the specific language governing permissions and limitations under the Apache Lic
tmp,
text = function (item) { return ""+item.text; }; // function used to retrieve the text portion of a data item that is matched against the search
if ($.isArray(data)) {
if (Array.isArray(data)) {
tmp = data;
data = { results: tmp };
}
@ -909,7 +909,7 @@ the specific language governing permissions and limitations under the Apache Lic
opts.id = function (e) { return e[idKey]; };
}
if ($.isArray(opts.element.data("select2Tags"))) {
if (Array.isArray(opts.element.data("select2Tags"))) {
if ("tags" in opts) {
throw "tags specified as both an attribute 'data-select2-tags' and in options of Select2 " + opts.element.attr("id");
}
@ -1586,7 +1586,7 @@ the specific language governing permissions and limitations under the Apache Lic
var maxSelSize = this.getMaximumSelectionSize();
if (maxSelSize >=1) {
data = this.data();
if ($.isArray(data) && data.length >= maxSelSize && checkFormatter(opts.formatSelectionTooBig, "formatSelectionTooBig")) {
if (Array.isArray(data) && data.length >= maxSelSize && checkFormatter(opts.formatSelectionTooBig, "formatSelectionTooBig")) {
render("<li class='select2-selection-limit'>" + opts.formatSelectionTooBig(maxSelSize) + "</li>");
return;
}

@ -1,28 +1,46 @@
const path = require('path');
const webpack = require('webpack');
const path = require("path");
module.exports = {
entry: './test.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
},
module: {
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
module.exports = [
// CommonJS Build
{
entry: "./src/editable-form/editable-form-bootstrap5.js",
output: {
path: path.resolve(__dirname, "dist/bootstrap5-editable/js"),
filename: "bootstrap-editable.js",
library: {
type: "commonjs2"
}
]
},
module: {
rules: [
{
test: /\.css$/i,
use: ["style-loader", "css-loader"],
}
]
}
},
mode: 'development',
plugins: [
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery',
'window.$': 'jquery'
})
]
};
// ES Module Build
{
entry: "./src/editable-form/editable-form-bootstrap5.js",
output: {
path: path.resolve(__dirname, "dist/bootstrap5-editable/js"),
filename: "bootstrap-editable.esm.js",
library: {
type: "module"
}
},
experiments: {
outputModule: true, // Ensures Webpack treats this as an ES module
},
module: {
rules: [
{
test: /\.css$/i,
use: ["style-loader", "css-loader"],
}
]
}
}
];