aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-04-24 16:48:30 -0700
committerAlex Yatskov <alex@foosoft.net>2016-04-24 16:48:30 -0700
commit8143e372cdb61012ec8683feb01688adfa39dde1 (patch)
treee7336df5bd9fd3bb676e5063d649c5dd8b83fee3 /ext/fg/js
parent59989cd78c60b4c8d089b3bed070b11eb62622b6 (diff)
Stub handler for kanji click
Diffstat (limited to 'ext/fg/js')
-rw-r--r--ext/fg/js/frame.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/ext/fg/js/frame.js b/ext/fg/js/frame.js
index 868f07ce..c8f8211e 100644
--- a/ext/fg/js/frame.js
+++ b/ext/fg/js/frame.js
@@ -17,3 +17,17 @@
*/
+function onKanjiQuery(kanji) {
+ alert(kanji);
+}
+
+function registerKanjiLinks() {
+ for (const link of [].slice.call(document.getElementsByClassName('kanji-link'))) {
+ link.addEventListener('click', (e) => {
+ e.preventDefault();
+ onKanjiQuery(e.target.innerHTML);
+ });
+ }
+}
+
+document.addEventListener('DOMContentLoaded', registerKanjiLinks, false);