Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
东方怂天
cxmooc-tools
提交
420f9470
C
cxmooc-tools
项目概览
东方怂天
/
cxmooc-tools
通知
11
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
cxmooc-tools
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
420f9470
编写于
10月 08, 2018
作者:
C
CodFrm
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
v1.5.2 & fix 题目随机bug & 说明修改
上级
65e7d30e
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
18 addition
and
10 deletion
+18
-10
build/cxmooc-tools/manifest.json
build/cxmooc-tools/manifest.json
+1
-1
package.json
package.json
+1
-1
src/config.js
src/config.js
+1
-1
src/cxmooc-tools/import.html
src/cxmooc-tools/import.html
+2
-1
src/cxmooc-tools/popup.html
src/cxmooc-tools/popup.html
+3
-3
src/cxmooc-tools/topic.js
src/cxmooc-tools/topic.js
+10
-3
未找到文件。
build/cxmooc-tools/manifest.json
浏览文件 @
420f9470
{
"manifest_version"
:
2
,
"name"
:
"超星慕课小工具"
,
"version"
:
"1.5.
1
"
,
"version"
:
"1.5.
2
"
,
"description"
:
"用于超星慕课的小工具"
,
"icons"
:
{
"16"
:
"img/logo.png"
,
...
...
package.json
浏览文件 @
420f9470
{
"name"
:
"cxmooc-tools"
,
"version"
:
"1.5.
1
"
,
"version"
:
"1.5.
2
"
,
"description"
:
"> 一个快速学习超星慕课的chrome扩展工具(੧ᐛ੭挂科模式,启动)
\r
> 初次开发chrome扩展,有兴趣的朋友可以一起来哦"
,
"main"
:
"mooc.js"
,
"scripts"
:
{
...
...
src/config.js
浏览文件 @
420f9470
module
.
exports
=
{
url
:
"
https://blog.icodef.com:8081/
"
,
version
:
1.5
1
,
version
:
1.5
2
,
update
:
'
https://github.com/CodFrm/cxmooc-tools/releases
'
,
enforce
:
false
,
cx
:
{
...
...
src/cxmooc-tools/import.html
浏览文件 @
420f9470
...
...
@@ -50,7 +50,8 @@
</style>
<body>
<h4>
题库内容:
</h4>
<h3
style=
"margin:0;"
>
题库内容:
</h3>
<span
style=
"font-size:10px;font-weight:400;"
>
(这并不是一个完善的功能)
</span>
<textarea
id=
"content"
class=
"content bor"
></textarea>
<br>
<input
id=
"regx"
class=
"ipt-text bor"
type=
"text"
value=
""
placeholder=
"正则表达式,题目用 {topic} 代替 答案用{answer} 代替"
>
...
...
src/cxmooc-tools/popup.html
浏览文件 @
420f9470
...
...
@@ -57,16 +57,16 @@
<input
type=
"checkbox"
id=
"auto"
/>
<label
for=
"auto"
title=
"进入一个页面就会自动开始挂机,完成一个任务之后会自动进行下一个"
>
全自动挂机
</label>
</div>
<div
id=
"auto-m"
class=
"config-item"
style=
"display: none;"
>
<div
id=
"auto-m"
class=
"config-item"
style=
"display: none;
width:120px
"
>
<label
for=
"interval"
title=
"播放(题目)完成后n分钟再继续下一个任务"
>
间隔时间:
</label>
<input
type=
"text"
id=
"interval"
style=
"font-size: 10px;width: 30%"
placeholder=
"分钟"
/>
<input
type=
"text"
id=
"interval"
style=
"font-size: 10px;width: 30%"
placeholder=
"分钟"
/>
分钟
</div>
<br>
<a
href=
"import.html"
target=
"_black"
>
题库导入
</a>
</div>
<div>
<h4>
其他说明:
</h4>
<
p>
1.4之后采用了修改的播放器,需要能够从服务器下载才能使用全自动挂机
</p
>
<
span>
时间间隔单位为分钟,可以有小数点,例如,0.1为6秒
</span
>
<p>
GitHub开源地址:
<br>
<a
href=
"https://github.com/CodFrm/cxmooc-tools"
target=
"_black"
>
https://github.com/CodFrm/cxmooc-tools
</a>
...
...
src/cxmooc-tools/topic.js
浏览文件 @
420f9470
...
...
@@ -59,15 +59,22 @@ module.exports = function (_this, elLogo, index, over) {
}
}
else
{
var
json
=
JSON
.
parse
(
this
.
responseText
);
var
answer_null
=
false
;
//填入答案
for
(
let
i
in
json
)
{
fillIn
(
json
[
i
].
topic
,
json
[
i
].
result
==
undefined
?
[]
:
json
[
i
].
result
);
if
(
fillIn
(
json
[
i
].
topic
,
json
[
i
].
result
==
undefined
?
[]
:
json
[
i
].
result
)
==
'
null answer
'
)
{
answer_null
=
true
;
}
}
var
config
=
JSON
.
parse
(
localStorage
[
'
config
'
]);
//如果是自动挂机,填入之后自动提交
if
(
!
config
[
'
auto
'
])
{
return
;
}
if
(
answer_null
)
{
alert
(
'
有题目没有找到答案,并且未设置随机答案,请手动填入
'
);
return
;
}
setTimeout
(
function
()
{
//提交操作
var
submit
=
topicDoc
.
getElementsByClassName
(
'
Btn_blue_1
'
);
...
...
@@ -306,9 +313,9 @@ module.exports = function (_this, elLogo, index, over) {
return
;
}
var
options
=
topicEl
.
nextSibling
.
nextSibling
.
getElementsByTagName
(
'
li
'
);
var
rand
=
document
.
head
.
getAttribute
(
'
rand-answer
'
);
if
(
result
.
length
<=
0
)
{
//没有在线上检索到答案,先在检索本地题库
var
rand
=
document
.
head
.
getAttribute
(
'
rand-answer
'
);
//从本地题库读取内容
var
localTopic
=
getLocalTopic
(
topicMsg
.
topic
);
if
(
localTopic
!=
undefined
)
{
...
...
@@ -346,7 +353,7 @@ module.exports = function (_this, elLogo, index, over) {
//无答案,检索配置有没有设置随机答案....
if
(
rand
==
'
false
'
)
{
prompt
.
innerHTML
=
"
没有从题库中获取到相应记录
"
;
return
;
return
'
null answer
'
;
}
prompt
.
style
.
fontWeight
=
600
;
prompt
.
innerHTML
=
"
请注意这是随机生成的答案!<br/>
"
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录