<commit_before>function handleIframeHeight() {
  
  var updateHeight = function updateHeight() {
    var height = $( window ).height();
    var iframe = $( '.colorblind' );
    var iframeHeight = height - iframe.offset().top;
    
    iframe.css( 'height', iframeHeight + 'px' );
  }
  
  $( window ).resize( updateHeight );
  updateHeight();
  
}

function handleFormSubmit() {

  $( '#url-form' ).submit(function( event ) {
    event.preventDefault();
    var url = $( '#url-form .form-control' ).val();
    loadUrl( url );
  });

}

function handleAbnormalityMenu() {

  $( '#abnormality-menu li a' ).click( function( event ) {
    event.preventDefault();
    
    var key = $( this ).attr( 'key' );
    loadFilter( key );
    $( '#abnormality-menu .dropdown-toggle span' ).html( $( this ).html() );
  } ) ;
  
}

function loadFilter( filter ) {
  
  var element = $( '.colorblind' );
  var value = 'none' === filter ? '' : 'url(colorblindness.svg#' + filter + ')';
  
  element.css( 'filter', value );
  element.css( '-webkit-filter', value );
  
}

function loadUrl( url ) {
   
  if( -1 === url.indexOf( "://" ) ) {
    url = 'http://' + url;
  }
  
  $( '#url-form .form-control' ).val( url );
  $( 'iframe.colorblind' ).attr( 'src', url );
  jump( url );
  
}

function jump( anchor ) {

  var url = location.href;
  history.replaceState( null, null, url );
  location.hash = '#' + anchor;
  
}

$( function main() {
  <commit_msg>When guessing the protocol, use the current protocol (http or https) instead of fixing http<commit_after>function handleIframeHeight() {
  
  var updateHeight = function updateHeight() {
    var height = $( window ).height();
    var iframe = $( '.colorblind' );
    var iframeHeight = height - iframe.offset().top;
    
    iframe.css( 'height', iframeHeight + 'px' );
  }
  
  $( window ).resize( updateHeight );
  updateHeight();
  
}

function handleFormSubmit() {

  $( '#url-form' ).submit(function( event ) {
    event.preventDefault();
    var url = $( '#url-form .form-control' ).val();
    loadUrl( url );
  });

}

function handleAbnormalityMenu() {

  $( '#abnormality-menu li a' ).click( function( event ) {
    event.preventDefault();
    
    var key = $( this ).attr( 'key' );
    loadFilter( key );
    $( '#abnormality-menu .dropdown-toggle span' ).html( $( this ).html() );
  } ) ;
  
}

function loadFilter( filter ) {
  
  var element = $( '.colorblind' );
  var value = 'none' === filter ? '' : 'url(colorblindness.svg#' + filter + ')';
  
  element.css( 'filter', value );
  element.css( '-webkit-filter', value );
  
}

function loadUrl( url ) {
   
  if( -1 === url.indexOf( "://" ) ) {
    url = location.protocol + '//' + url;
  }
  
  $( '#url-form .form-control' ).val( url );
  $( 'iframe.colorblind' ).attr( 'src', url );
  jump( url );
  
}

function jump( anchor ) {

  var url = location.href;
  history.replaceState( null, null, url );
  location.hash = '#' + anchor;
  
}

$( function main() {
  
{'fraction_non_alphanumeric': 0.19050824638168967, 'fraction_numerical': 0.0006731740154830024, 'mean_word_length': 2.81025641025641, 'pattern_counts': {'":': 2, '<': 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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5838524', 'n_tokens_mistral': 1020, 'n_tokens_neox': 990, 'n_words': 236}