MediaWiki:Common.js: Difference between revisions

From Helix Project Wiki
No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
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 - Chatbase Integration Only
window.addEventListener('load', function() {
console.log('Loading Helix Chatbase integration...');
    console.log('Loading Helix Wiki Chat Bubble...');
 
   
// Only load Chatbase - remove custom chat bubble code
    // Simple, reliable chat bubble for wiki
var script = document.createElement('script');
    const chatBubble = document.createElement('div');
script.src = 'https://www.chatbase.co/embed.min.js';
    chatBubble.innerHTML = '💬 Wiki Help';
script.setAttribute('chatbotId', 'i65eBj3COxUlFEU_Lsrw0');
    chatBubble.id = 'helix-wiki-chat-bubble';
script.setAttribute('domain', 'www.chatbase.co');
    chatBubble.style.cssText = `
script.defer = true;
        position: fixed;
document.body.appendChild(script);
        bottom: 20px;
 
        right: 20px;
console.log('Chatbase integration loaded successfully');
        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);
});

Latest revision as of 11:53, 7 October 2025

/* Any JavaScript here will be loaded for all users on every page load. */
// Helix Project - Chatbase Integration Only
console.log('Loading Helix Chatbase integration...');

// Only load Chatbase - remove custom chat bubble code
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);

console.log('Chatbase integration loaded successfully');