Tumortisch-Dist/resources/app/lib/3rdparty/virtual-keyboard/js/jquery.keyboard.extension-previewkeyset.min.js
2021-06-15 16:00:08 +02:00

2 lines
1.1 KiB
JavaScript

/*! jQuery UI Virtual Keyboard previewKeyset v1.1.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(e){"use strict";e.keyboard=e.keyboard||{},e.fn.previewKeyset=function(t){return this.each(function(){var n=e(this).data("keyboard"),i=n.namespace+"Preview",o={sets:["normal","shift","alt","alt-shift"]};n&&(n.previewKeyset_options=e.extend({},o,t),n.extensionNamespace.push(i),n.previewKeyset=function(){var t=e.keyboard.css,i=n.previewKeyset_options.sets,o=n.$keyboard.find("."+t.keySet).filter('[name="'+i.join('"],[name="')+'"]');o.length>1&&o.eq(0).find("."+t.keyButton).not("."+t.keyAction).each(function(){var n,a,r={},s=i.length,d=o.find('button[data-pos="'+e(this).attr("data-pos")+'"]');for(n=0;n<s;n++)a=d.eq(n).parent().attr("name"),e.inArray(a,i)>=0&&(r["data-"+a]=d.eq(n).find("."+t.keyText).text());d.attr(r)})},n.options.alwaysOpen&&n.isVisible()?n.previewKeyset():n.$el.unbind(e.keyboard.events.kbBeforeVisible+i).bind(e.keyboard.events.kbBeforeVisible+i,function(){n.previewKeyset()}))})}});