【问题标题】:How to Put Emoticons into Chat Text Area?如何将表情符号放入聊天文本区?
【发布时间】:2016-11-30 21:06:47
【问题描述】:

我正在开发一个即时通讯工具,并希望启用“聊天者”以将表情符号添加到他们的聊天中。这是我目前所拥有的。

<template name="chat_page">
    <h2>Type in the box below to send a message!</h2>
  <div class="row">
    <div class="col-md-12">
      <div class="well well-lg">
        {{#each messages}}
          {{> chat_message}}
        {{/each}}
      </div>
    </div>
  </div> 
  <div class="row">
    <div class="col-xs-12 col-sm-6 col-sm-offset-3">
      <form class="js-send-chat">  
        <div class="form-group">  
          <input class="form-control" id="input-emoticon" type="text" name="chat" placeholder="type a message here..." />
        </div>
        <button class="btn btn-primary btn-block">Send</button>
      </form>
    </div>
  </div>
</template>

【问题讨论】:

  • 您可以像使用任何“特殊字符”一样使用 unicode 表情符号
  • 感谢丹的回复。尝试实现 EmojiOne。还在挣扎。任何有助于这项工作的链接将不胜感激。

标签: javascript jquery html emoticons


【解决方案1】:
<template name="emotis">
  {{{ parseEmoticons }}}
</template>

<template name="chat_page">
    <h2>Type in the box below to send a message!</h2>
  <div class="row">
    <div class="col-md-12">
      <div class="well well-lg">
        {{#each messages}}
          {{> chat_message}}
        {{/each}}
      </div>
    </div>
  </div>
  <div class="row">
    <div class="col-xs-12 col-sm-6 col-sm-offset-3">
      <form class="js-send-chat">  
        <div class="form-group">  
          <input class="form-control" id="input-emoticon" type="text" name="chat" placeholder="type a message here..." />
        </div>
        <button class="btn btn-primary btn-block">Send</button>
      </form>
    </div>
  </div>
</template>

<template name="chat_message">
  <div class="row">
    <div class="col-md-12">
      <span class=avatar> <img src="/{{creatorAvatar sentBy}}" class="creatorImg"> </span>
      <span class="text">On {{timeStamp}} </span>
      <span class="bold">{{getUserById sentBy}} said: {{{parseEmoticons text}}} </span>
    </div>
  </div>
<br>
<br>
</template>

【讨论】:

猜你喜欢
  • 2016-05-10
  • 2012-10-19
  • 1970-01-01
  • 2021-01-15
  • 2021-01-20
  • 1970-01-01
  • 1970-01-01
  • 2014-05-03
  • 2016-02-09
相关资源
最近更新 更多