<commit_before>class IDE.StatusBarMenu extends KDContextMenu

  constructor: (options = {}) ->

    menuItems         = @getMenuItems options.paneType
    {delegate}        = options
    options.menuWidth = 220
    options.x         = delegate.getX()
    options.cssClass  = 'status-bar-menu'

    super options, menuItems

    @on 'ContextMenuItemReceivedClick', (view, event) =>
      if event.target.classList.contains 'kdlistitemview'
        @destroy()

  getMenuItems: (paneType) ->
    appManager = KD.getSingleton 'appManager'
    items      = {}

    @addEditorMenuItems  items, appManager  if paneType is 'editor'
    @addDefaultMenuItems items, appManager

    return items

  addEditorMenuItems: (items, appManager) ->
    items.Save        = callback: -> appManager.tell 'IDE', 'saveFile'
    items['Save All'] = callback: -> appManager.tell 'IDE', 'saveAllFiles'
    items.customView  = @syntaxSelector = new IDE.SyntaxSelectorMenuItem
    items.separator   = type: 'separator'

  addDefaultMenuItems: (items, appManager) ->
    mainView = KD.getSingleton 'mainView'
    fsText   = if mainView.isFullscreen() then 'Exit' else 'Enter'

    items.Shortcuts  = callback: -> appManager.tell 'IDE', 'showShortcutsView'
    items["#{fsText} Fullscreen"] = callback: ->
      mainView.toggleFullscreen()
      appManager.tell 'IDE', 'doResize'
    items.Contribute = callback: -> KD.utils.createExternalLink 'https://github.com/koding/IDE'
    items.Quit       = callback: ->
      appManager.quitByName 'IDE'
      mainView.toggleFullscreen()  if mainView.isFullscreen()
      KD.getSingleton('router').handleRoute '/Activity'<commit_msg>StatusBar: Added menu item for save as.<commit_after>class IDE.StatusBarMenu extends KDContextMenu

  constructor: (options = {}) ->

    menuItems         = @getMenuItems options.paneType
    {delegate}        = options
    options.menuWidth = 220
    options.x         = delegate.getX()
    options.cssClass  = 'status-bar-menu'

    super options, menuItems

    @on 'ContextMenuItemReceivedClick', (view, event) =>
      if event.target.classList.contains 'kdlistitemview'
        @destroy()

  getMenuItems: (paneType) ->
    appManager = KD.getSingleton 'appManager'
    items      = {}

    @addEditorMenuItems  items, appManager  if paneType is 'editor'
    @addDefaultMenuItems items, appManager

    return items

  addEditorMenuItems: (items, appManager) ->
    items.Save        = callback: -> appManager.tell 'IDE', 'saveFile'
    items['Save As']  = callback: -> appManager.tell 'IDE', 'saveAs'
    items['Save All'] = callback: -> appManager.tell 'IDE', 'saveAllFiles'
    items.customView  = @syntaxSelector = new IDE.SyntaxSelectorMenuItem
    items.separator   = type: 'separator'

  addDefaultMenuItems: (items, appManager) ->
    mainView = KD.getSingleton 'mainView'
    fsText   = if mainView.isFullscreen() then 'Exit' else 'Enter'

    items.Shortcuts  = callback: -> appManager.tell 'IDE', 'showShortcutsView'
    items["#{fsText} Fullscreen"] = callback: ->
      mainView.toggleFullscreen()
      appManager.tell 'IDE', 'doResize'
    items.Contribute = callback: -> KD.utils.createExternalLink 'https://github.com/koding/IDE'
    items.Quit       = callback: ->
      appManager.quitByName 'IDE'
      mainView.toggleFullscreen()  if mainView.isFullscreen()
      KD.getSingleton('router').handleRoute '/Activity'
{'fraction_non_alphanumeric': 0.11987009152642457, 'fraction_numerical': 0.001771479185119575, 'mean_word_length': 3.261635220125786, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 26, 'https://': 2, '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': '363094', 'n_tokens_mistral': 1054, 'n_tokens_neox': 999, 'n_words': 221}