Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ Wiki: [Home](https://github.com/Mottie/Keyboard/wiki/Home) | [FAQ](https://githu

Only the latest changes will be shown below, see the [wiki log](https://github.com/Mottie/Keyboard/wiki/Log) to view older versions.

### Version 1.26.1 (8/12/2016)

* Add new setting `closeByClickEvent`. See [pull #476](https://github.com/Mottie/Keyboard/pull/476); thanks [@SeeeD](https://github.com/SeeeD)!
* Core: Include `userClosed` default.
* Docs: Switch to using `"normal"` instead of `"default"`.

### Version 1.26.0 (7/29/2016)

* Core:
Expand All @@ -159,9 +165,3 @@ Only the latest changes will be shown below, see the [wiki log](https://github.c
* Add `autoAcceptOnValid` option.
* Readme: Add link to react.js component.
* Testing: Update to jQuery 3.0.0-rc1; update migrate.

### Version 1.25.28 (5/23/2016)

* Readme: Add link to gemfile. Thanks to [scicasoft](https://github.com/scicasoft) for creating it!
* Docs: Update jQuery & add migrate for v3.0. Not using jQuery v3.0 yet due to limitations with Bootstrap.
* Core: Only trigger named events. Fixes [issue #463](https://github.com/Mottie/Keyboard/issues/463).
2 changes: 1 addition & 1 deletion dist/js/jquery.keyboard.extension-all.min.js

Large diffs are not rendered by default.

35 changes: 21 additions & 14 deletions dist/js/jquery.keyboard.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! jQuery UI Virtual Keyboard v1.26.0 *//*
/*! jQuery UI Virtual Keyboard v1.26.1 *//*
Author: Jeremy Satterfield
Maintained: Rob Garrison (Mottie on github)
Licensed under the MIT License
Expand Down Expand Up @@ -42,7 +42,7 @@ http://www.opensource.org/licenses/mit-license.php
var $keyboard = $.keyboard = function (el, options) {
var o, base = this;

base.version = '1.26.0';
base.version = '1.26.1';

// Access to jQuery and DOM versions of element
base.$el = $(el);
Expand Down Expand Up @@ -143,7 +143,8 @@ http://www.opensource.org/licenses/mit-license.php
kbevents.kbHidden,
kbevents.inputCanceled,
kbevents.inputAccepted,
kbevents.kbBeforeClose
kbevents.kbBeforeClose,
kbevents.inputRestricted
], function (i, callback) {
if ($.isFunction(o[callback])) {
// bind callback functions within options to triggered events
Expand All @@ -161,11 +162,9 @@ http://www.opensource.org/licenses/mit-license.php
tmp = tmp.add(base.el.ownerDocument);
}

var bindings = 'keyup checkkeyboard ';
if(o.closeByClickEvent) {
bindings = 'click ';
} else {
bindings += 'mousedown touchstart ';
var bindings = 'keyup checkkeyboard mousedown touchstart ';
if (o.closeByClickEvent) {
bindings += 'click ';
}
tmp.bind(bindings.split(' ').join(base.namespace + ' '), base.checkClose);

Expand Down Expand Up @@ -750,9 +749,6 @@ http://www.opensource.org/licenses/mit-license.php
evt = $.extend({}, e);
evt.type = $keyboard.events.inputRestricted;
base.$el.trigger(evt, [base, base.el]);
if ($.isFunction(o.restricted)) {
o.restricted(evt, base, base.el);
}
}
} else if ((e.ctrlKey || e.metaKey) &&
(e.which === keyCodes.A || e.which === keyCodes.C || e.which === keyCodes.V ||
Expand Down Expand Up @@ -1615,9 +1611,16 @@ http://www.opensource.org/licenses/mit-license.php
if ($keyboard.allie) {
e.preventDefault();
}
// send 'true' instead of a true (boolean), the input won't get a 'ui-keyboard-autoaccepted'
// class name - see issue #66
base.close(o.autoAccept ? 'true' : false);
if(o.closeByClickEvent) {
// only close the keyboard if the user is clicking on an input or if he causes a click event (touchstart/mousedown will not force the close with this setting)
if($(e.target).is("input") || $(e.target).is("textarea") || e.type === 'click') {
base.close(o.autoAccept ? 'true' : false);
}
} else {
// send 'true' instead of a true (boolean), the input won't get a 'ui-keyboard-autoaccepted'
// class name - see issue #66
base.close(o.autoAccept ? 'true' : false);
}
}
};

Expand Down Expand Up @@ -2610,6 +2613,10 @@ http://www.opensource.org/licenses/mit-license.php
// or when another keyboard opens.
stayOpen: false,

// Prevents the keyboard from closing when the user clicks or presses outside the keyboard
// the `autoAccept` option must also be set to true when this option is true or changes are lost
userClosed: false,

// if true, keyboard will not close if you press escape.
ignoreEsc: false,

Expand Down
6 changes: 3 additions & 3 deletions dist/js/jquery.keyboard.min.js

Large diffs are not rendered by default.

46 changes: 23 additions & 23 deletions docs/js/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jQuery(function($) {
$('#hex').keyboard({
layout: 'custom',
customLayout: {
'default' : [
'normal' : [
'C D E F',
'8 9 A B',
'4 5 6 7',
Expand Down Expand Up @@ -134,7 +134,7 @@ jQuery(function($) {
'meta99' : '\u2660:numbers' // Spade
},
customLayout: {
'default' : [
'normal' : [
// Add labels using a ":" after the key's name and replace spaces with "_"
// without the labels this line is just 'a b c d e f g'
'a:a_letter,_that_sounds_like_"ey" b:a_bug_that_makes_honey c:is_when_I_look_around d:a_grade,_I_never_got e:is_what_girls_say_when_they_run_away_from_me f:u,_is_what_I_say_to_those_screaming_girls! g:gee,_is_that_the_end_of_my_wittiness?',
Expand Down Expand Up @@ -207,7 +207,7 @@ jQuery(function($) {
'meta2' : '\u2665' // Heart
},
customLayout: {
'default' : [
'normal' : [
'd e f a u l t',
'{meta1} {meta2} {accept} {cancel}'
],
Expand All @@ -228,7 +228,7 @@ jQuery(function($) {
$('#junk').keyboard({
layout: 'custom',
customLayout: {
'default' : [
'normal' : [
'a e i o u y c',
'` \' " ~ ^ {dec} {combo}',
'{tab} {enter} {bksp}',
Expand Down Expand Up @@ -257,7 +257,7 @@ jQuery(function($) {
$('#map').keyboard({
layout : 'custom',
customLayout: {
'default' : [
'normal' : [
// "n(a):title/tooltip"; n = new key, (a) = actual key, ":label" = title/tooltip (use an underscore "_" in place of a space " ")
'\u03b1(a):lower_case_alpha_(type_a) \u03b2(b):lower_case_beta_(type_b) \u03be(c):lower_case_xi_(type_c) \u03b4(d):lower_case_delta_(type_d) \u03b5(e):lower_case_epsilon_(type_e) \u03b6(f):lower_case_zeta_(type_f) \u03b3(g):lower_case_gamma_(type_g)', // lower case Greek
'{shift} {accept} {cancel}'
Expand Down Expand Up @@ -319,19 +319,19 @@ jQuery(function($) {
$('#ipad').keyboard({

display: {
'bksp' : '\u2190',
'accept' : 'return',
'default' : 'ABC',
'shift' : '\u21d1',
'meta1' : '.?123',
'meta2' : '#+='
'bksp' : '\u2190',
'accept' : 'return',
'normal' : 'ABC',
'shift' : '\u21d1',
'meta1' : '.?123',
'meta2' : '#+='
},

layout: 'custom',

customLayout: {

'default': [
'normal': [
'q w e r t y u i o p {bksp}',
'a s d f g h j k l {enter}',
'{s} z x c v b n m , . {s}',
Expand All @@ -347,13 +347,13 @@ jQuery(function($) {
'1 2 3 4 5 6 7 8 9 0 {bksp}',
'- / : ; ( ) \u20ac & @ {enter}',
'{meta2} . , ? ! \' " {meta2}',
'{default} {space} {default} {accept}'
'{normal} {space} {normal} {accept}'
],
'meta2': [
'[ ] { } # % ^ * + = {bksp}',
'_ \\ | ~ < > $ \u00a3 \u00a5 {enter}',
'{meta1} . , ? ! \' " {meta1}',
'{default} {space} {default} {accept}'
'{normal} {space} {normal} {accept}'
]

}
Expand All @@ -365,19 +365,19 @@ jQuery(function($) {
$('#ipad-email').keyboard({

display: {
'bksp' : '\u2190',
'enter' : 'return',
'default' : 'ABC',
'meta1' : '.?123',
'meta2' : '#+=',
'accept' : '\u21d3'
'bksp' : '\u2190',
'enter' : 'return',
'normal' : 'ABC',
'meta1' : '.?123',
'meta2' : '#+=',
'accept' : '\u21d3'
},

layout: 'custom',

customLayout: {

'default': [
'normal': [
'q w e r t y u i o p {bksp}',
'a s d f g h j k l {enter}',
'{s} z x c v b n m @ . {s}',
Expand All @@ -393,13 +393,13 @@ jQuery(function($) {
'1 2 3 4 5 6 7 8 9 0 {bksp}',
'` | { } % ^ * / \' {enter}',
'{meta2} $ & ~ # = + . {meta2}',
'{default} {space} ! ? {accept}'
'{normal} {space} ! ? {accept}'
],
'meta2': [
'[ ] { } \u2039 \u203a ^ * " , {bksp}',
'\\ | / < > $ \u00a3 \u00a5 \u2022 {enter}',
'{meta1} \u20ac & ~ # = + . {meta1}',
'{default} {space} ! ? {accept}'
'{normal} {space} ! ? {accept}'
]

}
Expand Down
24 changes: 12 additions & 12 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ <h4>Script</h4>
.keyboard({
layout: 'custom',
customLayout: {
'default' : [
'normal' : [
'C D E F',
'8 9 A B',
'4 5 6 7',
Expand Down Expand Up @@ -472,7 +472,7 @@ <h4>Script</h4>
'meta99' : '\u2660:numbers' // Spade
},
customLayout: {
'default' : [
'normal' : [
// Add labels using a ":" after the key's name and replace spaces with "_"
// without the labels this line is just 'a b c d e f g'
'a:a_letter,_that_sounds_like_"ey" b:a_bug_that_makes_honey c:is_when_I_look_around d:a_grade,_I_never_got e:is_what_girls_say_when_they_run_away_from_me f:u,_is_what_I_say_to_those_screaming_girls! g:gee,_is_that_the_end_of_my_wittiness?',
Expand Down Expand Up @@ -570,7 +570,7 @@ <h4>Script</h4>
.keyboard({
layout: 'custom',
customLayout: {
'default' : [
'normal' : [
'a e i o u y c',
'` \' " ~ {sp:1} {dec}',
'{tab} {enter} {bksp}',
Expand Down Expand Up @@ -616,7 +616,7 @@ <h4>Script</h4>
$('#map').keyboard({
layout: 'custom',
customLayout: {
'default' : [
'normal' : [
// "n(a):title_or_tooltip"; n = new key, (a) = actual key, ":label" = title_or_tooltip (use an underscore "_" in place of a space " ")
'\u03b1(a):lower_case_alpha_(type_a) \u03b2(b):lower_case_beta_(type_b) \u03b3(c):lower_case_gamma_(type_c) \u03b4(d):lower_case_delta_(type_d) \u03b5(e):lower_case_epsilon_(type_e) \u03b6(f):lower_case_zeta_(type_f) \u03b7(g):lower_case_eta_(type_g)', // lower case Greek
'{shift} {accept} {cancel}'
Expand Down Expand Up @@ -683,14 +683,14 @@ <h4>Script</h4>
display: {
'bksp' : "\u2190",
'accept' : 'return',
'default': 'ABC',
'normal' : 'ABC',
'meta1' : '.?123',
'meta2' : '#+='
},

layout: 'custom',
customLayout: {
'default': [
'normal': [
'q w e r t y u i o p {bksp}',
'a s d f g h j k l {enter}',
'{s} z x c v b n m , . {s}',
Expand All @@ -706,13 +706,13 @@ <h4>Script</h4>
'1 2 3 4 5 6 7 8 9 0 {bksp}',
'- / : ; ( ) \u20ac & @ {enter}',
'{meta2} . , ? ! \' " {meta2}',
'{default} {space} {default} {accept}'
'{normal} {space} {normal} {accept}'
],
'meta2': [
'[ ] { } # % ^ * + = {bksp}',
'_ \\ | ~ &lt; &gt; $ \u00a3 \u00a5 {enter}',
'{meta1} . , ? ! \' " {meta1}',
'{default} {space} {default} {accept}'
'{normal} {space} {normal} {accept}'
]
}

Expand All @@ -738,15 +738,15 @@ <h4>Script</h4>
display: {
'bksp' : '\u2190',
'enter' : 'return',
'default': 'ABC',
'normal' : 'ABC',
'meta1' : '.?123',
'meta2' : '#+=',
'accept' : '\u21d3'
},

layout: 'custom',
customLayout: {
'default': [
'normal': [
'q w e r t y u i o p {bksp}',
'a s d f g h j k l {enter}',
'{s} z x c v b n m @ . {s}',
Expand All @@ -762,13 +762,13 @@ <h4>Script</h4>
'1 2 3 4 5 6 7 8 9 0 {bksp}',
'` | { } % ^ * / \' {enter}',
'{meta2} $ & ~ # = + . {meta2}',
'{default} {space} ! ? {accept}'
'{normal} {space} ! ? {accept}'
],
'meta2': [
'[ ] { } \u2039 \u203a ^ * " , {bksp}',
'\\ | / &lt; &gt; $ \u00a3 \u00a5 \u2022 {enter}',
'{meta1} \u20ac & ~ # = + . {meta1}',
'{default} {space} ! ? {accept}'
'{normal} {space} ! ? {accept}'
]
}

Expand Down
2 changes: 1 addition & 1 deletion js/jquery.keyboard.extension-all.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀▀██
█████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
*/
/*! jQuery UI Virtual Keyboard (1.26.0) - ALL Extensions + Mousewheel */
/*! jQuery UI Virtual Keyboard (1.26.1) - ALL Extensions + Mousewheel */
/*! jQuery UI Virtual Keyboard Alt Key Popup v1.1.1 *//*
* for Keyboard v1.18+ only (1/10/2016)
*
Expand Down
Loading