<commit_before>{div, span, header, i} = React.DOM
{form, input, label} = React.DOM

roomForm = React.createClass
  submit: ->
    {room} = @refs
    roomNode = room.getDOMNode()
    if roomNode.value
      @props.joinMessage {room: room.state.value, nick: 'Peppe'}
    false

  render: ->
    form className: "credentials-form", onSubmit: @submit,
      label {}, "Huone",
        input className: "credentials-room", type: "text", ref: "room"
      input className: "credentials-send", type: "submit", value: "Send",

usersHeader = React.createClass
  render: ->
    header className: "users-header",
      div {},
        span className: "room-name", @props.room
        i className: "fa fa-times"

usersContainer = React.createClass
  render: ->
    div id: "users-container",
      usersHeader {room: @props.room}
      # roomForm {joinMessage: @joinMessage}

module.exports.usersContainer = usersContainer
<commit_msg>make room name content editable<commit_after>{div, span, header, i} = React.DOM
{form, input, label} = React.DOM

roomForm = React.createClass
  submit: ->
    {room} = @refs
    roomNode = room.getDOMNode()
    if roomNode.value
      @props.joinMessage {room: room.state.value, nick: 'Peppe'}
    false

  render: ->
    form className: "credentials-form", onSubmit: @submit,
      label {}, "Huone",
        input className: "credentials-room", type: "text", ref: "room"
      input className: "credentials-send", type: "submit", value: "Send",

usersHeader = React.createClass
  handleRoomContentEditable: () ->
    node = @refs.roomName.getDOMNode()
    node.textContent = ""
    node.contentEditable = true
    node.focus()

  changeRoom: (ev) ->
    if ev.keyCode isnt 13 then return
    node = @refs.roomName.getDOMNode()
    node.contentEditable = false
    node.blur()

  render: ->
    header className: "users-header",
      div {},
        span {className: "room-name", ref: "roomName", onBlur: @changeRoom, onKeyDown: @changeRoom}, @props.room
        i className: "fa fa-times", onClick: @handleRoomContentEditable

usersContainer = React.createClass
  render: ->
    div id: "users-container",
      usersHeader {room: @props.room}
      # roomForm {joinMessage: @joinMessage}

module.exports.usersContainer = usersContainer

{'fraction_non_alphanumeric': 0.13780918727915195, 'fraction_numerical': 0.0008833922261484099, 'mean_word_length': 3.322519083969466, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '6791514', 'n_tokens_mistral': 715, 'n_tokens_neox': 701, 'n_words': 182}