v1.0.46 - clean version
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
<name>Minimal Profile</name>
|
<name>Minimal Profile</name>
|
||||||
<summary>Hides profile fields to create a minimal user profile</summary>
|
<summary>Hides profile fields to create a minimal user profile</summary>
|
||||||
<description>Allows administrators to hide profile fields like pronouns, social links, etc.</description>
|
<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>
|
<licence>AGPL</licence>
|
||||||
<author>Your Name</author>
|
<author>Your Name</author>
|
||||||
<namespace>MinimalProfile</namespace>
|
<namespace>MinimalProfile</namespace>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* MinimalProfile v45 - Handle both OCS and plain JSON
|
* MinimalProfile v46 - Clean version
|
||||||
*/
|
*/
|
||||||
(function() {
|
(function() {
|
||||||
'use strict';
|
'use strict';
|
||||||
@@ -8,8 +8,6 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('MinimalProfile v45: Starting');
|
|
||||||
|
|
||||||
var map = {
|
var map = {
|
||||||
'pronouns': '#account-property-pronouns',
|
'pronouns': '#account-property-pronouns',
|
||||||
'role': '#account-property-role',
|
'role': '#account-property-role',
|
||||||
@@ -23,7 +21,6 @@
|
|||||||
hidden.forEach(function(f) {
|
hidden.forEach(function(f) {
|
||||||
if (map[f]) {
|
if (map[f]) {
|
||||||
css += '.personal-settings-setting-box:has(' + map[f] + ') { display: none !important; }';
|
css += '.personal-settings-setting-box:has(' + map[f] + ') { display: none !important; }';
|
||||||
console.log('Hiding:', f);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -38,22 +35,13 @@
|
|||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
xhr.open('GET', '/ocs/v2.php/apps/minimalprofile/api/v1/hidden-fields', true);
|
xhr.open('GET', '/ocs/v2.php/apps/minimalprofile/api/v1/hidden-fields', true);
|
||||||
xhr.onload = function() {
|
xhr.onload = function() {
|
||||||
console.log('MinimalProfile v45: Response', xhr.status, xhr.responseText);
|
|
||||||
if (xhr.status === 200) {
|
if (xhr.status === 200) {
|
||||||
try {
|
try {
|
||||||
var data = JSON.parse(xhr.responseText);
|
var data = JSON.parse(xhr.responseText);
|
||||||
var fields = data?.ocs?.data?.hiddenFields || data?.hiddenFields;
|
var fields = data?.ocs?.data?.hiddenFields || data?.hiddenFields;
|
||||||
console.log('MinimalProfile v45: Fields:', fields);
|
|
||||||
hideFields(fields);
|
hideFields(fields);
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
console.error('MinimalProfile v45: Parse error', e);
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
console.error('MinimalProfile v45: API failed', xhr.status);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
xhr.onerror = function() {
|
|
||||||
console.error('MinimalProfile v45: Network error');
|
|
||||||
};
|
};
|
||||||
xhr.send();
|
xhr.send();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user