<commit_before>define [
  'i18n!react_files'
  'react'
  'compiled/react/shared/utils/withReactDOM'
  'compiled/fn/preventDefault'
  '../modules/customPropTypes'
  'compiled/models/Folder'
  './RestrictedDialogForm'
  '../utils/openMoveDialog'
  '../utils/downloadStuffAsAZip'
  '../utils/deleteStuff'
  'jquery'
  'jqueryui/dialog'
], (I18n, React, withReactDOM, preventDefault, customPropTypes, Folder, RestrictedDialogForm, openMoveDialog, downloadStuffAsAZip, deleteStuff, $) ->

  ItemCog = React.createClass
    displayName: 'ItemCog'

    propTypes:
      model: customPropTypes.filesystemObject


    render: withReactDOM ->
      wrap = (fn) =>
        preventDefault (event)=>
          fn([@props.model], {
            contextType: @props.model.collection?.parentFolder.get('context_type').toLowerCase() + 's'
            contextId: @props.model.collection?.parentFolder.get('context_id')
            returnFocusTo: event.target
          })

      span {},

        button {
          type: 'button'
          className: 'al-trigger al-trigger-gray btn btn-link'
          'aria-label': I18n.t('settings', 'Settings')
          'data-popup-within' : "#wrapper"
        },
          i className:'icon-settings',
          i className:'icon-mini-arrow-down'

        ul className:'al-options',
          li {},
            a (if @props.model instanceof Folder
              href: '#'
              onClick: wrap(downloadStuffAsAZip)
              ref: 'download'
            else
              href: @props.model.get('url')
              ref: 'download'
            ),<commit_msg>fix gear menu placement for last item in newfiles<commit_after>define [
  'i18n!react_files'
  'react'
  'compiled/react/shared/utils/withReactDOM'
  'compiled/fn/preventDefault'
  '../modules/customPropTypes'
  'compiled/models/Folder'
  './RestrictedDialogForm'
  '../utils/openMoveDialog'
  '../utils/downloadStuffAsAZip'
  '../utils/deleteStuff'
  'jquery'
  'jqueryui/dialog'
], (I18n, React, withReactDOM, preventDefault, customPropTypes, Folder, RestrictedDialogForm, openMoveDialog, downloadStuffAsAZip, deleteStuff, $) ->

  ItemCog = React.createClass
    displayName: 'ItemCog'

    propTypes:
      model: customPropTypes.filesystemObject


    render: withReactDOM ->
      wrap = (fn) =>
        preventDefault (event)=>
          fn([@props.model], {
            contextType: @props.model.collection?.parentFolder.get('context_type').toLowerCase() + 's'
            contextId: @props.model.collection?.parentFolder.get('context_id')
            returnFocusTo: event.target
          })

      span {},

        button {
          type: 'button'
          className: 'al-trigger al-trigger-gray btn btn-link'
          'aria-label': I18n.t('settings', 'Settings')
          'data-popup-within' : "#wrapper"
          'data-append-to-body' : true
        },
          i className:'icon-settings',
          i className:'icon-mini-arrow-down'

        ul className:'al-options',
          li {},
            a (if @props.model instanceof Folder
              href: '#'
              onClick: wrap(downloadStuffAsAZip)
              ref: 'download'
            else
              href: @props.model.get('url')
              ref: 'download'
            ),
{'fraction_non_alphanumeric': 0.1327188940092166, 'fraction_numerical': 0.003686635944700461, 'mean_word_length': 2.2922143579373104, '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': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3746004', 'n_tokens_mistral': 985, 'n_tokens_neox': 968, 'n_words': 170}