@gitlab/at.js

中文文档
1.5.11发布于 2026/10/16MITCommonJS零依赖近 30 天下载 16.7万

This is a temporary fork of https://github.com/ichord/At.js.

原始使用文档
文档目录9 节
  1. How to publish a new version
  2. ⚠️ Announcement ⚠️
  3. Demo
  4. Documentation
  5. Compatibility
  6. Features Preview
  7. Requirements
  8. Integrating with your Application
  9. Core Team Members

@gitlab/at.js

This is a temporary fork of https://github.com/ichord/At.js.

At GitLab we are moving away from at.js, but in the mean time we have a few fixes to the library:

How to publish a new version

  1. In a branch with your changes, run prepare-new-version.sh and follow its instructions.
Original description

⚠️ Announcement ⚠️

This project was no longer maintained. You could use zurb tribute instead.


An autocompletion library to autocomplete mentions, smileys etc. just like on Github!
Build Status

Notice

At.js now depends on Caret.js.
Please read CHANGELOG.md for more details if you are going to update to new version.

Demo

http://ichord.github.com/At.js

Documentation

https://github.com/ichord/At.js/wiki

Compatibility

  • textarea - Chrome, Safari, Firefox, IE7+ (maybe IE6)
  • contentEditable - Chrome, Safari, Firefox, IE9+

Features Preview

  • Support IE 7+ for textarea.
  • Supports HTML5 contentEditable elements (NOT including IE 8)
  • Can listen to any character and not just '@'. Can set up multiple listeners for different characters with different behavior and data
  • Listener events can be bound to multiple inputors.
  • Format returned data using templates
  • Keyboard controls in addition to mouse
    • Tab or Enter keys select the value
    • Up and Down navigate between values (and Ctrl-P and Ctrl-N also)
    • Right and left will re-search the keyword.
  • Custom data handlers and template renderers using a group of configurable callbacks
  • Supports AMD

Requirements

  • jQuery >= 1.7.0.
  • Caret.js (You can use Component or Bower to install it.)

Integrating with your Application

Simply include the following files in your HTML and you are good to go.

<link href="css/jquery.atwho.css" rel="stylesheet">
<script src="http://code.jquery.com/jquery.js"></script>
<script src="js/jquery.caret.js"></script>
<script src="js/jquery.atwho.js"></script>
$('#inputor').atwho({
    at: "@",
    data:['Peter', 'Tom', 'Anne']
})

Bower & Component

For installing using Bower you can use jquery.atwho and for Component please use ichord/At.js.

Rails

You can include At.js in your Rails application using the gem jquery-atwho-rails.

Core Team Members

版本与发布记录

@gitlab/at.js 共发布 6 个版本,首次发布于 2020/02/14;过去 12 个月发布了 3 个版本。

版本发布日期距今
1.5.11latest2026/10/1630 天前
1.5.92026/07/074 个月前
1.5.82026/07/074 个月前
1.5.72021/01/275 年前
1.5.62021/01/235 年前
1.5.52020/02/146 年前

关于 @gitlab/at.js 的常见问题

@gitlab/at.js 是什么?

This is a temporary fork of https://github.com/ichord/At.js.

如何安装 @gitlab/at.js?

在项目目录运行 npm install @gitlab/at.js,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:jquery(>=1.7.0 <4.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@gitlab/at.js 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/gitlab__at.js 是否存在。

@gitlab/at.js 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@gitlab/at.js 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >= 0.6.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@gitlab/at.js 可以商用吗?

@gitlab/at.js 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@gitlab/at.js 的下载量有多少?

根据 npm 官方下载统计,@gitlab/at.js 在 2026/10/17 – 2026/11/15 这 30 天内被下载 167,205 次,日均约 5,574 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@gitlab/at.js 还在维护吗?

最新版本 1.5.11 发布于 2026/10/16(30 天前);至今共发布 6 个版本,其中过去 12 个月发布了 3 个;首次发布于 2020/02/14。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。