/** * MinimalProfile v41 - API-based config */ (function() { 'use strict'; if (!window.location.pathname.includes('/settings/')) { return; } console.log('MinimalProfile v41: Starting'); var map = { 'pronouns': '#account-property-pronouns', 'role': '#account-property-role', 'headline': '#account-property-headline' }; function hideFields(hidden) { if (!hidden || !hidden.length) return; 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); } } function loadConfig() { var xhr = new XMLHttpRequest(); xhr.open('GET', '/apps/minimalprofile/api/v1/hidden-fields', true); xhr.onload = function() { if (xhr.status === 200) { try { var data = JSON.parse(xhr.responseText); console.log('MinimalProfile v41: API returned', data.hiddenFields); hideFields(data.hiddenFields); } catch(e) { console.error('MinimalProfile v41: JSON parse error', e); } } else { console.error('MinimalProfile v41: API failed', xhr.status); } }; xhr.onerror = function() { console.error('MinimalProfile v41: Network error'); }; xhr.send(); } loadConfig(); })();