钱骏琪
ea16ea6673
Pylint部分:
...
1. 补充module docstring,即文档顶部的简要说明 (我做的说明很简陋,只是为了通过pylint的检查而为之)
2. 优化了if-else-return,即删除了不必要的elif或else
3. 拆分了所有在同一行的模块引用(不同模块的引用需要放在不同行,以便理解和阅读)
4. 删除了部分没有被使用的引用(有的引用在文件A中被使用了,但import却写在了文件B,且文件B没有使用这些引用,而文件A引用了文件B,导致文件B的所有引用也被A引用,这似乎并不合理)
5. 修改了引用的顺序(os、random等系统引用应放在自定义模块引用的上方)
6. 修改了过长的代码,注释除外(每行限制在100个字符以内)
7. 优化了条件判断的判断符号:
is和is not 用于判断两个变量是否指向同一个位置
== 和 !=用于比较两个变量
8. 为每个py文件添加了"last new line",删除了多余的尾部空行
Pylint提示了但是没有进行的操作:
1. 将字符串改为f-string的格式
因为f-string需要python3.6以上的版本,为了防止出现版本问题,故不做修改
2. 将所有函数内的return内容改为一致的类型
因为原有的代码逻辑已经确定,修改return的类型会导致方法的无法使用,故不做修改
3. 将标识符的格式改为"snake_case naming style"
标识符的修改内容过于庞大,且可能出现程序不可预见的错误,在pylint中重要等级为0,故不做修改
JSLint Part:
1. 提高代码的可读性:将部分超过80个字符的代码行拆解开(由于文字注释的存在,很多语句仅注释就超过了80个字符,此类型的语句行不做修改)
2. 用===与!==代替==与!=的判断
3. 将i++改为i+=1
4. 分离for循环中的let与var到其他行中,以适应JSLint在循环语句中对var和let的偏好
5. 给三元表达式外围添加圆括号,避免出现优先级的问题
6. 将正则表达式修改为JSLint要求的多行模式
疑问:
形如:
for (let i = 0; i < list.length; i+=1) {
的语句,JSLint报错: [JSLint was unable to finish] Unexpected 'let'.
但是网上搜索到的结果是ES6是支持let的使用的,暂且不做修改。
2023-05-26 22:18:11 +08:00
mrlan
43c719b6b2
Merge pull request 'Fix bug 501 - 特殊字符&加入生词库后删除按钮失效' ( #81 ) from Bug501-Hui into master
...
Reviewed-on: http://121.4.94.30:3000/mrlan/EnglishPal/pulls/81
2023-01-31 16:45:50 +08:00
Hui Lan
a1955341c6
Fix bug 501 - 特殊字符&加入生词库后删除按钮失效
2023-01-31 16:39:11 +08:00
mrlan
92a8b4a994
Lanhui-update-README2 ( #80 )
...
Co-authored-by: Lan Hui <1348141770@qq.com>
Reviewed-on: http://121.4.94.30:3000/mrlan/EnglishPal/pulls/80
Co-authored-by: mrlan <mrlan@noreply.121.4.94.30>
Co-committed-by: mrlan <mrlan@noreply.121.4.94.30>
2023-01-30 15:44:01 +08:00
王志豪
e10dbf9d67
Bug507-WuWenZhuo ( #70 )
...
### 修复了生词簿为空时,双击文章单词无法高亮的问题
通过增加一个判断,判断生词簿为空时,不把生词簿的内容进行处理,仅处理选中单词。
### 修复了生词簿为空时,取消高亮后,导致文章格式混乱的问题
原代码中,从数据库提取文章放到网页上时,使用的是.innerText的方法,导致原文章里包含的<br>标签丢失,导致文章格式混乱的问题。
Co-authored-by: unknown <Alcatraz@qq.com>
Co-authored-by: Hui Lan <lanhui@zjnu.edu.cn>
Reviewed-on: http://121.4.94.30:3000/mrlan/EnglishPal/pulls/70
Co-authored-by: 王志豪 <1594799762@qq.com>
Co-committed-by: 王志豪 <1594799762@qq.com>
2023-01-29 12:48:52 +08:00
李雨峰
9cdc9c6f7f
Bug521-LiYuFeng-Refactor ( #72 )
...
@mrlan
蓝老师:
本次改进内容如下:
1. 对生词居中问题进行修改,现在已经不会居中了。
2. 对于单词数量基数大而导致的排序速度慢的问题,我们进行了优化,提升了排序的速度。
3. 对用户交互进行了优化,当用户点击“熟悉”或“不熟悉”之后,会自动进行排序,并会跳转到那个单词的位置,用抖动的效果来提示用户。
Co-authored-by: isaac <1141730046@qq.com>
Reviewed-on: http://121.4.94.30:3000/mrlan/EnglishPal/pulls/72
Co-authored-by: 李雨峰 <1141730046@qq.com>
Co-committed-by: 李雨峰 <1141730046@qq.com>
2023-01-29 12:01:19 +08:00
陈秋伟
972a1a5524
Bug490-ChenQiuwei ( #63 )
...
修复Bug-490,使注册时确认密码能够发挥作用,在确认密码与所设置密码不一致时,能够提示“确认密码与输入密码不一致”。
Co-authored-by: 2658626578 <2658626578@qq.com>
Co-authored-by: Hui Lan <lanhui@zjnu.edu.cn>
Reviewed-on: http://121.4.94.30:3000/mrlan/EnglishPal/pulls/63
Co-authored-by: 陈秋伟 <2658626578@qq.com>
Co-committed-by: 陈秋伟 <2658626578@qq.com>
2023-01-29 11:49:27 +08:00
mrlan
c52d53596f
Merge pull request 'Bug489-DingRui' ( #74 ) from SPM2022F-CONTRIBUTORS-DingRui into master
...
Reviewed-on: http://121.4.94.30:3000/mrlan/EnglishPal/pulls/74
2023-01-29 11:31:41 +08:00
mrlan
ca8c1bf8de
Merge pull request 'Bug508-CenHaotian' ( #62 ) from Bug508-CenHaotian into master
...
Reviewed-on: http://121.4.94.30:3000/mrlan/EnglishPal/pulls/62
2023-01-29 11:19:49 +08:00
mrlan
febd0fc932
Merge pull request '用简单的方法(创建 frequency 文件夹)修复Bug 499' ( #64 ) from Bug499-Hui into master
...
Reviewed-on: http://121.4.94.30:3000/mrlan/EnglishPal/pulls/64
2023-01-29 11:06:17 +08:00
mrlan
03353d49b1
Bug525-Hui ( #79 )
...
Co-authored-by: Hui Lan <lanhui@zjnu.edu.cn>
Reviewed-on: http://121.4.94.30:3000/mrlan/EnglishPal/pulls/79
Co-authored-by: mrlan <mrlan@noreply.121.4.94.30>
Co-committed-by: mrlan <mrlan@noreply.121.4.94.30>
2023-01-29 10:57:58 +08:00
mrlan
1373df2a3e
Merge pull request '增加单词默认勾选,并修改提示 Fix Bug 495 - Liang Li Gang' ( #77 ) from Bug495-LiangLiGang into master
...
Reviewed-on: http://121.4.94.30:3000/mrlan/EnglishPal/pulls/77
2023-01-29 10:27:22 +08:00
np1717
086dfcb6eb
fix bug 489
2022-12-19 17:54:10 +08:00
任榆
f0afd5f40f
Merge pull request 'Bug 512 - 文章朗读问题' ( #59 ) from Bug512-RenYu into master
...
Reviewed-on: http://121.4.94.30:3000/mrlan/EnglishPal/pulls/59
2022-12-13 13:39:23 +08:00
任榆
5cc981b549
Merge branch 'master' into Bug512-RenYu
2022-12-13 13:28:48 +08:00
岑昊天
f37ea182f6
加入生词库过滤|
2022-12-06 17:02:59 +08:00
MR LAN
6327b11711
Made folder 'frequency' under folder 'static', and added a README file under folder 'frequency'
2022-12-06 16:06:13 +08:00
岑昊天
d58dacd71c
修复Bug508,解决带有特殊字符|的单词在文章中的高亮问题
2022-12-06 14:40:50 +08:00
张艺腾
e74f1ff477
Bug505-ZhangYiteng ( #61 )
...
bug修改只涉及到account_service.py中新增的5行。
其他增删都是重写reset.html(页面样式和login、signup页面相一致),并将reset、signup、login三个页面的共同样式抽离出独立的css文件。
Co-authored-by: Q_yt <2483750517@qq.com>
Co-authored-by: Hui Lan <lanhui@zjnu.edu.cn>
Reviewed-on: http://121.4.94.30:3000/mrlan/EnglishPal/pulls/61
Co-authored-by: 张艺腾 <2483750517@qq.com>
Co-committed-by: 张艺腾 <2483750517@qq.com>
2022-12-03 20:52:01 +08:00
丁锐
89c12337d5
在README中修改内容
2022-12-02 15:48:45 +08:00
梁立港
b65ffa6054
增加单词默认勾选,并修改提示
2022-12-01 21:04:12 +08:00
丁锐
7e3004a2e6
撤回操作
2022-11-29 16:55:48 +08:00
丁锐
3609421976
对确认密码部分保证有数据读入
2022-11-29 16:53:59 +08:00
任榆
5c85041135
Bug 512 - 文章朗读问题
...
在fillwowrd.js中添加了stopRead()函数,将其添加给对应按钮或超链接以终止朗读。
2022-11-25 15:42:37 +08:00
mrlan
671df67723
Bug487-WuYuhan-Refactor ( #58 )
...
将所有用于用户名验证的逻辑放入到 `UserName` 类中。
Hui
Co-authored-by: Lan Hui <1348141770@qq.com>
Reviewed-on: http://121.4.94.30:3000/mrlan/EnglishPal/pulls/58
Co-authored-by: mrlan <mrlan@noreply.121.4.94.30>
Co-committed-by: mrlan <mrlan@noreply.121.4.94.30>
2022-11-10 19:03:59 +08:00
mrlan
f909201615
Merge pull request 'Bug487-WuYuhan-Refactor' ( #57 ) from Bug487-WuYuhan-Refactor into master
...
Reviewed-on: http://121.4.94.30:3000/mrlan/EnglishPal/pulls/57
2022-11-08 19:53:09 +08:00
Hui Lan
29ffada7eb
Login.py: improve comments.
2022-11-03 22:28:25 +08:00
Hui Lan
d3a796428d
account_service.py: module re is no longer necessary.
2022-11-03 22:21:34 +08:00
Lan Hui
702205940c
Login.py: must convert warn to string before comparing to OK
2022-11-03 22:06:24 +08:00
Lan Hui
f0b5adc5e4
Login.py: fix function name
2022-11-03 22:02:32 +08:00
Hui Lan
3cfec31c3f
Login.py: add missing colon
2022-11-03 22:00:47 +08:00
Hui Lan
286e884dd8
Refactor Wu Yuhan's code
2022-11-03 21:59:12 +08:00
mrlan
bfd87c51f6
Merge pull request 'Bug487-WuYuhan' ( #56 ) from Bug487-WuYuhan into master
...
Reviewed-on: http://121.4.94.30:3000/mrlan/EnglishPal/pulls/56
2022-11-03 21:28:55 +08:00
mrlan
ab01b8e19b
Hui-Build ( #55 )
...
Make English Pal docker run automatically each time after Ubuntu reboot.
Hui
Co-authored-by: Hui Lan <lanhui@zjnu.edu.cn>
Reviewed-on: http://121.4.94.30:3000/mrlan/EnglishPal/pulls/55
Co-authored-by: mrlan <mrlan@noreply.121.4.94.30>
Co-committed-by: mrlan <mrlan@noreply.121.4.94.30>
2022-11-01 21:43:01 +08:00
吴宇涵
59d95d8e9f
account_service.py: 导入re库使用正则匹配过滤了注册时用户名的非法字符
2022-10-21 11:07:20 +08:00
吴宇涵
5844eab6d5
account_service.py: 添加注册时用户名的非法字符过滤
2022-10-21 10:44:39 +08:00
mrlan
02ffcd3b59
Merge pull request 'Bug412-JiangLetian-Refactor' ( #54 ) from Bug412-JiangLetian-Refactor into master
...
Reviewed-on: http://121.4.94.30:3000/mrlan/EnglishPal/pulls/54
2022-08-05 16:18:06 +08:00
Lan Hui
ecc354bc0d
Refactor: use better function
2022-08-02 12:33:41 +08:00
Lan Hui
1d8671c5c7
Refactor: use better function name
2022-08-02 12:30:27 +08:00
Lan Hui
8cb34e56ba
Refactor: remove duplicate code block
2022-08-02 12:26:18 +08:00
Lan Hui
b5dacb9ad2
Improve comments
2022-08-02 11:52:40 +08:00
Lan Hui
47e745e774
Use better variable name (use articleContent instead of txt, and use camelCase)
2022-08-02 11:45:21 +08:00
Lan Hui
1dfe370983
Use better variable names
2022-08-02 11:39:35 +08:00
mrlan
9927515b11
Merge pull request 'Bug412-JiangLetian' ( #39 ) from Bug412-JiangLetian into master
...
Reviewed-on: http://121.4.94.30:3000/mrlan/EnglishPal/pulls/39
2022-08-02 11:03:39 +08:00
Lan Hui
c15746bbb2
Resolve conflicts
2022-08-02 11:00:33 +08:00
mrlan
b745da4c90
Merge pull request 'IMPROVE-WangWeiLong' ( #35 ) from IMPROVE-WangWeiLong into master
...
Reviewed-on: http://121.4.94.30:3000/mrlan/EnglishPal/pulls/35
2022-07-31 09:11:53 +08:00
mrlan
7663dfb8f4
Merge pull request 'Hui-EscapeUserInput' ( #53 ) from Hui-EscapeUserInput into master
...
Reviewed-on: http://121.4.94.30:3000/mrlan/EnglishPal/pulls/53
2022-07-29 16:20:01 +08:00
Lan Hui
0098fa8746
Prevent attribute injection
2022-07-29 15:26:19 +08:00
Lan Hui
828cef406c
Escape user input first
2022-07-29 15:22:42 +08:00
徐幸
2c1bc98833
Bug422-XuXing ( #46 )
...
增加了返回上一篇的按钮及相关功能的实现,当点击下一篇文章跳转至下一篇时,页面中会增加一个返回上一篇按钮,点击返回上一篇按钮后可以回到上一篇。
Co-authored-by: Lan Hui <1348141770@qq.com>
Reviewed-on: http://121.4.94.30:3000/mrlan/EnglishPal/pulls/46
Co-authored-by: 徐幸 <2567198082@qq.com>
Co-committed-by: 徐幸 <2567198082@qq.com>
2022-07-21 23:13:33 +08:00