Преглед на файлове

合并分支解决冲突

lujianhong преди 4 години
родител
ревизия
89fe7e77a9

+ 43 - 10
EBook.Web/Common/mtm_temp.js

@@ -1,9 +1,11 @@
 /*高亮文本标注*/
 function Fill(data) {
+    var wordFlag = false;
+    var phraseFlag = false;
+    var sentenceFlag = false;
     var highlightArr = [];
     clearHighlight();
     $.each(data, function (i, item) {
-
         if (typeof (item.HightCode) != 'undefined' && item.HightCode != null && item.HightCode != "") {
             var highlightItem = $('span[id=' + item.HightCode + ']').eq(0);
             if (highlightItem.length > 0) {
@@ -13,7 +15,7 @@ function Fill(data) {
                 }
                 else {
                     highlightItem.attr('hitCode', item.SourceCode);
-                }
+            }
 
                 highlightArr.push(highlightItem);
             }
@@ -27,18 +29,18 @@ function Fill(data) {
                 }
                 else {
                     highlightItem.attr('hitCode', item.SourceCode);
-                }
+            }
 
                 highlightArr.push(highlightItem);
             }
         }
-
-
         $.each(highlightArr, function (i, item) {
             if (item.attr('flag') == 'word') {
+                wordFlag = true;
                 bindEvent(item.attr('iskeyklg', 'true').attr("hitstyle", "wordStyle").addClass('wordStyle'), true);
             }
             else if (item.attr('flag') == 'phrase') {
+                phraseFlag = true;
                 if (item != null && item.attr('separate') != null) {
                     $("span[separate=" + item.attr('separate') + "]").attr('iskeyklg', 'true').attr("hitstyle", "phraseStyle").addClass('phraseStyle');
                     bindEvent(item, true);
@@ -46,15 +48,46 @@ function Fill(data) {
                 else {
                     bindEvent(item.attr('iskeyklg', 'true').attr("hitstyle", "phraseStyle").addClass('phraseStyle'), true);
                     if ($(item).parent().attr('iskeyklg') == 'true' && $(item).parent().attr('flag') == 'phrase') $(item).addClass('border1')
-                }
+            }
             }
             else if (item.attr('flag') == 'sentence') {
                 if (item.attr('iskeyklg') == 'true') return;
+                sentenceFlag = true;
                 bindEvent(item.attr('iskeyklg', 'true').attr("hitstyle", "sentenceStyle").addClass('sentenceStyle')
                     .before('<img src="file:///android_asset/js/sentenceIco.png" class="sentImagcs">'), true);
             }
         });
     });
