<commit_before>var LEVELS = ['Newcomer', 'Bronze', 'Silver', 'Gold', 'Open'];
var COLOR_MAP = {
  'Newcomer' : 'Navy',
  'Bronze' : 'SaddleBrown',
  'Silver' : 'SlateGray',
  'Gold' : 'OrangeRed',
  'Open' : 'DarkGreen'
};
var INFO_FIELDS = ['timing', 'startAlignment', 'startFoot', 'startDirection', 'comment'];

//-------------------------------------------
var viewMode = 'browse'; // vs. "routine" for building a routine
var isLatinDance = false; // do not show starting direction for Latin dances
var DANCE_MAP;
var URL_BASE;
var figures;  // all figues in the selected dance
var sortedIds = []; // display figures in alphabetically order

var showPrecedes = true;  // whether to show preceding figures
var showFollows = true;
var showComments = true;  // whether to show comments
var showDiagram = true;  // whether to show diagram
var showVideos = true; 

var generateRelativeUrl = false;  // for figure links

var selectedFigureName = inputFigureName; // current selected figure name
var routine = []; // array of RoutineStep objects

var currentAnimatedDiagram = null;

var IS_DEBUG = '0';

//-------------------------------------------
// one-time initialization after scripts are loaded
function initVars() {
  if (!IS_GADGET) {
    var paramValue = getURLParam('dance');
    if (paramValue) inputDance = paramValue;

    paramValue = getURLParam('debug');
    if (paramValue) IS_DEBUG = paramValue;
    if (IS_DEBUG == '1') showPrecedes = true;

    paramValue = getURLParam('figure');
    if (paramValue) inputFigureName = paramValue;

    /* input mode:
         '': is for per figure
         'routine': is for connection figures page - building routine
    */
    paramValue = getURLParam('mode');
    if (paramValue) inputMode = paramValue;

    paramValue = getURLParam('video');
    if (paramValue) inputVideoMode = paramValue;

    // show debug output
    document.getElementById('debugOutput').style.display = 'block';
  }

  DANCE_MAP  = {
    'Waltz' : {
      'urlprefix' : 'waltz',
      'figures' : waltzFigures,
      'type' : 'standard'
    },
    'Quickstep' : {
      'urlprefix' : 'quickstep',
      'figures' : quickstepFigures,
      'type' : 'standard'
    },
    'Foxtrot' : {
      'urlprefix' : 'slow-foxtrot',
      'figures' : foxtrotFigures,
      'type' : 'standard'
    },
    'Tango' : {
      'urlprefix' : 'tango',
      'figures' : tangoFigures,
      'type' : 'standard'
    },
    'VWaltz' : {
      'urlprefix' : 'viennese-waltz',
      'figures' : vwaltzFigures,
      'type' : 'standard'
    },
    'ChaCha' : {
      'urlprefix' : 'cha-cha-cha',
      'figures' : chachaFigures,
      'type' : 'latin'
    },
    'Samba' : {
      'urlprefix' : 'samba',
      'figures' : sambaFigures,
      'type' : 'latin'
    },
    'Jive' : {
      'urlprefix' : 'jive',
      'figures' : jiveFigures,
      'type' : 'latin'
    },
    'Rumba' : {
      'urlprefix' : 'rumba',
      'figures' : rumbaFigures,
      'type' : 'latin'
    }
  };

  isLatinDance = DANCE_MAP[inputDance]['type'] == 'latin';
  URL_BASE = 'http://www.dancecentral.info/ballroom/international-style/' + DANCE_MAP[inputDance]['urlprefix'] + '/';    
  figures = DANCE_MAP[inputDance]['figures'];
  selectedFigureName = inputFigureName; 

  // if there is a figure name, we need to reset the Level to at least include the figure's level
  // otherwise, it will apear to list all figures, nothing matches. not expectedon per figure page.
  var figure = figures[selectedFigureName];
  if (figure) { // 'all' won't match and figure will be null
    // reset level
    for (var i = 0; i< LEVELS.length; i++) { // increasing higher level
      setCookie(LEVELS[i], '1');<commit_msg>relative url<commit_after>var LEVELS = ['Newcomer', 'Bronze', 'Silver', 'Gold', 'Open'];
var COLOR_MAP = {
  'Newcomer' : 'Navy',
  'Bronze' : 'SaddleBrown',
  'Silver' : 'SlateGray',
  'Gold' : 'OrangeRed',
  'Open' : 'DarkGreen'
};
var INFO_FIELDS = ['timing', 'startAlignment', 'startFoot', 'startDirection', 'comment'];

//-------------------------------------------
var viewMode = 'browse'; // vs. "routine" for building a routine
var isLatinDance = false; // do not show starting direction for Latin dances
var DANCE_MAP;
var URL_BASE;
var figures;  // all figues in the selected dance
var sortedIds = []; // display figures in alphabetically order

var showPrecedes = true;  // whether to show preceding figures
var showFollows = true;
var showComments = true;  // whether to show comments
var showDiagram = true;  // whether to show diagram
var showVideos = true; 

var generateRelativeUrl = false;  // for figure links

var selectedFigureName = inputFigureName; // current selected figure name
var routine = []; // array of RoutineStep objects

var currentAnimatedDiagram = null;

var IS_DEBUG = '0';

//-------------------------------------------
// one-time initialization after scripts are loaded
function initVars() {
  if (!IS_GADGET) {
    var paramValue = getURLParam('dance');
    if (paramValue) inputDance = paramValue;

    paramValue = getURLParam('debug');
    if (paramValue) IS_DEBUG = paramValue;
    if (IS_DEBUG == '1') showPrecedes = true;

    paramValue = getURLParam('figure');
    if (paramValue) inputFigureName = paramValue;

    /* input mode:
         '': is for per figure
         'routine': is for connection figures page - building routine
    */
    paramValue = getURLParam('mode');
    if (paramValue) inputMode = paramValue;

    paramValue = getURLParam('video');
    if (paramValue) inputVideoMode = paramValue;

    // show debug output
    document.getElementById('debugOutput').style.display = 'block';
  }

  DANCE_MAP  = {
    'Waltz' : {
      'urlprefix' : 'waltz',
      'figures' : waltzFigures,
      'type' : 'standard'
    },
    'Quickstep' : {
      'urlprefix' : 'quickstep',
      'figures' : quickstepFigures,
      'type' : 'standard'
    },
    'Foxtrot' : {
      'urlprefix' : 'slow-foxtrot',
      'figures' : foxtrotFigures,
      'type' : 'standard'
    },
    'Tango' : {
      'urlprefix' : 'tango',
      'figures' : tangoFigures,
      'type' : 'standard'
    },
    'VWaltz' : {
      'urlprefix' : 'viennese-waltz',
      'figures' : vwaltzFigures,
      'type' : 'standard'
    },
    'ChaCha' : {
      'urlprefix' : 'cha-cha-cha',
      'figures' : chachaFigures,
      'type' : 'latin'
    },
    'Samba' : {
      'urlprefix' : 'samba',
      'figures' : sambaFigures,
      'type' : 'latin'
    },
    'Jive' : {
      'urlprefix' : 'jive',
      'figures' : jiveFigures,
      'type' : 'latin'
    },
    'Rumba' : {
      'urlprefix' : 'rumba',
      'figures' : rumbaFigures,
      'type' : 'latin'
    }
  };

  isLatinDance = DANCE_MAP[inputDance]['type'] == 'latin';
  URL_BASE = '/ballroom/international-style/' + DANCE_MAP[inputDance]['urlprefix'] + '/';    
  //URL_BASE = 'http://www.dancecentral.info/ballroom/international-style/' + DANCE_MAP[inputDance]['urlprefix'] + '/';    
  figures = DANCE_MAP[inputDance]['figures'];
  selectedFigureName = inputFigureName; 

  // if there is a figure name, we need to reset the Level to at least include the figure's level
  // otherwise, it will apear to list all figures, nothing matches. not expectedon per figure page.
  var figure = figures[selectedFigureName];
  if (figure) { // 'all' won't match and figure will be null
    // reset level
    for (var i = 0; i< LEVELS.length; i++) { // increasing higher level
      setCookie(LEVELS[i], '1');
{'fraction_non_alphanumeric': 0.16379195079556091, 'fraction_numerical': 0.0010696617194812142, 'mean_word_length': 2.755020080321285, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6788801', 'n_tokens_mistral': 2491, 'n_tokens_neox': 2391, 'n_words': 639}