diff options
author | Teddy Wing | 2021-03-21 17:23:11 +0100 |
---|---|---|
committer | Teddy Wing | 2021-03-21 17:47:35 +0100 |
commit | a129f8e229f16292d65ffd9dcf9f8a585aa3fe8a (patch) | |
tree | 02b50df62163bc86570488ecc587489f5c09e3a2 /lib/mousetrap/plugins/record/tests/jelly.js | |
parent | 5ba6d5d6b508c535efb4ab43b02c6c21bfd49185 (diff) | |
download | Peniquitous-a129f8e229f16292d65ffd9dcf9f8a585aa3fe8a.tar.bz2 |
Remove Bower-included Mousetrap
Now that we've added Mousetrap via NPM, we can remove the one we
installed via Bower and Bower files.
Didn't really need to switch to NPM, but I wanted to get a Mousetrap
dependency that included its LICENSE file so I could include it in my
build.
Diffstat (limited to 'lib/mousetrap/plugins/record/tests/jelly.js')
-rw-r--r-- | lib/mousetrap/plugins/record/tests/jelly.js | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/lib/mousetrap/plugins/record/tests/jelly.js b/lib/mousetrap/plugins/record/tests/jelly.js deleted file mode 100644 index 57ff01a..0000000 --- a/lib/mousetrap/plugins/record/tests/jelly.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Peanut butter goes great with jelly. - * - * @author Dan Tao <daniel.tao@gmail.com> - */ -var Jelly = (function() { - var recordButton = $("button.test-record"), - recordResult = $("div.test-record-result"); - - function _formatSequenceAsHtml(sequence) { - var combos = [], - i; - - for (i = 0; i < sequence.length; ++i) { - combos.push('<span>' + _formatKeysAsHtml(sequence[i].split('+')) + '</span>'); - } - - return combos.join(' '); - } - - function _formatKeysAsHtml(keys) { - var htmlKeys = [], - i; - - for (i = 0; i < keys.length; ++i) { - htmlKeys.push('<kbd>' + keys[i] + '</kbd>'); - } - - return htmlKeys.join('+'); - } - - function _prepareRecordTest() { - recordButton.prop('disabled', true); - recordButton.text('Recording'); - - Mousetrap.record(function(sequence) { - recordResult.html(_formatSequenceAsHtml(sequence)); - recordButton.prop('disabled', false); - recordButton.text('Record'); - }); - - // take focus away from the button so that Mousetrap will actually - // capture keystrokes - recordButton.blur(); - } - - return { - spread: function() { - recordButton.click(_prepareRecordTest); - } - }; - -})(); |