Tumortisch-Dist/resources/app/lib/3rdparty/virtual-keyboard/js/jquery.keyboard.extension-extender.min.js

2 lines
2.2 KiB
JavaScript
Raw Permalink Normal View History

2021-06-15 16:00:08 +02:00
/*! jQuery UI Virtual Keyboard Extender v1.0.3 */
!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(e){"use strict";var n=e.keyboard;n.css.extender="ui-keyboard-extender",n.language.en.display.extender=" :toggle_numpad",n.layouts.numpad={normal:["{clear} / * -","7 8 9 +","4 5 6 %","1 2 3 =","0 {dec} {left} {right}"]},n.keyaction.extender=function(e,n){return e.extender_toggle(),!1},e.fn.addExtender=function(t){var o={layout:"numpad",showing:!1,reposition:!0};return this.each(function(){var s=e(this).data("keyboard");if(s){if(s.extender_options=e.extend({},o,s.extender_options,t),s.extender_namespace)return s.extender_layoutSwitcher();s.extender_namespace=s.namespace+"extender",s.extensionNamespace.push(s.extender_namespace),s.extender_layoutSwitcher=function(){s.extender_lastKeyset=s.last.keyset,s.extender_bindEvents(!1),s.$el.one(n.events.kbBeforeVisible,function(){s.shiftActive=s.extender_lastKeyset[0],s.altActive=s.extender_lastKeyset[1],s.metaActive=s.extender_lastKeyset[2],s.showKeySet(),s.extender_setup(),s.extender_bindEvents()}),s.redraw()},s.extender_bindEvents=function(e){var t=n.events.kbBeforeVisible+s.extender_namespace;s.$el.unbind(t),!1!==e&&s.$el.bind(t,function(){s.extender_setup()})},s.extender_setup=function(){var e,t=s.extender_options.layout;void 0===n.builtLayouts[t]&&s.buildKeyboard(t),(e=n.builtLayouts[t].$keyboard.find("."+n.css.keySet+"-normal").clone()).removeClass().removeAttr("name").addClass(n.css.extender).children("button").removeAttr("data-pos"),e[0].style.display=s.extender_options.showing?"inline-block":"none",s.$keyboard.find("div."+n.css.extender).remove(),s.$keyboard.append(e),s.extender_toggle(s.extender_options.showing),s.bindKeys()},s.extender_toggle=function(t){s.extender_options.showing=void 0===t?!s.extender_options.showing:t,s.$keyboard.find("button."+n.css.extender).toggleClass(s.options.css.buttonActive,s.extender_options.showing).end().find("div."+n.css.extender)[0].style.display=s.extender_options.showing?"inline-block":"none",s.extender_options.reposition&&e(window).trigger("resize")},s.options.alwaysOpen&&s.isVisible()&&s.extender_setup(),s.extender_bindEvents()}})}});