<commit_before>//
// Connection to SRE explorer.
//
MathJax.Hub.Register.StartupHook('Sre Ready', function() {
  var FALSE, KEY;
  MathJax.Hub.Register.StartupHook('MathEvents Ready', function() {
    FALSE = MathJax.Extension.MathEvents.Event.False;
    KEY = MathJax.Extension.MathEvents.Event.KEY;
  });


  var LiveRegion = MathJax.Extension.LiveRegion = MathJax.Object.Subclass({
    version: "1.0",
    
    div: null,
    Init: function() {
      this.div = LiveRegion.Create('assertive');
    },
    //
    // Adds the speech div.
    //
    Add: function() {
      if (LiveRegion.announced) return;
      document.body.appendChild(this.div);
      LiveRegion.Announce();
    },
    //
    // Clears the speech div.
    //
    Clear: function() {
      this.Update('');
    },
    //
    // Speaks a string by poking it into the speech div.
    //
    Update: function(speech) {
      LiveRegion.Update(this.div, speech);
    }
  }, {
    ANNOUNCE: 'Navigatable Math in page. Explore with shift space.',
    announced: false,
    //
    // Creates a live region with a particular type and display style.
    //
    Create: function(type, style) {
      var element = MathJax.HTML.Element(
        'div', {className: 'MathJax_SpeechOutput', style: style});
      element.setAttribute('aria-live', type);
      return element;
    },
    //
    // Updates a live region's text content.
    //
    Update: MathJax.Hub.Browser.isPC ?
      function(div, speech) {
        div.textContent = '';
        setTimeout(function() {div.textContent = speech;}, 100);
      } : function(div, speech) {
        div.textContent = speech;
      },
    //
    // Speaks the announce string.
    //
    Announce: function() {
      if (LiveRegion.announced) return;
      LiveRegion.announeced = true;
      var div = LiveRegion.Create('polite',
                                  {fontSize: '1px', color: '#FFFFFF'});
      document.body.appendChild(div);
      LiveRegion.Update(div, LiveRegion.ANNOUNCE);
      setTimeout(function() {document.body.removeChild(div);}, 1000);
    }
  });
  
  <commit_msg>Fixes issue #62<commit_after>//
// Connection to SRE explorer.
//
MathJax.Hub.Register.StartupHook('Sre Ready', function() {
  var FALSE, KEY;
  MathJax.Hub.Register.StartupHook('MathEvents Ready', function() {
    FALSE = MathJax.Extension.MathEvents.Event.False;
    KEY = MathJax.Extension.MathEvents.Event.KEY;
  });


  var LiveRegion = MathJax.Extension.LiveRegion = MathJax.Object.Subclass({
    version: "1.0",
    
    div: null,
    Init: function() {
      this.div = LiveRegion.Create('assertive');
    },
    //
    // Adds the speech div.
    //
    Add: function() {
      if (LiveRegion.announced) return;
      document.body.appendChild(this.div);
      LiveRegion.Announce();
    },
    //
    // Clears the speech div.
    //
    Clear: function() {
      this.Update('');
    },
    //
    // Speaks a string by poking it into the speech div.
    //
    Update: function(speech) {
      LiveRegion.Update(this.div, speech);
    }
  }, {
    ANNOUNCE: 'Navigatable Math in page. Explore with shift space.',
    announced: false,
    //
    // Creates a live region with a particular type and display style.
    //
    Create: function(type, style) {
      var element = MathJax.HTML.Element(
        'div', {className: 'MathJax_SpeechOutput', style: style});
      element.setAttribute('aria-live', type);
      return element;
    },
    //
    // Updates a live region's text content.
    //
    Update: MathJax.Hub.Browser.isPC ?
      function(div, speech) {
        div.textContent = '';
        setTimeout(function() {div.textContent = speech;}, 100);
      } : function(div, speech) {
        div.textContent = speech;
      },
    //
    // Speaks the announce string.
    //
    Announce: function() {
      if (LiveRegion.announced) return;
      LiveRegion.announced = true;
      var div = LiveRegion.Create('polite',
                                  {fontSize: '1px', color: '#FFFFFF'});
      document.body.appendChild(div);
      LiveRegion.Update(div, LiveRegion.ANNOUNCE);
      setTimeout(function() {document.body.removeChild(div);}, 1000);
    }
  });
  
  
{'fraction_non_alphanumeric': 0.14238015740519913, 'fraction_numerical': 0.005246839971380873, 'mean_word_length': 2.2536850271528315, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1662024', 'n_tokens_mistral': 1326, 'n_tokens_neox': 1298, 'n_words': 286}