<commit_before># $Id$

package EnsEMBL::Web::Document::Element::Logo;

### Generates the logo wrapped in a link to the homepage

use strict;

use base qw(EnsEMBL::Web::Document::Element);

sub image       :lvalue { $_[0]{'image'};       }
sub width       :lvalue { $_[0]{'width'};       }
sub height      :lvalue { $_[0]{'height'};      }
sub alt         :lvalue { $_[0]{'alt'};         }
sub href        :lvalue { $_[0]{'href'}         }
sub print_image :lvalue { $_[0]{'print_image'}; }

sub logo_img {
### a
  my $self = shift;
  return sprintf(
    '<img src="%s%s" alt="%s" title="%s" class="print_hide" style="width:%spx;height:%spx" />',
    $self->img_url, $self->image, $self->alt, $self->alt, $self->width, $self->height
  );
}

sub logo_print {
### a
  my $self = shift;
  return sprintf(
    '<img src="%s%s" alt="%s" title="%s" class="screen_hide_inline" style="width:%spx;height:%spx" />',
    $self->img_url, $self->print_image, $self->alt, $self->alt, $self->width, $self->height
  ) if ($self->print_image);
}

sub content {
  my $self = shift;
  my $url  = $self->href || $self->home_url;
  
  return sprintf '<a href="%s">%s</a>%s', $url, $self->logo_img, $self->logo_print;
}

sub init {
  my $self  = shift;
  my $style = $self->species_defs->ENSEMBL_STYLE;
  
  $self->image       = $style->{'SITE_LOGO'};
  $self->width       = $style->{'SITE_LOGO_WIDTH'};
  $self->height      = $style->{'SITE_LOGO_HEIGHT'};
  $self->alt         = $style->{'SITE_LOGO_ALT'};
  $self->href        = $style->{'SITE_LOGO_HREF'};
  $self->print_image = $style->{'PRINT_LOGO'};
}

1;
<commit_msg>Added alternative logo for mobile browsers<commit_after># $Id$

package EnsEMBL::Web::Document::Element::Logo;

### Generates the logo wrapped in a link to the homepage

use strict;

use base qw(EnsEMBL::Web::Document::Element);

sub image       :lvalue { $_[0]{'image'};       }
sub width       :lvalue { $_[0]{'width'};       }
sub height      :lvalue { $_[0]{'height'};      }
sub alt         :lvalue { $_[0]{'alt'};         }
sub href        :lvalue { $_[0]{'href'}         }
sub print_image :lvalue { $_[0]{'print_image'}; }

sub logo_print {
### a
  my $self = shift;
  return sprintf(
    '<img src="%s%s" alt="%s" title="%s" class="screen_hide_inline" style="width:%spx;height:%spx" />',
    $self->img_url, $self->print_image, $self->alt, $self->alt, $self->width, $self->height
  ) if ($self->print_image);
}

sub content {
  my $self = shift;
  my $url  = $self->href || $self->home_url;
  
  my $html = sprintf '<a href="%s"><div class="logo-header print_hide" title="%s">&nbsp;</div></a>', 
              $url, $self->alt; 

  my $species = $self->hub->{'_species'};
  $species = '' if ($species eq 'Multi');

  $html .= sprintf '<span class="mobile-only species-header">%s</span>',
              $species ? $self->species_defs->SPECIES_COMMON_NAME 
                       : $self->species_defs->ENSEMBL_SITETYPE; 

  $html .= $self->logo_print;

  return $html;
}

sub init {
  my $self  = shift;
  my $style = $self->species_defs->ENSEMBL_STYLE;
  
  $self->image       = $style->{'SITE_LOGO'};
  $self->width       = $style->{'SITE_LOGO_WIDTH'};
  $self->height      = $style->{'SITE_LOGO_HEIGHT'};
  $self->alt         = $style->{'SITE_LOGO_ALT'};
  $self->href        = $style->{'SITE_LOGO_HREF'};
  $self->print_image = $style->{'PRINT_LOGO'};
}

1;

{'fraction_non_alphanumeric': 0.21169833729216153, 'fraction_numerical': 0.004156769596199525, 'mean_word_length': 3.248423707440101, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 76, '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': '3510716', 'n_tokens_mistral': 1315, 'n_tokens_neox': 1295, 'n_words': 252}