Attempt to replicate slack search input field as ember addon.
Like search input field in slack, special keywords(modifiers) are used to filter out the search. This modifiers are passed as form of config object with options like:
configHash: {
"@": { // '@' is special key (modifier) which highlighted in input
type: 'list', // type of modifier (either list or date)
defaultHint: 'any user', // displayed when modifier is active but has no value
sectionTitle: 'Users', // used as header when all modifiers content displayed
content: [ // content to be used for displaying list
{value: 'abrahm', label: 'Abrahm Micanski' },
{value: 'lilly', label: 'Lilly Richards' },
{value: 'emma', label: 'Emma Roberts' },
]
},
"before:": {
type: 'date',
defaultHint: 'a date',
}
}
There is also help popup which is displayed when user focuses input first time. The content of popup should be passed to slack-search-input
in block form.
Simple placeholder displayed when input has no value
Config object used for getting modifiers
Initial value of input
Can be used to hide popups
Max character length of input
Fired when inputValue changes
Fired when modifier has valid value
Fired when the escape key is hit
Currently two types of modifiers are supported list
and date
:
Once you got query string, you can deserialze it to object.
import { deserializeQueryString } from `ember-slack-search-input`;
search() {
let queryString = get(this, 'queryString');
console.log(queryString) // `before:2000-23-23 lorem`
let modifiers = deserializeQueryString(queryString);
let before = modifiers['before:'];
let { model, fullText, modifier, value } = before[0]; //first occurance of `before:`
console.log(model); // moment date
console.log(fullText); // before:2000-23-23
console.log(modifier); // before:
console.log(value); // 2000-23-23
}
Currently addon styles has hard dependency on bootstrap 3.x.x
, bootstrap should be installed already to styles work properly.For input field to react properly to paste/cut
events, they should be added to customEvents
hash in app.js
.
App = Ember.Application.extend({
customEvents: {
paste: "paste",
cut: "cut"
},
...
});
ember install ember-slack-search-input
<form id="myform"> <input type="search" id="searchText" th:value="${searchText}" autocomplete="off"><a id="searchBtn" onclick="searchFun()"></a> </form> html禁用input在输入时自动弹出自带的下拉框 绑定输入法搜索
Search Input 当监控被触发的时候,使用搜索输入把Elasticsearch搜索请求结果加入到执行上下文。有关支持的所有属性,请参阅搜索输入属性。 在搜索输入的request对象中,你可以指定: 您希望搜索的索引 搜索类型 搜索请求体 搜索请求体支持全Elasticsearch查询DSL--- 它与Elasticsearch _search请求体相同。 例如,以下输
input元素可以通过属性控制 MDN https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/input/search css3新增属性控制input[type=search] 1.::-webkit-input-placeholder 2.::-webkit-search-cancel-button 重写边框样式 input[type
使用css3新增的属性来控制input[type=search] input[type=search]::-webkit-search-cancel-button{ -webkit-appearance: none; }
/* --清除谷歌浏览器下的 search 叉号 */ input::-webkit-search-cancel-button { display: none; } /* --清除IE下的 search 叉号 */ input[type="search"]::-ms-clear { display: none; }
slack-term A Slack client for your terminal. Installation Binary installation Download acompatible binary for your system. For convenience, place slack-term in adirectory where you can access it from
slack-cli | Powerful Slack CLI via pure bash A pure bash, pipe friendly, feature rich, command line interface for Slack.Richly formatted messages,file uploads, and even creating Slack posts are first
Elixir-Slack This is a Slack Real Time Messaging API client for Elixir. You'll need aSlack API token which can be retrieved by following the Token GenerationInstructions or by creating anew bot integr
Laravel Slack Notification Channel Official Documentation Documentation for Laravel Slack Notification Channel can be found on the Laravel website. Contributing Thank you for considering contributing
Zabbix Slack AlertScript About This is simply a Bash script that uses the custom alert script functionality within Zabbix along with the incoming web-hook feature of Slack. I originally created this s
Slack Bash Scripts 包含一组用于 Slackware Linux 管理维护的工具脚本。