<commit_before>// $Revision$

// Left menu panel - both on the main page and the popup config-type box
Ensembl.Panel.LocalContext = Ensembl.Panel.extend({
  init: function () {
    var panel = this;
    
    this.base();
    
    this.shareEnabled = false;
    
    $.extend(this, Ensembl.Share);
    
    this.shareInit();
    
    Ensembl.EventManager.register('removeShare',  this, this.removeShare);
    Ensembl.EventManager.register('hashChange',   this, this.removeShare);
    Ensembl.EventManager.register('reloadPage',   this, this.removeShare);
    Ensembl.EventManager.register('ajaxComplete', this, this.shareReady);
    
    this.elLk.links = $('ul.local_context li', this.el);
    
    $('img.toggle', this.elLk.links).on('click', function () {
      var li  = $(this).parent();
      
      li.toggleClass('closed');
      
      var state = li.hasClass('closed') ? 'closed' : 'open';
      var modal = panel instanceof Ensembl.Panel.ModalContent;
      var code  = (modal ? panel.params.url : window.location.pathname).replace(Ensembl.speciesPath + '/', '').split('/')[0];
      
      $(this).attr('src', function (i, src) { return src.replace(/closed|open/, state); });
      
      $.ajax({
        url: '/Ajax/nav_config',
        data: {
          code:  code,
          menu:  this.className.replace(/toggle|\s/g, ''),
          state: state === 'closed' ^ li.hasClass('default_closed') ? 1 : 0
        }
      });
      
      li = null;
      
      return false;
    });
  },
  
  shareReady: function () {
    var panel = this;
    
    this.shareOptions.species = {};
    
    $.each(Ensembl.PanelManager.getPanels('ImageMap'), function () {
      panel.shareOptions.species[this.id] = this.getSpecies();
    });
    
    this.shareEnabled = true;
    
    if (this.shareWaiting) {
      this.share(this.elLk.shareLink.href, this.elLk.shareLink);<commit_msg>this.elLk.shareLink is a jquery element now<commit_after>// $Revision$

// Left menu panel - both on the main page and the popup config-type box
Ensembl.Panel.LocalContext = Ensembl.Panel.extend({
  init: function () {
    var panel = this;
    
    this.base();
    
    this.shareEnabled = false;
    
    $.extend(this, Ensembl.Share);
    
    this.shareInit();
    
    Ensembl.EventManager.register('removeShare',  this, this.removeShare);
    Ensembl.EventManager.register('hashChange',   this, this.removeShare);
    Ensembl.EventManager.register('reloadPage',   this, this.removeShare);
    Ensembl.EventManager.register('ajaxComplete', this, this.shareReady);
    
    this.elLk.links = $('ul.local_context li', this.el);
    
    $('img.toggle', this.elLk.links).on('click', function () {
      var li  = $(this).parent();
      
      li.toggleClass('closed');
      
      var state = li.hasClass('closed') ? 'closed' : 'open';
      var modal = panel instanceof Ensembl.Panel.ModalContent;
      var code  = (modal ? panel.params.url : window.location.pathname).replace(Ensembl.speciesPath + '/', '').split('/')[0];
      
      $(this).attr('src', function (i, src) { return src.replace(/closed|open/, state); });
      
      $.ajax({
        url: '/Ajax/nav_config',
        data: {
          code:  code,
          menu:  this.className.replace(/toggle|\s/g, ''),
          state: state === 'closed' ^ li.hasClass('default_closed') ? 1 : 0
        }
      });
      
      li = null;
      
      return false;
    });
  },
  
  shareReady: function () {
    var panel = this;
    
    this.shareOptions.species = {};
    
    $.each(Ensembl.PanelManager.getPanels('ImageMap'), function () {
      panel.shareOptions.species[this.id] = this.getSpecies();
    });
    
    this.shareEnabled = true;
    
    if (this.shareWaiting) {
      this.share(this.elLk.shareLink[0].href, this.elLk.shareLink[0]);
{'fraction_non_alphanumeric': 0.16035751840168244, 'fraction_numerical': 0.002103049421661409, 'mean_word_length': 2.471715328467153, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '231703', 'n_tokens_mistral': 1216, 'n_tokens_neox': 1198, 'n_words': 220}