autofocus djtkana
This commit is contained in:
parent
07b35e5302
commit
1e059d9751
|
@ -123,10 +123,7 @@ var replacements = {
|
||||||
'tu' : 'tsu',
|
'tu' : 'tsu',
|
||||||
'ti' : 'chi',
|
'ti' : 'chi',
|
||||||
'ci' : 'chi',
|
'ci' : 'chi',
|
||||||
'si' : 'chu', // these are broken. will fix later.
|
'wo' : 'o'
|
||||||
'du' : 'zu',
|
|
||||||
'di' : 'ji',
|
|
||||||
'wo' : 'o',
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var active = [];
|
var active = [];
|
||||||
|
@ -294,7 +291,7 @@ function check_answer() {
|
||||||
chars_correct = cur_reading.split('');
|
chars_correct = cur_reading.split('');
|
||||||
|
|
||||||
for (i = 0; i < chars.length; i++) {
|
for (i = 0; i < chars.length; i++) {
|
||||||
if(chars[i] != chars_correct[i]) {
|
if(chars[i] != chars_correct[i] && answer != 'w') {
|
||||||
document.getElementById('message').innerHTML = '<span id="wrong">' + cur_kana + ' = ' + cur_reading + '</span>';
|
document.getElementById('message').innerHTML = '<span id="wrong">' + cur_kana + ' = ' + cur_reading + '</span>';
|
||||||
wrong = true;
|
wrong = true;
|
||||||
}
|
}
|
||||||
|
@ -343,7 +340,6 @@ function play_other(file) {
|
||||||
function stroke_order() {
|
function stroke_order() {
|
||||||
document.getElementById('kana').innerHTML = '<img src="stroke/' + cur_kana + '.gif" id="stroke" />';
|
document.getElementById('kana').innerHTML = '<img src="stroke/' + cur_kana + '.gif" id="stroke" />';
|
||||||
document.getElementById('input_box').focus();
|
document.getElementById('input_box').focus();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -373,6 +369,7 @@ onload = function () {
|
||||||
answer_input.onpropertychange = answer_input.oninput;
|
answer_input.onpropertychange = answer_input.oninput;
|
||||||
|
|
||||||
document.body.onkeydown = function(e){
|
document.body.onkeydown = function(e){
|
||||||
|
document.getElementById('input_box').focus();
|
||||||
if(e.keyCode == 32 || e.keyCode == 13){
|
if(e.keyCode == 32 || e.keyCode == 13){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if( ! wrong) {
|
if( ! wrong) {
|
||||||
|
|
Loading…
Reference in New Issue