MediaWiki:Common.js: Difference between revisions
From Helix Project Wiki
Steve Helix (talk | contribs) No edit summary |
Steve Helix (talk | contribs) No edit summary |
||
| Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */ | /* Any JavaScript here will be loaded for all users on every page load. */ | ||
// Helix Project - Wiki Chat Bubble ( | // Helix Project - Wiki Chat Bubble Debug Version | ||
console.log('=== Helix Wiki Chat Bubble Debug ==='); | |||
// Test if script is loading | |||
console.log('MediaWiki:Common.js is loading...'); | |||
window.addEventListener('load', function() { | window.addEventListener('load', function() { | ||
console.log(' | console.log('Window load event fired'); | ||
// | // Create chat bubble with very obvious styling | ||
var chatBubble = document.createElement('div'); | var chatBubble = document.createElement('div'); | ||
chatBubble.innerHTML = '💬 | chatBubble.innerHTML = '💬 WIKI CHAT DEBUG'; | ||
chatBubble.id = 'helix-wiki-chat-bubble'; | chatBubble.id = 'helix-wiki-chat-bubble'; | ||
// | // Make it impossible to miss | ||
chatBubble.style.position = 'fixed'; | chatBubble.style.position = 'fixed'; | ||
chatBubble.style.bottom = '20px'; | chatBubble.style.bottom = '20px'; | ||
chatBubble.style.right = '20px'; | chatBubble.style.right = '20px'; | ||
chatBubble.style.background = ' | chatBubble.style.background = 'red'; | ||
chatBubble.style.color = 'white'; | chatBubble.style.color = 'white'; | ||
chatBubble.style.padding = ' | chatBubble.style.padding = '15px'; | ||
chatBubble.style.borderRadius = ' | chatBubble.style.borderRadius = '10px'; | ||
chatBubble.style.cursor = 'pointer'; | chatBubble.style.cursor = 'pointer'; | ||
chatBubble.style.zIndex = ' | chatBubble.style.zIndex = '999999'; | ||
chatBubble.style.fontSize = '16px'; | |||
chatBubble.style.fontSize = ' | |||
chatBubble.style.fontWeight = 'bold'; | chatBubble.style.fontWeight = 'bold'; | ||
chatBubble.style.border = '3px solid yellow'; | |||
// Simple click action | // Simple click action | ||
chatBubble.onclick = function() { | chatBubble.onclick = function() { | ||
alert('Wiki chat bubble clicked!'); | |||
}; | }; | ||
// Try to append to body | |||
console.log('Attempting to append chat bubble to body...'); | |||
document.body.appendChild(chatBubble); | document.body.appendChild(chatBubble); | ||
console.log(' | console.log('Chat bubble appended to body'); | ||
// | // Verify it's actually in the DOM | ||
var | var checkBubble = document.getElementById('helix-wiki-chat-bubble'); | ||
if (checkBubble) { | |||
console.log('✅ Chat bubble found in DOM'); | |||
} else { | |||
console.log('❌ Chat bubble NOT found in DOM'); | |||
} | |||
}); | }); | ||
// Also try without waiting for load | |||
console.log('Creating immediate chat bubble...'); | |||
var immediateBubble = document.createElement('div'); | |||
immediateBubble.innerHTML = 'IMMEDIATE BUBBLE'; | |||
immediateBubble.style.cssText = 'position:fixed;top:20px;right:20px;background:green;color:white;padding:10px;z-index:999999;'; | |||
document.body.appendChild(immediateBubble); | |||
console.log('Immediate bubble added'); | |||
Revision as of 11:50, 7 October 2025
/* Any JavaScript here will be loaded for all users on every page load. */
// Helix Project - Wiki Chat Bubble Debug Version
console.log('=== Helix Wiki Chat Bubble Debug ===');
// Test if script is loading
console.log('MediaWiki:Common.js is loading...');
window.addEventListener('load', function() {
console.log('Window load event fired');
// Create chat bubble with very obvious styling
var chatBubble = document.createElement('div');
chatBubble.innerHTML = '💬 WIKI CHAT DEBUG';
chatBubble.id = 'helix-wiki-chat-bubble';
// Make it impossible to miss
chatBubble.style.position = 'fixed';
chatBubble.style.bottom = '20px';
chatBubble.style.right = '20px';
chatBubble.style.background = 'red';
chatBubble.style.color = 'white';
chatBubble.style.padding = '15px';
chatBubble.style.borderRadius = '10px';
chatBubble.style.cursor = 'pointer';
chatBubble.style.zIndex = '999999';
chatBubble.style.fontSize = '16px';
chatBubble.style.fontWeight = 'bold';
chatBubble.style.border = '3px solid yellow';
// Simple click action
chatBubble.onclick = function() {
alert('Wiki chat bubble clicked!');
};
// Try to append to body
console.log('Attempting to append chat bubble to body...');
document.body.appendChild(chatBubble);
console.log('Chat bubble appended to body');
// Verify it's actually in the DOM
var checkBubble = document.getElementById('helix-wiki-chat-bubble');
if (checkBubble) {
console.log('✅ Chat bubble found in DOM');
} else {
console.log('❌ Chat bubble NOT found in DOM');
}
});
// Also try without waiting for load
console.log('Creating immediate chat bubble...');
var immediateBubble = document.createElement('div');
immediateBubble.innerHTML = 'IMMEDIATE BUBBLE';
immediateBubble.style.cssText = 'position:fixed;top:20px;right:20px;background:green;color:white;padding:10px;z-index:999999;';
document.body.appendChild(immediateBubble);
console.log('Immediate bubble added');
