<commit_before>import * as xhr from 'common/xhr';
import { sparkline } from '@fnando/sparkline';
import throttle from 'common/throttle';
import resizeHandle from 'common/resize';
import * as cg from 'chessground/types';
import { Api as ChessgroundApi } from 'chessground/api';

type CoordModifier = 'new' | 'next' | 'current' | 'resolved';

lichess.load.then(() => {
  $('#trainer').each(function (this: HTMLElement) {
    const $trainer = $(this);
    const $board = $('.coord-trainer__board .cg-wrap');
    const $coordsSvg = $('.coords-svg');
    const $coordTexts = $coordsSvg.find('.coord text');
    let ground: ChessgroundApi;
    const $side = $('.coord-trainer__side');
    const $right = $('.coord-trainer__table');
    const $bar = $trainer.find('.progress_bar');
    const $start = $right.find('.start');
    const $explanation = $right.find('.explanation');
    const $score = $('.coord-trainer__score');
    const $timer = $('.coord-trainer__timer');
    const scoreUrl = $trainer.data('score-url');
    const duration = 30 * 1000;
    const tickDelay = 50;
    const resizePref = $trainer.data('resize-pref');
    let colorPref = $trainer.data('color-pref');
    let color: Color;
    let startAt: Date, score: number;
    let wrongTimeout: number;
    let ply = 0;

    const showColor = function () {
      color = colorPref == 'random' ? ['white', 'black'][Math.round(Math.random())] : colorPref;
      if (!ground)
        ground = window.Chessground($board[0], {
          coordinates: false,
          drawable: { enabled: false },
          movable: {
            free: false,
            color: null,
          },
          orientation: color,
          addPieceZIndex: $('#main-wrap').hasClass('is3d'),
          events: {
            insert(elements: cg.Elements) {<commit_msg>Only block touch scrolling on coordinate training<commit_after>import * as xhr from 'common/xhr';
import { sparkline } from '@fnando/sparkline';
import throttle from 'common/throttle';
import resizeHandle from 'common/resize';
import * as cg from 'chessground/types';
import { Api as ChessgroundApi } from 'chessground/api';

type CoordModifier = 'new' | 'next' | 'current' | 'resolved';

lichess.load.then(() => {
  $('#trainer').each(function (this: HTMLElement) {
    const $trainer = $(this);
    const $board = $('.coord-trainer__board .cg-wrap');
    const $coordsSvg = $('.coords-svg');
    const $coordTexts = $coordsSvg.find('.coord text');
    let ground: ChessgroundApi;
    const $side = $('.coord-trainer__side');
    const $right = $('.coord-trainer__table');
    const $bar = $trainer.find('.progress_bar');
    const $start = $right.find('.start');
    const $explanation = $right.find('.explanation');
    const $score = $('.coord-trainer__score');
    const $timer = $('.coord-trainer__timer');
    const scoreUrl = $trainer.data('score-url');
    const duration = 30 * 1000;
    const tickDelay = 50;
    const resizePref = $trainer.data('resize-pref');
    let colorPref = $trainer.data('color-pref');
    let color: Color;
    let startAt: Date, score: number;
    let wrongTimeout: number;
    let ply = 0;

    const showColor = function () {
      color = colorPref == 'random' ? ['white', 'black'][Math.round(Math.random())] : colorPref;
      if (!ground)
        ground = window.Chessground($board[0], {
          coordinates: false,
          blockTouchScroll: true,
          drawable: { enabled: false },
          movable: {
            free: false,
            color: null,
          },
          orientation: color,
          addPieceZIndex: $('#main-wrap').hasClass('is3d'),
          events: {
            insert(elements: cg.Elements) {
{'fraction_non_alphanumeric': 0.16113228089275994, 'fraction_numerical': 0.005988023952095809, 'mean_word_length': 3.0607734806629834, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4301323', 'n_tokens_mistral': 1158, 'n_tokens_neox': 1118, 'n_words': 280}