Socket
Socket
Sign inDemoInstall

jquery-shortcuts

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.0 to 1.3.1

30

jquery.shortcuts.js
/*!
* jQuery Shortcuts Plugin v1.3.0
* jQuery Shortcuts Plugin v1.3.1
* https://github.com/riga/jquery.shortcuts

@@ -17,3 +17,3 @@ *

/**
* Store the global shortcuts object.
* Store the global shortcut group.
*/

@@ -74,3 +74,3 @@

/**
* Helper function that returns a specific shortcuts object for a given namespace.
* Helper function that returns a specific shortcut group for a given namespace.
*

@@ -84,3 +84,3 @@ * @param {string} namespace - Namespace of the shortcuts object.

// the global shortcuts object needs to be setup
// the global shortcut group needs to be setup
if (!globalShortcuts) {

@@ -99,3 +99,3 @@ return null;

// recursive lookup in each shortcut object's sub objects
// recursive lookup in each shortcut group's subgroups
var shortcuts = globalShortcuts;

@@ -116,5 +116,5 @@ while (parts.length) {

/**
* Helper function that returns the name of a shortcuts object given its namespace.
* Helper function that returns the name of a shortcut group given its namespace.
*
* @param {string} namespace - The namespace of the shortcuts object.
* @param {string} namespace - The namespace of the shortcut group.
* @returns {string}

@@ -136,3 +136,3 @@ */

/**
* Helper functions that parses a key and returns helpful variables in an object.
* Helper functions that parses a key and returns helpful variables.
*

@@ -173,6 +173,6 @@ * @example

* @param {string|object} [namespace=globalNamespace] - A string that defines the namespace of the
* new shortcuts. In that case, the global namespace will be prefixed and the created shortcuts
* object is returned. When an object is passed, it is used to extend the default options and the
* main shortcuts object is returned. Make sure to extend the options _before_ instantiating the
* first shortcuts object.
* new shortcuts. In that case, the global namespace will be prefixed and the created shortcut
* group is returned. When an object is passed, it is used to extend the default options and the
* main `Shortcuts` object is returned. Make sure to extend the options _before_ instantiating
* the first shortcut group.
* @returns {shortcuts|Shortcuts}

@@ -194,3 +194,3 @@ */

// is there already a shortcuts object with that namespace?
// is there already a shortcut group with that namespace?
var self = getShortcuts(namespace);

@@ -387,3 +387,3 @@

/**
* Store the new shortcuts object.
* Store the new shortcut group.
*/

@@ -420,3 +420,3 @@

/**
* Return the created shortcuts.
* Return the created group.
*/

@@ -423,0 +423,0 @@

{
"name": "jquery-shortcuts",
"version": "1.3.0",
"version": "1.3.1",
"author": "Marcel Rieger <marcelrieger@icloud.com>",
"description": "jQuery.Shortcuts lets you easily switch between sets of arbitrary and easy-to-define shortcuts.",
"description": "jQuery.Shortcuts lets you easily switch between groups of arbitrary and easy-to-define shortcuts.",
"keywords": [

@@ -7,0 +7,0 @@ "jquery-plugin",

@@ -37,3 +37,3 @@ # jQuery.Shortcuts

##### Add and remove (global) shortcuts:
##### Add and remove (global) shortcuts

@@ -46,3 +46,3 @@ ```javascript

var handler = function(event) {
// some nifty action
// some nifty action
};

@@ -57,3 +57,3 @@ sc.add("ctrl+h", handler);

##### Handle shortcut parentage using namespaces:
##### Handle shortcut parentage using namespaces

@@ -90,3 +90,3 @@ ```javascript

var handler = function(event) {
// do sth here
// do sth here
};

@@ -133,14 +133,14 @@ sc1.add("ctrl+h", handler);

> Disable the shortcuts. Please see the **note** in `enable()`.
* `priority([priority])`
> When `priority` is given, the priority is set to that value. Otherwise, the current priority is returned. **Note** that priorities are only applied, when the `priorities` option is set to `true`.
> When `priority` is given, the priority is set to that value. Otherwise, the current priority is returned. **Note** that priorities are only applied, when the `priorities` option is set to `true`.
* `add(key, [handler1], [handler2], [...])`
> Add handlers for a shortcut given by `key`. See [John Resig's hotkeys plugin](https://github.com/jeresig/jquery.hotkeys) for more information on the format. As of version 1.1.0, you can prepend the desired event type to your key using the colon character, e.g. `keydown:ctrl+a`. `keydown` is the default. Other valid events are `keyup` and `keypress`.
> Add handlers for a shortcut given by `key`. See [John Resig's hotkeys plugin](https://github.com/jeresig/jquery.hotkeys) for more information on the format. As of version 1.1.0, you can prepend the desired event type to your key using the colon character, e.g. `keydown:ctrl+a`. `keydown` is the default. Other valid events are `keyup` and `keypress`.
* `remove(key, [handler1], [handler2], [...])`
> Remove handlers for a shortcut given by `key`. If no handlers are given, remove all handlers for that `key`.
> Remove handlers for a shortcut given by `key`. If no handlers are given, remove all handlers for that `key`.
* `empty()`
> Remove all handlers for all keys.
> Remove all handlers for all keys.

@@ -147,0 +147,0 @@ * `options()`

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc