备份现场结果补录、图片修复与跳过文章功能
This commit is contained in:
1 parent
1e6504b4a2
commit
d157c179c8
20 files changed
+597
-47
No files matched your search
@@ -1,7 +1,7 @@
|
||||
// ==UserScript==
|
||||
// @name 新闻工作台 · 本地连接
|
||||
// @namespace local.dww11.auto-news
|
||||
// @version 0.1.0
|
||||
// @version 0.1.1
|
||||
// @match https://www.dww11.com/*
|
||||
// @match https://dww11.com/*
|
||||
// @match https://house.dww11.com/*
|
||||
@@ -15,7 +15,7 @@
|
||||
// ==/UserScript==
|
||||
(() => {
|
||||
'use strict';
|
||||
const allowed = new Set(['heartbeat','next','package','event','accept','switch-begin','takeover','stop','current']);
|
||||
const allowed = new Set(['heartbeat','next','package','event','accept','switch-begin','takeover','stop','current','skip']);
|
||||
let token = GM_getValue('pairToken',''), port = GM_getValue('pairPort',8770);
|
||||
let stopRevision = 0;
|
||||
const signalStop = () => { stopRevision++; document.dispatchEvent(new CustomEvent('dww11:auto-stop')); };
|
||||
@@ -56,6 +56,10 @@
|
||||
const shadow=host.attachShadow({mode:'closed'});
|
||||
shadow.innerHTML='<style>section{font:13px/1.6 system-ui;background:white;color:#24364a;border:1px solid #ccd7e0;border-radius:10px;padding:12px;width:250px;box-shadow:0 3px 20px #0002}button,input{font:inherit;box-sizing:border-box;padding:7px;margin:4px 0;width:100%}button{cursor:pointer}#halt{background:#ad302d;color:white;border:0;border-radius:6px}small{display:block}</style><section><strong>新闻工作台 · 本地连接</strong><button id="halt">终止流程</button><details><summary>连接设置</summary><label>本地端口<input id="port" type="number" min="1" max="65535"></label><label>连接码<input id="token" type="password" autocomplete="off"></label><button id="save">保存连接设置</button></details><small id="status">请启动本地工作台并配对</small></section>';
|
||||
const $=id=>shadow.getElementById(id);$('port').value=port;
|
||||
const skip=document.createElement('button');skip.id='skip';skip.type='button';skip.textContent='跳过本文章';
|
||||
$('halt').before(skip);
|
||||
skip.onclick=()=>document.dispatchEvent(new CustomEvent('dww11:skip-article'));
|
||||
document.addEventListener('dww11:skip-busy',event=>{skip.disabled=Boolean(event.detail);});
|
||||
$('save').onclick=()=>{
|
||||
const value=Number($('port').value);if(!Number.isInteger(value)||value<1||value>65535){$('status').textContent='端口无效';return;}
|
||||
if($('token').value.trim()) token=$('token').value.trim();port=value;
|
||||
|
||||
Reference in new issue
Block a user