Files
nextcloud_minimalprofile/js/minimalprofile.js
2026-04-16 20:47:35 +02:00

39 lines
1.1 KiB
JavaScript

/**
* Minimal Profile v40 - NEW SCRIPT
*/
(function() {
'use strict';
if (!window.location.pathname.includes('/settings/')) {
return;
}
console.log('MinimalProfile v40: HERE');
var storageKey = 'minimalprofile_hidden';
var stored = localStorage.getItem(storageKey);
var hidden = stored ? JSON.parse(stored) : [];
var urlParam = new URLSearchParams(window.location.search).get('hide');
if (urlParam) hidden = urlParam.split(',');
if (!hidden.length) return;
var map = {
'pronouns': '#account-property-pronouns',
'role': '#account-property-role',
'headline': '#account-property-headline'
};
var css = '';
hidden.forEach(function(f) {
if (map[f]) {
css += '.personal-settings-setting-box:has(' + map[f] + ') { display: none !important; }';
console.log('Hiding:', f);
}
});
if (css) {
var s = document.createElement('style');
s.textContent = css;
document.head.appendChild(s);
}
})();