<commit_before>class ContentPanel extends KDView

  constructor:(options, data)->

    super options, data

    @registerSingleton "contentPanel", @, yes
    @bindTransitionEnd()
    @listenWindowResize()
    @state = 'full'

    @navOpenedOnce = if KD.isLoggedIn() then yes else no

    mainViewController = @getSingleton "mainViewController"
    mainViewController.on "UILayoutNeedsToChange", @bound "changeLayout"
    mainViewController.on "browseRequested", @bound "browseRequested"

  typeMap =
    full    : 'adjustForFullWidth'
    develop : 'adjustForDevelop'
    social  : 'adjustForSocial'

  nameMap =
    Home    : 'adjustForFullWidth'

  browseRequested:->
    @navOpenedOnce = yes
    @adjustForSocial()
    @getSingleton("mainView").mainTabView.changeLayout hideTabs : no

  changeLayout:(options)->

    {type, hideTabs, name}    = options
    @windowController or= @getSingleton 'windowController'

    @unsetClass 'full develop social'
    @adjustShadow hideTabs
    @navOpenedOnce = yes unless name in ["Home", "Activity"]

    @adjustLayoutHelper name, type

  adjustShadow:(hideTabs)->
    @[if hideTabs then 'setClass' else 'unsetClass'] "no-shadow"

  adjustLayoutHelper:(name, type)->
    if KD.isLoggedIn() or @navOpenedOnce
    then @[nameMap[name] or typeMap[type] or typeMap[@state]]?()
    else @adjustForFullWidth()

  adjustForFullWidth:->
    @setX 0
    @setWidth @windowController.winWidth
    @setClass 'full'
    @state = 'full'

  adjustForDevelop:->
    @setX 260
    @setWidth @windowController.winWidth - 260
    @setClass 'develop'
    @state = 'develop'

  adjustForSocial:->
    @setX 0<commit_msg>Move windowController assignment to constructor<commit_after>class ContentPanel extends KDView

  constructor:(options, data)->

    super options, data

    @registerSingleton "contentPanel", @, yes
    @bindTransitionEnd()
    @listenWindowResize()
    @state = 'full'
    @windowController or= @getSingleton 'windowController'

    @navOpenedOnce = if KD.isLoggedIn() then yes else no

    mainViewController = @getSingleton "mainViewController"
    mainViewController.on "UILayoutNeedsToChange", @bound "changeLayout"
    mainViewController.on "browseRequested", @bound "browseRequested"

  typeMap =
    full    : 'adjustForFullWidth'
    develop : 'adjustForDevelop'
    social  : 'adjustForSocial'

  nameMap =
    Home    : 'adjustForFullWidth'

  browseRequested:->
    @navOpenedOnce = yes
    @adjustForSocial()
    @getSingleton("mainView").mainTabView.changeLayout hideTabs : no

  changeLayout:(options)->

    {type, hideTabs, name}    = options

    @unsetClass 'full develop social'
    @adjustShadow hideTabs
    @navOpenedOnce = yes unless name in ["Home", "Activity"]

    @adjustLayoutHelper name, type

  adjustShadow:(hideTabs)->
    @[if hideTabs then 'setClass' else 'unsetClass'] "no-shadow"

  adjustLayoutHelper:(name, type)->
    if KD.isLoggedIn() or @navOpenedOnce
    then @[nameMap[name] or typeMap[type] or typeMap[@state]]?()
    else @adjustForFullWidth()

  adjustForFullWidth:->
    @setX 0
    @setWidth @windowController.winWidth
    @setClass 'full'
    @state = 'full'

  adjustForDevelop:->
    @setX 260
    @setWidth @windowController.winWidth - 260
    @setClass 'develop'
    @state = 'develop'

  adjustForSocial:->
    @setX 0
{'fraction_non_alphanumeric': 0.11037394451145958, 'fraction_numerical': 0.0048250904704463205, 'mean_word_length': 3.8282387190684135, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6742827', 'n_tokens_mistral': 1102, 'n_tokens_neox': 1013, 'n_words': 243}