v1.0.46 - clean version

This commit is contained in:
2026-04-16 20:58:17 +02:00
parent e643db10df
commit d57fbb50ee
2 changed files with 3 additions and 15 deletions

View File

@@ -4,7 +4,7 @@
<name>Minimal Profile</name>
<summary>Hides profile fields to create a minimal user profile</summary>
<description>Allows administrators to hide profile fields like pronouns, social links, etc.</description>
<version>1.0.45</version>
<version>1.0.46</version>
<licence>AGPL</licence>
<author>Your Name</author>
<namespace>MinimalProfile</namespace>

View File

@@ -1,5 +1,5 @@
/**
* MinimalProfile v45 - Handle both OCS and plain JSON
* MinimalProfile v46 - Clean version
*/
(function() {
'use strict';
@@ -8,8 +8,6 @@
return;
}
console.log('MinimalProfile v45: Starting');
var map = {
'pronouns': '#account-property-pronouns',
'role': '#account-property-role',
@@ -23,7 +21,6 @@
hidden.forEach(function(f) {
if (map[f]) {
css += '.personal-settings-setting-box:has(' + map[f] + ') { display: none !important; }';
console.log('Hiding:', f);
}
});
@@ -38,22 +35,13 @@
var xhr = new XMLHttpRequest();
xhr.open('GET', '/ocs/v2.php/apps/minimalprofile/api/v1/hidden-fields', true);
xhr.onload = function() {
console.log('MinimalProfile v45: Response', xhr.status, xhr.responseText);
if (xhr.status === 200) {
try {
var data = JSON.parse(xhr.responseText);
var fields = data?.ocs?.data?.hiddenFields || data?.hiddenFields;
console.log('MinimalProfile v45: Fields:', fields);
hideFields(fields);
} catch(e) {
console.error('MinimalProfile v45: Parse error', e);
} catch(e) {}
}
} else {
console.error('MinimalProfile v45: API failed', xhr.status);
}
};
xhr.onerror = function() {
console.error('MinimalProfile v45: Network error');
};
xhr.send();
}