/*! jQuery UI Virtual Keyboard for jQuery Mobile Themes v1.4.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(a){a.fn.addMobile=function(e){var n,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 o=a(this).data("keyboard");o&&void 0!==a.fn.textinput&&(o.mobile_options=n=a.extend(!0,{},t,e),o.mobile_themes=a.trim((" "+n.allThemes).split(" ").join(" "+n.buttonMarkup.cssClass+"-")+(" "+n.allThemes).split(" ").join(" "+n.buttonAction.cssClass+"-")+(" "+n.allThemes).split(" ").join(" "+n.buttonActive.cssClass+"-")),void 0===o.options.mobile_savedActiveClass&&(o.options.mobile_savedActiveClass=""+o.options.css.buttonActive),o.mobile_init=function(){var e=o.namespace+"Mobile";a("."+a.keyboard.css.input).textinput(),o.options.alwaysOpen&&o.isVisible&&o.mobile_setup(),o.extensionNamespace.push(e),o.$el.unbind(e).bind(a.keyboard.events.kbBeforeVisible+e,function(){o&&o.el.active&&o.$keyboard.length&&o.$keyboard.css("visibility","hidden")}).bind(a.keyboard.events.kbVisible+e,function(){o&&o.el.active&&o.$keyboard.length&&(o.mobile_setup(),o.$keyboard.css("visibility","visible"),o.$preview.focus())})},o.mobile_setup=function(){var e,t=a.keyboard.css,s=o.options,i=o.mobile_themes;o.mobile_$actionKeys=o.$keyboard.find("."+o.options.css.buttonAction),s.css.buttonActive=s.mobile_savedActiveClass+" "+o.modOptions(n.buttonActive,n.buttonMarkup),o.$keyboard.addClass(o.modOptions(n.container,n.container)).find("."+t.preview).removeClass("ui-widget ui-widget-content").addClass(o.modOptions(n.input,n.input)).end().find("button").removeClass(a.trim("ui-corner-all ui-state-default "+i)).addClass(o.modOptions(n.buttonMarkup,n.buttonMarkup)).not(o.mobile_$actionKeys).hover(function(){a(this).removeClass(i).addClass(o.modOptions(n.buttonHover,n.buttonMarkup))},function(){a(this).removeClass(i+" "+n.buttonHover.cssClass).addClass(o.modOptions(n.buttonMarkup,n.buttonMarkup))}),o.mobile_$actionKeys.removeClass(i).addClass(o.modOptions(n.buttonAction,n.buttonMarkup)),o.msie&&o.$preview[0]!==o.el&&(o.$preview.hide(),o.$keyboard.css("width",""),o.width=o.$keyboard.outerWidth(),o.$keyboard.width(o.width+parseInt(o.$preview.css("fontSize"),10)),o.$preview.width(o.width),o.$preview.show()),a.ui&&a.ui.position&&((e=s.position).of=e.of||o.$el.data("keyboardPosition")||o.$el,e.collision=e.collision||"flipfit flipfit",o.$keyboard.position(e))},o.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":"")},o.mobile_init())})}});