mirror of
https://github.com/JoeanAmier/XHS-Downloader.git
synced 2026-03-22 06:57:16 +08:00
feat(script): 链接提取选择界面添加序号显示
This commit is contained in:
@@ -9,8 +9,9 @@
|
|||||||
|
|
||||||
**用户脚本更新内容:**
|
**用户脚本更新内容:**
|
||||||
|
|
||||||
**版本号:2.2.0**
|
**版本号:2.2.2**
|
||||||
|
|
||||||
1. 新增链接提取/图片下载选择模式开关
|
1. 新增链接提取/图片下载选择模式开关
|
||||||
2. 修复合辑作品链接提取失败的问题
|
2. 修复合辑作品链接提取失败的问题
|
||||||
3. 新增推送下载任务至服务器功能
|
3. 链接提取选择界面添加序号显示
|
||||||
|
4. 新增推送下载任务至服务器功能
|
||||||
|
|||||||
@@ -41,8 +41,7 @@
|
|||||||
maxScrollCount: GM_getValue("maxScrollCount", 50),
|
maxScrollCount: GM_getValue("maxScrollCount", 50),
|
||||||
keepMenuVisible: GM_getValue("keepMenuVisible", false),
|
keepMenuVisible: GM_getValue("keepMenuVisible", false),
|
||||||
linkCheckboxSwitch: GM_getValue("linkCheckboxSwitch", true),
|
linkCheckboxSwitch: GM_getValue("linkCheckboxSwitch", true),
|
||||||
imageCheckboxSwitch: GM_getValue("imageCheckboxSwitch", true),
|
imageCheckboxSwitch: GM_getValue("imageCheckboxSwitch", true), // imageDownloadFormat: GM_getValue("imageDownloadFormat", "JPG"),
|
||||||
// imageDownloadFormat: GM_getValue("imageDownloadFormat", "JPG"),
|
|
||||||
scriptServerURL: GM_getValue("scriptServerURL", defaultsWebSocketURL),
|
scriptServerURL: GM_getValue("scriptServerURL", defaultsWebSocketURL),
|
||||||
scriptServerSwitch: GM_getValue("scriptServerSwitch", false),
|
scriptServerSwitch: GM_getValue("scriptServerSwitch", false),
|
||||||
fileNameFormat: undefined,
|
fileNameFormat: undefined,
|
||||||
@@ -1136,7 +1135,7 @@
|
|||||||
|
|
||||||
const scriptServerURL = createTextInput({
|
const scriptServerURL = createTextInput({
|
||||||
label: 'WebSocket 服务器地址',
|
label: 'WebSocket 服务器地址',
|
||||||
description: 'WebSocket 服务器地址',
|
description: '用户脚本连接的 WebSocket 服务器',
|
||||||
placeholder: defaultsWebSocketURL,
|
placeholder: defaultsWebSocketURL,
|
||||||
value: GM_getValue("scriptServerURL", defaultsWebSocketURL),
|
value: GM_getValue("scriptServerURL", defaultsWebSocketURL),
|
||||||
disabled: !GM_getValue("scriptServerSwitch", false),
|
disabled: !GM_getValue("scriptServerSwitch", false),
|
||||||
@@ -1480,10 +1479,10 @@
|
|||||||
/* 列表项 */
|
/* 列表项 */
|
||||||
.list-item {
|
.list-item {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 24px 64px 1fr; /* 复选框、缩略图、文本区 */
|
grid-template-columns: 32px 0px 64px 1fr; /* 序号、复选框、缩略图、文本区 */
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 12px;
|
gap: 8px;
|
||||||
padding: 10px;
|
padding: 8px;
|
||||||
border: 1px solid #eee;
|
border: 1px solid #eee;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
|
transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
|
||||||
@@ -1498,6 +1497,11 @@
|
|||||||
box-shadow: 0 0 0 4px rgba(33,150,243,0.12) inset;
|
box-shadow: 0 0 0 4px rgba(33,150,243,0.12) inset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 序号样式 */
|
||||||
|
.list-number {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
/* 复选框样式(使用原生复选框以保证可访问性与简单性) */
|
/* 复选框样式(使用原生复选框以保证可访问性与简单性) */
|
||||||
.list-checkbox {
|
.list-checkbox {
|
||||||
width: 18px;
|
width: 18px;
|
||||||
@@ -1587,11 +1591,16 @@
|
|||||||
|
|
||||||
// id -> item 映射
|
// id -> item 映射
|
||||||
const map = new Map();
|
const map = new Map();
|
||||||
list.forEach(item => {
|
list.forEach((item, index) => {
|
||||||
const row = document.createElement('div');
|
const row = document.createElement('div');
|
||||||
row.className = 'list-item';
|
row.className = 'list-item';
|
||||||
row.dataset.key = item.id;
|
row.dataset.key = item.id;
|
||||||
|
|
||||||
|
// 添加序号
|
||||||
|
const number = document.createElement('div');
|
||||||
|
number.className = 'list-number';
|
||||||
|
number.textContent = (index + 1).toString();
|
||||||
|
|
||||||
const checkbox = document.createElement('input');
|
const checkbox = document.createElement('input');
|
||||||
checkbox.type = 'checkbox';
|
checkbox.type = 'checkbox';
|
||||||
checkbox.className = 'list-checkbox';
|
checkbox.className = 'list-checkbox';
|
||||||
@@ -1613,6 +1622,7 @@
|
|||||||
texts.appendChild(author);
|
texts.appendChild(author);
|
||||||
texts.appendChild(title);
|
texts.appendChild(title);
|
||||||
|
|
||||||
|
row.appendChild(number);
|
||||||
row.appendChild(checkbox);
|
row.appendChild(checkbox);
|
||||||
row.appendChild(img);
|
row.appendChild(img);
|
||||||
row.appendChild(texts);
|
row.appendChild(texts);
|
||||||
|
|||||||
Reference in New Issue
Block a user