[Golang] Online Input Method (Pāli) by GopherJS
Inspired by palipad (demo of palipad), I write a Golang webapp which help users input Pāli language online. The implementation is simple. Create an input:text element first, and then listen to the onKeyup event of the input:text element. The last two characters of the input:text element will be replaced according to the following rule. This application is an example of DOM manipulation by GopherJS. See GopherJS DOM Example series for more details.
| Type | For |
|---|---|
| AA | Ā |
| aa | ā |
| II | Ī |
| ii | ī |
| UU | Ū |
| uu | ū |
| "N | Ṅ |
| "n | ṅ |
| .M | Ṃ |
| .m | ṃ |
| ~N | Ñ |
| ~n | ñ |
| .T | Ṭ |
| .t | ṭ |
| .D | Ḍ |
| .d | ḍ |
| .N | Ṇ |
| .n | ṇ |
| .L | Ḷ |
| .l | ḷ |
Source Code for Demo (HTML):
Source Code for Demo (Go):
Tested on: Ubuntu Linux 15.10, Go 1.5.2.
GopherJS DOM Example series
- [Golang] GopherJS DOM Example - getElementById and Set innerHTML
- [Golang] GopherJS DOM Example - Event Binding (addEventListener)
- [Golang] GopherJS DOM Example - Detect Keypress (Keyboard Event)
- [Golang] GopherJS DOM Example - Access Input Element Value
- [Golang] GopherJS DOM Example - Access HTML Data Attribute
- [Golang] Online Snake Game by GopherJS
- [Golang] GopherJS DOM Example - Hide Element by display:none
- [Golang] GopherJS DOM Example - Create and Append Element
- [Golang] GopherJS DOM Example - Play Sound on Click Event
- [Golang] GopherJS DOM Example - Toggle (Play/Pause) Sound on Click Event
- [Golang] GopherJS DOM Example - Dropdown Menu
- [Golang] Draggable (Movable) Element by GopherJS
- [Golang] Toggle (Show/Hide) HTML Element by GopherJS
References:
| [1] | GopherJS - A compiler from Go to JavaScript
(GitHub,
GopherJS Playground,
) |
| [2] | Bindings · gopherjs/gopherjs Wiki · GitHub |
| [3] | dom - GopherJS bindings for the JavaScript DOM APIs (GitHub) |
| [4] | Getting Started with GopherJS |
| [5] | [Dart] Online Input Method - Pali (Pāli, Pāḷi) |
