namejr 4 سال پیش
والد
کامیت
f102eaa9df
4فایلهای تغییر یافته به همراه169 افزوده شده و 76 حذف شده
  1. 44 10
      EBook.Web/Common/mtm_passage.css
  2. 50 5
      EBook.Web/Common/mtm_temp.js
  3. 3 0
      EBook.Web/Common/tasklib_book.css
  4. 72 61
      EBook.Web/Common/tasklib_book.js

+ 44 - 10
EBook.Web/Common/mtm_passage.css

@@ -191,20 +191,54 @@ body {
     z-index: 5;
 }
 
-.wordStyle:hover,.phraseStyle:hover,.sentenceStyle:hover{
-	/*box-shadow: 0 0 10px #000000;*/
-}
-
 .wordStyle:hover{
     color:#ff7d1e;
     font-weight: bold;
 	background-color: #ffeeb2;
 }
-
+.wordStyle[showflag='0']{
+    color: #ffffff;
+}
+.wordStyle[showflag='0']:hover{
+    color: #ffffff;
+	background-color: #ffffff;
+}
+.wordStyle[showflag='0'][data-scolor='5']{
+    color: #f2db8b;
+	background-color: #f2db8b;
+}
+.wordStyle[showflag='0'][data-scolor='5']:hover{
+    color: #ffeeb2;
+	background-color: #ffeeb2;
+}
+.wordStyle[showflag='0'][data-scolor='6'],.wordStyle[showflag='0'][data-scolor='6']:hover{
+    color: #fff;
+	background-color: #fff;
+}
 .phraseStyle:hover{
-	/* color:#8c7a00; */
 	background-color: #ffeeb2;
 }
