<commit_before>/***********************************************************************
**                                                                    **
**  Makes the list of transcripts collapsible                         **
**                                                                    **
**  Public functions: None...                                         **
**                                                                    **
***********************************************************************/

  function __init_table_dropdown(table_id) {
/** Initialize link to either collapse or expand transcript list.

    PRIVATE - should only be executed once on page load
**/

// If no transcripts OR already generated link so return....
    if( !$(table_id) || $(table_id + '_link') ) return;

    var initial_open = $(table_id).visible();
    var txt_on       = 'show ' + table_id;
    var txt_off      = 'hide ' + table_id;

    $(table_id + '_text').appendChild(
      Builder.node( 'div',
        { id: table_id + '_link' }, 
        [ initial_open ? txt_off : txt_on ]
      )
    );

    Event.observe($(table_id + '_link'),'click',function(event){
      $(table_id).toggle();
      $(table_id+'_link').remove();
      __init_table_dropdown(table_id);
    });
  }
  function __init_transcript_dropdown() { __init_table_dropdown('transcripts'); }
  function __init_location_dropdown()   { __init_table_dropdown('locations'); }

  addLoadEvent( __init_transcript_dropdown );
  addLoadEvent( __init_location_dropdown  );<commit_msg>added collapse expand cookies<commit_after>/***********************************************************************
**                                                                    **
**  Makes the list of transcripts collapsible                         **
**                                                                    **
**  Public functions: None...                                         **
**                                                                    **
***********************************************************************/

  function __init_table_dropdown(table_id) {
/** Initialize link to either collapse or expand transcript list.

    PRIVATE - should only be executed once on page load
**/

// If no transcripts OR already generated link so return....
    
    if( !$(table_id) || $(table_id + '_link') ) return;
    var t = Cookie.get('ENSEMBL_'+table_id);
    if( t == 'close' ) {
      $(table_id).hide();
    } else { 
      $(table_id).show();
    }

    var initial_open = $(table_id).visible();
    var txt_on       = 'show ' + table_id;
    var txt_off      = 'hide ' + table_id;

    $(table_id + '_text').appendChild(
      Builder.node( 'div',
        { id: table_id + '_link' }, 
        [ initial_open ? txt_off : txt_on ]
      )
    );

    Event.observe($(table_id + '_link'),'click',function(event){
      $(table_id).toggle();
      __info( 'Setting cookie ENSEMBL_'+table_id+' to ' + ( $(table_id).visible() ? 'open' : 'close' ) );
      Cookie.set( 'ENSEMBL_'+table_id, $(table_id).visible() ? 'open' : 'close' );
      $(table_id+'_link').remove();
      __init_table_dropdown(table_id);
    });
  }
  function __init_transcript_dropdown() { __init_table_dropdown('transcripts'); }
  function __init_location_dropdown()   { __init_table_dropdown('locations'); }

  addLoadEvent( __init_transcript_dropdown );
  addLoadEvent( __init_location_dropdown  );
{'fraction_non_alphanumeric': 0.2011527377521614, 'fraction_numerical': 0.0, 'mean_word_length': 2.0156385751520416, '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': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2999853', 'n_tokens_mistral': 899, 'n_tokens_neox': 847, 'n_words': 185}