MediaWiki:Common.js

Revision as of 23:48, 27 October 2025 by Thomas (talk | contribs) (adding a bot to the site)

Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.

/* M'adrono Chat Widget for Talmido - Fixed Version */
  mw.loader.using(['mediawiki.util'], function() {
      $(document).ready(function() {
          const script = document.createElement('script');
          script.src = "https://storage.googleapis.com/creatorsagi-scripts/creatorsagi-widget.min.js";
          script.setAttribute('data-domain', 'ai.talmido.org');
          script.setAttribute('data-dialog-title', 'Ask M\'adrono... 🙏');
          script.setAttribute('data-mobile-button-text', 'Chat with M\'adrono');
          script.setAttribute('data-dialog-subtitle', 'Your AI assistant for Malankara Orthodox Sunday School teaching. Supporting teachers in forming young disciples of Christ 💫');
          script.setAttribute('data-suggestions', '["Lesson Planning", "Teaching Activities", "Learning Assessment", "Orthodox Doctrine"]');
          script.setAttribute('data-extended-suggestions', '["Grade Resources", "Liturgical Calendar", "Children Engagement", "Talmido Curriculum"]');
          script.setAttribute('data-primary-color', '#1aafe3');
          script.setAttribute('data-placeholder-texts', '["Ask about lesson planning...", "How can I teach children about...", "Need help with Grade..."]');

          document.body.appendChild(script);

          // Add CSS fixes after widget loads
          script.onload = function() {
              setTimeout(function() {
                  // Add custom styles to fix button positioning
                  const style = document.createElement('style');
                  style.textContent = `
                      /* Fix widget button positioning */
                      .creatorsagi-suggestions button,
                      .creatorsagi-extended-suggestions button {
                          position: relative !important;
                          float: none !important;
                          display: inline-block !important;
                          margin: 4px !important;
                      }
                      .creatorsagi-dialog {
                          z-index: 999999 !important;
                      }
                      /* Reset any MediaWiki interference */
                      .creatorsagi-widget-container * {
                          box-sizing: border-box !important;
                      }
                  `;
                  document.head.appendChild(style);
              }, 1000); // Wait for widget to initialize
          };
      });
  });