Update RepoControls.plugin.js

This commit is contained in:
Mirco Wittrien 2019-01-07 13:02:22 +01:00
parent c61074a495
commit 953846cb27
1 changed files with 9 additions and 9 deletions

View File

@ -242,15 +242,6 @@ class RepoControls {
if (controls) controls.insertBefore(button, controls.firstElementChild);
}
changeTextToHTML (wrapper, searchstring) {
if (!wrapper || !wrapper.tagName) return;
if (typeof searchstring === "undefined") searchstring = document.querySelector(".repo-controls " + BDFDB.dotCN.searchbarinput).value;
wrapper.querySelectorAll(BDFDB.dotCNC._reponame + BDFDB.dotCNC._repoversion + BDFDB.dotCNC._repoauthor + BDFDB.dotCN._repodescription).forEach(ele => {
if (ele.classList.contains(BDFDB.disCN._repodescription)) ele.style.display = "block";
ele.innerHTML = BDFDB.highlightText(ele.innerText, searchstring);
});
}
addControls (type, container) {
if (!type || !container) return;
BDFDB.removeEles(".repo-controls");
@ -344,6 +335,15 @@ class RepoControls {
}
}
changeTextToHTML (wrapper, searchstring) {
if (!wrapper || !wrapper.tagName) return;
if (typeof searchstring === "undefined") searchstring = document.querySelector(".repo-controls " + BDFDB.dotCN.searchbarinput).value.replace(/[<|>]/g, "").toUpperCase();
if (searchstring) wrapper.querySelectorAll(BDFDB.dotCNC._reponame + BDFDB.dotCNC._repoversion + BDFDB.dotCNC._repoauthor + BDFDB.dotCN._repodescription).forEach(ele => {
if (ele.classList.contains(BDFDB.disCN._repodescription)) ele.style.display = "block";
ele.innerHTML = BDFDB.highlightText(ele.innerText, searchstring);
});
}
toggleAll (type, container, enable) {
BDFDB.openConfirmModal(this, `Are you sure you want to ${enable ? "enable" : "disable"} all ${type[0].toUpperCase() + type.slice(1)}s?`, () => {
for (let header of container.querySelectorAll(BDFDB.dotCN._repoheader)) {