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:
@@ -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();
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user