v1.0.31 - debug JS logging
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
(function() {
|
||||
'use strict';
|
||||
console.log('MinimalProfile: START');
|
||||
console.log('MinimalProfile: START - version 1.0.31');
|
||||
|
||||
var fieldSelectors = {
|
||||
'pronouns': '#account-property-pronouns',
|
||||
@@ -21,6 +21,9 @@
|
||||
};
|
||||
|
||||
function applyCss(hiddenFields) {
|
||||
console.log('MinimalProfile: applyCss called with', hiddenFields);
|
||||
console.log('MinimalProfile: hiddenFields type', typeof hiddenFields, Array.isArray(hiddenFields));
|
||||
|
||||
if (!hiddenFields || hiddenFields.length === 0) {
|
||||
console.log('MinimalProfile: No fields to hide');
|
||||
return;
|
||||
@@ -38,23 +41,34 @@
|
||||
if (css) {
|
||||
var style = document.createElement('style');
|
||||
style.textContent = css;
|
||||
style.id = 'minimalprofile-dynamic';
|
||||
document.head.appendChild(style);
|
||||
console.log('MinimalProfile: CSS applied');
|
||||
console.log('MinimalProfile: CSS applied:', css);
|
||||
}
|
||||
}
|
||||
|
||||
// Fetch config
|
||||
console.log('MinimalProfile: Fetching config...');
|
||||
|
||||
var url = OC.generateUrl('/apps/minimalprofile/api/v1/hidden-fields');
|
||||
console.log('MinimalProfile: URL:', url);
|
||||
|
||||
var req = new XMLHttpRequest();
|
||||
req.open('GET', url);
|
||||
req.onload = function() {
|
||||
console.log('MinimalProfile: Status:', req.status, req.statusText);
|
||||
console.log('MinimalProfile: Response:', req.responseText);
|
||||
if (req.status === 200) {
|
||||
try {
|
||||
var data = JSON.parse(req.responseText);
|
||||
applyCss(data.hiddenFields || []);
|
||||
console.log('MinimalProfile: Parsed data:', data);
|
||||
applyCss(data.hiddenFields);
|
||||
} catch (e) {
|
||||
console.error('MinimalProfile: Parse error', e);
|
||||
}
|
||||
}
|
||||
};
|
||||
req.open('GET', OC.generateUrl('/apps/minimalprofile/api/v1/hidden-fields'));
|
||||
req.onerror = function() {
|
||||
console.error('MinimalProfile: Request FAILED');
|
||||
};
|
||||
req.send();
|
||||
})();
|
||||
Reference in New Issue
Block a user