From 04f508452c151a530988c98717aa4a96e6d89398 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 28 Jun 2019 16:33:29 +0100 Subject: [PATCH] Bug 17178: (RM follow-up) Use latest version of library This patch just updates us to the latest version of the jQuery library introduced in this patchset. Thankyou goes out to Josef Moravec who has already contributed a language translation upstream for Czech (and the reason I pulled in this updated library at this time) Signed-off-by: Martin Renvoize --- .../js/jquery.keyboard.extension-all.min.js | 2 +- .../lib/keyboard/js/jquery.keyboard.js | 29 +++++++++---------- .../lib/keyboard/js/jquery.keyboard.min.js | 4 +-- .../lib/keyboard/languages/all.min.js | 2 +- .../lib/keyboard/layouts/all.min.js | 6 ++-- 5 files changed, 20 insertions(+), 23 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/lib/keyboard/js/jquery.keyboard.extension-all.min.js b/koha-tmpl/intranet-tmpl/lib/keyboard/js/jquery.keyboard.extension-all.min.js index 68d8b0d07f..10fcf22b62 100644 --- a/koha-tmpl/intranet-tmpl/lib/keyboard/js/jquery.keyboard.extension-all.min.js +++ b/koha-tmpl/intranet-tmpl/lib/keyboard/js/jquery.keyboard.extension-all.min.js @@ -1,4 +1,4 @@ -/*! jQuery UI Virtual Keyboard (1.29.1) - ALL Extensions + Mousewheel */ +/*! jQuery UI Virtual Keyboard (1.30.1) - ALL Extensions + Mousewheel */ /*! jQuery UI Virtual Keyboard Alt Key Popup v2.0.0 */ !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&"object"==typeof module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(b){"use strict";var f=b.keyboard;b.extend(f.css,{altKeyPopup:"ui-keyboard-popup",altKeyOverlay:"ui-keyboard-overlay",altKeyPopupOpen:"ui-keyboard-popup-open"}),f.altKeys=b.extend({a:"å æ ā ă ą à á â ã ä",A:"Å Æ Ā Ă Ą À Á  à Ä",c:"ç ć ĉ ċ č",C:"Ç Ć Ĉ Ċ Č",d:"ď ð ď",D:"Ď Ð Ď",e:"ė ę ĕ ě ə è é ê ë ē",E:"Ė Ę Ĕ Ě Ǝ È É Ê Ë Ē",g:"ģ ğ ĝ ġ",G:"Ģ Ğ Ĝ Ġ",h:"ĥ ħ",H:"Ĥ Ħ",i:"ı į ī ï î í ì ĩ ĭ",I:"İ Į Ī Ï Î Í Ì Ĩ Ĭ",j:"ĵ",J:"Ĵ",k:"ķ",K:"Ķ",l:"Ł Ľ Ļ Ĺ Ŀ",L:"ł ľ ļ ĺ ŀ",n:"ʼn ň ņ ń ñ",N:"ʼn Ň Ņ Ń Ñ",o:"œ ő ø ö õ ô ó ò ō ŏ",O:"Œ Ő Ø Ö Õ Ô Ó Ò Ō Ŏ",r:"ŕ ř ŗ",R:"Ŕ Ř Ŗ",s:"ś š ş ß § ŝ",S:"Ś Š Ş ẞ § Ŝ",t:"þ ť ț ţ ŧ",T:"Þ Ť Ț Ţ Ŧ",u:"ų ű ů ū ü û ú ù ũ ŭ",U:"Ų Ű Ů Ū Ü Û Ú Ù Ũ Ŭ",w:"ŵ",W:"Ŵ",y:"ý",Y:"Ý",z:"ź ż ž",Z:"Ź Ż Ž","!":"¡",$:"€ £ ¤ ¥ ¢ ₡ ₱ ₩ ₹ ₪ ₭ ₮ ₦ ₤","?":"¿","'":"〈 「 『 “",'"':"〉 」 』 ”","(":"《 【 〔",")":"》 】 〕"},f.altKeys),b.fn.addAltKeyPopup=function(e){var t={holdTime:500,popupVisible:"popup-visible",popupHidden:"popup-hidden",popupPosition:null};return this.each(function(){var y=b(this).data("keyboard");if(y){if(y.altkeypopup_options=b.extend({},t,y.altkeypopup_options,e),y.altkeypopup_namespace)return y.altkeypopup_setup();y.altkeypopup_namespace=y.namespace+"AltKeyPopup",y.extensionNamespace.push(y.altkeypopup_namespace),y.altkeypopup_setup=function(){var a,e="mousedown touchstart ".split(" ").join(y.altkeypopup_namespace+" "),t="mouseup touchend touchcancel ".split(" ").join(y.altkeypopup_namespace+" ");y.options.repeatRate=0,y.unbindButton(y.altkeypopup_namespace).bindButton(e,function(){clearTimeout(a);var e=b(this),t=e.attr("data-value")||"",o=y.altkeypopup_options.holdTime;t in f.altKeys&&(o?a=setTimeout(function(){y.altKeyPopup_popup(t,e)},o):y.altKeyPopup_popup(t,e))}).bindButton(t,function(){clearTimeout(a)}),y.altkeypopup_blockingFlag=!1,y.$preview.unbind("keypress keydown keyup ".split(" ").join(y.altkeypopup_namespace+" ").trim()).bind("keypress keydown keyup ".split(" ").join(y.altkeypopup_namespace+" "),function(e){if("keyup"===e.type)return clearTimeout(a),y.altkeypopup_blockingFlag=!1,"Escape"!==e.key;var t=f.builtLayouts[y.layout],o=b(e.target),n=e.key,i=e.key;return"keydown"===e.type&&i in f.altKeys?y.altkeypopup_blockingFlag!==n&&(y.altkeypopup_blockingFlag=n,!0):y.altkeypopup_blockingFlag?(t.hasMappedKeys&&t.mappedKeys.hasOwnProperty(i)&&(i=t.mappedKeys[i]),i in f.altKeys&&(clearTimeout(a),a=setTimeout(function(){y.altkeypopup_blockingFlag===n&&y.altKeyPopup_popup(i,o)},y.altkeypopup_options.holdTime)),!0):void 0})},y.altKeyPopup_close=function(){y.altkeypopup_blockingFlag=!1,y.altKeyPopup_$overlay=null,setTimeout(function(){if(y.$keyboard.length){y.$keyboard.removeClass(f.css.altKeyPopupOpen);var e=y.$keyboard.find("."+f.css.altKeyOverlay);e&&e.remove()}},1),b(document).unbind(y.altkeypopup_namespace),y.$preview.focus(),y.options.ignoreEsc=y.altKeyPopup_savedIgnoreEsc,y.$el.trigger(y.altkeypopup_options.popupHidden,[y])},y.altKeyPopup_popup=function(e,t){if(!y.$keyboard.find("."+f.css.altKeyOverlay).length){var o,n,i,a,s,r,p,u,l,d=f.css,c={$kb:y.$keyboard,kbWidth:y.$keyboard.outerWidth(),kbHeight:y.$keyboard.outerHeight(),$key:t};y.altKeyPopup_$overlay=b('
').css({width:c.kbWidth,height:c.kbHeight}).appendTo(y.$keyboard).bind("click touchstart",function(){y.altKeyPopup_close()}),l="inactive hidden ".split(" ").join(y.altkeypopup_namespace+" "),y.$keyboard.addClass(f.css.altKeyPopupOpen),y.$el.unbind(l).bind(l,function(){y.altKeyPopup_close()}),"bksp"!==e&&f.keyaction.bksp(y),n=b('
'),o=f.altKeys[e].split(/\s+/),y.buildRow(n,0,o,[]),i=n.appendTo(y.altKeyPopup_$overlay).children().bind("mousedown touchstart",function(){y.altKeyPopup_close()}).bind("mouseover mouseleave",function(e){i.removeClass(y.options.css.buttonHover),"mouseleave"!==e.type&&b(this).addClass(y.options.css.buttonHover)}),y.altKeyPopup_navigate(!0),y.altKeyPopup_savedIgnoreEsc=y.options.ignoreEsc,y.options.ignoreEsc=!0,b(document).unbind(y.altkeypopup_namespace).bind("keydown"+y.altkeypopup_namespace,function(){return!1}).bind("keyup"+y.altkeypopup_namespace,function(e){return"Escape"===e.key?(e.which=0,y.altKeyPopup_close()):y.altKeyPopup_navigate(e),!1}),p=(c.$popup=n).outerWidth(),(a=t.position().left-p/2)+p>c.kbWidth&&(a=c.kbWidth-p)<0&&n.css({width:c.kbWidth,height:"auto"}),s=t.position().top-t.outerHeight()-5,u=n.outerHeight(),r=y.$keyboard.find("."+d.keySet).position().top,s+u>c.kbHeight&&(s=c.kbHeight-u)').appendTo(y.$keyboard),y.$caret&&y.$caret.remove(),y.$caret=b('
').insertAfter(y.$preview),y.$el.unbind(i.kbChange+n).bind(i.kbChange+n,function(){y.findCaretPos()}),y.$preview.unbind(t).bind(t,function(){y.findCaretPos()})},y.findCaretPos=function(){if(y.caret_$div){var t,o,e,n,i,a,s,r,p=y.preview,u=parseFloat(y.$preview.css("fontSize")),l="INPUT"===p.nodeName,d=y.caret_$div[0];t=d.style,o=window.getComputedStyle?getComputedStyle(p,null):p.currentStyle,n=f.caret(y.$preview),i=Math["ltr"===o.direction?"max":"min"](n.start,n.end),y.textareaCaretProperties.forEach(function(e){t[e]=o[e]}),f.firefox&&(t.width=parseInt(o.width,10)-2+"px",p.scrollHeight>parseInt(o.height,10)&&(t.overflowY="scroll")),t.width=parseInt(l?p.scrollWidth:o.width,10)+(l?2*u:0)+"px",d.textContent=p.value.substring(0,i),"INPUT"===p.nodeName&&(d.textContent=d.textContent.replace(/\x20/g," ")),(s=document.createElement("span")).textContent=p.value.substring(i)||"​",d.appendChild(s),r=b(s).position(),n="center"===t.textAlign?u:0,y.caretPos={top:r.top+parseInt(o.borderTopWidth,10)+c.offsetY,left:r.left+parseInt(o.borderLeftWidth,10)+c.offsetX-n},e=parseInt(y.$caret.css("margin-top"),10),t=Math.round(u+2*e)+c.adjustHt,r=y.$preview.position(),y.$caret.css({top:r.top-p.scrollTop+y.caretPos.top-e,left:r.left-p.scrollLeft+y.caretPos.left,height:t}),a=p.value.substring(i,i+c.charIndex).replace(/\s/," ")||" ",y.$caret.attr(c.charAttr,a)}},y.$el.unbind(n).bind(i.kbBeforeVisible+n,function(){y.caret_setup()}).bind(i.kbVisible+n,function(){y.findCaretPos()}).bind(i.kbHidden+n,function(){var e="keyup keypress mouseup mouseleave ".split(" ").join(n+" ");y.$preview.unbind(e),y.$caret.remove(),y.$caret=null,y.caret_$div=null}),y.options.alwaysOpen&&y.isVisible()&&(y.caret_setup(),y.findCaretPos()))})}}),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&"object"==typeof module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(n){"use strict";var i=n.keyboard;i.css.extender="ui-keyboard-extender",i.language.en.display.extender=" :toggle_numpad",i.layouts.numpad={normal:["{clear} / * -","7 8 9 +","4 5 6 %","1 2 3 =","0 {dec} {left} {right}"]},i.keyaction.extender=function(e){return e.extender_toggle(),!1},n.fn.addExtender=function(e){var t={layout:"numpad",showing:!1,reposition:!0};return this.each(function(){var o=n(this).data("keyboard");if(o){if(o.extender_options=n.extend({},t,o.extender_options,e),o.extender_namespace)return o.extender_layoutSwitcher();o.extender_namespace=o.namespace+"extender",o.extensionNamespace.push(o.extender_namespace),o.extender_layoutSwitcher=function(){o.extender_lastKeyset=o.last.keyset,o.extender_bindEvents(!1),o.$el.one(i.events.kbBeforeVisible,function(){o.shiftActive=o.extender_lastKeyset[0],o.altActive=o.extender_lastKeyset[1],o.metaActive=o.extender_lastKeyset[2],o.showKeySet(),o.extender_setup(),o.extender_bindEvents()}),o.redraw()},o.extender_bindEvents=function(e){var t=i.events.kbBeforeVisible+o.extender_namespace;o.$el.unbind(t),!1!==e&&o.$el.bind(t,function(){o.extender_setup()})},o.extender_setup=function(){var e,t=o.extender_options.layout;void 0===i.builtLayouts[t]&&o.buildKeyboard(t),(e=i.builtLayouts[t].$keyboard.find("."+i.css.keySet+"-normal").clone()).removeClass().removeAttr("name").addClass(i.css.extender).children("button").removeAttr("data-pos"),e[0].style.display=o.extender_options.showing?"inline-block":"none",o.$keyboard.find("div."+i.css.extender).remove(),o.$keyboard.append(e),o.extender_toggle(o.extender_options.showing),o.bindKeys()},o.extender_toggle=function(e){o.extender_options.showing=void 0===e?!o.extender_options.showing:e,o.$keyboard.find("button."+i.css.extender).toggleClass(o.options.css.buttonActive,o.extender_options.showing).end().find("div."+i.css.extender)[0].style.display=o.extender_options.showing?"inline-block":"none",o.extender_options.reposition&&n(window).trigger("resize")},o.options.alwaysOpen&&o.isVisible()&&o.extender_setup(),o.extender_bindEvents()}})}}),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&"object"==typeof module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(s){s.fn.addMobile=function(e){var a,t={container:{theme:"b",cssClass:"ui-body"},input:{theme:"b",cssClass:""},buttonMarkup:{theme:"b",cssClass:"ui-btn",shadow:"true",corners:"true"},buttonHover:{theme:"b",cssClass:"ui-btn-hover"},buttonAction:{theme:"b",cssClass:"ui-btn-active"},buttonActive:{theme:"b",cssClass:"ui-btn-active"},allThemes:"a b c"};return this.each(function(){var i=s(this).data("keyboard");i&&void 0!==s.fn.textinput&&(i.mobile_options=a=s.extend(!0,{},t,e),i.mobile_themes=s.trim((" "+a.allThemes).split(" ").join(" "+a.buttonMarkup.cssClass+"-")+(" "+a.allThemes).split(" ").join(" "+a.buttonAction.cssClass+"-")+(" "+a.allThemes).split(" ").join(" "+a.buttonActive.cssClass+"-")),void 0===i.options.mobile_savedActiveClass&&(i.options.mobile_savedActiveClass=""+i.options.css.buttonActive),i.mobile_init=function(){var e=i.namespace+"Mobile";s("."+s.keyboard.css.input).textinput(),i.options.alwaysOpen&&i.isVisible&&i.mobile_setup(),i.extensionNamespace.push(e),i.$el.unbind(e).bind(s.keyboard.events.kbBeforeVisible+e,function(){i&&i.el.active&&i.$keyboard.length&&i.$keyboard.css("visibility","hidden")}).bind(s.keyboard.events.kbVisible+e,function(){i&&i.el.active&&i.$keyboard.length&&(i.mobile_setup(),i.$keyboard.css("visibility","visible"),i.$preview.focus())})},i.mobile_setup=function(){var e,t=s.keyboard.css,o=i.options,n=i.mobile_themes;i.mobile_$actionKeys=i.$keyboard.find("."+i.options.css.buttonAction),o.css.buttonActive=o.mobile_savedActiveClass+" "+i.modOptions(a.buttonActive,a.buttonMarkup),i.$keyboard.addClass(i.modOptions(a.container,a.container)).find("."+t.preview).removeClass("ui-widget ui-widget-content").addClass(i.modOptions(a.input,a.input)).end().find("button").removeClass(s.trim("ui-corner-all ui-state-default "+n)).addClass(i.modOptions(a.buttonMarkup,a.buttonMarkup)).not(i.mobile_$actionKeys).hover(function(){s(this).removeClass(n).addClass(i.modOptions(a.buttonHover,a.buttonMarkup))},function(){s(this).removeClass(n+" "+a.buttonHover.cssClass).addClass(i.modOptions(a.buttonMarkup,a.buttonMarkup))}),i.mobile_$actionKeys.removeClass(n).addClass(i.modOptions(a.buttonAction,a.buttonMarkup)),i.msie&&i.$preview[0]!==i.el&&(i.$preview.hide(),i.$keyboard.css("width",""),i.width=i.$keyboard.outerWidth(),i.$keyboard.width(i.width+parseInt(i.$preview.css("fontSize"),10)),i.$preview.width(i.width),i.$preview.show()),s.ui&&s.ui.position&&((e=o.position).of=e.of||i.$el.data("keyboardPosition")||i.$el,e.collision=e.collision||"flipfit flipfit",i.$keyboard.position(e))},i.modOptions=function(e,t){return" "+(e.cssClass||"")+" "+(t&&t.cssClass?t.cssClass+"-"+(e.theme||""):"")+("true"==e.shadow?" ui-shadow":"")+("true"==e.corners?" ui-corner-all":"")},i.mobile_init())})}}),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&"object"==typeof module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(b){"use strict";b.keyboard=b.keyboard||{},b.keyboard.navigationKeys={toggle:112,enter:13,pageup:33,pagedown:34,end:35,home:36,left:37,up:38,right:39,down:40,caretrt:45,caretlt:46,caretright:function(e){b.keyboard.keyaction.right(e)},caretleft:function(e){b.keyboard.keyaction.left(e)}},b.fn.addNavigation=function(t){return this.each(function(){var l,e,d=b(this).data("keyboard"),c=d.options,n=b.keyboard.events,y=b.keyboard.css;d&&(d.navigation_options=l=b.extend({},{position:[0,0],toggleMode:!1,focusClass:"hasFocus",toggleKey:null,rowLooping:!1},t),d.navigation_keys=e=b.extend({},b.keyboard.navigationKeys),d.navigation_namespace=d.namespace+"Nav",d.extensionNamespace.push(d.navigation_namespace),d.saveNav=[d.options.tabNavigation,d.options.enterNavigation],d.allNavKeys=b.map(e,function(e){return e}),d.navigation_init=function(){d.$keyboard.toggleClass(l.focusClass,l.toggleMode).find("."+y.keySet+":visible").find("."+y.keyButton+'[data-pos="'+l.position[0]+","+l.position[1]+'"]').addClass(c.css.buttonHover),d.$preview.unbind(d.navigation_namespace).bind("keydown"+d.navigation_namespace,function(e){return d.checkKeys(e.which)})},d.checkKeys=function(e,t){if(void 0!==e&&d.isVisible()){var o=d.navigation_keys;return(e===(l.toggleKey||o.toggle)||t)&&(l.toggleMode=!t&&!l.toggleMode,d.options.tabNavigation=!l.toggleMode&&d.saveNav[0],d.options.enterNavigation=!l.toggleMode&&d.saveNav[1]),d.$keyboard.toggleClass(l.focusClass,l.toggleMode),l.toggleMode&&e===o.enter?(d.$keyboard.find("."+y.keySet+":visible").find("."+y.keyButton+'[data-pos="'+l.position[0]+","+l.position[1]+'"]').trigger(n.kbRepeater),!1):l.toggleMode&&0<=b.inArray(e,d.allNavKeys)?(d.navigateKeys(e),!1):void 0}},d.getMaxIndex=function(e,t){return e.find("."+y.keyButton+'[data-pos^="'+t+',"]').length-1},d.leftNavigateKey=function(e,t){var o=d.navigation_options.rowLooping,n=e-1;return 0<=n?n:o?t:0},d.rightNavigateKey=function(e,t){var o=d.navigation_options.rowLooping,n=e+1;return n<=t?n:o?0:t},d.navigateKeys=function(e,t,o){if(d.isVisible()){o="number"==typeof o?o:l.position[1],t="number"==typeof t?t:l.position[0];var n,i=d.$keyboard.find("."+y.keySet+":visible"),a=i.find("."+y.endRow).length-1,s=d.getMaxIndex(i,t),r=d.last,p=d.$preview.val().length,u=d.navigation_keys;switch(e){case u.pageup:t=0;break;case u.pagedown:t=a;break;case u.end:o=s;break;case u.home:o=0;break;case u.left:o=d.leftNavigateKey(o,s);break;case u.up:t+=0p?p:r.start,d.last.start=d.last.end=r.end=r.start,b.keyboard.caret(d.$preview,d.last)),(s=d.getMaxIndex(i,t)) -1 && (colonIndex < 0 || colonIndex > htmlIndex)) { - // html includes colons; see #701 - data.name = name; + if (htmlIndex > -1) { + // If it looks like HTML, skip processing; see #743 + // html may include colons; see #701 return data; } + // Don't split colons followed by //, e.g. https://; Fixes #555 + parts = name.split(/:(?!\/\/)/); + /* map defined keys format 'key(A):Label_for_key_(ignore_parentheses_here)' 'key' = key that is seen (can any character(s); but it might need to be escaped using '\' @@ -2074,12 +2075,8 @@ http://www.opensource.org/licenses/mit-license.php // add the wide class keyClass += (keys.name.length > 2 ? ' ' + kbcss.keyWide : '') + ' ' + o.css.buttonDefault; - data.html = '' + - // this prevents HTML from being added to the key - keys.name.replace(/[\u00A0-\u9999]/gim, function (i) { - return '&#' + i.charCodeAt(0) + ';'; - }) + - ''; + // Allow HTML in the key.name + data.html = '' + keys.name + ''; data.$key = base.keyBtn .clone() diff --git a/koha-tmpl/intranet-tmpl/lib/keyboard/js/jquery.keyboard.min.js b/koha-tmpl/intranet-tmpl/lib/keyboard/js/jquery.keyboard.min.js index 6ba1717885..6aab7be778 100644 --- a/koha-tmpl/intranet-tmpl/lib/keyboard/js/jquery.keyboard.min.js +++ b/koha-tmpl/intranet-tmpl/lib/keyboard/js/jquery.keyboard.min.js @@ -1,2 +1,2 @@ -/*! jQuery UI Virtual Keyboard v1.29.1 */ -!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&"object"==typeof module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(y){"use strict";var b=y.keyboard=function(c,o){var p,h=this;h.version="1.29.1",h.$el=y(c),h.el=c,h.$el.data("keyboard",h),h.init=function(){h.initialized=!1;var e,t,a,i=b.css,n=b.events;h.settings=o||{},o&&o.position&&(t=y.extend({},o.position),o.position=null),h.options=p=y.extend(!0,{},b.defaultOptions,o),t&&(p.position=t,o.position=t),h.el.active=!0,h.namespace=".keyboard"+Math.random().toString(16).slice(2),h.extensionNamespace=[],h.shiftActive=h.altActive=h.metaActive=h.sets=h.capsLock=!1,h.rows=["","-shift","-alt","-alt-shift"],h.inPlaceholder=h.$el.attr("placeholder")||"",h.watermark=b.watermark&&""!==h.inPlaceholder,h.repeatTime=1e3/(p.repeatRate||20),p.preventDoubleEventTime=p.preventDoubleEventTime||100,h.isOpen=!1,h.wheel="function"==typeof y.fn.mousewheel,h.escapeRegex=/[-\/\\^$*+?.()|[\]{}]/g,h.isTextArea="textarea"===h.el.nodeName.toLowerCase(),h.isInput="input"===h.el.nodeName.toLowerCase(),h.isContentEditable=!h.isTextArea&&!h.isInput&&h.el.isContentEditable,e=b.keyCodes,h.alwaysAllowed=[e.capsLock,e.pageUp,e.pageDown,e.end,e.home,e.left,e.up,e.right,e.down,e.insert,e.delete],h.$keyboard=[],h.enabled=!0,h.checkCaret=p.lockInput||b.checkCaretSupport(),h.isContentEditable&&(p.usePreview=!1),h.last={start:0,end:0,key:"",val:"",preVal:"",layout:"",virtual:!0,keyset:[!1,!1,!1],wheel_$Keys:[],wheelIndex:0,wheelLayers:[]},h.temp=["",0,0],y.each([n.kbInit,n.kbBeforeVisible,n.kbVisible,n.kbHidden,n.inputCanceled,n.inputAccepted,n.kbBeforeClose,n.inputRestricted],function(e,t){"function"==typeof p[t]&&h.$el.bind(t+h.namespace+"callbacks",p[t])}),p.alwaysOpen&&(p.stayOpen=!0),a=y(document),h.el.ownerDocument!==document&&(a=a.add(h.el.ownerDocument));var s="keyup checkkeyboard mousedown touchstart ";p.closeByClickEvent&&(s+="click "),a.bind(s.split(" ").join(h.namespace+" "),function(e){clearTimeout(h.timer3),h.timer3=setTimeout(function(){h.checkClose(e)},1)}),h.$el.addClass(i.input+" "+p.css.input).attr({"aria-haspopup":"true",role:"textbox"}),(p.lockInput||h.el.readOnly)&&(p.lockInput=!0,h.$el.addClass(i.locked).attr({readonly:"readonly"})),h.isUnavailable()&&h.$el.addClass(i.noKeyboard),p.openOn&&h.bindFocus(),h.watermark||""!==h.getValue(h.$el)||""===h.inPlaceholder||""===h.$el.attr("placeholder")||(h.$el.addClass(i.placeholder),h.setValue(h.inPlaceholder,h.$el)),h.$el.trigger(n.kbInit,[h,h.el]),p.alwaysOpen&&h.reveal(),h.initialized=!0},h.toggle=function(){if(h.hasKeyboard()){var e=h.$keyboard.find("."+b.css.keyToggle),t=!h.enabled;return h.preview.readonly=t||h.options.lockInput,h.$keyboard.toggleClass(b.css.keyDisabled,t).find("."+b.css.keyButton).not(e).attr("aria-disabled",t).each(function(){this.disabled=t}),e.toggleClass(b.css.keyDisabled,t),t&&h.typing_options&&(h.typing_options.text=""),h}},h.setCurrent=function(){var e=b.css,t=y("."+e.isCurrent),a=t.data("keyboard");y.isEmptyObject(a)||a.el===h.el||a.close(!!a.options.autoAccept&&"true"),t.removeClass(e.isCurrent),y("."+e.hasFocus).removeClass(e.hasFocus),h.$el.addClass(e.isCurrent),h.$keyboard.addClass(e.hasFocus),h.isCurrent(!0),h.isOpen=!0},h.isUnavailable=function(){return h.$el.is(":disabled")||!h.options.activeOnReadonly&&h.$el.attr("readonly")&&!h.$el.hasClass(b.css.locked)},h.isCurrent=function(e){var t=b.currentKeyboard||!1;return e?t=b.currentKeyboard=h.el:!1===e&&t===h.el&&(t=b.currentKeyboard=""),t===h.el},h.hasKeyboard=function(){return h.$keyboard&&0").addClass(n.wrapper).append(h.$preview).prependTo(h.$keyboard)}else h.$preview=h.$el,h.preview=h.el},h.caret=function(e,t){var a=b.caret(h.$preview,e,t);return a instanceof y?(h.saveCaret(a.start,a.end),h):a},h.saveCaret=function(e,t,a){var i;h.isCurrent()&&(i=void 0===e?b.caret(a||h.$preview):b.caret(a||h.$preview,e,t),h.last.start=void 0===e?i.start:e,h.last.end=void 0===t?i.end:t)},h.saveLastChange=function(e){h.last.val=e||h.getValue(h.$preview||h.$el),h.isContentEditable&&(h.last.elms=h.el.cloneNode(!0))},h.setScroll=function(){if(!h.isContentEditable&&h.last.virtual){var e,t,a,i,n=h.last.val.substring(0,Math.max(h.last.start,h.last.end));h.$previewCopy||(h.$previewCopy=h.$preview.clone().removeAttr("id").css({position:"absolute",left:0,zIndex:-10,visibility:"hidden"}).addClass(b.css.inputClone),h.$previewCopy[0].disabled=!0,h.isTextArea||h.$previewCopy.css({"white-space":"pre",width:0}),p.usePreview?h.$preview.after(h.$previewCopy):h.$keyboard.prepend(h.$previewCopy)),h.isTextArea?(h.$previewCopy.height(h.lineHeight).val(n),h.preview.scrollTop=h.lineHeight*(Math.floor(h.$previewCopy[0].scrollHeight/h.lineHeight)-1)):(h.$previewCopy.val(n.replace(/\s/g," ")),a=/c/i.test(p.scrollAdjustment)?h.preview.clientWidth/2:p.scrollAdjustment,e=h.$previewCopy[0].scrollWidth-1,void 0===h.last.scrollWidth&&(h.last.scrollWidth=e,h.last.direction=!0),i=h.last.scrollWidth===e?h.last.direction:h.last.scrollWidth=h.preview.scrollWidth-t?h.preview.scrollLeft=h.preview.scrollWidth-a:h.preview.scrollLeft=0=o.A&&t<=o.Z,i=t>=o.a&&t<=o.z,n=h.last.key=String.fromCharCode(t);if(!(t=o.X&&e.which<=o.Z))return;r.hasMappedKeys&&r.mappedKeys.hasOwnProperty(n)&&(h.last.key=r.mappedKeys[n],h.insertText(h.last.key),e.preventDefault()),"function"==typeof p.beforeInsert&&(h.insertText(h.last.key),e.preventDefault()),h.checkMaxLength()}}}).bind("keyup"+e,function(e){if(h.isCurrent()){switch(h.last.virtual=!1,e.which){case o.tab:if(h.tab&&!p.lockInput){h.shiftActive=e.shiftKey;var t=b.keyaction.tab(h);if(h.tab=!1,!t)return!1}else e.preventDefault();break;case o.escape:return p.ignoreEsc||h.close(!(!p.autoAccept||!p.autoAcceptOnEsc)&&"true"),!1}clearTimeout(h.throttled),h.throttled=setTimeout(function(){h&&h.isVisible()&&h.checkCombos()},100),h.checkMaxLength(),h.last.preVal=""+h.last.val,h.saveLastChange();var a=y.Event(b.events.kbChange);if(a.action=h.last.key,h.$el.trigger(a,[h,h.el]),"function"==typeof p.change)return a.type=b.events.inputChange,p.change(a,h,h.el),!1;p.acceptValid&&p.autoAcceptOnValid&&"function"==typeof p.validate&&p.validate(h,h.getValue(h.$preview))&&(h.$preview.blur(),h.accept())}}).bind("keydown"+e,function(e){if(h.last.keyPress=e.which,p.alwaysOpen&&!h.isCurrent()&&h.reveal(),e.which===o.tab)return!(h.tab=!0);if(p.lockInput||e.timeStamp===h.last.timeStamp)return!p.lockInput;switch(h.last.timeStamp=e.timeStamp,h.last.virtual=!1,e.which){case o.backSpace:b.keyaction.bksp(h,null,e),e.preventDefault();break;case o.enter:b.keyaction.enter(h,null,e);break;case o.capsLock:h.shiftActive=h.capsLock=!h.capsLock,h.showSet();break;case o.V:if(e.ctrlKey||e.metaKey){if(p.preventPaste)return void e.preventDefault();h.checkCombos()}}}).bind("mouseup touchend ".split(" ").join(e+" "),function(){h.last.virtual=!0,h.saveCaret()}),h.$keyboard.bind("mousedown click touchstart ".split(" ").join(h.namespace+" "),function(e){e.stopPropagation(),h.isCurrent()||(h.reveal(),y(h.el.ownerDocument).trigger("checkkeyboard"+h.namespace)),h.setFocus()}),p.preventPaste&&(h.$preview.bind("contextmenu"+h.namespace,function(e){e.preventDefault()}),h.$el.bind("contextmenu"+h.namespace,function(e){e.preventDefault()}))},h.bindButton=function(e,t){var a="."+b.css.keyButton,i=function(e){e.stopPropagation(),e.$target=y(this).closest("."+b.css.keyboard+", ."+b.css.input),t.call(this,e)};return y.fn.on?h.$keyboard.on(e,a,i):y.fn.delegate&&h.$keyboard.delegate(a,e,i),h},h.unbindButton=function(e){return y.fn.off?h.$keyboard.off(e):y.fn.undelegate&&h.$keyboard.undelegate("."+b.css.keyButton,e),h},h.bindKeys=function(){var s=b.css;h.unbindButton(h.namespace+" "+h.namespace+"kb").bindButton("mouseenter mouseleave touchstart ".split(" ").join(h.namespace+" "),function(e){if(!p.alwaysOpen&&!p.userClosed||"mouseleave"===e.type||h.isCurrent()||(h.reveal(),h.setFocus()),h.isCurrent()&&!this.disabled){var t,a,i=h.last,n=y(this),s=e.type;p.useWheel&&h.wheel&&(t=h.getLayers(n),a=(t.length?t.map(function(){return y(this).attr("data-value")||""}).get():"")||[n.text()],i.wheel_$Keys=t,i.wheelLayers=a,i.wheelIndex=y.inArray(n.attr("data-value"),a)),"mouseenter"!==s&&"touchstart"!==s||"password"===h.el.type||n.hasClass(p.css.buttonDisabled)||(n.addClass(p.css.buttonHover),p.useWheel&&h.wheel&&n.attr("title",function(e,t){return h.wheel&&""===t&&h.sets&&1=t.left&&e.originalEvent.touches[0].pageX=t.top&&e.originalEvent.touches[0].pageYn.length-1&&(i=0),i<0&&(i=n.length-1)):i=0,h.last.wheelIndex=i,a.html(n[i]),!1}},30)).bindButton("mousedown touchstart ".split(" ").join(h.namespace+"kb "),function(){var e=y(this);if(e&&(!e.hasClass(s.keyAction)||e.is("."+s.keyPrefix+"tab bksp space enter".split(" ").join(",."+s.keyPrefix))))return 0!==p.repeatRate&&(h.mouseRepeat=[!0,e],setTimeout(function(){h&&h.mouseRepeat[0]&&h.mouseRepeat[1]===e&&!e[0].disabled&&h.repeatKey(e)},p.repeatDelay)),!1})},h.throttleEvent=function(e,t){var a;return function(){a||(e.apply(this,arguments),a=!0,setTimeout(function(){a=!1},t))}},h.execCommand=function(e,t){h.el.ownerDocument.execCommand(e,!1,t),h.el.normalize(),p.reposition&&h.reposition()},h.getValue=function(e){return(e=e||h.$preview)[h.isContentEditable?"text":"val"]()},h.setValue=function(e,t){return t=t||h.$preview,h.isContentEditable?e!==t.text()&&(b.replaceContent(t,e),h.saveCaret()):t.val(e),h},h.insertText=function(e){if(!h.$preview)return h;if("function"==typeof p.beforeInsert&&(e=p.beforeInsert(h.last.event,h,h.el,e)),void 0===e||!1===e)return h.last.key="",h;if(h.isContentEditable)return h.insertContentEditable(e);var t,a=!1,i="\b"===e,n=h.getValue(),s=b.caret(h.$preview),o=n.length;return s.endo&&(s.end=s.start=o),h.isTextArea&&b.msie&&"\n"===n.substring(s.start,s.start+1)&&(s.start+=1,s.end+=1),t=s.start,"{d}"===e&&(e="",s.end+=1),i&&(e="",a=i&&t===s.end&&0p.maxLength&&(e=b.caret(h.$preview).start,t=Math.min(e,p.maxLength),p.maxInsert||(a=h.last.val,t=e-1),h.setValue(a.substring(0,p.maxLength)),h.saveCaret(t,t)),h.$decBtn.length&&h.checkDecimal(),h}},h.repeatKey=function(e){e.trigger(b.events.kbRepeater),h.mouseRepeat[0]&&(h.repeater=setTimeout(function(){h&&h.repeatKey(e)},h.repeatTime))},h.getKeySet=function(){var e=[];return h.altActive&&e.push("alt"),h.shiftActive&&e.push("shift"),h.metaActive&&e.push(h.metaActive),e.length?e.join("+"):"normal"},h.showKeySet=function(e){return"string"==typeof e?(h.last.keyset=[h.shiftActive,h.altActive,h.metaActive],h.shiftActive=/shift/i.test(e),h.altActive=/alt/i.test(e),/\bmeta/.test(e)?(h.metaActive=!0,h.showSet(e.match(/\bmeta[\w-]+/i)[0])):(h.metaActive=!1,h.showSet())):h.showSet(e),h},h.showSet=function(e){if(h.hasKeyboard()){p=h.options;var t=b.css,a="."+t.keyPrefix,i=p.css.buttonActive,n="",s=(h.shiftActive?1:0)+(h.altActive?2:0);if(h.shiftActive||(h.capsLock=!1),h.metaActive?(h.shiftActive&&(e=(e||"").replace("-shift","")),h.altActive&&(e=(e||"").replace("-alt","")),""===(n=/^meta/i.test(e)?e:"")?n=!0===h.metaActive?"":h.metaActive:h.metaActive=n,(!p.stickyShift&&h.last.keyset[2]!==h.metaActive||(h.shiftActive||h.altActive)&&!h.$keyboard.find("."+t.keySet+"-"+n+h.rows[s]).length)&&(h.shiftActive=h.altActive=!1)):!p.stickyShift&&h.last.keyset[2]!==h.metaActive&&h.shiftActive&&(h.shiftActive=h.altActive=!1),n=0!==(s=(h.shiftActive?1:0)+(h.altActive?2:0))||h.metaActive?""===n?"":"-"+n:"-normal",!h.$keyboard.find("."+t.keySet+n+h.rows[s]).length)return h.shiftActive=h.last.keyset[0],h.altActive=h.last.keyset[1],void(h.metaActive=h.last.keyset[2]);h.$keyboard.find(a+"alt,"+a+"shift,."+t.keyAction+"[class*=meta]").removeClass(i).end().find(a+"alt").toggleClass(i,h.altActive).end().find(a+"shift").toggleClass(i,h.shiftActive).end().find(a+"lock").toggleClass(i,h.capsLock).end().find("."+t.keySet).hide().end().find("."+(t.keyAction+a+n).replace("--","-")).addClass(i),h.$keyboard.find("."+t.keySet+n+h.rows[s])[0].style.display="inline-block",h.metaActive&&h.$keyboard.find(a+h.metaActive).toggleClass(i,!1!==h.metaActive),h.last.keyset=[h.shiftActive,h.altActive,h.metaActive],h.$el.trigger(b.events.kbKeysetChange,[h,h.el]),p.reposition&&h.reposition()}},h.checkCombos=function(){if(!(h.isVisible()||h.hasKeyboard()&&h.$keyboard.hasClass(b.css.hasFocus)))return h.getValue(h.$preview||h.$el);var e,t,a,i,n=h.getValue(),s=b.caret(h.$preview),o=b.builtLayouts[h.layout],r=h.isContentEditable?b.getEditableLength(h.el):n.length,l=r;return""===n||(s.endl&&(s.end=s.start=l),b.msie&&"\n"===n.substring(s.start,s.start+1)&&(s.start+=1,s.end+=1),p.useCombos&&(b.msie?n=n.replace(h.regex,function(e,t,a){return p.combos.hasOwnProperty(t)&&p.combos[t][a]||e}):h.$preview.length&&(t=s.start-(0<=s.start-2?2:0),b.caret(h.$preview,t,s.end),a=(i=function(e){return(e||"").replace(h.regex,function(e,t,a){return p.combos.hasOwnProperty(t)&&p.combos[t][a]||e})})((t=b.caret(h.$preview)).text),t&&t.replaceStr&&a!==t.text&&(h.isContentEditable?b.replaceContent(c,i):h.setValue(t.replaceStr(a))),n=h.getValue())),p.restrictInput&&""!==n&&(t=o.acceptedKeys.length,(e=o.acceptedKeysRegex)||(a=y.map(o.acceptedKeys,function(e){return e.replace(h.escapeRegex,"\\$&")}),-1n.length-1&&(i=p.stopAtEnd,s=0),s<0&&(i=p.stopAtEnd,s=n.length-1),!i){if(!(t=h.close(t)))return;(a=n.eq(s).data("keyboard"))&&a.options.openOn.length?a.focusOn():n.eq(s).focus()}}return!1},h.close=function(e){if(h.isOpen&&h.$keyboard.length){clearTimeout(h.throttled);var t=b.css,a=b.events,i=e?h.checkCombos():h.originalContent;if(e&&"function"==typeof p.validate&&!p.validate(h,i,!0)&&(i=h.originalContent,e=!1,p.cancelClose))return;h.isCurrent(!1),h.isOpen=p.alwaysOpen||p.userClosed,h.isContentEditable&&!e?h.$el.html(i):h.setValue(i,h.$el),h.$el.removeClass(t.isCurrent+" "+t.inputAutoAccepted).addClass(e?!0===e?"":t.inputAutoAccepted:"").trigger(a.inputChange),p.alwaysOpen||h.$el.trigger(a.kbBeforeClose,[h,h.el,e||!1]),b.caret(h.$preview,h.last),h.$el.trigger(e?a.inputAccepted:a.inputCanceled,[h,h.el]).trigger(p.alwaysOpen?a.kbInactive:a.kbHidden,[h,h.el]).blur(),h&&(h.last.eventTime=(new Date).getTime(),p.alwaysOpen||p.userClosed&&"true"===e||!h.$keyboard.length||(h.removeKeyboard(),h.timer=setTimeout(function(){h&&h.bindFocus()},200)),h.watermark||""!==h.el.value||""===h.inPlaceholder||(h.$el.addClass(t.placeholder),h.setValue(h.inPlaceholder,h.$el)))}return!!e},h.accept=function(){return h.close(!0)},h.checkClose=function(e){if(!h.opening){var t=y.keyboard.css,a=e.$target||y(e.target).closest("."+b.css.keyboard+", ."+b.css.input);if(a.length||(a=y(e.target)),a.length&&a.hasClass(t.keyboard)){var i=a.data("keyboard");i!==h&&!i.$el.hasClass(t.isCurrent)&&i.options.openOn&&e.type===p.openOn&&i.focusOn()}else h.escClose(e,a)}},h.escCloseCallback={keepOpen:function(){return!h.isOpen}},h.escClose=function(e,t){if(h.isOpen){if(e&&"keyup"===e.type)return e.which!==b.keyCodes.escape||p.ignoreEsc?"":h.close(!(!p.autoAccept||!p.autoAcceptOnEsc)&&"true");var a=!1,i=t.length&&t||y(e.target);if(y.each(h.escCloseCallback,function(e,t){"function"==typeof t&&(a=a||t(i))}),!a&&(!h.isCurrent()&&h.isOpen||h.isOpen&&i[0]!==h.el)){if((p.stayOpen||p.userClosed)&&!i.hasClass(b.css.input))return;if(b.allie&&e.preventDefault(),p.closeByClickEvent){var n=i[0]&&i[0].nodeName.toLowerCase();"input"!==n&&"textarea"!==n&&"click"!==e.type||h.close(!!p.autoAccept&&"true")}else h.close(!!p.autoAccept&&"true")}}},h.keyBtn=y("