Difference between revisions of "MediaWiki:Common.js"

Line 1: Line 1:
−
/* M'adrono Widget - Simple Version */
+
/* M'adrono Widget - Simple Version  
 
   $(function() {
 
   $(function() {
 
       var s = document.createElement('script');
 
       var s = document.createElement('script');
Line 14: Line 14:
 
       s.dataset.placeholderTexts = '["Ask about lesson planning...", "How can I teach children about...", "Need help with Grade..."]';
 
       s.dataset.placeholderTexts = '["Ask about lesson planning...", "How can I teach children about...", "Need help with Grade..."]';
 
       document.body.appendChild(s);
 
       document.body.appendChild(s);
 +
  });*/
 +
/* M'adrono Widget for Talmido - Auto-minimized */
 +
  $(document).ready(function() {
 +
      var 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 Madrono... 🙏');
 +
      script.setAttribute('data-mobile-button-text', 'Chat with Madrono');
 +
      script.setAttribute('data-dialog-subtitle', 'Your AI assistant for Malankara Orthodox Sunday School teaching');
 +
      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...']");
 +
 +
      // Add onload handler to minimize immediately
 +
      script.onload = function() {
 +
          // Wait a moment for widget to initialize
 +
          setTimeout(function() {
 +
              // Remove expanded class to minimize
 +
              var dialogBox = document.getElementById('dialog-box');
 +
              if (dialogBox) {
 +
                  dialogBox.classList.remove('dialog-box--expanded');
 +
                  dialogBox.style.display = 'none';
 +
              }
 +
 +
              // Show the circle button
 +
              var circleButton = document.querySelector('.desktop-circle-button');
 +
              if (circleButton) {
 +
                  circleButton.style.display = 'flex';
 +
              }
 +
 +
              // Hide extended suggestions
 +
              var extendedSuggestions = document.getElementById('extended-suggestions');
 +
              if (extendedSuggestions) {
 +
                  extendedSuggestions.style.display = 'none';
 +
              }
 +
          }, 100); // Small delay to ensure widget is loaded
 +
      };
 +
 +
      document.body.appendChild(script);
 
   });
 
   });

Revision as of 04:55, 28 October 2025

/* M'adrono Widget - Simple Version 
  $(function() {
      var s = document.createElement('script');
      s.src = 'https://storage.googleapis.com/creatorsagi-scripts/creatorsagi-widget.min.js';
      s.dataset.domain = 'ai.talmido.org';
      s.dataset.dialogTitle = 'Ask M\'adrono... 🙏';
      s.dataset.mobileButtonText = 'Chat with M\'adrono';
      s.dataset.dialogSubtitle = 'Your AI assistant for Malankara Orthodox Sunday School teaching. Supporting teachers in forming young disciples of Christ 💫';
      /* Removing due to floating buttons on desktop
        s.dataset.suggestions = '["Lesson Planning", "Teaching Activities", "Learning Assessment", "Orthodox Doctrine"]';
        s.dataset.extendedSuggestions = '["Grade Resources", "Liturgical Calendar", "Children Engagement", "Talmido Curriculum"]';
      */
      s.dataset.primaryColor = '#1aafe3';
      s.dataset.placeholderTexts = '["Ask about lesson planning...", "How can I teach children about...", "Need help with Grade..."]';
      document.body.appendChild(s);
  });*/
/* M'adrono Widget for Talmido - Auto-minimized */
  $(document).ready(function() {
      var 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 Madrono... 🙏');
      script.setAttribute('data-mobile-button-text', 'Chat with Madrono');
      script.setAttribute('data-dialog-subtitle', 'Your AI assistant for Malankara Orthodox Sunday School teaching');
      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...']");

      // Add onload handler to minimize immediately
      script.onload = function() {
          // Wait a moment for widget to initialize
          setTimeout(function() {
              // Remove expanded class to minimize
              var dialogBox = document.getElementById('dialog-box');
              if (dialogBox) {
                  dialogBox.classList.remove('dialog-box--expanded');
                  dialogBox.style.display = 'none';
              }

              // Show the circle button
              var circleButton = document.querySelector('.desktop-circle-button');
              if (circleButton) {
                  circleButton.style.display = 'flex';
              }

              // Hide extended suggestions
              var extendedSuggestions = document.getElementById('extended-suggestions');
              if (extendedSuggestions) {
                  extendedSuggestions.style.display = 'none';
              }
          }, 100); // Small delay to ensure widget is loaded
      };

      document.body.appendChild(script);
  });