Fix: check previous alphabets
This commit is contained in:
@@ -490,10 +490,10 @@ var TypingTest = {
|
||||
var typingLetter = "";
|
||||
var typingNextLetter = "";
|
||||
|
||||
// console.log("-----");
|
||||
// console.log("inputConent : '" + inputContent + "'");
|
||||
// console.log("inputIndex : " + inputIndex);
|
||||
// console.log("misspelledIndex : " + misspelledIndex);
|
||||
console.log("-----");
|
||||
console.log("inputConent : '" + inputContent + "'");
|
||||
console.log("inputIndex : " + inputIndex);
|
||||
console.log("misspelledIndex : " + misspelledIndex);
|
||||
|
||||
if(inputIndex < 0)
|
||||
inputLetter = "";
|
||||
@@ -505,9 +505,9 @@ var TypingTest = {
|
||||
if(misspelledIndex <= typingContent.length)
|
||||
typingNextLetter = typingContent[misspelledIndex + 1];
|
||||
|
||||
// console.log("inputLetter : '" + inputLetter + "'");
|
||||
// console.log("typingLetter : '" + typingLetter + "'");
|
||||
// console.log("typingNextLetter : '" + typingNextLetter + "'");
|
||||
console.log("inputLetter : '" + inputLetter + "'");
|
||||
console.log("typingLetter : '" + typingLetter + "'");
|
||||
console.log("typingNextLetter : '" + typingNextLetter + "'");
|
||||
|
||||
// var typingAlphabet = "";
|
||||
var inputLetterAlphabets = StringUtil.toKoreanAlphabets(inputLetter);
|
||||
@@ -517,8 +517,12 @@ var TypingTest = {
|
||||
// console.log("typingLetterAlphabets : " + typingLetterAlphabets);
|
||||
// console.log("typingNextLetterAlphabets : " + typingNextLetterAlphabets);
|
||||
|
||||
if(misspelledIndex < inputIndex) {
|
||||
highlightKey = "Backspace";
|
||||
}
|
||||
|
||||
// typing nothing yet
|
||||
if(inputLetterAlphabets.length == 0) {
|
||||
else if(inputLetterAlphabets.length == 0) {
|
||||
// highlightKey = typingLetterAlphabets[0];
|
||||
highlightKey = StringUtil.chosung(typingLetter);
|
||||
}
|
||||
@@ -549,7 +553,12 @@ var TypingTest = {
|
||||
var typingLetterJungsung = StringUtil.jungsung(typingLetter);
|
||||
// console.log("* 222");
|
||||
// inputLetter jungsung == typingLetter jungsung
|
||||
if(StringUtil.jungsung(inputLetter) == StringUtil.jungsung(typingLetter)) {
|
||||
|
||||
// inputLetter chosung != typingLetter chosung
|
||||
if(StringUtil.chosung(inputLetter) != StringUtil.chosung(typingLetter))
|
||||
highlightKey = "Backspace";
|
||||
|
||||
else if(StringUtil.jungsung(inputLetter) == StringUtil.jungsung(typingLetter)) {
|
||||
if(StringUtil.hasJongsung(typingLetter)) {
|
||||
// highlightKey = StringUtil.jongsung(typingLetter);
|
||||
var typingLetterJongsung = StringUtil.jongsung(typingLetter);
|
||||
@@ -603,8 +612,15 @@ var TypingTest = {
|
||||
|
||||
// after typing jongsung
|
||||
else if(inputLetterAlphabets.length == 3) {
|
||||
// inputLetter chosung != typingLetter chosung
|
||||
if(StringUtil.chosung(inputLetter) != StringUtil.chosung(typingLetter))
|
||||
highlightKey = "Backspace";
|
||||
// inputLetter jungsung != typingLetter jungsung
|
||||
else if(StringUtil.jungsung(inputLetter) != StringUtil.jungsung(typingLetter))
|
||||
highlightKey = "Backspace";
|
||||
|
||||
// 입력할 글자에 종성이 있을 경우
|
||||
if(StringUtil.hasJongsung(typingLetter)) {
|
||||
else if(StringUtil.hasJongsung(typingLetter)) {
|
||||
var typingLetterJongsung = StringUtil.jongsung(typingLetter);
|
||||
// 입력한 글자의 종성과 입력할 글자의 종성이 같은 경우
|
||||
if(StringUtil.jongsung(inputLetter) == typingLetterJongsung)
|
||||
|
||||
Reference in New Issue
Block a user