mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-14 02:27:09 -07:00
WebUI: simplify code
This commit is contained in:
parent
b75c42f850
commit
8e9680bf69
1 changed files with 6 additions and 6 deletions
|
@ -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" });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue