|
|
@@ -1,5 +1,5 @@
|
|
|
//播放音频图片地址
|
|
|
-var PicInfo1 = {
|
|
|
+var PicInfo = {
|
|
|
answerPointImgUrl: "file:///android_asset/js/update-answer.png",
|
|
|
yaoshiShowImgUrl: "file:///android_asset/js/yaoshi-show.png",
|
|
|
yaoshiHideImgUrl: "file:///android_asset/js/yaoshi-hide.png",
|
|
|
@@ -10,7 +10,7 @@ var PicInfo1 = {
|
|
|
}
|
|
|
|
|
|
//本地调用用的资源
|
|
|
-var PicInfo = {
|
|
|
+var PicInfo1 = {
|
|
|
answerPointImgUrl: "../Images/update-answer.png",
|
|
|
yaoshiShowImgUrl: "../Images/yaoshi-show.png",
|
|
|
yaoshiHideImgUrl: "../Images/yaoshi-hide.png",
|
|
|
@@ -20,6 +20,12 @@ var PicInfo = {
|
|
|
audioPlayImgUrl: "../Images/dynaiselaba.gif",
|
|
|
audioPauseImgUrl: "../Images/dynaiselaba.png"
|
|
|
}
|
|
|
+// 高亮
|
|
|
+var styleWPSContrl = {
|
|
|
+ wordFlag: true,
|
|
|
+ phraseFlag: true,
|
|
|
+ sentenceFlag: true
|
|
|
+}
|
|
|
// 表格处理Start
|
|
|
var pressTableFlag = false;
|
|
|
var GetPadVal = function () {
|
|
|
@@ -232,6 +238,49 @@ var AdjustTableFunc = function () {
|
|
|
};
|
|
|
// 表格处理End
|
|
|
|
|
|
+// 判断是否在横线内
|
|
|
+var isGCFunc = function (NodeHandle) {
|
|
|
+ var isFlag = false;
|
|
|
+ var PClsName = $(NodeHandle).attr("class");
|
|
|
+ var tagName = $(NodeHandle).prop("tagName");
|
|
|
+ while (tagName != undefined && tagName != "document" && tagName != "body" && ((PClsName != undefined && PClsName.indexOf("underlineContent") == -1) || PClsName == undefined)) {
|
|
|
+ NodeHandle = $(NodeHandle).parent();
|
|
|
+ PClsName = $(NodeHandle).attr("class");
|
|
|
+ tagName = $(NodeHandle).prop("tagName");
|
|
|
+ }
|
|
|
+ if (PClsName != undefined && PClsName.indexOf("underlineContent") > -1) {
|
|
|
+ isFlag = true;
|
|
|
+ }
|
|
|
+ return isFlag;
|
|
|
+};
|
|
|
+// 处理高亮
|
|
|
+var dealGLShowFunc = function (NodeHandle) {
|
|
|
+ if (styleWPSContrl.wordFlag) {
|
|
|
+ $(NodeHandle).find(".wordStyle").css("color", "#db5d00");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $.each($(NodeHandle).find(".wordStyle"), function (index, element) {
|
|
|
+ if (isGCFunc(element)) {
|
|
|
+ $(element).css("color", "#92D050");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $(element).css("color", "#000000");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (styleWPSContrl.phraseFlag) {
|
|
|
+ $(NodeHandle).find(".phraseStyle").css("background-color", "#f2db8b");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $(NodeHandle).find(".phraseStyle").css("background-color", "#fff");
|
|
|
+ }
|
|
|
+ if (styleWPSContrl.sentenceFlag) {
|
|
|
+ $(NodeHandle).find(".sentenceStyle").css("border-bottom", "2px solid #78ae43");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $(NodeHandle).find(".sentenceStyle").css("border-bottom", "2px solid #fff");
|
|
|
+ }
|
|
|
+};
|
|
|
// 处理显示或隐藏答案
|
|
|
var dealAnswerFunc = function (NodeHandle, OCFlag) {
|
|
|
var FontSizeValue = $(NodeHandle).css("font-size");
|
|
|
@@ -248,6 +297,8 @@ var dealAnswerFunc = function (NodeHandle, OCFlag) {
|
|
|
}
|
|
|
if (OCFlag) {
|
|
|
$(NodeHandle).css("display", "inline-block").after(addHtml);
|
|
|
+ // 处理高亮
|
|
|
+ dealGLShowFunc(NodeHandle);
|
|
|
}
|
|
|
else {
|
|
|
$(NodeHandle).css("display", "none").after(addHtml);
|
|
|
@@ -257,6 +308,8 @@ var dealAnswerFunc = function (NodeHandle, OCFlag) {
|
|
|
else {
|
|
|
if (OCFlag) {
|
|
|
$(NodeHandle).css("display", "inline-block").next().attr("data-status", "0");
|
|
|
+ // 处理高亮
|
|
|
+ dealGLShowFunc(NodeHandle);
|
|
|
}
|
|
|
else {
|
|
|
$(NodeHandle).css("display", "none").next().attr("data-status", "1");
|
|
|
@@ -299,8 +352,6 @@ function showHideAnswerEx(isShowYX, isShowAS) {
|
|
|
if (isShowAS) {
|
|
|
$.each($(".underlineContent"), function (index, item) {
|
|
|
dealAnswerFunc(item, true);
|
|
|
- $(item).find(".wordStyle").css("color", "#db5d00");
|
|
|
- $(item).find(".phraseStyle").css("background-color", "#f2db8b");
|
|
|
});
|
|
|
$(".yaoshi").attr("data-status", "1");
|
|
|
$(".yaoshi").attr("src", PicInfo.yaoshiShowImgUrl);
|
|
|
@@ -308,8 +359,6 @@ function showHideAnswerEx(isShowYX, isShowAS) {
|
|
|
else {
|
|
|
$.each($(".underlineContent,.underlineContent.no-answer"), function (index, item) {
|
|
|
dealAnswerFunc(item, false);
|
|
|
- $(item).find(".wordStyle").css("color", "#ffffff");
|
|
|
- $(item).find(".phraseStyle").css("background-color", "#ffffff");
|
|
|
});
|
|
|
$(".yaoshi").attr("data-status", "0");
|
|
|
$(".yaoshi").attr("src", PicInfo.yaoshiHideImgUrl);
|
|
|
@@ -407,8 +456,6 @@ function bindEventTeaOrignalYS() {
|
|
|
$(item).attr("src", PicInfo.yaoshiShowImgUrl);
|
|
|
$.each($(item).parent().find(".underlineContent"), function (cIndex, cItem) {
|
|
|
dealAnswerFunc(cItem, true);
|
|
|
- $(item).find(".wordStyle").css("color", "#db5d00");
|
|
|
- $(item).find(".phraseStyle").css("background-color", "#f2db8b");
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
@@ -417,8 +464,6 @@ function bindEventTeaOrignalYS() {
|
|
|
$(this).attr("src", PicInfo.yaoshiShowImgUrl);
|
|
|
$.each($(this).nextUntil(".yaoshi").find(".underlineContent"), function (index, item) {
|
|
|
dealAnswerFunc(item, true);
|
|
|
- $(item).find(".wordStyle").css("color", "#db5d00");
|
|
|
- $(item).find(".phraseStyle").css("background-color", "#f2db8b");
|
|
|
});
|
|
|
}
|
|
|
//不再存在已隐藏的钥匙,移动端回调
|
|
|
@@ -435,8 +480,6 @@ function bindEventTeaOrignalYS() {
|
|
|
$(item).attr("src", PicInfo.yaoshiHideImgUrl);
|
|
|
$.each($(item).parent().find(".underlineContent"), function (cIndex, cItem) {
|
|
|
dealAnswerFunc(cItem, false);
|
|
|
- $(item).find(".wordStyle").css("color", "#ffffff");
|
|
|
- $(item).find(".phraseStyle").css("background-color", "#ffffff");
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
@@ -445,8 +488,6 @@ function bindEventTeaOrignalYS() {
|
|
|
$(this).attr("src", PicInfo.yaoshiHideImgUrl);
|
|
|
$.each($(this).nextUntil(".yaoshi").find(".underlineContent"), function (index, item) {
|
|
|
dealAnswerFunc(item, false);
|
|
|
- $(item).find(".wordStyle").css("color", "#ffffff");
|
|
|
- $(item).find(".phraseStyle").css("background-color", "#ffffff");
|
|
|
});
|
|
|
}
|
|
|
//添加回调
|
|
|
@@ -542,8 +583,6 @@ function bindEventYS() {
|
|
|
$(fItem).attr("src", PicInfo.yaoshiShowImgUrl);
|
|
|
$.each($(fItem).parent().find(".underlineContent"), function (index, item) {
|
|
|
dealAnswerFunc(item, true);
|
|
|
- $(item).find(".wordStyle").css("color", "#db5d00");
|
|
|
- $(item).find(".phraseStyle").css("background-color", "#f2db8b");
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
@@ -553,8 +592,6 @@ function bindEventYS() {
|
|
|
//$(this).nextUntil(".yaoshi").filter(".underlineContent").css("color", "#92D050");
|
|
|
$.each($(this).nextUntil(".yaoshi").filter(".underlineContent"), function (index, item) {
|
|
|
dealAnswerFunc(item, true);
|
|
|
- $(item).find(".wordStyle").css("color", "#db5d00");
|
|
|
- $(item).find(".phraseStyle").css("background-color", "#f2db8b");
|
|
|
});
|
|
|
}
|
|
|
//不再存在已隐藏的钥匙,移动端回调
|
|
|
@@ -571,8 +608,6 @@ function bindEventYS() {
|
|
|
$(fItem).attr("src", PicInfo.yaoshiHideImgUrl);
|
|
|
$.each($(fItem).parent().find(".underlineContent"), function (index, item) {
|
|
|
dealAnswerFunc(item, false);
|
|
|
- $(item).find(".wordStyle").css("color", "#ffffff");
|
|
|
- $(item).find(".phraseStyle").css("background-color", "#ffffff");
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
@@ -582,8 +617,6 @@ function bindEventYS() {
|
|
|
//$(this).nextUntil(".yaoshi").filter(".underlineContent").css("color", "#ffffff");
|
|
|
$.each($(this).nextUntil(".yaoshi").filter(".underlineContent"), function (index, item) {
|
|
|
dealAnswerFunc(item, false);
|
|
|
- $(item).find(".wordStyle").css("color", "#ffffff");
|
|
|
- $(item).find(".phraseStyle").css("background-color", "#ffffff");
|
|
|
});
|
|
|
}
|
|
|
//添加回调
|
|
|
@@ -1443,6 +1476,14 @@ function randomNum(minNum, maxNum) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// 传递显示单词wordFlag/句子phraseFlag/句型sentenceFlag,true表示高亮,false表示不高亮
|
|
|
+function showGLWorld(wordFlag, phraseFlag, sentenceFlag) {
|
|
|
+ styleWPSContrl.wordFlag = wordFlag;
|
|
|
+ styleWPSContrl.phraseFlag = phraseFlag;
|
|
|
+ styleWPSContrl.sentenceFlag = sentenceFlag;
|
|
|
+ dealGLShowFunc(document);
|
|
|
+}
|
|
|
+
|
|
|
function playVisiableAudioCallBack(type, url) {
|
|
|
//console.log(url);
|
|
|
cancelBubble();
|