+    // 绑定横线内处理
+    $.each($(document).find("u,span,p"), function (Iindex, Iitem) {
+        var ClsName = $(Iitem).attr("class");
+        if ($(Iitem).attr("ulflag") == undefined) {
+            $(Iitem).attr("ulflag", "0");
+        }
+        if ($(Iitem).attr("shcode") == undefined) {
+            $(Iitem).attr("shcode", 1);
+        }
+        if ($(Iitem).attr("showflag") == undefined) {
+            $(Iitem).attr("showflag", "1");
+        }
+        if (ClsName != undefined && ClsName.indexOf("underlineContent") > -1) {
+            $(Iitem).attr("ulflag", "1");
+            $.each($(Iitem).find("u,span,p"), function (index, element) {
+                if ($(element).attr("ulflag") == undefined) {
+                    $(element).attr("ulflag", "1");
+                }
+                if ($(element).attr("shcode") == undefined) {
+                    $(element).attr("shcode", 1);
+                }
+                if ($(element).attr("showflag") == undefined) {
+                    $(element).attr("showflag", "1");
+                }
+            });
+        }
+    });
+    if (typeof (showGLWorld) == "function") {
+        showGLWorld(wordFlag, phraseFlag, sentenceFlag);
+    }
 }
 
 function clearHighlight() {
@@ -94,7 +127,7 @@ function bindEvent(ele, opt) {
                             //plugin.call(code);
                             //alert($(this).attr("hitCode"));
                             var sHCode = $(this).attr("shcode");
-                            if (sHCode != 1) {
+                            if (sHCode == 1) {
                                 test($(this).attr("hitCode"));
                             }
                         }
@@ -107,7 +140,7 @@ function bindEvent(ele, opt) {
                         //plugin.call(code);
                         //alert($(this).attr("hitCode"));
                         var sHCode = $(this).attr("shcode");
-                        if (sHCode != 1) {
+                        if (sHCode == 1) {
                             test($(this).attr("hitCode"));
                         }
                     }
@@ -120,7 +153,7 @@ function bindEvent(ele, opt) {
                         //plugin.call(code);
                         //alert($(this).attr("hitCode"));
                         var sHCode = $(this).attr("shcode");
-                        if (sHCode != 1) {
+                        if (sHCode == 1) {
                             test($(this).attr("hitCode"));
                         }
                     }
@@ -130,7 +163,7 @@ function bindEvent(ele, opt) {
                         //plugin.call(code);
                         //alert($(this).attr("hitCode"));
                         var sHCode = $(this).attr("shcode");
-                        if (sHCode != 1) {
+                        if (sHCode == 1) {
                             test($(this).next().attr("hitCode"));
                         }
                     }

+ 180 - 63
EBook.Web/Common/tasklib_book.js

@@ -47,15 +47,27 @@ var removeHtmlFunc = function (HtmlStr) {
     // 清除非长度标签
     var pattStr = new RegExp(/<(img){1}.*?>/ig);
     var matchesArr = HtmlStr.match(pattStr);
-    if (matchesArr != null && matchesArr.length > 0) {
+    if (matchesArr != null && (matchesArr != undefined && matchesArr.length > 0)) {
         for (var i = 0; i < matchesArr.length; i++) {
             HtmlStr = HtmlStr.replace(matchesArr[i], "");
         }
     }
     pattStr = new RegExp(/(<(p){1}.*?>).*?(<\/\2>)/ig);
     matchesArr = HtmlStr.match(pattStr);
+    if (matchesArr != undefined && matchesArr.length > 0) {
+        // 清除匹配的P标签
+        for (var i = 0; i < matchesArr.length; i++) {
+            HtmlStr = HtmlStr.replace(matchesArr[i], "");
+        }
+    }
     // 判断是否存在p标签
-    if (matchesArr != null || matchesArr.length > 0) {
+    if (matchesArr != null || (matchesArr != undefined && matchesArr.length > 0)) {
+        if (HtmlStr != null && HtmlStr != "") {
+            // p标签混排
+            HtmlStr = "<p>" + HtmlStr + "</p>";
+            matchesArr.push(HtmlStr);
+            HtmlStr = null;
+        }
         pattStr = new RegExp(/(<(p|b|span|u){1}.*?>).*?(<\/\2>)/i);
         for (var i = 0; i < matchesArr.length; i++) {
             var NewHtmlStr = matchesArr[i];
@@ -155,14 +167,24 @@ var AdjustTableFunc = function () {
                     TableWidth += ArrMaxLen[i];
                 }
                 else if (ArrMaxLen[i] != undefined && $(item).find("tr").eq(0).find("td").length > 1 && !RuleFlag) {
-                    TableWidth += ArrMaxLen[i];
-                    var NotRuleWidth = 0;
                     if (i == ArrMaxLen.length - 1) {
-                        NotRuleWidth = TableWidth / $(item).find("tr").eq(0).find("td").length;
+                        var FLenVal = $(item).find("tr").eq(0).find("td").length;
+                        var AllLenArr = [];
+                        for (var j = 0; j < FLenVal; j++) {
+                            AllLenArr.push(parseInt($(item).find("tr").eq(0).find("td").eq(j).attr("colspan")));
+                        }
+                        var AIndex = 0;
+                        for (var j = 0; j < AllLenArr.length; j++) {
+                            var AWidthVal = 0;
+                            for (var k = 0; k < parseInt(AllLenArr[j]) ; k++) {
+                                AWidthVal += ArrMaxLen[AIndex];
+                                AIndex += 1;
+                            }
+                            AWidthVal += 100;
+                            TableWidth += AWidthVal;
+                            $(item).find("tr").eq(0).find("td").eq(j).css("width", AWidthVal + "px");
+                        }
                     }
-                    $.each($(item).find("tr").eq(0).find("td"), function (tdIndex, tdItem) {
-                        $(tdItem).css("width", NotRuleWidth + "px");
-                    });
                 }
                 else if (ArrMaxLen[i] != undefined && $(item).find("tr").eq(0).find("td").length == 1) {
                     OneFlag = true;
@@ -254,53 +276,147 @@ var isGCFunc = function (NodeHandle) {
     }
     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");
+//(shcode是否可点击1可点击;ulflag判断是否存在横线内1表示在;showflag是否显示1显示)
+// 处理显示或隐藏答案
+var dealAnswerFunc = function (NodeHandle, OCFlag, ThProFlag) {
+    if (OCFlag) {
+        var showflagS = $(NodeHandle).attr("showflag");
+        if ($(NodeHandle).attr("ulflag") == 1) {
+            if (!ThProFlag || (ThProFlag && showflagS == 1)) {
+                if ($(NodeHandle).text() == "暂无参考答案") {
+                    $(NodeHandle).css("color", "#989898").attr("shcode", 1).attr("showflag", "1");
+                }
+                else {
+                    $(NodeHandle).css("color", "#92D050").attr("shcode", 1).attr("showflag", "1");
+                }
+            }
+        }
+        else {
+            $(NodeHandle).css("color", "#000000").attr("shcode", 1).attr("showflag", "1");
+        }
+        if ($(NodeHandle).attr("hitstyle") == "wordStyle") {
+            if (styleWPSContrl.wordFlag) {
+                if (!ThProFlag || (ThProFlag && showflagS == 1)) {
+                    $(NodeHandle).css("color", "#db5d00").attr("shcode", 1).attr("showflag", "1");
+                }
             }
             else {
-                $(element).css("color", "#000000");
+                var ulflag = $(NodeHandle).attr("ulflag");
+                if (ulflag == "1") {
+                    if (!ThProFlag || (ThProFlag && showflagS == 1)) {
+                        $(NodeHandle).css("color", "#92D050").attr("shcode", 0).attr("showflag", "1");
+                    }
+                }
+                else {
+                    $(NodeHandle).css("color", "#000000").attr("shcode", 0).attr("showflag", "1");
+                }
             }
-        });
-    }
-    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) {
-    if (OCFlag) {
-        $(NodeHandle).css("color", "#92D050").css("border-bottom", "1px solid #979797").css("background-color", "transparent").attr("shcode", "0");
-        $(NodeHandle).children().css("color", "#92D050").css("border-bottom", "1px solid #979797").css("background-color", "transparent").attr("shcode", "0");
-        // 处理高亮
-        dealGLShowFunc(NodeHandle);
+        }
+        else if ($(NodeHandle).attr("hitstyle") == "phraseStyle") {
+            if (styleWPSContrl.phraseFlag && showflagS == "1") {
+                $(NodeHandle).css("background-color", "#f2db8b").attr("shcode", 1).attr("showflag", "1");
+            }
+            else if (showflagS == "1") {
+                $(NodeHandle).css("background-color", "#ffffff").attr("shcode", 0).attr("showflag", "1");
+            }
+        }
+        else if ($(NodeHandle).attr("hitstyle") == "sentenceStyle") {
+            if (styleWPSContrl.sentenceFlag && showflagS == "1") {
+                $(NodeHandle).css("border-bottom", "2px solid #78ae43").attr("shcode", 1).attr("showflag", "1");
+            }
+            else if (showflagS == "1") {
+                $(NodeHandle).css("border-bottom", "2px solid #ffffff").attr("shcode", 1).attr("showflag", "1");
+            }
+        }
+        if (!ThProFlag) {
+            $.each($(NodeHandle).find("u,span,p"), function (index, element) {
+                showflagS = $(element).attr("showflag");
+                // 处理普通文本
+                if ($(element).attr("ulflag") == 1) {
+                    if (!ThProFlag || (ThProFlag && showflagS == 1)) {
+                        if ($(element).text() == "暂无参考答案") {
+                            $(element).css("color", "#989898").attr("shcode", 1).attr("showflag", "1");
+                        }
+                        else {
+                            $(element).css("color", "#92D050").attr("shcode", 1).attr("showflag", "1");
+                        }
+                    }
+                }
+                else {
+                    $(element).css("color", "#000000").attr("shcode", 1).attr("showflag", "1");
+                }
+                // 处理高亮
+                if ($(element).attr("hitstyle") == "wordStyle") {
+                    if (styleWPSContrl.wordFlag) {
+                        if (!ThProFlag || (ThProFlag && showflagS == 1)) {
+                            $(element).css("color", "#db5d00").attr("shcode", 1).attr("showflag", "1");
+                        }
+                    }
+                    else {
+                        if (!ThProFlag || (ThProFlag && showflagS == 1)) {
+                            var ulflag = $(element).attr("ulflag");
+                            if (ulflag == "1") {
+                                if (!ThProFlag || (ThProFlag && showflagS == 1)) {
+                                    $(element).css("color", "#92D050").attr("shcode", 0).attr("showflag", "1");
+                                }
+                            }
+                            else {
+                                $(element).css("color", "#000000").attr("shcode", 0).attr("showflag", "1");
+                            }
+                        }
+                    }
+                }
+                else if ($(element).attr("hitstyle") == "phraseStyle") {
+                    if (styleWPSContrl.phraseFlag) {
+                        if (!ThProFlag || (ThProFlag && showflagS == 1)) {
+                            $(element).css("background-color", "#f2db8b").attr("shcode", 1).attr("showflag", "1");
+                        }
+                    }
+                    else {
+                        $(element).css("background-color", "#ffffff").attr("shcode", 0).attr("showflag", "1");
+                    }
+                }
+                else if ($(element).attr("hitstyle") == "sentenceStyle") {
+                    if (styleWPSContrl.sentenceFlag) {
+                        if (!ThProFlag || (ThProFlag && showflagS == 1)) {
+                            $(element).css("border-bottom", "2px solid #78ae43").attr("shcode", 1).attr("showflag", "1");
+                        }
+                    }
+                    else {
+                        $(element).css("border-bottom", "2px solid #ffffff").attr("shcode", 0).attr("showflag", "1");
+                    }
+                }
+            });
+        }
     }
     else {
-        $(NodeHandle).css("color", "#fff").css("border-bottom", "1px solid #979797").css("background-color", "#fff").attr("shcode", "1");
-        $(NodeHandle).children().css("color", "#fff").css("border-bottom", "1px solid #979797").css("background-color", "#fff").attr("shcode", "1");
-        $(NodeHandle).find(".wordStyle").css("color", "#fff").css("border-bottom", "1px solid #979797").css("background-color", "#fff").attr("shcode", "1");
-        $(NodeHandle).find(".sentenceStyle").css("color", "#fff").css("border-bottom", "1px solid #979797").css("background-color", "#fff").attr("shcode", "1");
-        $(NodeHandle).find(".phraseStyle").css("color", "#fff").css("border-bottom", "1px solid #979797").css("background-color", "#fff").attr("shcode", "1");
+        $(NodeHandle).css("color", "#ffffff").attr("shcode", 1).attr("showflag", "0");
+        if ($(NodeHandle).attr("hitstyle") == "wordStyle") {
+            $(NodeHandle).attr("shcode", 0).attr("showflag", "0");
+        }
+        else if ($(NodeHandle).attr("hitstyle") == "phraseStyle") {
+            $(NodeHandle).css("background-color", "#ffffff").attr("shcode", 0).attr("showflag", "0");
+        }
+        else if ($(NodeHandle).attr("hitstyle") == "sentenceStyle") {
+            $(NodeHandle).css("border-bottom", "2px solid #ffffff").attr("shcode", 0).attr("showflag", "0");
+        }
+        $.each($(NodeHandle).find("u,span,p"), function (index,element) {
+            // 处理普通文本
+            $(element).css("color", "#ffffff").attr("shcode", 1).attr("showflag", "0");  // 合并处理
+            // 处理高亮
+            if ($(element).attr("hitstyle") == "wordStyle") {
+                $(element).attr("shcode", 0).attr("showflag", "0");
+            }
+            else if ($(element).attr("hitstyle") == "phraseStyle") {
+                $(element).css("background-color", "#ffffff").attr("shcode", 0).attr("showflag", "0");
+            }
+            else if ($(element).attr("hitstyle") == "sentenceStyle") {
+                $(element).css("border-bottom", "2px solid #ffffff").attr("shcode", 0).attr("showflag", "0");
+            }
+        });
     }
     var underlineContentText = $(NodeHandle).text();  // 获取文本内容
-    if (underlineContentText.indexOf("√") > -1) {
+    if (underlineContentText != undefined && underlineContentText.indexOf("√") > -1) {
         if (OCFlag) {
             $(NodeHandle).parent().find(".checkbox").find("input").prop('checked', true);
         }
@@ -315,13 +431,13 @@ function showHideAnswer(flag) {
     if (flag) {
         $(".yaoshi").attr("src", PicInfo.yaoshiShowImgUrl);
         $.each($(".underlineContent"), function (index, item) {
-            dealAnswerFunc(item, true);
+            dealAnswerFunc(item, true, false);
         });
     }
     else {
         $(".yaoshi").attr("src", PicInfo.yaoshiHideImgUrl);
         $.each($(".underlineContent,.underlineContent.no-answer"), function (index, item) {
-            dealAnswerFunc(item, false);
+            dealAnswerFunc(item, false, false);
         });
     }
 }
@@ -336,14 +452,14 @@ function showHideAnswerEx(isShowYX, isShowAS) {
     }
     if (isShowAS) {
         $.each($(".underlineContent"), function (index, item) {
-            dealAnswerFunc(item, true);
+            dealAnswerFunc(item, true, false);
         });
         $(".yaoshi").attr("data-status", "1");
         $(".yaoshi").attr("src", PicInfo.yaoshiShowImgUrl);
     }
     else {
         $.each($(".underlineContent,.underlineContent.no-answer"), function (index, item) {
-            dealAnswerFunc(item, false);
+            dealAnswerFunc(item, false, false);
         });
         $(".yaoshi").attr("data-status", "0");
         $(".yaoshi").attr("src", PicInfo.yaoshiHideImgUrl);
@@ -440,7 +556,7 @@ function bindEventTeaOrignalYS() {
                     $(item).attr("data-status", "1");
                     $(item).attr("src", PicInfo.yaoshiShowImgUrl);
                     $.each($(item).parent().find(".underlineContent"), function (cIndex, cItem) {
-                        dealAnswerFunc(cItem, true);
+                        dealAnswerFunc(cItem, true, false);
                     });
                 });
             }
@@ -448,7 +564,7 @@ function bindEventTeaOrignalYS() {
                 $(this).attr("data-status", "1");
                 $(this).attr("src", PicInfo.yaoshiShowImgUrl);
                 $.each($(this).nextUntil(".yaoshi").find(".underlineContent"), function (index, item) {
-                    dealAnswerFunc(item, true);
+                    dealAnswerFunc(item, true, false);
                 });
             }
             //不再存在已隐藏的钥匙,移动端回调
@@ -464,7 +580,7 @@ function bindEventTeaOrignalYS() {
                     $(item).attr("data-status", "0");
                     $(item).attr("src", PicInfo.yaoshiHideImgUrl);
                     $.each($(item).parent().find(".underlineContent"), function (cIndex, cItem) {
-                        dealAnswerFunc(cItem, false);
+                        dealAnswerFunc(cItem, false, false);
                     });
                 });
             }
@@ -472,7 +588,7 @@ function bindEventTeaOrignalYS() {
                 $(this).attr("data-status", "0");
                 $(this).attr("src", PicInfo.yaoshiHideImgUrl);
                 $.each($(this).nextUntil(".yaoshi").find(".underlineContent"), function (index, item) {
-                    dealAnswerFunc(item, false);
+                    dealAnswerFunc(item, false, false);
                 });
             }
             //添加回调
@@ -567,7 +683,7 @@ function bindEventYS() {
                     $(fItem).attr("data-status", "1");
                     $(fItem).attr("src", PicInfo.yaoshiShowImgUrl);
                     $.each($(fItem).parent().find(".underlineContent"), function (index, item) {
-                        dealAnswerFunc(item, true);
+                        dealAnswerFunc(item, true, false);
                     });
                 });
             }
@@ -576,7 +692,7 @@ function bindEventYS() {
                 $(this).attr("src", PicInfo.yaoshiShowImgUrl);
                 //$(this).nextUntil(".yaoshi").filter(".underlineContent").css("color", "#92D050");
                 $.each($(this).nextUntil(".yaoshi").filter(".underlineContent"), function (index, item) {
-                    dealAnswerFunc(item, true);
+                    dealAnswerFunc(item, true, false);
                 });
             }
             //不再存在已隐藏的钥匙,移动端回调
@@ -592,7 +708,7 @@ function bindEventYS() {
                     $(fItem).attr("data-status", "0");
                     $(fItem).attr("src", PicInfo.yaoshiHideImgUrl);
                     $.each($(fItem).parent().find(".underlineContent"), function (index, item) {
-                        dealAnswerFunc(item, false);
+                        dealAnswerFunc(item, false, false);
                     });
                 });
             }
@@ -601,7 +717,7 @@ function bindEventYS() {
                 $(this).attr("src", PicInfo.yaoshiHideImgUrl);
                 //$(this).nextUntil(".yaoshi").filter(".underlineContent").css("color", "#ffffff");
                 $.each($(this).nextUntil(".yaoshi").filter(".underlineContent"), function (index, item) {
-                    dealAnswerFunc(item, false);
+                    dealAnswerFunc(item, false, false);
                 });
             }
             //添加回调
@@ -1509,14 +1625,15 @@ function randomNum(minNum, maxNum) {
     }
 }
 
-// 传递显示单词wordFlag/句子phraseFlag/句型sentenceFlag,true表示高亮,false表示不高亮
+// 传递显示单词wordFlag/短语phraseFlag/句型sentenceFlag,true表示高亮,false表示不高亮
 function showGLWorld(wordFlag, phraseFlag, sentenceFlag) {
     styleWPSContrl.wordFlag = wordFlag;
     styleWPSContrl.phraseFlag = phraseFlag;
     styleWPSContrl.sentenceFlag = sentenceFlag;
-    dealGLShowFunc(document);
+    $.each($(document.body).find("u[hitstyle='wordStyle'],span[hitstyle='wordStyle'],p[hitstyle='wordStyle'],u[hitstyle='phraseStyle'],span[hitstyle='phraseStyle'],p[hitstyle='phraseStyle'],u[hitstyle='sentenceStyle'],span[hitstyle='sentenceStyle'],p[hitstyle='sentenceStyle']"), function (index, element) {
+        dealAnswerFunc(element, true, true);
+    });
 }
-
 function playVisiableAudioCallBack(type, url) {
     //console.log(url);
     cancelBubble();

Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
EBook.Web/HightCode/data202116P.json


+ 1 - 0
EBook.Web/HightCode/data202116S.json

@@ -0,0 +1 @@
+[{"HightCode":"SS68","SourceCode":"CD0502804A004FBAC"}]

Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
EBook.Web/HightCode/data202116W.json


+ 94 - 7
EBook.Web/Test.html

@@ -21,6 +21,11 @@
         <button id="backup-review">回填评阅数据</button>
         <button id="scroll-review">定位滚动数据</button>
         <button id="test-ui">测试UI效果</button>
+        <button id="wordStyleID">单词</button>
+        <button id="phraseStyleID">短语</button>
+        <button id="sentenceStyleID">句型</button>
+        <button id="ShowID">全显示</button>
+        <button id="HiddenID">隐藏</button>
     </div>
     <!--<input type="text" style="border:0px; border-bottom:solid #fbfbfb 1px; border-radius: 3px;padding-left:5px; color:#6ab7ff;" value="测试的" />-->
 
@@ -41,18 +46,23 @@
         //加载数据
         window.onload = function () {
             //加载听说课文
-            answerjson = $.ajax({ url: "AnsText/duogouxuan.json", async: false }).responseText;
-            reviewjson = $.ajax({ url: "AnsText/220342.json", async: false }).responseText;
-            hightcodejson = $.ajax({ url: "HightCode/data202115.json", async: false }).responseText;
+            answerjson = $.ajax({ url: "AnsText/GCZD.json", async: false }).responseText;
+            reviewjson = $.ajax({ url: "AnsText/anstext.txt", async: false }).responseText;
+            hightcodejson = JSON.parse($.ajax({ url: "HightCode/data202116P.json", async: false }).responseText);
+            for (var i = 0; i < JSON.parse($.ajax({ url: "HightCode/data202116S.json", async: false }).responseText).length; i++) {
+                hightcodejson.push(JSON.parse($.ajax({ url: "HightCode/data202116S.json", async: false }).responseText)[i]);
+            }
+            for (var i = 0; i < JSON.parse($.ajax({ url: "HightCode/data202116W.json", async: false }).responseText).length; i++) {
+                hightcodejson.push(JSON.parse($.ajax({ url: "HightCode/data202116W.json", async: false }).responseText)[i]);
+            }
         }
         //加载听说课文
         $("#load-text").on("click", function () {
             var data = $.ajax({ url: "lghp/duogouxuan.lghp", async: false }).responseText;
             $("#data").html(data);
-
-            //Fill(JSON.parse(hightcodejson));
             bindEventYS();
-            Fill(JSON.parse(hightcodejson));
+            Fill(hightcodejson);
+            showHideAnswerEx(true, false);
             //bindCoursewareEvent();
 
             var ResInfo = {
@@ -134,7 +144,84 @@
             var clonediv = $(".btn-play").prop("outerHTML");
             $(".test-p").html($(".test-p").html() + clonediv);
         });
-
+        var wordStyleFlag = true;
+        var phraseStyleFlag = true;
+        var sentenceStyleFlag = true;
+        $("#wordStyleID").on("click", function () {
+            wordStyleFlag = !wordStyleFlag;
+            hightcodejson = null;
+            hightcodejson = [];
+            if (phraseStyleFlag) {
+                for (var i = 0; i < JSON.parse($.ajax({ url: "HightCode/data202116P.json", async: false }).responseText).length; i++) {
+                    hightcodejson.push(JSON.parse($.ajax({ url: "HightCode/data202116P.json", async: false }).responseText)[i]);
+                }
+            }
+            if (wordStyleFlag) {
+                for (var i = 0; i < JSON.parse($.ajax({ url: "HightCode/data202116W.json", async: false }).responseText).length; i++) {
+                    hightcodejson.push(JSON.parse($.ajax({ url: "HightCode/data202116W.json", async: false }).responseText)[i]);
+                }
+            }
+            if (sentenceStyleFlag) {
+                for (var i = 0; i < JSON.parse($.ajax({ url: "HightCode/data202116S.json", async: false }).responseText).length; i++) {
+                    hightcodejson.push(JSON.parse($.ajax({ url: "HightCode/data202116S.json", async: false }).responseText)[i]);
+                }
+            }
+            console.log(hightcodejson);
+            Fill(hightcodejson);
+            showGLWorld(wordStyleFlag, phraseStyleFlag, sentenceStyleFlag);
+        });
+        $("#phraseStyleID").on("click", function () {
+            phraseStyleFlag = !phraseStyleFlag;
+            hightcodejson = null;
+            hightcodejson = [];
+            if (phraseStyleFlag) {
+                for (var i = 0; i < JSON.parse($.ajax({ url: "HightCode/data202116P.json", async: false }).responseText).length; i++) {
+                    hightcodejson.push(JSON.parse($.ajax({ url: "HightCode/data202116P.json", async: false }).responseText)[i]);
+                }
+            }
+            if (wordStyleFlag) {
+                for (var i = 0; i < JSON.parse($.ajax({ url: "HightCode/data202116W.json", async: false }).responseText).length; i++) {
+                    hightcodejson.push(JSON.parse($.ajax({ url: "HightCode/data202116W.json", async: false }).responseText)[i]);
+                }
+            }
+            if (sentenceStyleFlag) {
+                for (var i = 0; i < JSON.parse($.ajax({ url: "HightCode/data202116S.json", async: false }).responseText).length; i++) {
+                    hightcodejson.push(JSON.parse($.ajax({ url: "HightCode/data202116S.json", async: false }).responseText)[i]);
+                }
+            }
+            console.log(hightcodejson);
+            Fill(hightcodejson);
+            showGLWorld(wordStyleFlag, phraseStyleFlag, sentenceStyleFlag);
+        });
+        $("#sentenceStyleID").on("click", function () {
+            sentenceStyleFlag = !sentenceStyleFlag;
+            hightcodejson = null;
+            hightcodejson = [];
+            if (phraseStyleFlag) {
+                for (var i = 0; i < JSON.parse($.ajax({ url: "HightCode/data202116P.json", async: false }).responseText).length; i++) {
+                    hightcodejson.push(JSON.parse($.ajax({ url: "HightCode/data202116P.json", async: false }).responseText)[i]);
+                }
+            }
+            if (wordStyleFlag) {
+                for (var i = 0; i < JSON.parse($.ajax({ url: "HightCode/data202116W.json", async: false }).responseText).length; i++) {
+                    hightcodejson.push(JSON.parse($.ajax({ url: "HightCode/data202116W.json", async: false }).responseText)[i]);
+                }
+            }
+            if (sentenceStyleFlag) {
+                for (var i = 0; i < JSON.parse($.ajax({ url: "HightCode/data202116S.json", async: false }).responseText).length; i++) {
+                    hightcodejson.push(JSON.parse($.ajax({ url: "HightCode/data202116S.json", async: false }).responseText)[i]);
+                }
+            }
+            console.log(hightcodejson);
+            Fill(hightcodejson);
+            showGLWorld(wordStyleFlag, phraseStyleFlag, sentenceStyleFlag);
+        });
+        $("#ShowID").on("click", function () {
+            showGLWorld(true, true, true);
+        });
+        $("#HiddenID").on("click", function () {
+            showGLWorld(false, false, false);
+        });
         //生成从minNum到maxNum的随机数
         function randomNum(minNum, maxNum) {
             switch (arguments.length) {

Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
EBook.Web/lghp/22216.lghp


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
EBook.Web/lghp/data202116.lghp


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
EBook.Web/lghp/jieduan.lghp


Някои файлове не бяха показани, защото твърде много файлове са промени