|
1 |
| -/*! jQuery UI Virtual Keyboard v1.28.9 *//* |
| 1 | +/*! jQuery UI Virtual Keyboard v1.29.0 *//* |
2 | 2 | Author: Jeremy Satterfield
|
3 | 3 | Maintained: Rob Garrison (Mottie on github)
|
4 | 4 | Licensed under the MIT License
|
@@ -42,7 +42,7 @@ http://www.opensource.org/licenses/mit-license.php
|
42 | 42 | var $keyboard = $.keyboard = function (el, options) {
|
43 | 43 | var o, base = this;
|
44 | 44 |
|
45 |
| - base.version = '1.28.9'; |
| 45 | + base.version = '1.29.0'; |
46 | 46 |
|
47 | 47 | // Access to jQuery and DOM versions of element
|
48 | 48 | base.$el = $(el);
|
@@ -90,7 +90,7 @@ http://www.opensource.org/licenses/mit-license.php
|
90 | 90 | // flag indication that a keyboard is open
|
91 | 91 | base.isOpen = false;
|
92 | 92 | // is mousewheel plugin loaded?
|
93 |
| - base.wheel = $.isFunction($.fn.mousewheel); |
| 93 | + base.wheel = typeof $.fn.mousewheel === 'function'; |
94 | 94 | // special character in regex that need to be escaped
|
95 | 95 | base.escapeRegex = /[-\/\\^$*+?.()|[\]{}]/g;
|
96 | 96 | base.isTextArea = base.el.nodeName.toLowerCase() === 'textarea';
|
@@ -154,7 +154,7 @@ http://www.opensource.org/licenses/mit-license.php
|
154 | 154 | kbevents.kbBeforeClose,
|
155 | 155 | kbevents.inputRestricted
|
156 | 156 | ], function (i, callback) {
|
157 |
| - if ($.isFunction(o[callback])) { |
| 157 | + if (typeof o[callback] === 'function') { |
158 | 158 | // bind callback functions within options to triggered events
|
159 | 159 | base.$el.bind(callback + base.namespace + 'callbacks', o[callback]);
|
160 | 160 | }
|
@@ -503,7 +503,7 @@ http://www.opensource.org/licenses/mit-license.php
|
503 | 503 | // some languages include a dash, e.g. 'en-gb' or 'fr-ca'
|
504 | 504 | // allow o.language to be a string or array...
|
505 | 505 | // array is for future expansion where a layout can be set for multiple languages
|
506 |
| - lang = ($.isArray(lang) ? lang[0] : lang); |
| 506 | + lang = (Object.prototype.toString.call(lang) === '[object Array]' ? lang[0] : lang); |
507 | 507 | base.language = lang;
|
508 | 508 | lang = lang.split('-')[0];
|
509 | 509 |
|
@@ -549,7 +549,7 @@ http://www.opensource.org/licenses/mit-license.php
|
549 | 549 |
|
550 | 550 | base.updateLanguage();
|
551 | 551 | if (typeof $keyboard.builtLayouts[base.layout] === 'undefined') {
|
552 |
| - if ($.isFunction(o.create)) { |
| 552 | + if (typeof o.create === 'function') { |
553 | 553 | // create must call buildKeyboard() function; or create it's own keyboard
|
554 | 554 | base.$keyboard = o.create(base);
|
555 | 555 | } else if (!base.$keyboard.length) {
|
@@ -938,14 +938,14 @@ http://www.opensource.org/licenses/mit-license.php
|
938 | 938 |
|
939 | 939 | // change callback is no longer bound to the input element as the callback could be
|
940 | 940 | // called during an external change event with all the necessary parameters (issue #157)
|
941 |
| - if ($.isFunction(o.change)) { |
| 941 | + if (typeof o.change === 'function') { |
942 | 942 | event.type = $keyboard.events.inputChange;
|
943 | 943 | o.change(event, base, base.el);
|
944 | 944 | return false;
|
945 | 945 | }
|
946 | 946 | if (o.acceptValid && o.autoAcceptOnValid) {
|
947 | 947 | if (
|
948 |
| - $.isFunction(o.validate) && |
| 948 | + typeof o.validate === 'function' && |
949 | 949 | o.validate(base, base.getValue(base.$preview))
|
950 | 950 | ) {
|
951 | 951 | base.$preview.blur();
|
@@ -1149,7 +1149,7 @@ http://www.opensource.org/licenses/mit-license.php
|
1149 | 1149 | // keyaction is added as a string, override original action & text
|
1150 | 1150 | if (action === last.key && typeof $keyboard.keyaction[action] === 'string') {
|
1151 | 1151 | last.key = action = $keyboard.keyaction[action];
|
1152 |
| - } else if (action in $keyboard.keyaction && $.isFunction($keyboard.keyaction[action])) { |
| 1152 | + } else if (action in $keyboard.keyaction && typeof $keyboard.keyaction[action] === 'function') { |
1153 | 1153 | // stop processing if action returns false (close & cancel)
|
1154 | 1154 | if ($keyboard.keyaction[action](base, this, e) === false) {
|
1155 | 1155 | return false;
|
@@ -1178,7 +1178,7 @@ http://www.opensource.org/licenses/mit-license.php
|
1178 | 1178 | last.preVal = '' + last.val;
|
1179 | 1179 | base.saveLastChange();
|
1180 | 1180 |
|
1181 |
| - if ($.isFunction(o.change)) { |
| 1181 | + if (typeof o.change === 'function') { |
1182 | 1182 | e.type = $keyboard.events.inputChange;
|
1183 | 1183 | o.change(e, base, base.el);
|
1184 | 1184 | // return false to prevent reopening keyboard if base.accept() was called
|
@@ -1218,7 +1218,7 @@ http://www.opensource.org/licenses/mit-license.php
|
1218 | 1218 | clearTimeout(base.repeater); // make sure key repeat stops!
|
1219 | 1219 | if (o.acceptValid && o.autoAcceptOnValid) {
|
1220 | 1220 | if (
|
1221 |
| - $.isFunction(o.validate) && |
| 1221 | + typeof o.validate === 'function' && |
1222 | 1222 | o.validate(base, base.getValue())
|
1223 | 1223 | ) {
|
1224 | 1224 | base.$preview.blur();
|
@@ -1674,7 +1674,7 @@ http://www.opensource.org/licenses/mit-license.php
|
1674 | 1674 | var kbcss = $keyboard.css,
|
1675 | 1675 | $accept = base.$keyboard.find('.' + kbcss.keyPrefix + 'accept'),
|
1676 | 1676 | valid = true;
|
1677 |
| - if ($.isFunction(o.validate)) { |
| 1677 | + if (typeof o.validate === 'function') { |
1678 | 1678 | valid = o.validate(base, base.getValue(), false);
|
1679 | 1679 | }
|
1680 | 1680 | // toggle accept button classes; defined in the css
|
@@ -1726,7 +1726,7 @@ http://www.opensource.org/licenses/mit-license.php
|
1726 | 1726 | // goToNext = true, then go to next input; if false go to prev
|
1727 | 1727 | // isAccepted is from autoAccept option or true if user presses shift+enter
|
1728 | 1728 | base.switchInput = function (goToNext, isAccepted) {
|
1729 |
| - if ($.isFunction(o.switchInput)) { |
| 1729 | + if (typeof o.switchInput === 'function') { |
1730 | 1730 | o.switchInput(base, goToNext, isAccepted);
|
1731 | 1731 | } else {
|
1732 | 1732 | // base.$keyboard may be an empty array - see #275 (apod42)
|
@@ -1775,7 +1775,7 @@ http://www.opensource.org/licenses/mit-license.php
|
1775 | 1775 | kbevents = $keyboard.events,
|
1776 | 1776 | val = accepted ? base.checkCombos() : base.originalContent;
|
1777 | 1777 | // validate input if accepted
|
1778 |
| - if (accepted && $.isFunction(o.validate) && !o.validate(base, val, true)) { |
| 1778 | + if (accepted && typeof o.validate === 'function' && !o.validate(base, val, true)) { |
1779 | 1779 | val = base.originalContent;
|
1780 | 1780 | accepted = false;
|
1781 | 1781 | if (o.cancelClose) {
|
@@ -2435,6 +2435,9 @@ http://www.opensource.org/licenses/mit-license.php
|
2435 | 2435 | if (base.$keyboard.length) {
|
2436 | 2436 | base.removeKeyboard();
|
2437 | 2437 | }
|
| 2438 | + if (base.options.openOn) { |
| 2439 | + base.removeBindings(base.options.openOn); |
| 2440 | + } |
2438 | 2441 | base.removeBindings(base.namespace);
|
2439 | 2442 | base.removeBindings(base.namespace + 'callbacks');
|
2440 | 2443 | for (index = 0; index < len; index++) {
|
|
0 commit comments