Created
September 5, 2017 14:08
-
-
Save AshleyGrant/87b7807ef8a50301fe358b26f7263056 to your computer and use it in GitHub Desktop.
Aurelia Onscreen Keyboard Gist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <require from="./keyboard"></require> | |
| <div> | |
| <label>Name: </label> | |
| <input type="text" value.bind="name" keyboard /> | |
| </div> | |
| </template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export class App { | |
| name: 'Ashley'; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html> | |
| <head> | |
| <title>Aurelia</title> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <script src="https://code.jquery.com/jquery.js"></script> | |
| <script src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.js"></script> | |
| <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.css"> | |
| <link rel="stylesheet" href="https://mottie.github.io/Keyboard/css/keyboard.css"> | |
| <script src="https://mottie.github.io/Keyboard/js/jquery.keyboard.js"></script> | |
| <script src="https://mottie.github.io/Keyboard/js/jquery.mousewheel.js"></script> | |
| <script src="https://mottie.github.io/Keyboard/js/jquery.keyboard.extension-typing.js"></script> | |
| </head> | |
| <body aurelia-app> | |
| <h1>Loading...</h1> | |
| <script src="https://jdanyow.github.io/rjs-bundle/node_modules/requirejs/require.js"></script> | |
| <script src="https://jdanyow.github.io/rjs-bundle/config.js"></script> | |
| <script src="https://jdanyow.github.io/rjs-bundle/bundles/aurelia.js"></script> | |
| <script src="https://jdanyow.github.io/rjs-bundle/bundles/babel.js"></script> | |
| <script> | |
| require(['aurelia-bootstrapper']); | |
| </script> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {inject} from 'aurelia-framework'; | |
| @inject(Element) | |
| export class KeyboardCustomAttribute { | |
| constructor(el) { | |
| this.el = el; | |
| } | |
| attached() { | |
| $(this.el).keyboard({ | |
| layout: 'qwerty' | |
| }) | |
| // activate the typing extension | |
| .addTyping({ | |
| showTyping: true, | |
| delay: 250 | |
| }); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment