<commit_before>{ Controller } = require 'spine'
Configuration = require '../lib/configuration'

class QuickGuide extends Controller
  className: 'quick-guide'
  template: Configuration.QuickGuideTemplate

  show: false

  events:
    'click .tab': 'toggle'
    'click img': 'onClick'

  constructor: ->
    super
    @html @template

  toggle: =>
    right = if @show then 0 else -1 * @el.width()
    @el.css('right', right)
    @show = not @show

  onClick: (e) =>
    type = e.target.dataset.type
    @navigate('/guide')

    if type in ['lensing-clusters', 'lensed-galaxies', 'lensed-quasars']
      sectionType = 'real-lenses'
    if type in ['noise', 'offsets']
      sectionType = 'artifacts'
    else
      sectionType = 'false-positives'

    $(".guide-menu li[data-type='#{sectionType}']").click()
    $("ul.menu li[data-type='#{type}']").click()
<commit_msg>Fix quick guide<commit_after>{ Controller } = require 'spine'
Configuration = require '../lib/configuration'

class QuickGuide extends Controller
  className: 'quick-guide'
  template: Configuration.QuickGuideTemplate

  show: false

  events:
    'click .tab': 'toggle'
    'click img': 'onClick'

  constructor: ->
    super
    @html @template

  toggle: =>
    right = if @show then 0 else -1 * @el.width()
    @el.css('right', right)
    @show = not @show

  onClick: (e) =>
    window.location.hash = '/guide'

    type = e.target.dataset.type

    if type in ['lensing-clusters', 'lensed-galaxies', 'lensed-quasars']
      sectionType = 'real-lenses'
    else if type in ['noise', 'offsets']
      sectionType = 'artifacts'
    else
      sectionType = 'false-positives'

    $(".guide-menu li[data-type='#{sectionType}']").click()
    $("ul.menu li[data-type='#{type}']").click()

{'fraction_non_alphanumeric': 0.16287015945330297, 'fraction_numerical': 0.002277904328018223, 'mean_word_length': 3.1933174224343674, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '6867977', 'n_tokens_mistral': 594, 'n_tokens_neox': 568, 'n_words': 142}