+.phraseStyle:hover .wordStyle[showflag='0']{
+    color: #ffeeb2;
+	background-color: #ffeeb2;
+}
+.phraseStyle[showflag='0'] {
+    background-color: #ffffff;
+}
+.phraseStyle[showflag='0']:hover{
+	background-color: #ffffff;
+}
+.phraseStyle[showflag='0']:hover .wordStyle{
+    color: #ffffff;
+	background-color: #ffffff;
+}
+
+
+
+
+
+
+
 
 .sentenceStyle:hover{
 	color:#1a6500;
@@ -417,12 +451,12 @@ ul {
 
 .ui-dialog a,a:-webkit-any-link,a:link,a:visited,a:hover,a:active{cursor:pointer !important;}
 
-.wordStyle[data-lstatus='1'] {
+/*.wordStyle[data-lstatus='1'] {
     color: #000000 !important;
-}
-.phraseStyle[data-lstatus='1'] {
+}*/
+/*.phraseStyle[data-lstatus='1'] {
     background-color: #ffffff !important;
-}
+}*/
 .sentenceStyle[data-lstatus='1'] {
     border-bottom: none !important;
 }

+ 50 - 5
EBook.Web/Common/mtm_temp.js

@@ -38,7 +38,8 @@ function Fill(data) {
         $.each(highlightArr, function (i, item) {
             if (item.attr('flag') == 'word') {
                 styleWPSContrl.wordFlag = true;
-                bindEvent(item.attr('iskeyklg', 'true').attr("hitstyle", "wordStyle").addClass('wordStyle'), true);
+                // data-scolor显示的颜色等级卡控
+                bindEvent(item.attr('iskeyklg', 'true').attr("hitstyle", "wordStyle").attr("data-scolor", cHPhraseStyleFunc(item)).addClass('wordStyle'), true);
             }
             else if (item.attr('flag') == 'phrase') {
                 styleWPSContrl.phraseFlag = true;
@@ -179,8 +180,52 @@ function bindEvent(ele, opt) {
     }
 }
 
-function test(code) {
-    //alert(code);
-    cancelBubble();
-    plugin.call(code);
+// #region
+// 判断显示层级:0表示最外层;1表示在underlineContent里面;2表示在phraseStyle里面;5表示在underlineContent且phraseStyle在underlineContent里面,7表示在phraseStyle且underlineContent在phraseStyle里面
+function cHPhraseStyleFunc(element) {
+    var ReNumber = 0;
+    var wFlag=true;
+    while (wFlag) {
+        var ClsName = $(element).attr("class");
+        if ($(element).parent() == null || $(element)[0].tagName.toUpperCase() == "BODY") {
+            wFlag = false;
+            return ReNumber;
+        }
+        else if (ClsName != undefined && ClsName.indexOf("phraseStyle") > -1) {
+            wFlag = false;
+            ReNumber += 1;
+        }
+        else if (ClsName != undefined && ClsName.indexOf("underlineContent") > -1) {
+            wFlag = false;
+            ReNumber += 2;
+        }
+        element = $(element).parent();
+    };
+    wFlag = true;
+    while (wFlag) {
+        var ClsName = $(element).attr("class");
+        if ($(element).parent() == null || $(element)[0].tagName.toUpperCase() == "BODY") {
+            wFlag = false;
+            return ReNumber;
+        }
+        else if (ClsName != undefined && ClsName.indexOf("phraseStyle") > -1) {
+            wFlag = false;
+            ReNumber += 3;
+            return ReNumber;
+        }
+        else if (ClsName != undefined && ClsName.indexOf("underlineContent") > -1) {
+            wFlag = false;
+            ReNumber += 5;
+            return ReNumber;
+        }
+        element = $(element).parent();
+    };
+    return ReNumber;
+}
+// #endregion
+
+    function test(code) {
+        //alert(code);
+        cancelBubble();
+        plugin.call(code);
 }

+ 3 - 0
EBook.Web/Common/tasklib_book.css

@@ -113,6 +113,9 @@ p .answer-body:first-child{
     display:inline;
     line-height: 35px;
 }
+.underlineContent[showflag='0'],.underlineContent span[showflag='0']{
+    color:#ffffff;
+}
 .TableContainer{
     width: 100px;
     height: auto;

+ 72 - 61
EBook.Web/Common/tasklib_book.js

@@ -736,9 +736,44 @@ var RemoveSESpaceWhite = function (item) {
     }
     $(item).text(HtmlStr);
 };
-// 将句型换色
-function dealWordStyleFunc() {
-    $(".phraseStyle").find(".wordStyle").css("color", "#f2db8b");
+// 将句型换色(外面是否抱着未隐藏的phraseStyle)
+function dealWordStyleFunc(NodeHandle) {
+    //$(".phraseStyle").find(".wordStyle").css("color", "#f2db8b");
+    var TNodeHandle = null;
+    TNodeHandle = NodeHandle;
+    var SCFlag = false;  // 是否句型换色
+    var whileFlag = true;  // 是否循环
+    while (whileFlag) {
+        var ClsName = $(TNodeHandle).attr("class");
+        if ($(TNodeHandle).parent() == null || $(TNodeHandle)[0].tagName.toUpperCase() == "BODY") {
+            whileFlag = false;
+            return false;
+        }
+        else if (ClsName != undefined && ClsName.indexOf("phraseStyle") > -1) {
+            whileFlag = false;
+        }
+        else if (ClsName != undefined && ClsName.indexOf("underlineContent") > -1) {
+            // 先到underlineContent,可能外面包含phraseStyle
+            SCFlag = true;
+            whileFlag = false;
+        }
+        TNodeHandle = $(TNodeHandle).parent();
+    };
+    whileFlag = true;
+    while (whileFlag) {
+        var ClsName = $(TNodeHandle).attr("class");
+        if ($(TNodeHandle).parent() == null || $(TNodeHandle)[0].tagName.toUpperCase() == "BODY") {
+            whileFlag = false;
+            return false;
+        }
+        else if (ClsName != undefined && ClsName.indexOf("phraseStyle") > -1) {
+            // 换色
+            return true;
+            whileFlag = false;
+        }
+        TNodeHandle = $(TNodeHandle).parent();
+    };
+    return false;
 };
 // 处理显示或隐藏答案,(shcode是否可点击1可点击;ulflag判断是否存在横线内1表示在;showflag是否显示1显示)
 var dealAnswerFunc = function (NodeHandle, OCFlag, ThProFlag) {
@@ -747,31 +782,31 @@ var dealAnswerFunc = function (NodeHandle, OCFlag, ThProFlag) {
         if ($(NodeHandle).attr("ulflag") == 1) {
             if (!ThProFlag || (ThProFlag && showflagS == 1)) {
                 if ($(NodeHandle).text() == "暂无参考答案") {
-                    $(NodeHandle).css("color", "#989898").attr("shcode", 1).attr("showflag", "1");
+                    $(NodeHandle).attr("shcode", 1).attr("showflag", "1");
                 }
                 else {
-                    $(NodeHandle).css("color", "#92D050").attr("shcode", 1).attr("showflag", "1");
+                    $(NodeHandle).attr("shcode", 1).attr("showflag", "1");
                 }
             }
         }
         else {
-            $(NodeHandle).css("color", "#000000").attr("shcode", 1).attr("showflag", "1");
+            $(NodeHandle).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");
+                    $(NodeHandle).attr("shcode", 1).attr("showflag", "1");
                 }
             }
             else {
                 var ulflag = $(NodeHandle).attr("ulflag");
                 if (ulflag == "1") {
                     if (!ThProFlag || (ThProFlag && showflagS == 1)) {
-                        $(NodeHandle).css("color", "#92D050").attr("shcode", 0).attr("showflag", "1");
+                        $(NodeHandle).attr("shcode", 0).attr("showflag", "1");
                     }
                 }
                 else {
-                    $(NodeHandle).css("color", "#000000").attr("shcode", 0).attr("showflag", "1");
+                    $(NodeHandle).attr("shcode", 0).attr("showflag", "1");
                 }
             }
         }
@@ -779,28 +814,28 @@ var dealAnswerFunc = function (NodeHandle, OCFlag, ThProFlag) {
             if (styleWPSContrl.phraseFlag && showflagS == "1") {
                 var ulflag = $(NodeHandle).attr("ulflag");
                 if (ulflag == "1") {
-                    $(NodeHandle).css("background-color", "#f2db8b").attr("shcode", 1).attr("showflag", "1")
+                    $(NodeHandle).attr("shcode", 1).attr("showflag", "1")
                 }
                 else {
-                    $(NodeHandle).css("background-color", "#f2db8b").attr("shcode", 1).attr("showflag", "1");
+                    $(NodeHandle).attr("shcode", 1).attr("showflag", "1");
                 }
             }
             else if (showflagS == "1") {
                 var ulflag = $(NodeHandle).attr("ulflag");
                 if (ulflag == "1") {
-                    $(NodeHandle).css("background-color", "#ffffff").attr("shcode", 0).attr("showflag", "1");
+                    $(NodeHandle).attr("shcode", 0).attr("showflag", "1");
                 }
                 else {
-                    $(NodeHandle).css("background-color", "#ffffff").attr("shcode", 0).attr("showflag", "1");
+                    $(NodeHandle).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");
+                $(NodeHandle).attr("shcode", 1).attr("showflag", "1");
             }
             else if (showflagS == "1") {
-                $(NodeHandle).css("border-bottom", "none").attr("shcode", 1).attr("showflag", "1");
+                $(NodeHandle).attr("shcode", 1).attr("showflag", "1");
             }
         }
         if (!ThProFlag) {
@@ -810,21 +845,21 @@ var dealAnswerFunc = function (NodeHandle, OCFlag, ThProFlag) {
                 if ($(element).attr("ulflag") == 1) {
                     if (!ThProFlag || (ThProFlag && showflagS == 1)) {
                         if ($(element).text() == "暂无参考答案") {
-                            $(element).css("color", "#989898").attr("shcode", 1).attr("showflag", "1");
+                            $(element).attr("shcode", 1).attr("showflag", "1");
                         }
                         else {
-                            $(element).css("color", "#92D050").attr("shcode", 1).attr("showflag", "1");
+                            $(element).attr("shcode", 1).attr("showflag", "1");
                         }
                     }
                 }
                 else {
-                    $(element).css("color", "#000000").attr("shcode", 1).attr("showflag", "1");
+                    $(element).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");
+                            $(element).attr("shcode", 1).attr("showflag", "1");
                         }
                     }
                     else {
@@ -832,11 +867,11 @@ var dealAnswerFunc = function (NodeHandle, OCFlag, ThProFlag) {
                             var ulflag = $(element).attr("ulflag");
                             if (ulflag == "1") {
                                 if (!ThProFlag || (ThProFlag && showflagS == 1)) {
-                                    $(element).css("color", "#92D050").attr("shcode", 0).attr("showflag", "1");
+                                    $(element).attr("shcode", 0).attr("showflag", "1");
                                 }
                             }
                             else {
-                                $(element).css("color", "#000000").attr("shcode", 0).attr("showflag", "1");
+                                $(element).attr("shcode", 0).attr("showflag", "1");
                             }
                         }
                     }
@@ -846,67 +881,61 @@ var dealAnswerFunc = function (NodeHandle, OCFlag, ThProFlag) {
                         if (!ThProFlag || (ThProFlag && showflagS == 1)) {
                             var ulflag = $(element).attr("ulflag");
                             if (ulflag == "1") {
-                                $(element).css("background-color", "#f2db8b").attr("shcode", 1).attr("showflag", "1");
+                                $(element).attr("shcode", 1).attr("showflag", "1");
                             }
                             else {
-                                $(element).css("background-color", "#f2db8b").attr("shcode", 1).attr("showflag", "1");
+                                $(element).attr("shcode", 1).attr("showflag", "1");
                             }
                         }
                     }
                     else {
                         var ulflag = $(element).attr("ulflag");
                         if (ulflag == "1") {
-                            $(element).css("background-color", "#ffffff").attr("shcode", 0).attr("showflag", "1");
+                            $(element).attr("shcode", 0).attr("showflag", "1");
                         }
                         else {
-                            $(element).css("background-color", "#ffffff").attr("shcode", 0).attr("showflag", "1");
+                            $(element).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");
+                            $(element).attr("shcode", 1).attr("showflag", "1");
                         }
                     }
                     else {
-                        $(element).css("border-bottom", "none").attr("shcode", 0).attr("showflag", "1");
+                        $(element).attr("shcode", 0).attr("showflag", "1");
                     }
                 }
             });
         }
     }
     else {
-        $(NodeHandle).css("color", "#ffffff").attr("shcode", 1).attr("showflag", "0");
+        $(NodeHandle).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", "none").attr("shcode", 0).attr("showflag", "0");
+            $(NodeHandle).attr("shcode", 0).attr("showflag", "0");
         }
         else if ($(NodeHandle).attr("hitstyle") == "sentenceStyle") {
-            $(NodeHandle).css("border-bottom", "none").attr("shcode", 0).attr("showflag", "0");
+            $(NodeHandle).attr("shcode", 0).attr("showflag", "0");
         }
         $.each($(NodeHandle).find(".cAStauts"), function (index, element) {
             // 处理普通文本
-            $(element).css("color", "#ffffff").attr("shcode", 1).attr("showflag", "0");  // 合并处理
+            $(element).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");
+                $(element).attr("shcode", 0).attr("showflag", "0");
             }
             else if ($(element).attr("hitstyle") == "sentenceStyle") {
-                $(element).css("border-bottom", "none").attr("shcode", 0).attr("showflag", "0");
+                $(element).attr("shcode", 0).attr("showflag", "0");
             }
         });
-        // 处理句型里面的颜色
-        dealWordStyleFunc();
-        var ClsName = $(NodeHandle).attr("class");
-        if (ClsName.indexOf("underlinePart") > -1) {
-            $(NodeHandle).css("border-bottom", "1px solid #979797");
-        }
     }
     var underlineContentText = $(NodeHandle).text();  // 获取文本内容
     if (underlineContentText != undefined && underlineContentText.indexOf("√") > -1) {
@@ -1320,30 +1349,12 @@ function resetPressFlag() {
     pressTableFlag = false;
 }
 
-// 打理干净underline
+// 删除叼毛题库原先附加无用属性
 function dealUnderLineFunc() {
-    //var ArrList = [];
-    //$.each($('.underline'), function (index, element) {
-    //    var nextClsName = $(this).next().attr("class");
-    //    var prevClsName = $(this).prev().attr("class");
-    //    if ($(this).prev().find(".underlineContent").length > 0) {
-    //        ArrList.push(index);
-    //    }
-    //    else if (prevClsName != undefined && (prevClsName.indexOf("underlineContent") > -1 || prevClsName.indexOf("underline") > -1)) {
-    //        ArrList.push(index);
-    //    }
-    //    else if ($(this).next().find(".underlineContent").length > 0) {
-    //        ArrList.push(index);
-    //    }
-    //    else if (nextClsName != undefined && (nextClsName.indexOf("underlineContent") > -1 || nextClsName.indexOf("underline") > -1)) {
-    //        ArrList.push(index);
-    //    }
-    //});
-    //while (ArrList.length > 0) {
-    //    var ArrStr = ArrList.pop();
-    //    $('.underline').eq(ArrStr).remove();
-    //}
+    // 打理干净underline
     $('.underline').remove();  // 删除全部
+    // 删除全部underlineContent的颜色
+    $(".underlineContent").css("color", "");
 }
 
 // 打补丁(非underlineContent下的span下嵌套underlineContent)