<commit_before>package com.mogproject.mogami.playground.view.parts

import com.mogproject.mogami.core.State
import com.mogproject.mogami.playground.controller.{Controller, English, Japanese, Language}
import org.scalajs.dom.html.{Button, Div}

import scalatags.JsDom.all._

/**
  * key: (state: State, isHandicap: Boolean)
  */
object EditReset extends ButtonLike[(State, Boolean), Button, Div] {
  override protected val keys = Seq(
    (State.HIRATE, false),
    (State.MATING_BLACK, false),
    (State.MATING_WHITE, false),
    (State.HANDICAP_LANCE, true),
    (State.HANDICAP_BISHOP, true),
    (State.HANDICAP_ROOK, true),
    (State.HANDICAP_ROOK_LANCE, true),
    (State.HANDICAP_2_PIECE, true),
    (State.HANDICAP_3_PIECE, true),
    (State.HANDICAP_4_PIECE, true),
    (State.HANDICAP_5_PIECE, true),
    (State.HANDICAP_6_PIECE, true),
    (State.HANDICAP_8_PIECE, true),
    (State.HANDICAP_10_PIECE, true),
    (State.HANDICAP_THREE_PAWNS, true),
    (State.HANDICAP_NAKED_KING, true)
  )

  override protected val labels: Map[Language, Seq[String]] = Map(
    Japanese -> Seq(
      "平手", "詰将棋 (先手)", "詰将棋 (後手)",
      "香落ち", "角落ち", "飛車落ち", "飛香落ち",
      "二枚落ち", "三枚落ち", "四枚落ち", "五枚落ち",
      "六枚落ち", "八枚落ち", "十枚落ち",
      "歩三兵", "裸玉"),
    English -> Seq("Even", "Mating (Black)", "Mating (White)",
      "Lance", "Bishop", "Rook", "Rook-Lance",
      "2-Piece", "3-Piece", "4-Piece", "5-Piece",
      "6-Piece", "8-Piece", "10-Piece",
      "Three Pawns", "Naked King")
  )

  override def initialize(): Unit = {}

  override protected def generateInput(key: (State, Boolean)): Button = button(
    tpe := "button",
    cls := "btn btn-default btn-block",
    data("dismiss") := "modal",
    onclick := { () => invoke(key) }
  ).render

  override protected def invoke(key: (State, Boolean)): Unit = Controller.setEditInitialState(key._1, key._2)

  override val output: Div = div(
    cls := "row", inputs.map(e => div(cls := "col-md-4 col-xs-6", e))<commit_msg>fixed EditReset layout for size md<commit_after>package com.mogproject.mogami.playground.view.parts

import com.mogproject.mogami.core.State
import com.mogproject.mogami.playground.controller.{Controller, English, Japanese, Language}
import org.scalajs.dom.html.{Button, Div}

import scalatags.JsDom.all._

/**
  * key: (state: State, isHandicap: Boolean)
  */
object EditReset extends ButtonLike[(State, Boolean), Button, Div] {
  override protected val keys = Seq(
    (State.HIRATE, false),
    (State.MATING_BLACK, false),
    (State.MATING_WHITE, false),
    (State.HANDICAP_LANCE, true),
    (State.HANDICAP_BISHOP, true),
    (State.HANDICAP_ROOK, true),
    (State.HANDICAP_ROOK_LANCE, true),
    (State.HANDICAP_2_PIECE, true),
    (State.HANDICAP_3_PIECE, true),
    (State.HANDICAP_4_PIECE, true),
    (State.HANDICAP_5_PIECE, true),
    (State.HANDICAP_6_PIECE, true),
    (State.HANDICAP_8_PIECE, true),
    (State.HANDICAP_10_PIECE, true),
    (State.HANDICAP_THREE_PAWNS, true),
    (State.HANDICAP_NAKED_KING, true)
  )

  override protected val labels: Map[Language, Seq[String]] = Map(
    Japanese -> Seq(
      "平手", "詰将棋 (先手)", "詰将棋 (後手)",
      "香落ち", "角落ち", "飛車落ち", "飛香落ち",
      "二枚落ち", "三枚落ち", "四枚落ち", "五枚落ち",
      "六枚落ち", "八枚落ち", "十枚落ち",
      "歩三兵", "裸玉"),
    English -> Seq("Even", "Mating (Black)", "Mating (White)",
      "Lance", "Bishop", "Rook", "Rook-Lance",
      "2-Piece", "3-Piece", "4-Piece", "5-Piece",
      "6-Piece", "8-Piece", "10-Piece",
      "Three Pawns", "Naked King")
  )

  override def initialize(): Unit = {}

  override protected def generateInput(key: (State, Boolean)): Button = button(
    tpe := "button",
    cls := "btn btn-default btn-block",
    data("dismiss") := "modal",
    onclick := { () => invoke(key) }
  ).render

  override protected def invoke(key: (State, Boolean)): Unit = Controller.setEditInitialState(key._1, key._2)

  override val output: Div = div(
    cls := "row", inputs.map(e => div(cls := "col-lg-4 col-xs-6", e))
{'fraction_non_alphanumeric': 0.17483044461190655, 'fraction_numerical': 0.01004772670183371, 'mean_word_length': 3.7517899761336517, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '2771825', 'n_tokens_mistral': 1601, 'n_tokens_neox': 1650, 'n_words': 314}