This commit is contained in:
Mirco Wittrien 2019-01-09 10:26:58 +01:00
parent 45d97c30af
commit 7fd7c78c10
2 changed files with 34 additions and 31 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,14 @@
//META{"name":"RepoControls"}*// //META{"name":"RepoControls"}*//
class RepoControls { class RepoControls {
getName () {return "RepoControls";}
getVersion () {return "1.2.4";}
getAuthor () {return "DevilBro";}
getDescription () {return "Lets you sort and filter your list of downloaded Themes and Plugins.";}
initConstructor () { initConstructor () {
this.patchModules = { this.patchModules = {
"V2C_List":"componentDidMount", "V2C_List":"componentDidMount",
@ -108,14 +116,6 @@ class RepoControls {
}; };
} }
getName () {return "RepoControls";}
getDescription () {return "Lets you sort and filter your list of downloaded Themes and Plugins.";}
getVersion () {return "1.2.4";}
getAuthor () {return "DevilBro";}
getSettingsPanel () { getSettingsPanel () {
if (!this.started || typeof BDFDB !== "object") return; if (!this.started || typeof BDFDB !== "object") return;
let settings = BDFDB.getAllData(this, "settings"); let settings = BDFDB.getAllData(this, "settings");
@ -281,6 +281,7 @@ class RepoControls {
container.entries = {}; container.entries = {};
for (let li of container.children) { for (let li of container.children) {
if (li.querySelector(BDFDB.dotCN._reponame)) {
let name = li.querySelector(BDFDB.dotCN._reponame).textContent; let name = li.querySelector(BDFDB.dotCN._reponame).textContent;
let version = li.querySelector(BDFDB.dotCN._repoversion).textContent; let version = li.querySelector(BDFDB.dotCN._repoversion).textContent;
let author = li.querySelector(BDFDB.dotCN._repoauthor).textContent; let author = li.querySelector(BDFDB.dotCN._repoauthor).textContent;
@ -302,6 +303,7 @@ class RepoControls {
enabled: enabled ? 0 : 1 enabled: enabled ? 0 : 1
}; };
} }
}
this.sortEntries(container, repoControls); this.sortEntries(container, repoControls);
} }
@ -340,9 +342,10 @@ class RepoControls {
for (let ele of wrapper.querySelectorAll(BDFDB.dotCNC._reponame + BDFDB.dotCNC._repoversion + BDFDB.dotCNC._repoauthor + BDFDB.dotCN._repodescription)) { for (let ele of wrapper.querySelectorAll(BDFDB.dotCNC._reponame + BDFDB.dotCNC._repoversion + BDFDB.dotCNC._repoauthor + BDFDB.dotCN._repodescription)) {
if (ele.classList.contains(BDFDB.disCN._repodescription)) { if (ele.classList.contains(BDFDB.disCN._repodescription)) {
ele.style.display = "block"; ele.style.display = "block";
ele.innerHTML = BDFDB.highlightText(ele.innerText, searchstring); if (searchstring && searchstring.length > 2) ele.innerHTML = BDFDB.highlightText(ele.innerText, searchstring);
else ele.innerHTML = ele.innerText;
} }
else if (searchstring || ele.querySelector(".highlight")) ele.innerHTML = BDFDB.highlightText(ele.innerText, searchstring); else if (searchstring && searchstring.length > 2 || ele.querySelector(BDFDB.dotCN.highlight)) ele.innerHTML = BDFDB.highlightText(ele.innerText, searchstring);
} }
} }