All Projects → akzhan → Jquery Keyfilter

akzhan / Jquery Keyfilter

This plugin filters keyboard input by specified regular expression.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Jquery Keyfilter

Selectpage
A simple style and powerful selector, including ajax remote data, autocomplete, pagination, tags, i18n and keyboard navigation features
Stars: ✭ 679 (+1735.14%)
Mutual labels:  keyboard, jquery-plugin
Cmd Toutiao
摸鱼神器:在命令行中看今日头条
Stars: ✭ 34 (-8.11%)
Mutual labels:  keyboard
Framecarousel
A jQuery plugin for quickly creating carousels within frames
Stars: ✭ 14 (-62.16%)
Mutual labels:  jquery-plugin
Mechanical Keyboard
DIY mechanical keyboard and where to find them
Stars: ✭ 947 (+2459.46%)
Mutual labels:  keyboard
Gtm In Viewport Manager
A manager of in-viewport events for GTM (Google Tag Manager).
Stars: ✭ 20 (-45.95%)
Mutual labels:  jquery-plugin
Typing Assistant
Typing Assistant provides the ability to autocomplete words and suggests predictions for the next word. This makes typing faster, more intelligent and reduces effort.
Stars: ✭ 32 (-13.51%)
Mutual labels:  keyboard
Bootstrap
Open Source JS plugins
Stars: ✭ 13 (-64.86%)
Mutual labels:  jquery-plugin
Viewer
⚠️ [Deprecated] No longer maintained, please use https://github.com/fengyuanchen/jquery-viewer
Stars: ✭ 985 (+2562.16%)
Mutual labels:  jquery-plugin
Emojikeyboard
自定义表情键盘(支持系统表情, 图片表情),仅供参考学习~
Stars: ✭ 33 (-10.81%)
Mutual labels:  keyboard
Silence
A simple, clean macro recorder written in C#. Windows 10 compatible.
Stars: ✭ 29 (-21.62%)
Mutual labels:  keyboard
Voyager65 Keyplus
65% keyboard PCB for Keyplus firmware. Simplified variants available.
Stars: ✭ 29 (-21.62%)
Mutual labels:  keyboard
Sticky Nav
A jQuery plugin make the navbar sticky, smart anchor link highlighting, smooth scrolling. Simple and powerful.
Stars: ✭ 21 (-43.24%)
Mutual labels:  jquery-plugin
Gridstrap.js
gridstrap.js is a jQuery plugin designed to take Bootstrap's CSS grid system and turn it into a managed draggable and resizeable grid while truely maintaining its responsive behaviour.
Stars: ✭ 32 (-13.51%)
Mutual labels:  jquery-plugin
Sodieremojikeyboardplus
支持自定义emoji表情,icon font , FontAwesome,斜体,超链接,粗体,下划线,字体,颜色,镂空字体等富文本
Stars: ✭ 14 (-62.16%)
Mutual labels:  keyboard
Chrome Virtual Keyboard
Touch-friendly Virtual Keyboard for Chrome browser
Stars: ✭ 35 (-5.41%)
Mutual labels:  keyboard
Infinite Scroll
📜 Automatically add next page
Stars: ✭ 7,006 (+18835.14%)
Mutual labels:  jquery-plugin
Armory Keyboard
utility for emulating a USB HID keyboard with the USBArmory
Stars: ✭ 28 (-24.32%)
Mutual labels:  keyboard
Parallax background
jQuery parallax background plugin based on GSAP
Stars: ✭ 30 (-18.92%)
Mutual labels:  jquery-plugin
Jquery Sse
jQuery Plugin for Server-Sent Events (SSE) EventSource Polyfill
Stars: ✭ 37 (+0%)
Mutual labels:  jquery-plugin
Jquery.tabslideout.js
jQuery plugin to create a side/top/bottom tab that slides out to show a feedback form, contact form, notepad etc.
Stars: ✭ 35 (-5.41%)
Mutual labels:  jquery-plugin

Introduction

This jQuery plugin filters keyboard input by specified regular expression.

Source code inspired by Ext.JS (Ext.form.TextField, Ext.EventManager), but was modified to provide more accurate logic.

Procedural style

$("#ggg").keyfilter(/[\dA-F]/);

Also you can pass test function instead of regexp. Its arguments:

  • this - HTML DOM Element (event target).
  • c - String that contains incoming character.
$("#ggg").keyfilter(function(c) { return c != 'a'; });

CSS class attribute style

<input type="text" class="mask-num" />

Inputs with CSS classes like this will automatically have the corresponding regexp below applied.

Predefined classes with its regexps

  • mask-pint: /[\d]/
  • mask-int: /[\d\-]/
  • mask-pnum: /[\d\.]/
  • mask-num: /[\d\-\.]/
  • mask-hex: /[0-9a-f]/i
  • mask-email: /[a-z0-9_\.\[email protected]]/i
  • mask-alpha: /[a-z_]/i
  • mask-alphanum: /[a-z0-9_]/i

Using different classes

You can apply these standard regexps to different classes if you wish.

$("input.integer").keyfilter($.fn.keyfilter.defaults.masks.int)

Extensibility

Keyfilter supports extending and changing of list of provided masks.

Example of extending

/*
 * Key filter masks for hosting.
 */

(function($)
{
  var hostingMasks = {
    dir: /[a-z0-9_\/\-\.]/i,
    ftpuser: /[a-z0-9_]/
  };

  $.extend($.fn.keyfilter.defaults.masks, hostingMasks);

})(jQuery);

Override built-in masks to allow french accents

/*
 * Key filter masks supporting french accents.
 */

(function($)
{
  $.extend($.fn.keyfilter.defaults.masks, {
    alpha:    /[a-zéèçàêoe_]/i,
    alphanum: /[a-zéèçàêoe0-9_]/i
  });
})(jQuery);

Overriding

You can fully override masks by simple assignment after the plugin loads but before the document.ready event fires.

$.fn.keyfilter.defaults.masks = { ... };
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].