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 | // Helix Project - Wiki Chat Bubble | ||
window.addEventListener('load', function() { | window.addEventListener('load', function() { | ||
console.log('Loading Helix | console.log('Loading Helix Wiki Chat Bubble...'); | ||
// Simple, reliable chat bubble for wiki | |||
const chatBubble = document.createElement('div'); | const chatBubble = document.createElement('div'); | ||
chatBubble. | chatBubble.innerHTML = '💬 Wiki Help'; | ||
chatBubble. | chatBubble.id = 'helix-wiki-chat-bubble'; | ||
chatBubble.style.cssText = ` | chatBubble.style.cssText = ` | ||
position: fixed; | position: fixed; | ||
bottom: 20px; | bottom: 20px; | ||
right: 20px; | right: 20px; | ||
background: | background: #007cba; | ||
color: white; | color: white; | ||
padding: | padding: 12px 18px; | ||
border-radius: | border-radius: 20px; | ||
cursor: pointer; | cursor: pointer; | ||
z-index: | z-index: 1000; | ||
box-shadow: 0 | box-shadow: 0 2px 10px rgba(0,0,0,0.2); | ||
font-family: | font-family: sans-serif; | ||
font-size: 14px; | font-size: 14px; | ||
font-weight: | font-weight: bold; | ||
`; | `; | ||
// | // Simple click action - go to wiki help | ||
chatBubble. | chatBubble.onclick = function() { | ||
window.location.href = '/wiki/Help:Contents'; | |||
}; | }; | ||
chatBubble. | // Add hover effect | ||
this.style. | chatBubble.onmouseover = function() { | ||
this.style. | this.style.background = '#005a87'; | ||
this.style.transform = 'scale(1.05)'; | |||
}; | }; | ||
chatBubble.onmouseout = function() { | |||
chatBubble. | this.style.background = '#007cba'; | ||
this.style.transform = 'scale(1)'; | |||
}; | }; | ||
document.body.appendChild(chatBubble); | document.body.appendChild(chatBubble); | ||
console.log('Wiki | console.log('Helix Wiki Chat Bubble added successfully'); | ||
// Optional: Keep your existing Chatbase integration | |||
var script = document.createElement('script'); | |||
script.src = 'https://www.chatbase.co/embed.min.js'; | |||
script.setAttribute('chatbotId', 'i65eBj3COxUlFEU_Lsrw0'); | |||
script.setAttribute('domain', 'www.chatbase.co'); | |||
script.defer = true; | |||
document.body.appendChild(script); | |||
}); | |||
document.body.appendChild( | |||
Revision as of 11:45, 7 October 2025
/* Any JavaScript here will be loaded for all users on every page load. */
// Helix Project - Wiki Chat Bubble
window.addEventListener('load', function() {
console.log('Loading Helix Wiki Chat Bubble...');
// Simple, reliable chat bubble for wiki
const chatBubble = document.createElement('div');
chatBubble.innerHTML = '💬 Wiki Help';
chatBubble.id = 'helix-wiki-chat-bubble';
chatBubble.style.cssText = `
position: fixed;
bottom: 20px;
right: 20px;
background: #007cba;
color: white;
padding: 12px 18px;
border-radius: 20px;
cursor: pointer;
z-index: 1000;
box-shadow: 0 2px 10px rgba(0,0,0,0.2);
font-family: sans-serif;
font-size: 14px;
font-weight: bold;
`;
// Simple click action - go to wiki help
chatBubble.onclick = function() {
window.location.href = '/wiki/Help:Contents';
};
// Add hover effect
chatBubble.onmouseover = function() {
this.style.background = '#005a87';
this.style.transform = 'scale(1.05)';
};
chatBubble.onmouseout = function() {
this.style.background = '#007cba';
this.style.transform = 'scale(1)';
};
document.body.appendChild(chatBubble);
console.log('Helix Wiki Chat Bubble added successfully');
// Optional: Keep your existing Chatbase integration
var script = document.createElement('script');
script.src = 'https://www.chatbase.co/embed.min.js';
script.setAttribute('chatbotId', 'i65eBj3COxUlFEU_Lsrw0');
script.setAttribute('domain', 'www.chatbase.co');
script.defer = true;
document.body.appendChild(script);
});
