<commit_before>var gsbn = {
  
    slideWidth : null,
    dragging : false,

    // init: add message listeners and call the appropriate function based on the request
    init : function() {
      
      // If we already setup the resizing on this page, do nothing	
      if (window.top.document.body.getAttribute("slide-resize-js") != null) {
        return;
      }
	  
	    // Make sure this is the Speaker Notes tab
      if (!window.top.location.pathname.startsWith('/presentation/') || !window.top.location.pathname.endsWith('/present')) {
        return;
      }
	  
      window.top.document.body.setAttribute("slide-resize-js", true);

      var getOptsResp = function(opts) {
        gsbn.addJS(opts);
      }
      gsbn.getOptions(getOptsResp);
    },
    
    addJS : function(opts) {             
        // Run this JavaScript code in the Speaker Notes window
        // (I'm on Chrome on Windows so I press F12 to bring up the Developer Tools, go to Console, and run it there)
        var notesMaxWidth = parseInt(opts.notesMaxWidth) || gsbnCommon.defaultOpts.notesMaxWidth;
        var resizeSlidesRuleCount = 1;
               
        // The core logic to resize the slides
        var resizeSlides = function() {
          
          // Resize the current slide
          var fullWidth = window.top.innerWidth;
          if (gsbn.slideWidth === null) {
            var slideWidth = (fullWidth < notesMaxWidth * 2) ? fullWidth / 2 : fullWidth - notesMaxWidth;
          } else {
            var slideWidth = gsbn.slideWidth;
          }
          var sheet = window.top.document.styleSheets[0];
          sheet.insertRule(
            ".punch-viewer-speakernotes-side-panel," +
            ".punch-viewer-speakernotes-page-container," +
            ".punch-viewer-speakernotes-page," +
            ".punch-viewer-speakernotes-page > svg {" +
            "  width: " + slideWidth + "px !important; " +
            "  height:auto !important;" +
            "}", resizeSlidesRuleCount++);
          sheet.insertRule(
            ".punch-viewer-speakernotes-text-body-scrollable { position: static !important; }",
            resizeSlidesRuleCount++);
	        sheet.insertRule(
	          ".punch-viewer-speaker-qanda-content { position: static !important; }",
	          resizeSlidesRuleCount++);
	        sheet.insertRule(
	          ".punch-viewer-speaker-questions,.punch-viewer-speaker-series-list, .punch-viewer-speaker-series-intro-container, .punch-viewer-speaker-qanda-not-available { position: static !important; }",
	          resizeSlidesRuleCount++);
          sheet.insertRule(
            ".punch-viewer-speakernotes-timer-panel { position: fixed !important; }",
            resizeSlidesRuleCount++);
          sheet.insertRule(
            ".punch-viewer-speakernotes-text-body-scrollable, .punch-viewer-speakernotes-base { height: 100% !important; }",
            resizeSlidesRuleCount++);
          sheet.insertRule(
            "body[gsbn-dragging=true]{ cursor: e-resize; }",
            resizeSlidesRuleCount++);            
	  sheet.insertRule(
	    "punch-viewer-speaker-empty-questions { position: static; }");
          // Resize the next slide
          if (opts.nextSlide) {
            sheet.insertRule(
              ".punch-viewer-speakernotes-page-previous { vertical-align: top !important; }",
              resizeSlidesRuleCount++);       
              
            var mainSlide = window.top.document.getElementsByClassName("punch-viewer-speakernotes-page-container")[0];
            var nextSlide = window.top.document.getElementsByClassName("punch-viewer-speakernotes-page-next")[0];
            var prevSlide = window.top.document.getElementsByClassName("punch-viewer-speakernotes-page-previous")[0];
            var ratio = mainSlide.scrollHeight / mainSlide.scrollWidth;

            var nextSlideWidth = slideWidth - prevSlide.offsetWidth -
                                 parseInt(window.top.getComputedStyle(prevSlide).marginRight) -
                                 parseInt(window.top.getComputedStyle(nextSlide).marginLeft) - 10;<commit_msg>Fix code for presenter view Q&A<commit_after>var gsbn = {
  
    slideWidth : null,
    dragging : false,

    // init: add message listeners and call the appropriate function based on the request
    init : function() {
      
      // If we already setup the resizing on this page, do nothing	
      if (window.top.document.body.getAttribute("slide-resize-js") != null) {
        return;
      }
	  
	    // Make sure this is the Speaker Notes tab
      if (!window.top.location.pathname.startsWith('/presentation/') || !window.top.location.pathname.endsWith('/present')) {
        return;
      }
	  
      window.top.document.body.setAttribute("slide-resize-js", true);

      var getOptsResp = function(opts) {
        gsbn.addJS(opts);
      }
      gsbn.getOptions(getOptsResp);
    },
    
    addJS : function(opts) {             
        // Run this JavaScript code in the Speaker Notes window
        // (I'm on Chrome on Windows so I press F12 to bring up the Developer Tools, go to Console, and run it there)
        var notesMaxWidth = parseInt(opts.notesMaxWidth) || gsbnCommon.defaultOpts.notesMaxWidth;
        var resizeSlidesRuleCount = 1;
               
        // The core logic to resize the slides
        var resizeSlides = function() {
          
          // Resize the current slide
          var fullWidth = window.top.innerWidth;
          if (gsbn.slideWidth === null) {
            var slideWidth = (fullWidth < notesMaxWidth * 2) ? fullWidth / 2 : fullWidth - notesMaxWidth;
          } else {
            var slideWidth = gsbn.slideWidth;
          }
          var sheet = window.top.document.styleSheets[0];
          sheet.insertRule(
            ".punch-viewer-speakernotes-side-panel," +
            ".punch-viewer-speakernotes-page-container," +
            ".punch-viewer-speakernotes-page," +
            ".punch-viewer-speakernotes-page > svg {" +
            "  width: " + slideWidth + "px !important; " +
            "  height:auto !important;" +
            "}", resizeSlidesRuleCount++);
          sheet.insertRule(
            ".punch-viewer-speakernotes-text-body-scrollable { position: static !important; }",
            resizeSlidesRuleCount++);
	        sheet.insertRule(
	          ".punch-viewer-speaker-qanda-content { position: static !important; }",
	          resizeSlidesRuleCount++);
	        sheet.insertRule(
	          ".punch-viewer-speaker-questions,.punch-viewer-speaker-series-list, .punch-viewer-speaker-series-intro-container, .punch-viewer-speaker-qanda-not-available { position: static !important; }",
	          resizeSlidesRuleCount++);
          sheet.insertRule(
            ".punch-viewer-speakernotes-timer-panel { position: fixed !important; }",
            resizeSlidesRuleCount++);
          sheet.insertRule(
            ".punch-viewer-speakernotes-text-body-scrollable, .punch-viewer-speakernotes-base { height: 100% !important; }",
            resizeSlidesRuleCount++);
          sheet.insertRule(
            "body[gsbn-dragging=true]{ cursor: e-resize; }",
            resizeSlidesRuleCount++);            
	  sheet.insertRule(
	    ".punch-viewer-speaker-empty-questions { position: static !important; }",
        resizeSlidesRuleCount++);
          // Resize the next slide
          if (opts.nextSlide) {
            sheet.insertRule(
              ".punch-viewer-speakernotes-page-previous { vertical-align: top !important; }",
              resizeSlidesRuleCount++);       
              
            var mainSlide = window.top.document.getElementsByClassName("punch-viewer-speakernotes-page-container")[0];
            var nextSlide = window.top.document.getElementsByClassName("punch-viewer-speakernotes-page-next")[0];
            var prevSlide = window.top.document.getElementsByClassName("punch-viewer-speakernotes-page-previous")[0];
            var ratio = mainSlide.scrollHeight / mainSlide.scrollWidth;

            var nextSlideWidth = slideWidth - prevSlide.offsetWidth -
                                 parseInt(window.top.getComputedStyle(prevSlide).marginRight) -
                                 parseInt(window.top.getComputedStyle(nextSlide).marginLeft) - 10;
{'fraction_non_alphanumeric': 0.11464505986213569, 'fraction_numerical': 0.0033861410085862863, 'mean_word_length': 2.14329152413531, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6661296', 'n_tokens_mistral': 2435, 'n_tokens_neox': 2332, 'n_words': 442}