Skip to content

Commit

Permalink
Release 0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartmemo committed Sep 3, 2015
1 parent 8c1bcd1 commit 93c828a
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 20 deletions.
2 changes: 1 addition & 1 deletion bower.json
@@ -1,7 +1,7 @@
{
"name": "qwerty-hancock",
"main": "dist/qwerty-hancock.js",
"version": "0.4.5",
"version": "0.5.0",
"homepage": "http://stuartmemo.com/qwerty-hancock/",
"authors": [
{
Expand Down
38 changes: 25 additions & 13 deletions dist/qwerty-hancock.js
@@ -1,16 +1,21 @@
/*
* Qwerty Hancock keyboard library v0.4.5
* Qwerty Hancock keyboard library v0.5.0
* The web keyboard for now people.
* Copyright 2012-14, Stuart Memo
* Copyright 2012-15, Stuart Memo
*
* Licensed under the MIT License
* http://opensource.org/licenses/mit-license.php
*
* http://stuartmemo.com/qwerty-hancock
*/

(function (window, undefined) {
var version = '0.4.5',
(function () {
var root = this;
/* In <script> context, `this` is the window.
* In node context (browserify), `this` is the node global.
*/
var globalWindow = typeof global === 'undefined' ? root : root.window;
var version = '0.5.0',
settings = {},
mouse_is_down = false,
keysDown = {},
Expand Down Expand Up @@ -278,7 +283,7 @@
callback(element.title, getFrequencyOfNote(element.title));
}
};

/**
* Create key DOM element.
* @return {object} Key DOM element.
Expand Down Expand Up @@ -359,7 +364,7 @@
var setKeyPressOffset = function (sorted_white_notes) {
settings.keyPressOffset = sorted_white_notes[0] === 'C' ? 0 : 1;
};

var createKeyboard = function () {
var keyboard = {
container: document.getElementById(settings.id),
Expand Down Expand Up @@ -410,7 +415,7 @@
lightenUp(document.getElementById(key_pressed));
}
};

/**
* Handle a keyboard key being released.
* @param {element} key The DOM element of the key that was released.
Expand All @@ -437,12 +442,12 @@
var that = this;

// Key is pressed down on keyboard.
window.addEventListener('keydown', function (key) {
globalWindow.addEventListener('keydown', function (key) {
keyboardDown(key, that.keyDown);
});

// Key is released on keyboard.
window.addEventListener('keyup', function (key) {
globalWindow.addEventListener('keyup', function (key) {
keyboardUp(key, that.keyUp);
});

Expand Down Expand Up @@ -483,7 +488,7 @@
keyboard_element.addEventListener('touchcancel', function (event) {
mouseOut(event.target, that.keyUp);
});
}
}
};

/**
Expand All @@ -504,5 +509,12 @@
init.call(this, settings);
};

window.QwertyHancock = QwertyHancock;
})(window);
if (typeof exports !== 'undefined') {
if (typeof module !== 'undefined' && module.exports) {
exports = module.exports = QwertyHancock;
}
exports.QwertyHancock = QwertyHancock;
} else {
root.QwertyHancock = QwertyHancock;
}
})(this);
4 changes: 2 additions & 2 deletions dist/qwerty-hancock.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -3,7 +3,7 @@
"name": "qwerty-hancock",
"title": "Qwerty Hancock",
"description": "An interactive HTML plugin-free keyboard for your web audio project.",
"version": "0.4.5",
"version": "0.5.0",
"repository": {
"type": "git",
"url": "git@github.com:stuartmemo/qwerty-hancock.git"
Expand Down
6 changes: 3 additions & 3 deletions src/qwerty-hancock.js
@@ -1,7 +1,7 @@
/*
* Qwerty Hancock keyboard library v0.4.5
* Qwerty Hancock keyboard library v0.5.0
* The web keyboard for now people.
* Copyright 2012-14, Stuart Memo
* Copyright 2012-15, Stuart Memo
*
* Licensed under the MIT License
* http://opensource.org/licenses/mit-license.php
Expand All @@ -15,7 +15,7 @@
* In node context (browserify), `this` is the node global.
*/
var globalWindow = typeof global === 'undefined' ? root : root.window;
var version = '0.4.5',
var version = '0.5.0',
settings = {},
mouse_is_down = false,
keysDown = {},
Expand Down

0 comments on commit 93c828a

Please sign in to comment.