<commit_before>package EnsEMBL::Web::Document::HTML::Javascript;
use strict;
use CGI qw(escapeHTML);
use EnsEMBL::Web::Document::HTML;
use warnings;

@EnsEMBL::Web::Document::HTML::Javascript::ISA = qw(EnsEMBL::Web::Document::HTML);

sub new { return shift->SUPER::new( 'scripts' => '', 'sources' => {} ); }

sub add_source { 
  my( $self, $src ) = @_;
  return unless $src;
  
  return if $self->{'sources'}{$src};
  $self->{'sources'}{$src}=1;
  $self->{'scripts'}.=qq(  <script type="text/javascript" src="$src"></script>\n);
}

sub add_script {
  return unless $_[1];
  $_[0]->{'scripts'}.=qq(  <script type="text/javascript">\n$_[1]</script>\n);
}

sub render { $_[0]->print( $_[0]->{'scripts'} ); } 
1;

<commit_msg>added by default setting of ENSEMBL_START_TIME<commit_after>package EnsEMBL::Web::Document::HTML::Javascript;
use strict;
use CGI qw(escapeHTML);
use EnsEMBL::Web::Document::HTML;
use warnings;

@EnsEMBL::Web::Document::HTML::Javascript::ISA = qw(EnsEMBL::Web::Document::HTML);

sub new {
  my $class = shift;
  my $self = $class->SUPER::new( 'scripts' => '', 'sources' => {} );
  $self->add_script( 'var ENSEMBL_START_TIME=new Date();' );
  return $self;
}

sub add_source { 
  my( $self, $src ) = @_;
  return unless $src;
  
  return if $self->{'sources'}{$src};
  $self->{'sources'}{$src}=1;
  $self->{'scripts'}.=qq(  <script type="text/javascript" src="$src"></script>\n);
}

sub add_script {
  return unless $_[1];
  $_[0]->{'scripts'}.=qq(  <script type="text/javascript">\n$_[1]</script>\n);
}

sub render { $_[0]->print( $_[0]->{'scripts'} ); } 
1;


{'fraction_non_alphanumeric': 0.2427307206068268, 'fraction_numerical': 0.008849557522123894, 'mean_word_length': 5.434959349593496, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 30, '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': '1208110', 'n_tokens_mistral': 627, 'n_tokens_neox': 603, 'n_words': 111}