mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 07:27:22 -06:00
WebUI: simplify code
This commit is contained in:
@@ -168,13 +168,13 @@ window.qBittorrent.Misc ??= (() => {
|
||||
};
|
||||
};
|
||||
|
||||
const escapeHtml = function(str) {
|
||||
const escapeHtml = (() => {
|
||||
const div = document.createElement("div");
|
||||
div.appendChild(document.createTextNode(str));
|
||||
const escapedString = div.innerHTML;
|
||||
div.remove();
|
||||
return escapedString;
|
||||
};
|
||||
return (str) => {
|
||||
div.textContent = str;
|
||||
return div.innerHTML;
|
||||
};
|
||||
})();
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#parameters
|
||||
const naturalSortCollator = new Intl.Collator(undefined, { numeric: true, usage: "sort" });
|
||||
|
||||
Reference in New Issue
Block a user