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