Skip to content

Commit

Permalink
Merge pull request #21 from YDX-2147483647/YDX-2147483647/issue20
Browse files Browse the repository at this point in the history
  • Loading branch information
YDX-2147483647 authored Apr 11, 2024
2 parents 4bd8366 + 63dba13 commit 6248271
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 15 deletions.
4 changes: 3 additions & 1 deletion TamperMonkey/BIT-补足下载附件时的默认文件名.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@
- 🤢 `df79cf7d92044e6cbfbd2161602733c3.xlsx`
- 😀 `附件1: 2021-2023年度北京理工大学开放实验项目库.xlsx`

现已适配[教学运行与考务中心](https://jxzx.bit.edu.cn/)[教务部](https://jwb.bit.edu.cn/)、各种书院通知([www 页面](https://www.bit.edu.cn/))等,完整支持列表请参考源代码开头的`matches`
现已适配[教学运行与考务中心](https://jxzx.bit.edu.cn/)[教务部](https://jwb.bit.edu.cn/)、各种书院通知([www 页面](https://www.bit.edu.cn/))等,完整支持列表请参考源代码开头的`matches`变量。如果您想要适配更多网站,请[到 GitHub 新建议题][new-issue]

[new-issue]: https://github.com/YDX-2147483647/BIT-enhanced/issues/new?title=【BIT-%E8%A1%A5%E8%B6%B3%E4%B8%8B%E8%BD%BD%E9%99%84%E4%BB%B6%E6%97%B6%E7%9A%84%E9%BB%98%E8%AE%A4%E6%96%87%E4%BB%B6%E5%90%8D】%E9%80%82%E9%85%8D%E2%96%A1%E2%96%A1&body=%E5%B8%8C%E6%9C%9B%E6%94%AF%E6%8C%81%E2%96%A1%E2%96%A1%EF%BC%8C%E4%BE%8B%E5%A6%82%20%E2%97%8B%E2%97%8B.bit.edu.cn/%E2%97%8B%E2%97%8B.htm%20%E3%80%82 "New Issue · YDX-2147483647/BIT-enhanced"
25 changes: 14 additions & 11 deletions TamperMonkey/BIT-补足下载附件时的默认文件名.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name BIT-补足下载附件时的默认文件名
// @namespace http://tampermonkey.net/
// @version 0.2.11
// @version 0.2.12
// @description 补充附件中 <a> 元素的 download 属性
// @license GPL-3.0-or-later
// @supportURL https://github.com/YDX-2147483647/BIT-enhanced/issues
Expand All @@ -16,55 +16,58 @@
// @match https://xcb.bit.edu.cn/*.htm
// @match https://grd.bit.edu.cn/*.htm
// @match https://sie.bit.edu.cn/*.htm
// @match https://cs.bit.edu.cn/*.htm
// @grant none
// ==/UserScript==

// 旧版本:BIT-教学运行与考务中心(0.1)。

(function () {
'use strict'

// 优先使用在前面的 title_selector
const matches = [
{ // 教学中心
host: 'jxzx',
attachments_selector: '.pageArticle > .Annex > ul > li > a:not([download])'
attachments_selector: '.pageArticle > .Annex > ul > li > a'
},
{ // 教务部
host: 'jwb',
attachments_selector: '.Annex > ul > li > a'
},
{ // World Wide Web
host: 'www',
attachments_selector: '.article .Annex > ul > li > a:not([download])'
attachments_selector: '.article .Annex > ul > li > a'
},
{ // Student
host: 'student',
attachments_selector: '.fujian > ul > li > a:not([download])'
attachments_selector: '.fujian > ul > li > a'
},
{ // Optics
host: 'opt',
attachments_selector: '.fujian > ul > li > a:not([download])'
attachments_selector: '.fujian > ul > li > a'
},
{ // 明德
host: 'mingde',
attachments_selector: '.pageArticle .Annex > ul > li > a:not([download])'
attachments_selector: '.pageArticle .Annex > ul > li > a'
},
{ // 徐特立
host: 'xuteli',
attachments_selector: '.annex > ul > li > a:not([download])'
attachments_selector: '.annex > ul > li > a'
},
{ // 宣传部
host: 'xcb',
attachments_selector: '.rt_fujian > ul > li > a:not([download])'
attachments_selector: '.rt_fujian > ul > li > a'
},
{ // Graduate
host: 'grd',
attachments_selector: '.myfujian > ul > li > a:not([download])'
attachments_selector: '.myfujian > ul > li > a'
},
{ // School of Information and Electronics
host: 'sie',
attachments_selector: '.annexList > li > a'
},
{ // Computer Science
host: 'cs',
attachments_selector: '.fujian > ul > li > a'
}
]

Expand Down
4 changes: 4 additions & 0 deletions TamperMonkey/BIT-补足页面标题.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@
这些标题会用于浏览器标签页名称、历史记录、分享时标题等。

如果你今天安装了这段脚本,看了一则通知,一周后突然想起来,就能直接从浏览器历史记录中搜索到了。

现已适配[教学运行与考务中心](https://jxzx.bit.edu.cn/)[教务部](https://jwb.bit.edu.cn/)、部分书院和学院等,完整支持列表请参考源代码开头的`sites`变量。如果您想要适配更多网站,请[到 GitHub 新建议题][new-issue]

[new-issue]: https://github.com/YDX-2147483647/BIT-enhanced/issues/new?title=%E3%80%90BIT-%E8%A1%A5%E8%B6%B3%E9%A1%B5%E9%9D%A2%E6%A0%87%E9%A2%98%E3%80%91%E9%80%82%E9%85%8D%E2%96%A1%E2%96%A1&body=%E5%B8%8C%E6%9C%9B%E6%94%AF%E6%8C%81%E2%96%A1%E2%96%A1%EF%BC%8C%E4%BE%8B%E5%A6%82%20%E2%97%8B%E2%97%8B.bit.edu.cn/%E2%97%8B%E2%97%8B.htm%20%E3%80%82 "New Issue · YDX-2147483647/BIT-enhanced"
4 changes: 1 addition & 3 deletions TamperMonkey/BIT-补足页面标题.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@
// @grant none
// ==/UserScript==

// 旧版本:BIT-教学运行与考务中心(0.1)。

(function () {
'use strict'

/**
* @typedef {Object} Site
* @property {String} host 例:“jwc”“jwc.bit.edu.cn”
* @property {String} host 例:“jwb”“jwb.bit.edu.cn”
* @property {String[]} title_selectors 优先使用在前面的 selector
* @property {String?} name 默认从`<title>`获取
*/
Expand Down

0 comments on commit 6248271

Please sign in to comment.