Core: Fixed #3233: Added constants for key codes.

This commit is contained in:
Scott González 2008-08-23 00:23:54 +00:00
parent 57ed1acc45
commit e0e41d7a5b

View File

@ -11,15 +11,44 @@
/** jQuery core modifications and additions **/ /** jQuery core modifications and additions **/
// This adds a selector to check if data exists.
jQuery.expr[':'].data = "jQuery.data(a, m[3])";
var _remove = $.fn.remove; var _remove = $.fn.remove;
$.fn.remove = function() { $.fn.remove = function() {
$("*", this).add(this).triggerHandler("remove"); $("*", this).add(this).triggerHandler("remove");
return _remove.apply(this, arguments ); return _remove.apply(this, arguments );
}; };
// This adds a selector to check if data exists.
jQuery.expr[':'].data = "jQuery.data(a, m[3])";
$.keyCode = {
BACKSPACE: 8,
CAPS_LOCK: 20,
COMMA: 188,
CONTROL: 17,
DELETE: 46,
DOWN: 40,
END: 35,
ENTER: 13,
ESCAPE: 27,
HOME: 36,
INSERT: 45,
LEFT: 37,
NUMPAD_ADD: 107,
NUMPAD_DECIMAL: 110,
NUMPAD_DIVIDE: 111,
NUMPAD_ENTER: 108,
NUMPAD_MULTIPLY: 106,
NUMPAD_SUBTRACT: 109,
PAGE_DOWN: 34,
PAGE_UP: 33,
PERIOD: 190,
RIGHT: 39,
SHIFT: 16,
SPACE: 32,
TAB: 9,
UP: 38
};
// $.widget is a factory to create jQuery plugins // $.widget is a factory to create jQuery plugins
// taking some boilerplate code out of the plugin code // taking some boilerplate code out of the plugin code
// created by Scott González and Jörn Zaefferer // created by Scott González and Jörn Zaefferer