fixed jQuery dprecations

This commit is contained in:
Micha 2025-03-03 12:53:00 +01:00
parent 30f1b9a6a9
commit af31afd34b
20 changed files with 63 additions and 63 deletions

@ -521,7 +521,7 @@ Editableform is linked with one of input types, e.g. 'text', 'select' etc.
@default null
@example
validate: function(value) {
if($.trim(value) == '') {
if(value.trim() == '') {
return 'This field is required';
}
}
@ -1502,7 +1502,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
//set value from settings or by element's text
if (this.options.value === undefined || this.options.value === null) {
this.value = this.input.html2value($.trim(this.$element.html()));
this.value = this.input.html2value(this.$element.html().trim());
isValueByText = true;
} else {
/*
@ -1564,7 +1564,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
break;
case 'auto':
//if element text is empty and value is defined and value not generated by text --> run autotext
doAutotext = !$.trim(this.$element.text()).length && this.value !== null && this.value !== undefined && !isValueByText;
doAutotext = !(this.$element.text().trim()).length && this.value !== null && this.value !== undefined && !isValueByText;
break;
default:
doAutotext = false;
@ -1696,7 +1696,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
//set option(s) by object
if(key && typeof key === 'object') {
$.each(key, $.proxy(function(k, v){
this.option($.trim(k), v);
this.option(k.triim(), v);
}, this));
return;
}
@ -1749,7 +1749,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
if(typeof(this.input.isEmpty) === 'function') {
this.isEmpty = this.input.isEmpty(this.$element);
} else {
this.isEmpty = $.trim(this.$element.html()) === '';
this.isEmpty = this.$element.html().trim() === '';
}
}
@ -2371,7 +2371,7 @@ To create your own input you can inherit from this class.
@param {DOMElement} element
**/
value2html: function(value, element) {
$(element)[this.options.escape ? 'text' : 'html']($.trim(value));
$(element)[this.options.escape ? 'text' : 'html'](value.trim());
},
/**
@ -3282,7 +3282,7 @@ $(function(){
str2value: function(str) {
var reg, value = null;
if(typeof str === 'string' && str.length) {
reg = new RegExp('\\s*'+$.trim(this.options.separator)+'\\s*');
reg = new RegExp('\\s*'+this.options.separator.trim()+'\\s*');
value = str.split(reg);
} else if(Array.isArray(str)) {
value = str;
@ -3856,7 +3856,7 @@ $(function(){
}
val = str.split(separator);
for (i = 0, l = val.length; i < l; i = i + 1) {
val[i] = $.trim(val[i]);
val[i] = val[i].trim();
}
return val;

File diff suppressed because one or more lines are too long

@ -521,7 +521,7 @@ Editableform is linked with one of input types, e.g. 'text', 'select' etc.
@default null
@example
validate: function(value) {
if($.trim(value) == '') {
if(value.trim() == '') {
return 'This field is required';
}
}
@ -1502,7 +1502,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
//set value from settings or by element's text
if (this.options.value === undefined || this.options.value === null) {
this.value = this.input.html2value($.trim(this.$element.html()));
this.value = this.input.html2value(this.$element.html().trim());
isValueByText = true;
} else {
/*
@ -1564,7 +1564,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
break;
case 'auto':
//if element text is empty and value is defined and value not generated by text --> run autotext
doAutotext = !$.trim(this.$element.text()).length && this.value !== null && this.value !== undefined && !isValueByText;
doAutotext = !(this.$element.text().trim()).length && this.value !== null && this.value !== undefined && !isValueByText;
break;
default:
doAutotext = false;
@ -1696,7 +1696,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
//set option(s) by object
if(key && typeof key === 'object') {
$.each(key, $.proxy(function(k, v){
this.option($.trim(k), v);
this.option(k.triim(), v);
}, this));
return;
}
@ -1749,7 +1749,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
if(typeof(this.input.isEmpty) === 'function') {
this.isEmpty = this.input.isEmpty(this.$element);
} else {
this.isEmpty = $.trim(this.$element.html()) === '';
this.isEmpty = this.$element.html().trim() === '';
}
}
@ -2371,7 +2371,7 @@ To create your own input you can inherit from this class.
@param {DOMElement} element
**/
value2html: function(value, element) {
$(element)[this.options.escape ? 'text' : 'html']($.trim(value));
$(element)[this.options.escape ? 'text' : 'html'](value.trim());
},
/**
@ -3282,7 +3282,7 @@ $(function(){
str2value: function(str) {
var reg, value = null;
if(typeof str === 'string' && str.length) {
reg = new RegExp('\\s*'+$.trim(this.options.separator)+'\\s*');
reg = new RegExp('\\s*'+this.options.separator.trim()+'\\s*');
value = str.split(reg);
} else if(Array.isArray(str)) {
value = str;
@ -3856,7 +3856,7 @@ $(function(){
}
val = str.split(separator);
for (i = 0, l = val.length; i < l; i = i + 1) {
val[i] = $.trim(val[i]);
val[i] = val[i].trim();
}
return val;

File diff suppressed because one or more lines are too long

@ -521,7 +521,7 @@ Editableform is linked with one of input types, e.g. 'text', 'select' etc.
@default null
@example
validate: function(value) {
if($.trim(value) == '') {
if(value.trim() == '') {
return 'This field is required';
}
}
@ -1502,7 +1502,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
//set value from settings or by element's text
if (this.options.value === undefined || this.options.value === null) {
this.value = this.input.html2value($.trim(this.$element.html()));
this.value = this.input.html2value(this.$element.html().trim());
isValueByText = true;
} else {
/*
@ -1564,7 +1564,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
break;
case 'auto':
//if element text is empty and value is defined and value not generated by text --> run autotext
doAutotext = !$.trim(this.$element.text()).length && this.value !== null && this.value !== undefined && !isValueByText;
doAutotext = !(this.$element.text().trim()).length && this.value !== null && this.value !== undefined && !isValueByText;
break;
default:
doAutotext = false;
@ -1696,7 +1696,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
//set option(s) by object
if(key && typeof key === 'object') {
$.each(key, $.proxy(function(k, v){
this.option($.trim(k), v);
this.option(k.triim(), v);
}, this));
return;
}
@ -1749,7 +1749,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
if(typeof(this.input.isEmpty) === 'function') {
this.isEmpty = this.input.isEmpty(this.$element);
} else {
this.isEmpty = $.trim(this.$element.html()) === '';
this.isEmpty = this.$element.html().trim() === '';
}
}
@ -2371,7 +2371,7 @@ To create your own input you can inherit from this class.
@param {DOMElement} element
**/
value2html: function(value, element) {
$(element)[this.options.escape ? 'text' : 'html']($.trim(value));
$(element)[this.options.escape ? 'text' : 'html'](value.trim());
},
/**
@ -3282,7 +3282,7 @@ $(function(){
str2value: function(str) {
var reg, value = null;
if(typeof str === 'string' && str.length) {
reg = new RegExp('\\s*'+$.trim(this.options.separator)+'\\s*');
reg = new RegExp('\\s*'+this.options.separator.trim()+'\\s*');
value = str.split(reg);
} else if(Array.isArray(str)) {
value = str;
@ -3856,7 +3856,7 @@ $(function(){
}
val = str.split(separator);
for (i = 0, l = val.length; i < l; i = i + 1) {
val[i] = $.trim(val[i]);
val[i] = val[i].trim();
}
return val;

File diff suppressed because one or more lines are too long

@ -124,10 +124,10 @@
};
},
tokenizeQuery: function(str) {
return $.trim(str).toLowerCase().split(/[\s]+/);
return str.trim().toLowerCase().split(/[\s]+/);
},
tokenizeText: function(str) {
return $.trim(str).toLowerCase().split(/[\s\-_]+/);
return str.trim().toLowerCase().split(/[\s\-_]+/);
},
getProtocol: function() {
return location.protocol;

@ -90,9 +90,9 @@ $(function(){
},
isEmpty: function($element) {
if($.trim($element.html()) === '') {
if($element.html().trim() === '') {
return true;
} else if($.trim($element.text()) !== '') {
} else if($element.text().trim() !== '') {
return false;
} else {
//e.g. '<img>', '<br>', '<p></p>'

@ -521,7 +521,7 @@ Editableform is linked with one of input types, e.g. 'text', 'select' etc.
@default null
@example
validate: function(value) {
if($.trim(value) == '') {
if(value.trim() == '') {
return 'This field is required';
}
}
@ -1502,7 +1502,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
//set value from settings or by element's text
if (this.options.value === undefined || this.options.value === null) {
this.value = this.input.html2value($.trim(this.$element.html()));
this.value = this.input.html2value(this.$element.html().trim());
isValueByText = true;
} else {
/*
@ -1564,7 +1564,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
break;
case 'auto':
//if element text is empty and value is defined and value not generated by text --> run autotext
doAutotext = !$.trim(this.$element.text()).length && this.value !== null && this.value !== undefined && !isValueByText;
doAutotext = !(this.$element.text().trim()).length && this.value !== null && this.value !== undefined && !isValueByText;
break;
default:
doAutotext = false;
@ -1696,7 +1696,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
//set option(s) by object
if(key && typeof key === 'object') {
$.each(key, $.proxy(function(k, v){
this.option($.trim(k), v);
this.option(k.triim(), v);
}, this));
return;
}
@ -1749,7 +1749,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
if(typeof(this.input.isEmpty) === 'function') {
this.isEmpty = this.input.isEmpty(this.$element);
} else {
this.isEmpty = $.trim(this.$element.html()) === '';
this.isEmpty = this.$element.html().trim() === '';
}
}
@ -2371,7 +2371,7 @@ To create your own input you can inherit from this class.
@param {DOMElement} element
**/
value2html: function(value, element) {
$(element)[this.options.escape ? 'text' : 'html']($.trim(value));
$(element)[this.options.escape ? 'text' : 'html'](value.trim());
},
/**
@ -3282,7 +3282,7 @@ $(function(){
str2value: function(str) {
var reg, value = null;
if(typeof str === 'string' && str.length) {
reg = new RegExp('\\s*'+$.trim(this.options.separator)+'\\s*');
reg = new RegExp('\\s*'+this.options.separator.trim()+'\\s*');
value = str.split(reg);
} else if(Array.isArray(str)) {
value = str;
@ -3856,7 +3856,7 @@ $(function(){
}
val = str.split(separator);
for (i = 0, l = val.length; i < l; i = i + 1) {
val[i] = $.trim(val[i]);
val[i] = val[i].trim();
}
return val;

File diff suppressed because one or more lines are too long

@ -521,7 +521,7 @@ Editableform is linked with one of input types, e.g. 'text', 'select' etc.
@default null
@example
validate: function(value) {
if($.trim(value) == '') {
if(value.trim() == '') {
return 'This field is required';
}
}
@ -1502,7 +1502,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
//set value from settings or by element's text
if (this.options.value === undefined || this.options.value === null) {
this.value = this.input.html2value($.trim(this.$element.html()));
this.value = this.input.html2value(this.$element.html().trim());
isValueByText = true;
} else {
/*
@ -1564,7 +1564,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
break;
case 'auto':
//if element text is empty and value is defined and value not generated by text --> run autotext
doAutotext = !$.trim(this.$element.text()).length && this.value !== null && this.value !== undefined && !isValueByText;
doAutotext = !(this.$element.text().trim()).length && this.value !== null && this.value !== undefined && !isValueByText;
break;
default:
doAutotext = false;
@ -1696,7 +1696,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
//set option(s) by object
if(key && typeof key === 'object') {
$.each(key, $.proxy(function(k, v){
this.option($.trim(k), v);
this.option(k.triim(), v);
}, this));
return;
}
@ -1749,7 +1749,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
if(typeof(this.input.isEmpty) === 'function') {
this.isEmpty = this.input.isEmpty(this.$element);
} else {
this.isEmpty = $.trim(this.$element.html()) === '';
this.isEmpty = this.$element.html().trim() === '';
}
}
@ -2371,7 +2371,7 @@ To create your own input you can inherit from this class.
@param {DOMElement} element
**/
value2html: function(value, element) {
$(element)[this.options.escape ? 'text' : 'html']($.trim(value));
$(element)[this.options.escape ? 'text' : 'html'](value.trim());
},
/**
@ -3282,7 +3282,7 @@ $(function(){
str2value: function(str) {
var reg, value = null;
if(typeof str === 'string' && str.length) {
reg = new RegExp('\\s*'+$.trim(this.options.separator)+'\\s*');
reg = new RegExp('\\s*'+this.options.separator.trim()+'\\s*');
value = str.split(reg);
} else if(Array.isArray(str)) {
value = str;
@ -3856,7 +3856,7 @@ $(function(){
}
val = str.split(separator);
for (i = 0, l = val.length; i < l; i = i + 1) {
val[i] = $.trim(val[i]);
val[i] = val[i].trim();
}
return val;

File diff suppressed because one or more lines are too long

@ -517,7 +517,7 @@ Editableform is linked with one of input types, e.g. 'text', 'select' etc.
@default null
@example
validate: function(value) {
if($.trim(value) == '') {
if(value.trim() == '') {
return 'This field is required';
}
}

@ -42,7 +42,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
//set value from settings or by element's text
if (this.options.value === undefined || this.options.value === null) {
this.value = this.input.html2value($.trim(this.$element.html()));
this.value = this.input.html2value(this.$element.html().trim());
isValueByText = true;
} else {
/*
@ -104,7 +104,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
break;
case 'auto':
//if element text is empty and value is defined and value not generated by text --> run autotext
doAutotext = !$.trim(this.$element.text()).length && this.value !== null && this.value !== undefined && !isValueByText;
doAutotext = !(this.$element.text().trim()).length && this.value !== null && this.value !== undefined && !isValueByText;
break;
default:
doAutotext = false;
@ -236,7 +236,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
//set option(s) by object
if(key && typeof key === 'object') {
$.each(key, $.proxy(function(k, v){
this.option($.trim(k), v);
this.option(k.triim(), v);
}, this));
return;
}
@ -289,7 +289,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
if(typeof(this.input.isEmpty) === 'function') {
this.isEmpty = this.input.isEmpty(this.$element);
} else {
this.isEmpty = $.trim(this.$element.html()) === '';
this.isEmpty = this.$element.html().trim() === '';
}
}

@ -124,10 +124,10 @@
};
},
tokenizeQuery: function(str) {
return $.trim(str).toLowerCase().split(/[\s]+/);
return str.trim().toLowerCase().split(/[\s]+/);
},
tokenizeText: function(str) {
return $.trim(str).toLowerCase().split(/[\s\-_]+/);
return str.trim().toLowerCase().split(/[\s\-_]+/);
},
getProtocol: function() {
return location.protocol;

@ -90,9 +90,9 @@ $(function(){
},
isEmpty: function($element) {
if($.trim($element.html()) === '') {
if($element.html().trim() === '') {
return true;
} else if($.trim($element.text()) !== '') {
} else if($element.text().trim() !== '') {
return false;
} else {
//e.g. '<img>', '<br>', '<p></p>'

@ -52,7 +52,7 @@ To create your own input you can inherit from this class.
@param {DOMElement} element
**/
value2html: function(value, element) {
$(element)[this.options.escape ? 'text' : 'html']($.trim(value));
$(element)[this.options.escape ? 'text' : 'html'](value.trim());
},
/**

@ -61,7 +61,7 @@ $(function(){
str2value: function(str) {
var reg, value = null;
if(typeof str === 'string' && str.length) {
reg = new RegExp('\\s*'+$.trim(this.options.separator)+'\\s*');
reg = new RegExp('\\s*'+this.options.separator.trim()+'\\s*');
value = str.split(reg);
} else if(Array.isArray(str)) {
value = str;

@ -165,7 +165,7 @@ the specific language governing permissions and limitations under the Apache Lic
var val, i, l;
if (string === null || string.length < 1) return [];
val = string.split(separator);
for (i = 0, l = val.length; i < l; i = i + 1) val[i] = $.trim(val[i]);
for (i = 0, l = val.length; i < l; i = i + 1) val[i] = val[i].trim();
return val;
}
@ -968,7 +968,7 @@ the specific language governing permissions and limitations under the Apache Lic
} else if ("tags" in opts) {
opts.query = tags(opts.tags);
if (opts.createSearchChoice === undefined) {
opts.createSearchChoice = function (term) { return {id: $.trim(term), text: $.trim(term)}; };
opts.createSearchChoice = function (term) { return {id: term.trim(), text: term.trim()}; };
}
if (opts.initSelection === undefined) {
opts.initSelection = function (element, callback) {

@ -259,7 +259,7 @@ $(function(){
}
val = str.split(separator);
for (i = 0, l = val.length; i < l; i = i + 1) {
val[i] = $.trim(val[i]);
val[i] = val[i].trim();
}
return val;