aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/handlebars.js
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2017-10-01 04:17:02 +0300
committersiikamiika <siikamiika@users.noreply.github.com>2017-10-01 04:17:02 +0300
commit803ccc1661384ee484298f3495585d3923495dd4 (patch)
tree77b4311d85ff57d5f8c2fcadecb9a2e883d90025 /ext/bg/js/handlebars.js
parentb24c70523479c16eca848f5aafaa887549689ac6 (diff)
merged: first draft, only supports JMdict
Diffstat (limited to 'ext/bg/js/handlebars.js')
-rw-r--r--ext/bg/js/handlebars.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/bg/js/handlebars.js b/ext/bg/js/handlebars.js
index 66d5fa2b..08304d43 100644
--- a/ext/bg/js/handlebars.js
+++ b/ext/bg/js/handlebars.js
@@ -71,6 +71,16 @@ function handlebarsKanjiLinks(options) {
return result;
}
+function handlebarsExpressions(options) {
+ const definition = options.fn(this);
+ return definition.expression;
+}
+
+function handlebarsReadings(options) {
+ const definition = options.fn(this);
+ return definition.reading;
+}
+
function handlebarsMultiLine(options) {
return options.fn(this).split('\n').join('<br>');
}
@@ -83,6 +93,8 @@ function handlebarsRegisterHelpers() {
Handlebars.registerHelper('furiganaPlain', handlebarsFuriganaPlain);
Handlebars.registerHelper('kanjiLinks', handlebarsKanjiLinks);
Handlebars.registerHelper('multiLine', handlebarsMultiLine);
+ Handlebars.registerHelper('expressions', handlebarsExpressions);
+ Handlebars.registerHelper('readings', handlebarsReadings);
}
}