简体   繁体   English

用于textarea和自由文本的Facebook jQuery自动完成插件

[英]Facebook jQuery autocomplete plugin for textarea & free text

Is there a jQuery plugin, similar to Facebook, that suggests/autocompletes with this criteria: 是否存在类似于Facebook的jQuery插件,它建议/使用此标准自动填充:

  1. Works for a textarea or contenteditable div. 适用于textarea或contenteditable div。 I'm finding many plugins that only support input fields (ex. http://loopj.com/jquery-tokeninput/ ). 我找到了许多只支持输入字段的插件(例如http://loopj.com/jquery-tokeninput/ )。
  2. Supports free text, a combination of tags and non-tag text. 支持自由文本,标签和非标签文本的组合。 This is an example that only allows tags after hitting enter: http://brianreavis.github.io/selectize.js/ - This is NOT free text. 这是一个只允许在输入后输入标签的例子: http//brianreavis.github.io/selectize.js/ - 这不是免费文本。 Examples of free text would be At.js ( http://ichord.github.io/At.js ), jquery-textcomplete ( http://yuku-t.com/jquery-textcomplete ), and jquery.mentionsInput ( http://podio.github.io/jquery-mentions-input ) 自由文本的示例是At.js( http://ichord.github.io/At.js ),jquery-textcomplete( http://yuku-t.com/jquery-textcomplete )和jquery.mentionsInput( http ://podio.github.io/jquery-mentions-input
  3. Pill-like CSS effect with backspace/delete functionality. 具有退格/删除功能的类似药丸的CSS效果。 http://yuku-t.com/jquery-textcomplete/ gets pretty close but the styling example doesn't have the delete functionality found in other plugins. http://yuku-t.com/jquery-textcomplete/非常接近,但样式示例没有在其他插件中找到的删除功能。 Example 1 has a good remove functionality. 示例1具有良好的删除功能。

Here is an example from Zapier that does it well: 以下是Zapier的一个例子:

Zapier

Found rich_textarea, which meets all the criteria. 找到rich_textarea,符合所有标准。

https://github.com/Yermo/rich_textarea https://github.com/Yermo/rich_textarea

Even though you've found a plug-in which suits your needs, I figured I'd suggest an alternative (for you, and anybody that may stumble upon this). 即使你找到了一个适合你需求的插件,我想我会建议一个替代方案(对你和任何可能偶然发现的人)。 The more the merrier, right? 越多越好,对吗?

Mentionator exceeds* all of your requirements, and is also lighter, and compatible across a greater number of browsers (with it being able to be affixed to <textarea> elements) than rich_textarea (the subject plug-in of the accepted answer at the time of this post). Mentionator超出了您的所有要求,并且更轻,并且与rich_textarea(当时接受的答案的主题插件)相比,可以在更多的浏览器中兼容(它可以附加到<textarea>元素)这篇文章)。

I should probably mentioned that Mentionator is maintained by yours truly :) . 我应该提到Mentionator是由你自己维护:)。

*Mentionator provides doesRecognizeDelimitedSubstrings and delimValue options, which are described in the Mentionator documentation as: * Mentionator提供了doRecognizeDelimitedSubstringsdelimValue选项,这些选项在Mentionator文档中描述为:

doesRecognizeDelimitedSubstrings: 
    A boolean which, if defined as true, will allow the external value
    of a mention, herein called "mentionExternalValue", to sustain
    modifications so long as the result of each such modification 
    is in mentionExternalValue.split(delimValue)

delimValue: 
    A string, or regular expression representing the set of strings,
    that, given doesRecognizeDelimitedSubstrings === true, delimit
    mentionExternalValue substrings that can also serve as external
    value of the mention if yielded by a modification of
    mentionExternalValue

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM