MediaWiki:Common.js: Difference between revisions

From Helix Project Wiki
No edit summary
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 (ES5 Compatible)
window.addEventListener('load', function() {
window.addEventListener('load', function() {
     console.log('Loading Helix Wiki Chat Bubble...');
     console.log('Loading Helix Wiki Chat Bubble...');
      
      
     // Simple, reliable chat bubble for wiki
     // Simple, reliable chat bubble for wiki
     const chatBubble = document.createElement('div');
     var chatBubble = document.createElement('div');
     chatBubble.innerHTML = '💬 Wiki Help';
     chatBubble.innerHTML = '💬 Wiki Help';
     chatBubble.id = 'helix-wiki-chat-bubble';
     chatBubble.id = 'helix-wiki-chat-bubble';
     chatBubble.style.cssText = `
   
        position: fixed;
    // Set styles individually (ES5 compatible)
        bottom: 20px;
     chatBubble.style.position = 'fixed';
        right: 20px;
    chatBubble.style.bottom = '20px';
        background: #007cba;
    chatBubble.style.right = '20px';
        color: white;
    chatBubble.style.background = '#007cba';
        padding: 12px 18px;
    chatBubble.style.color = 'white';
        border-radius: 20px;
    chatBubble.style.padding = '12px 18px';
        cursor: pointer;
    chatBubble.style.borderRadius = '20px';
        z-index: 1000;
    chatBubble.style.cursor = 'pointer';
        box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    chatBubble.style.zIndex = '1000';
        font-family: sans-serif;
    chatBubble.style.boxShadow = '0 2px 10px rgba(0,0,0,0.2)';
        font-size: 14px;
    chatBubble.style.fontFamily = 'sans-serif';
        font-weight: bold;
    chatBubble.style.fontSize = '14px';
    `;
    chatBubble.style.fontWeight = 'bold';
      
      
     // Simple click action - go to wiki help
     // Simple click action - go to wiki help

Revision as of 11:47, 7 October 2025

/* Any JavaScript here will be loaded for all users on every page load. */
// Helix Project - Wiki Chat Bubble (ES5 Compatible)
window.addEventListener('load', function() {
    console.log('Loading Helix Wiki Chat Bubble...');
    
    // Simple, reliable chat bubble for wiki
    var chatBubble = document.createElement('div');
    chatBubble.innerHTML = '💬 Wiki Help';
    chatBubble.id = 'helix-wiki-chat-bubble';
    
    // Set styles individually (ES5 compatible)
    chatBubble.style.position = 'fixed';
    chatBubble.style.bottom = '20px';
    chatBubble.style.right = '20px';
    chatBubble.style.background = '#007cba';
    chatBubble.style.color = 'white';
    chatBubble.style.padding = '12px 18px';
    chatBubble.style.borderRadius = '20px';
    chatBubble.style.cursor = 'pointer';
    chatBubble.style.zIndex = '1000';
    chatBubble.style.boxShadow = '0 2px 10px rgba(0,0,0,0.2)';
    chatBubble.style.fontFamily = 'sans-serif';
    chatBubble.style.fontSize = '14px';
    chatBubble.style.fontWeight = '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);
});