-
Notifications
You must be signed in to change notification settings - Fork 6
/
viewer-top.js
42 lines (41 loc) · 1.07 KB
/
viewer-top.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
jQuery(document).ready(function () {
urlVars = getUrlVars();
var kanji = urlVars["kanji"];
if (kanji == null) {
kanji = jQuery('#kanji').val();
} else {
jQuery('#kanji').val(kanji);
}
var file = urlVars["file"];
var cg = getShowGroups();
if (cg) {
jQuery('#colorGroups').prop('checked', true);
}
var rad = getShowRadicals();
if (rad) {
jQuery('#radicals').prop('checked', true);
}
var noso = getNoShowSO();
if (noso) {
// This is on by default.
jQuery('#displayOrders').prop('checked', false);
}
KanjiViewer.initialize(
"kanjiViewer",
jQuery('#displayOrders:checked').val(),
jQuery('#radicals:checked').val(),
jQuery('#colorGroups:checked').val(),
kanji,
file,
urlVars
);
jQuery('#kanjiViewerParams').submit(runKanjiViewer);
});
function runKanjiViewer() {
KanjiViewer.setStrokeOrdersVisible(jQuery('#displayOrders:checked').val());
KanjiViewer.setRadicals(jQuery('#radicals:checked').val());
KanjiViewer.setColorGroups(jQuery('#colorGroups:checked').val());
KanjiViewer.setKanji(jQuery('#kanji').val());
KanjiViewer.refreshKanji();
return false;
}