1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-16 19:54:24 +02:00

Update many other .js files for jQuery 3.x deprecations

This commit is contained in:
Ryan Cramer
2023-04-19 10:08:54 -04:00
parent 3f2488de7d
commit 1d7f029fa5
82 changed files with 380 additions and 3062 deletions

View File

@@ -525,4 +525,20 @@ if(typeof ProcessWire != "undefined") {
ProcessWire.entities = function(str) {
return $('<textarea />').text(str).html();
};
/**
* Trim any type of given value and return a trimmed string
*
* @param str
* @returns {string}
* @since 3.0.216
*
*/
ProcessWire.trim = function(str) {
if(typeof str !== 'string') {
if(typeof str === 'undefined' || str === null || str === '') return '';
str = str.toString();
}
return str.trim();
};
}