Fix: last letter jongsung bug
This commit is contained in:
@@ -498,6 +498,7 @@ var TypingTest = {
|
||||
// console.log("-----");
|
||||
// console.log("inputConent : '" + inputContent + "'");
|
||||
// console.log("inputIndex : " + inputIndex);
|
||||
// console.log("typingLength : " + typingLength);
|
||||
// console.log("misspelledIndex : " + misspelledIndex);
|
||||
|
||||
if(inputIndex < 0)
|
||||
@@ -626,16 +627,22 @@ var TypingTest = {
|
||||
|
||||
// 입력할 글자에 종성이 있을 경우
|
||||
else if(StringUtil.hasJongsung(typingLetter)) {
|
||||
console.log("has jongsung");
|
||||
// console.log("has jongsung");
|
||||
var typingLetterJongsung = StringUtil.jongsung(typingLetter);
|
||||
|
||||
// 입력한 글자의 종성과 입력할 글자의 종성이 같은 경우
|
||||
if(StringUtil.jongsung(inputLetter) == typingLetterJongsung)
|
||||
highlightKey = StringUtil.chosung(typingNextLetter);
|
||||
if(StringUtil.jongsung(inputLetter) == typingLetterJongsung) {
|
||||
if(inputIndex == typingLength - 1)
|
||||
highlightKey = "Enter";
|
||||
else
|
||||
highlightKey = StringUtil.chosung(typingNextLetter);
|
||||
}
|
||||
// 입력한 글자의 종성이 입력할 글자와 다를 경우
|
||||
else {
|
||||
if(inputIndex == typingLength - 1)
|
||||
highlightKey = "Backspace";
|
||||
// 입력할 글자의 종성이 합성자음일 경우
|
||||
if(StringUtil.isMultiAlphabetJongsung(typingLetterJongsung)) {
|
||||
else if(StringUtil.isMultiAlphabetJongsung(typingLetterJongsung)) {
|
||||
var inputJongsungAlphabets = StringUtil.getMultiAlphabetFromJongsung(StringUtil.jongsung(inputLetter));
|
||||
var typingJongsungAlphabets = StringUtil.getMultiAlphabetFromJongsung(StringUtil.jongsung(typingLetter));
|
||||
|
||||
@@ -669,22 +676,34 @@ var TypingTest = {
|
||||
}
|
||||
}
|
||||
}
|
||||
// 입력할 글자에 종성이 없을 경우
|
||||
else {
|
||||
// console.log("inputLetter jongsung : " + StringUtil.jongsung(inputLetter))
|
||||
// console.log("typingNextLetter chosung : " + StringUtil.chosung(typingNextLetter))
|
||||
if(StringUtil.jongsung(inputLetter) == StringUtil.chosung(typingNextLetter)) {
|
||||
// highlightKey = StringUtil.jungsung(typingNextLetter);
|
||||
if(StringUtil.isMultiAlphabetJungsung(StringUtil.jungsung(typingNextLetter))) {
|
||||
// console.log("* multi jungsung");
|
||||
jungsungAlphabets = StringUtil.getMultiAlphabetFromJungsung(StringUtil.jungsung(typingNextLetter));
|
||||
highlightKey = jungsungAlphabets[0];
|
||||
// console.log(highlightKey);
|
||||
} else {
|
||||
// console.log("* single jungsung");
|
||||
highlightKey = StringUtil.jungsung(typingNextLetter);
|
||||
// console.log(highlightKey);
|
||||
if(StringUtil.hasJongsung(inputLetter)) {
|
||||
// console.log("### has jongsung");
|
||||
if(inputIndex == typingLength - 1)
|
||||
highlightKey = "Backspace";
|
||||
else {
|
||||
if(StringUtil.jongsung(inputLetter) == StringUtil.chosung(typingNextLetter)) {
|
||||
// highlightKey = StringUtil.jungsung(typingNextLetter);
|
||||
if(StringUtil.isMultiAlphabetJungsung(StringUtil.jungsung(typingNextLetter))) {
|
||||
// console.log("* multi jungsung");
|
||||
jungsungAlphabets = StringUtil.getMultiAlphabetFromJungsung(StringUtil.jungsung(typingNextLetter));
|
||||
highlightKey = jungsungAlphabets[0];
|
||||
// console.log(highlightKey);
|
||||
} else {
|
||||
// console.log("* single jungsung");
|
||||
highlightKey = StringUtil.jungsung(typingNextLetter);
|
||||
// console.log(highlightKey);
|
||||
}
|
||||
}
|
||||
else {
|
||||
highlightKey = "Backspace";
|
||||
}
|
||||
}
|
||||
} else
|
||||
}
|
||||
else
|
||||
highlightKey = "Backspace";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user