9e91662ac7
This patch adds Mottie keyboard (https://github.com/Mottie/Keyboard) to advanced editor. To test: 1) Apply patches 2) perl install/data/mysql/updatedatabase.pl 3) Enable EnableAdvancedCatalogingEditor system preference 4) Go to cataloguing and to Advanced editor 5) Click on Keyboard shortcuts SUCCESS => the keyboard shortcut "Ctrl-K" should be displayed, with "Toggle keyboard" as description 6) press Ctrl-K SUCCESS => a virtual keyboard should be displayed, and a new toolbar button labeled "Keyboard layout" should appear. => when you press a letter on both the physical and virtual keyboard, they should be added to the editor. 7) Click on "Keyboard layout" SUCCESS => a modal should appear, where you can filter and select keyboard layouts. => when you select a layout, it should be reflected on the keyboard. => when you close the modal without selecting a layout, it should keep using the previous layout. 8) Sign off Sponsored-by: Round Rock Public Library Signed-off-by: Liz Rea <wizzyrea@gmail.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 lines
No EOL
2.2 KiB
JavaScript
2 lines
No EOL
2.2 KiB
JavaScript
/*! 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(o){"use strict";var s=o.keyboard;s.css.extender="ui-keyboard-extender",s.language.en.display.extender=" :toggle_numpad",s.layouts.numpad={normal:["{clear} / * -","7 8 9 +","4 5 6 %","1 2 3 =","0 {dec} {left} {right}"]},s.keyaction.extender=function(e){return e.extender_toggle(),!1},o.fn.addExtender=function(e){var n={layout:"numpad",showing:!1,reposition:!0};return this.each(function(){var t=o(this).data("keyboard");if(t){if(t.extender_options=o.extend({},n,t.extender_options,e),t.extender_namespace)return t.extender_layoutSwitcher();t.extender_namespace=t.namespace+"extender",t.extensionNamespace.push(t.extender_namespace),t.extender_layoutSwitcher=function(){t.extender_lastKeyset=t.last.keyset,t.extender_bindEvents(!1),t.$el.one(s.events.kbBeforeVisible,function(){t.shiftActive=t.extender_lastKeyset[0],t.altActive=t.extender_lastKeyset[1],t.metaActive=t.extender_lastKeyset[2],t.showKeySet(),t.extender_setup(),t.extender_bindEvents()}),t.redraw()},t.extender_bindEvents=function(e){var n=s.events.kbBeforeVisible+t.extender_namespace;t.$el.unbind(n),!1!==e&&t.$el.bind(n,function(){t.extender_setup()})},t.extender_setup=function(){var e,n=t.extender_options.layout;void 0===s.builtLayouts[n]&&t.buildKeyboard(n),(e=s.builtLayouts[n].$keyboard.find("."+s.css.keySet+"-normal").clone()).removeClass().removeAttr("name").addClass(s.css.extender).children("button").removeAttr("data-pos"),e[0].style.display=t.extender_options.showing?"inline-block":"none",t.$keyboard.find("div."+s.css.extender).remove(),t.$keyboard.append(e),t.extender_toggle(t.extender_options.showing),t.bindKeys()},t.extender_toggle=function(e){t.extender_options.showing=void 0===e?!t.extender_options.showing:e,t.$keyboard.find("button."+s.css.extender).toggleClass(t.options.css.buttonActive,t.extender_options.showing).end().find("div."+s.css.extender)[0].style.display=t.extender_options.showing?"inline-block":"none",t.extender_options.reposition&&o(window).trigger("resize")},t.options.alwaysOpen&&t.isVisible()&&t.extender_setup(),t.extender_bindEvents()}})}}); |