#19489 closed enhancement (maybelater)
Consider updating jquery.hotkeys plugin
Reported by: | GaryJ | Owned by: | |
---|---|---|---|
Milestone: | Priority: | low | |
Severity: | normal | Version: | 3.3 |
Component: | External Libraries | Keywords: | needs-patch |
Focuses: | javascript | Cc: |
Description
The current version of the jquery.hotkeys plugin in trunk is "(beta)(0.0.3)", where as the latest version (as linked to from the credits screen) is 0.8.
Incidentally, this 0.8 version from tzuryby is credited as being authored by John Resig (and indeed, he appears to have his own repo for it.
Change History (13)
#2
@
13 years ago
For jQuery 1.7+ you should be using on()
instead of bind()
, but I doubt that would fix the experience you're getting with it.
As both tzuryby and jeresig seem not to be addressing the outstanding issues, it may be worth following up on one of the recently active (one committed yesterday for instance) forks as visible from https://github.com/jeresig/jquery.hotkeys/network.
#4
in reply to:
↑ 1
@
13 years ago
Replying to kurtpayne:
API as of 0.8:
$(document).bind('keyup', 'Ctrl+C', function() {...});
According to the readme and this comment, the correct syntax is this:
$(document).bind('keydown.ctrl_a', fn);
#5
@
13 years ago
- Milestone changed from Awaiting Review to Future Release
Perhaps it would be best to also check/refactor table-hotkeys.js (our implementation of the plugin) too. A good initial patch is at http://core.trac.wordpress.org/attachment/ticket/20885/20885.patch.
#6
@
12 years ago
- Resolution set to fixed
- Status changed from new to closed
I have been having trouble getting this plugin to work properly -- it kept binding all the keys at once no matter what key I set. Because of this, hitting any key would trigger my alert "hello." It took two days to find what was wrong, but this code below should work for everyone, where 'S' is the key you chose to keydown (or up) upon:
jQuery(document).bind('keydown', function (e){ if (String.fromCharCode(e.keyCode) == 'S') { alert('hello'); e.preventDefault(); return false; } });
Hope this is helpful to someone!
#9
@
5 years ago
- Focuses javascript added
- Keywords close added
- Milestone set to 5.4
I'm marking this as a low priority, and as a candidate to close
for a few reasons:
- This is a super old library that, even in forked repositories, appears to be no longer actively maintained.
- In core, this only seems to be used for comments.
- There are a few lines commented out for browser compatibility reasons (see #20885).
- In the future, comments may actually become blocks/block editors.
- There are better, more modern ways to accomplish this.
But, let's try to at least look at this and close this out in 5.4 by either:
- Closing out without updating.
- Updating to the latest version of the current repository.
There seem to be some compatibility changes that need to be made to update to the "latest" version. If this requires anything more than a trivial level of effort, I vote to leave it as is.
#10
@
5 years ago
@desrosj Revisting this one, do you still feel this is a close
candidate at this point? I don't see any recent movement here, and 5.4 Beta 1 is closing in.
This ticket was mentioned in Slack in #core by david.baumwald. View the logs.
5 years ago
#12
@
5 years ago
- Keywords close removed
- Milestone 5.4 deleted
- Resolution set to maybelater
- Status changed from reopened to closed
I am going to close this one out. If someone wants to spend the time working on this it can be reopened.
But, since there are more modern ways to accomplish this, and it is not heavily utilized by Core, I think it can be left as is.
It looks like there was a version jump from 0.03 to 0.7. The later version looks like a complete rewrite. As of 0.8, the project was moved to github. I can't find anything about releases 0.4 through 0.6.
The API has changed, too. API as of 0.03:
API as of 0.8:
I tested this on a local installation and was getting some very odd behavior similar to this comment. After some investigation, I wasn't able to discern the root cause.