Skip to content
This repository has been archived by the owner on Apr 25, 2022. It is now read-only.

Commit

Permalink
修复题目页停止bug
Browse files Browse the repository at this point in the history
  • Loading branch information
CodFrm committed Mar 27, 2019
1 parent e713d23 commit adae0c9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/cxmooc-tools/chaoxing/chaoxing.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module.exports = function () {
this.index = 0;
this.iframe = undefined;
this.tag = Math.random();
this.complete_num = 0;
/**
* 查找iframe
* @param iframeElement
Expand Down Expand Up @@ -77,6 +78,7 @@ module.exports = function () {
}
}


//忽略完成的任务
function ignoreCompile(event) {
if (config.answer_ignore && self.list[self.index] instanceof Topic) {
Expand All @@ -90,6 +92,7 @@ module.exports = function () {
if ($(self.iframe).attr('tag') != self.tag) {
return;
}
self.complete_num++;
event.start();
}
}
Expand All @@ -114,6 +117,11 @@ module.exports = function () {
ignoreCompile(self.list[self.index]);
return;
}
if (self.complete_num <= 0) {
self.complete_num = 1;
lazySwitch();
return;
}
let folder = $('.tabtags').find('span');
for (let i = 0; i < folder.length; i++) {
if ($(folder[i]).hasClass('currents')) {
Expand Down
3 changes: 2 additions & 1 deletion src/cxmooc-tools/chaoxing/topic.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ module.exports = function () {
//监听框架,跳转抓取题目
function listenIframe() {
$($(self.iframe.contentDocument).find('#frame_content')[0]).on("load", function () {
if ($(this).attr('src').indexOf('modules/work') > 0) {
common.log("topic load " + this.contentWindow.location.href);
if (this.contentWindow.location.href.indexOf('selectWorkQuestionYiPiYue') > 0) {
self.document = this.contentDocument;
reloadInit();
}
Expand Down
2 changes: 1 addition & 1 deletion src/pack-crx.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const crx = new ChromeExtension({
});

crx.load(['./build/cxmooc-tools/manifest.json',
'./build/cxmooc-tools/img/navtu.png',
'./build/cxmooc-tools/img/navtu.webp',
'./build/cxmooc-tools/img/logo.png',
'./build/cxmooc-tools/src/*'
]).then(crx => crx.pack()).then(crxBuffer => {
Expand Down

0 comments on commit adae0c9

Please sign in to comment.