Renamed script
This commit is contained in:
parent
c732a9b025
commit
310679ce3c
@ -3,5 +3,5 @@ namespace OCA\MinimalProfile\AppInfo;
|
||||
|
||||
use OCP\Util;
|
||||
|
||||
Util::addStyle('minimalprofile', 'style');
|
||||
Util::addScript('minimalprofile', 'script');
|
||||
Util::addStyle("minimalprofile", "style");
|
||||
Util::addScript("minimalprofile", "hidePronouns");
|
||||
|
@ -9,7 +9,7 @@
|
||||
</description>
|
||||
<version>1.0.0</version>
|
||||
<licence>agpl</licence>
|
||||
<author>Your Name</author>
|
||||
<author>Guy Van Sanden</author>
|
||||
<namespace>MinimalProfile</namespace>
|
||||
<dependencies>
|
||||
<nextcloud min-version="26" max-version="31" />
|
||||
|
19
js/hidePronouns.js
Normal file
19
js/hidePronouns.js
Normal file
@ -0,0 +1,19 @@
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
function tryToHidePronouns() {
|
||||
const sections = document.querySelectorAll("section");
|
||||
|
||||
for (const section of sections) {
|
||||
const label = section.querySelector("label");
|
||||
if (label && label.textContent.trim().toLowerCase() === "pronouns") {
|
||||
console.log("Found Pronouns field, hiding section...");
|
||||
section.style.display = "none";
|
||||
clearInterval(checkInterval); // stop checking
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const checkInterval = setInterval(tryToHidePronouns, 500); // retry every half second
|
||||
|
||||
console.log("Started polling to find Pronouns field...");
|
||||
});
|
@ -1,7 +0,0 @@
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const pronounField = document.querySelector('[data-profile-field="pronouns"]');
|
||||
if (pronounField) {
|
||||
pronounField.style.display = 'none';
|
||||
}
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user