index.js
function getChatboxElement() {
    var content = h('div', {

    });

    var keyPressHandler = (e) => {
      if (e.charCode === 13) {
        var messageText = e.srcElement.value;

        if (messageText.length > 0) {
          e.srcElement.value = "";
          sendMessage(messageText);
        }

      }
    }

    var sendMessageBox = h('input', {
      onkeypress: keyPressHandler,
      className: 'ssb-embedded-chat-input-box',
      disabled: !chatboxEnabled
    });

    var scroller = h('div', {
      style: {
        'overflow-y': 'auto',
        'overflow-x': 'hidden'
      },
      className: 'ssb-embedded-chat-messages'
    }, content);

    pull(
      messagesSource(),
      aborter,
      pull.asyncMap(getNameAndChatMessage),
      Scroller(scroller,
        content,
        (details) =>
        renderChatMessage(details.message, details.displayName, details.isOld), false, true)
      );

    var chatBox = h('div', {
      className: 'ssb-embedded-chat',
    }, scroller, sendMessageBox)

    return chatBox;
  }
function getChatboxElement() {
    var content = h('div', {

    });

    var keyPressHandler = (e) => {
      if (e.charCode === 13) {
        var messageText = e.srcElement.value;

        if (messageText.length > 0) {
          e.srcElement.value = "";
          sendMessage(messageText);
        }

      }
    }

    var sendMessageBox = h('input', {
      onkeypress: keyPressHandler,
      className: 'ssb-embedded-chat-input-box',
      disabled: !chatboxEnabled
    });

    var scroller = h('div', {
      style: {
        'overflow-y': 'auto',
        'overflow-x': 'hidden'
      },
      className: 'ssb-embedded-chat-messages'
    }, content);

    pull(
      messagesSource(),
      aborter,
      pull.asyncMap(getNameAndChatMessage),
      Scroller(scroller,
        content,
        (details) =>
        renderChatMessage(details.message, details.displayName, details.isOld), false, true)
      );

    var chatBox = h('div', {
      className: 'ssb-embedded-chat',
    }, scroller, sendMessageBox)

    return chatBox;
  }
function getChatboxElement ( ) { var content = h ( 'div' , { } ) ; var keyPressHandler = ( e ) => { if ( e . charCode === 13 ) { var messageText = e . srcElement . value ; if ( messageText . length > 0 ) { e . srcElement . value = "" ; sendMessage ( messageText ) ; } } } var sendMessageBox = h ( 'input' , { onkeypress : keyPressHandler , className : 'ssb-embedded-chat-input-box' , disabled : ! chatboxEnabled } ) ; var scroller = h ( 'div' , { style : { 'overflow-y' : 'auto' , 'overflow-x' : 'hidden' } , className : 'ssb-embedded-chat-messages' } , content ) ; pull ( messagesSource ( ) , aborter , pull . asyncMap ( getNameAndChatMessage ) , Scroller ( scroller , content , ( details ) => renderChatMessage ( details . message , details . displayName , details . isOld ) , false , true ) ) ; var chatBox = h ( 'div' , { className : 'ssb-embedded-chat' , } , scroller , sendMessageBox ) return chatBox ; }
Return the scroller HTML DOM element that the consuming code
can attach to the DOM somewhere.
Return the scroller HTML DOM element that the consuming code can attach to the DOM somewhere .