v1.0.46 - clean version
This commit is contained in:
@@ -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,23 +35,14 @@
|
||||
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);
|
||||
}
|
||||
} else {
|
||||
console.error('MinimalProfile v45: API failed', xhr.status);
|
||||
} catch(e) {}
|
||||
}
|
||||
};
|
||||
xhr.onerror = function() {
|
||||
console.error('MinimalProfile v45: Network error');
|
||||
};
|
||||
xhr.send();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user