<commit_before>class MainViewController extends KDViewController

  logViewByElement = (el) ->

    for id, view of KD.instances when view.getElement?
      if el is view.getElement()
        log view
        break

    logViewByElement el.parentNode  unless el.parentNode is document.body


  constructor:->

    super

    {repeat, killRepeat} = KD.utils
    mainView             = @getView()
    appManager           = KD.singleton 'appManager'
    windowController     = KD.singleton 'windowController'
    display              = KD.singleton 'display'
    mainController       = KD.singleton 'mainController'

    mainView.on 'MainTabPaneShown', (pane) =>
      @mainTabPaneChanged mainView, pane

    appManager.on 'AppIsBeingShown', (controller) =>
      @setBodyClass KD.utils.slugify controller.getOption 'name'

      # todo:
      # remove this part once mmvp becomes mvp - SY
      {name} = controller.getOptions()
      switch name
        when 'IDE'
          mainView.activitySidebar?.deselectAllItems()
          mainView.activitySidebar?.activityLink?.unsetClass 'selected'
        when 'Activity'
          mainView.activitySidebar?.activityLink?.setClass 'selected'
          mainView.activitySidebar?.machineTree?.deselectAllNodes()



    display?.on 'ContentDisplayWantsToBeShown', do =>
      type = null
      (view) => @setBodyClass type  if type = view.getOption 'type'

    windowController.on 'ScrollHappened', @bound 'handleScroll'

    # if KD.config?.environment isnt 'production'
    #   window.addEventListener 'click', (event) =>
    #     if event.metaKey and event.altKey
    #       logViewByElement event.target
    #   , yes


  loadView:(mainView)->

    mainView.ready =>

      {body} = document
      if KD.checkFlag 'super-admin'
      then KDView.setElementClass body, 'add', 'super'
      else KDView.setElementClass body, 'remove', 'super'


  handleScroll: do ->

    threshold     = 50
    lastScroll    = 0<commit_msg>main: cmd+option click to debug is back<commit_after>class MainViewController extends KDViewController

  logViewByElement = (el) ->

    for id, view of KD.instances when view.getElement?
      if el is view.getElement()
        log view
        break

    logViewByElement el.parentNode  unless el.parentNode is document.body


  constructor:->

    super

    {repeat, killRepeat} = KD.utils
    mainView             = @getView()
    appManager           = KD.singleton 'appManager'
    windowController     = KD.singleton 'windowController'
    display              = KD.singleton 'display'
    mainController       = KD.singleton 'mainController'

    mainView.on 'MainTabPaneShown', (pane) =>
      @mainTabPaneChanged mainView, pane

    appManager.on 'AppIsBeingShown', (controller) =>
      @setBodyClass KD.utils.slugify controller.getOption 'name'

      # todo:
      # remove this part once mmvp becomes mvp - SY
      {name} = controller.getOptions()
      switch name
        when 'IDE'
          mainView.activitySidebar?.deselectAllItems()
          mainView.activitySidebar?.activityLink?.unsetClass 'selected'
        when 'Activity'
          mainView.activitySidebar?.activityLink?.setClass 'selected'
          mainView.activitySidebar?.machineTree?.deselectAllNodes()



    display?.on 'ContentDisplayWantsToBeShown', do =>
      type = null
      (view) => @setBodyClass type  if type = view.getOption 'type'

    windowController.on 'ScrollHappened', @bound 'handleScroll'

    if KD.config?.environment isnt 'production'
      window.addEventListener 'click', (event) =>
        if event.metaKey and event.altKey
          logViewByElement event.target
      , yes


  loadView:(mainView)->

    mainView.ready =>

      {body} = document
      if KD.checkFlag 'super-admin'
      then KDView.setElementClass body, 'add', 'super'
      else KDView.setElementClass body, 'remove', 'super'


  handleScroll: do ->

    threshold     = 50
    lastScroll    = 0
{'fraction_non_alphanumeric': 0.09539473684210527, 'fraction_numerical': 0.0015182186234817814, 'mean_word_length': 2.639963167587477, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, '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': '4723201', 'n_tokens_mistral': 1177, 'n_tokens_neox': 1098, 'n_words': 273}