Skip to content

Commit b367781

Browse files
author
wuwei
committed
优化算法
1 parent c13cfd9 commit b367781

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

StudyChromeApp/script.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,11 @@ function getTime(){
4040
* @returns {*|jQuery}
4141
*/
4242
function getStatus(){
43-
var span = $(window.parent["w_lms_content"].document).find("#tdRemark span");
44-
return $(span).hasClass("completed");
43+
var html = $(window.parent["w_lms_content"].document).find("#tdRemark")[0].innerHTML;
44+
if(html && html.indexOf("completed") != -1){
45+
return true;
46+
}
47+
return false;
4548
}
4649

4750

@@ -72,13 +75,13 @@ function startStudy() {
7275
console.log("自动正在学习中...");
7376

7477
if(!($("#StudyStatus").length > 0)){
75-
$('body').append("<div id='StudyStatus' style='position: fixed; z-index: 11111;font-weight: bold; bottom: 30px; left: 6px; color: red'>自动正在学习中...</div>")
78+
$('body').append("<div id='StudyStatus' style='background: #e1dfe2; width: 100%; text-align: center;position: fixed; z-index: 11111;font-weight: bold; bottom: 30px; color: red'>自动正在学习中...</div>")
7679
}
7780

7881
if((i%2)==1){
79-
$('#StudyStatus').text('自动正在学习中...');
82+
$('#StudyStatus').html('自动正在学习中...');
8083
} else{
81-
$('#StudyStatus').text('自动正在学习中');
84+
$('#StudyStatus').html('自动正在学习中&nbsp; &nbsp;');
8285
}
8386

8487

0 commit comments

Comments
 (0)