Browse Source

提交修改

namejr 4 years ago
parent
commit
f0aa9aa2e5
4 changed files with 83 additions and 79 deletions
  1. 26 27
      EBook.Web/Common/mtm_temp.js
  2. 55 49
      EBook.Web/Common/tasklib_book.js
  3. 2 3
      EBook.Web/Test.html
  4. 0 0
      EBook.Web/lghp/22216.lghp

+ 26 - 27
EBook.Web/Common/mtm_temp.js

@@ -60,36 +60,35 @@ function Fill(data) {
     });
     // °ó¶¨ºáÏßÄÚ´¦Àí
     $.each($(document).find(".wordStyle,.phraseStyle,.sentenceStyle,u,span,p"), function (Iindex, Iitem) {
-        if ($(Iitem).attr("ulflag") == undefined || $(Iitem).attr("shcode") == undefined || $(Iitem).attr("showflag") == undefined) {
-            var ClsName = $(Iitem).attr("class");
-            if ($(Iitem).attr("ulflag") == undefined) {
-                $(Iitem).attr("ulflag", "0");
-            }
-            else if ($(Iitem).attr("shcode") == undefined) {
-                $(Iitem).attr("shcode", 1);
-            }
-            else if ($(Iitem).attr("showflag") == undefined) {
-                $(Iitem).attr("showflag", "1");
-            }
-            if (ClsName != undefined && ClsName.indexOf("underlineContent") > -1) {
-                $(Iitem).attr("ulflag", "1");
-                $.each($(Iitem).find(".wordStyle,.phraseStyle,.sentenceStyle,u,span,p"), function (index, element) {
-                    if ($(element).attr("ulflag") == undefined || $(element).attr("shcode") == undefined || $(element).attr("showflag") == undefined) {
-                        if ($(element).attr("ulflag") == undefined) {
-                            $(element).attr("ulflag", "1");
-                        }
-                        else if ($(element).attr("shcode") == undefined) {
-                            $(element).attr("shcode", 1);
-                        }
-                        else if ($(element).attr("showflag") == undefined) {
-                            $(element).attr("showflag", "1");
-                        }
-                    }
-                });
-            }
+        var ClsName = $(Iitem).attr("class");
+        if ($(Iitem).attr("ulflag") == undefined) {
+            $(Iitem).attr("ulflag", "0");
+        }
+        else if ($(Iitem).attr("shcode") == undefined) {
+            $(Iitem).attr("shcode", 1);
+        }
+        else if ($(Iitem).attr("showflag") == undefined) {
+            $(Iitem).attr("showflag", "1");
+        }
+        if (ClsName != undefined && ClsName.indexOf("underlineContent") > -1) {
+            $(Iitem).attr("ulflag", "1");
+            $.each($(Iitem).find(".wordStyle,.phraseStyle,.sentenceStyle,u,span,p"), function (index, element) {
+                if ($(element).attr("ulflag") == undefined) {
+                    $(element).attr("ulflag", "1");
+                }
+                else if ($(element).attr("shcode") == undefined) {
+                    $(element).attr("shcode", 1);
+                }
+                else if ($(element).attr("showflag") == undefined) {
+                    $(element).attr("showflag", "1");
+                }
+            });
         }
     });
     if (typeof (showGLWorld) == "function") {
+        //window.setTimeout(function () {
+        //    showGLWorld(wordFlag, phraseFlag, sentenceFlag);
+        //}, 20);
         showGLWorld(wordFlag, phraseFlag, sentenceFlag);
     }
 }

+ 55 - 49
EBook.Web/Common/tasklib_book.js

@@ -270,6 +270,8 @@ var isGCFunc = function (NodeHandle) {
 // 处理显示或隐藏答案
 var dealAnswerFunc = function (NodeHandle, OCFlag, ThProFlag) {
     if (OCFlag) {
+        console.log($(NodeHandle));
+        console.log($(NodeHandle).attr("showflag"));
         var showflagS = $(NodeHandle).attr("showflag");
         if ($(NodeHandle).attr("ulflag") == 1) {
             if (!ThProFlag || (ThProFlag && showflagS == 1)) {
@@ -285,10 +287,12 @@ var dealAnswerFunc = function (NodeHandle, OCFlag, ThProFlag) {
             $(NodeHandle).css("color", "#000000").attr("shcode", 1).attr("showflag", "1");
         }
         if ($(NodeHandle).attr("hitstyle") == "wordStyle") {
-            if (styleWPSContrl.wordFlag && showflagS == "1") {
-                $(NodeHandle).css("color", "#db5d00").attr("shcode", 1).attr("showflag", "1");
+            if (styleWPSContrl.wordFlag) {
+                if (!ThProFlag || (ThProFlag && showflagS == 1)) {
+                    $(NodeHandle).css("color", "#db5d00").attr("shcode", 1).attr("showflag", "1");
+                }
             }
-            else if (showflagS == "1") {
+            else {
                 var ulflag = $(NodeHandle).attr("ulflag");
                 if (ulflag == "1") {
                     if (!ThProFlag || (ThProFlag && showflagS == 1)) {
@@ -316,64 +320,66 @@ var dealAnswerFunc = function (NodeHandle, OCFlag, ThProFlag) {
                 $(NodeHandle).css("border-bottom", "2px solid #ffffff").attr("shcode", 1).attr("showflag", "1");
             }
         }
-        $.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) {
+            $.each($(NodeHandle).find("u,span,p"), function (index, element) {
+                showflagS = $(element).attr("showflag");
+                // 处理普通文本
+                if ($(element).attr("ulflag") == 1) {
                     if (!ThProFlag || (ThProFlag && showflagS == 1)) {
-                        $(element).css("color", "#db5d00").attr("shcode", 1).attr("showflag", "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 {
-                    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");
-                            }
+                    $(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 {
-                            $(element).css("color", "#000000").attr("shcode", 0).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 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("background-color", "#ffffff").attr("shcode", 0).attr("showflag", "1");
                     }
                 }
-                else{
-                    $(element).css("border-bottom", "2px solid #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", "#ffffff").attr("shcode", 1).attr("showflag", "0");

+ 2 - 3
EBook.Web/Test.html

@@ -59,12 +59,11 @@
         //加载听说课文
         $("#load-text").on("click", function () {
             var data = $.ajax({ url: "lghp/data202116.lghp", async: false }).responseText;
-            //var data = $.ajax({ url: "lghp/jieduan.lghp", async: false }).responseText;
+            //var data = $.ajax({ url: "lghp/22216.lghp", async: false }).responseText;
             $("#data").html(data);
             bindEventYS();
-            //showHideAnswerEx(true, false);
             Fill(hightcodejson);
-            showHideAnswerEx(true, false);
+            //showHideAnswerEx(true, false);
             //bindCoursewareEvent();
 
             var ResInfo = {

File diff suppressed because it is too large
+ 0 - 0
EBook.Web/lghp/22216.lghp


Some files were not shown because too many files changed in this diff