V1.1.0.1
@@ -1810,7 +2210,7 @@
V1.0.8.1
-
1、修复因重复绑定按钮而导致RPC 下载会发送多条下载请求的Bug;
+
1、修复因重复绑定按钮而导致 RPC 下载会发送多条下载请求的Bug;
2、选择不使用油小猴服务器时,“用ghproxy连接Github仓库”更换为“用jsdelivr连接Github仓库”;
3、跟进官方V6.1.4版本,修复移动网盘无法获取链接,支持阿里云盘新域名alipan.com。
@@ -1877,7 +2277,7 @@
V1.0.7.2
-
1、修复使用RPC 下载时会重复发送链接的Bug。
+
1、修复使用 RPC 下载时会重复发送链接的Bug。
@@ -2053,48 +2453,48 @@
1、增加“注入”功能(bushi);
2、去除广告。
-
+
`,
allowOutsideClick: false,
showCloseButton: true,
- confirmButtonText: '我已阅',
- ...swalDefault
+ confirmButtonText: '
我已阅',
});
},
@@ -2104,26 +2504,76 @@
* @author 油小猴
* @author hmjz100
* @fires .listener-tip - 鼠标移动事件触发提示框定位
- * @see {@link color} 使用全局主题色渲染文件大小信息
+ * @see{@link temp.color} 使用全局主题色渲染文件大小信息
*/
createTip() {
- // 添加提示框到 body
- $('html').append('
');
+ let tooltip = $('
');
- // 监听所有带有 .listener-tip 类的元素的鼠标移动事件
- $(document).on('mousemove', '.listener-tip', function (e) {
- // 获取提示文字
- let tip = e.currentTarget.dataset.title || `${e.currentTarget.innerText}
${e.currentTarget.dataset.size} `;
+ this.waitForKeyElements(`.${mount}`, (element) => {
+ if ($('.pl-tooltip').length <= 0) element.append(tooltip);
+ return true;
+ }, true);
- // 设置提示框的位置并使用 fadeIn() 渐变显示
- $('.pl-tooltip').html(tip).css({
- 'left': e.pageX + 10 + 'px',
- 'top': e.pageY + 20 + 'px' // 增加一些间距
- }).show();
+ // 提取公共显示逻辑
+ const showTooltip = (target, x, y) => {
+ if (!target.data("title") && !target.data("size") && !target.text()) return;
+
+ let tip = '';
+ let title = target.data("title");
+
+ if (title) {
+ tip += `
${title} `;
+ } else {
+ let name = target.find(".name").text();
+ let size = target.find(".size").text();
+ tip += `
${name} `;
+ if (size !== undefined) {
+ tip += `
${size} `;
+ }
+ }
+
+ tooltip.html(tip).css({
+ left: x + 10 + 'px',
+ top: y + 20 + 'px',
+ display: 'flex'
+ });
+ };
+
+ // 鼠标/触摸移动时更新位置
+ temp.doc.on('mousemove touchmove', '.listener-tip', function (e) {
+ const isTouch = e.type.startsWith('touch');
+ const pageX = isTouch ? e.originalEvent.touches[0].pageX : e.pageX;
+ const pageY = isTouch ? e.originalEvent.touches[0].pageY : e.pageY;
+ showTooltip($(e.currentTarget), pageX, pageY);
});
- $(document).on('mouseleave', '.listener-tip, .pl-tooltip', function (e) {
- $('.pl-tooltip').hide();
+ // 触摸开始时立即显示
+ temp.doc.on('touchstart', '.listener-tip', function (e) {
+ // 阻止滚动避免干扰
+ e.preventDefault();
+ const touch = e.originalEvent.touches[0];
+ showTooltip($(e.currentTarget), touch.pageX, touch.pageY);
+ });
+
+ // 统一隐藏逻辑
+ temp.doc.on('mouseleave touchend touchcancel', '.listener-tip, .pl-tooltip', function (e) {
+ tooltip.css({ display: '' });
+ });
+
+ // 增强跨事件类型检测
+ temp.doc.on('mousemove touchmove', function (e) {
+ const $tooltip = tooltip;
+ if (!$tooltip.is(':visible')) return;
+
+ const isTouch = e.type.startsWith('touch');
+ const touch = isTouch ? e.originalEvent.touches[0] : null;
+ const target = isTouch
+ ? document.elementFromPoint(touch.clientX, touch.clientY)
+ : e.target;
+
+ if (!$(target).closest('.listener-tip, .pl-tooltip').length) {
+ $tooltip.css({ display: '' });
+ }
});
},
@@ -2149,6 +2599,137 @@
}, true)
},
+ /**
+ * 创建用于下载页面的 HTML
+ * @author 油小猴
+ * @author hmjz100
+ * @description 详见代码
+ */
+ generateDom(list, config) {
+ if (!list) {
+ return message.error('提示:
获取下载链接失败,刷新网页后再试试吧~');
+ }
+ let {
+ isFolder,
+ getFileName,
+ getFileSize,
+ getFileLink,
+ getFileMirror,
+ convert = {},
+ tooltip = {}
+ } = config;
+
+ let content = $(`
`);
+ let allLink = [];
+ list.forEach((v, i) => {
+ if (isFolder(v)) return;
+ let filename = getFileName(v);
+ let size = getFileSize(v);
+ let dlink = getFileLink(v);
+ let mirror = base.isType(getFileMirror) !== "undefined" ? getFileMirror(getFileLink(v)) : undefined;
+ if (!dlink || !dlink.includes("http")) {
+ content.find(".pl-main").append(`
+
${filename}
${base.sizeFormat(size)}
+
获取下载链接失败,刷新网页后再试试吧~
+
`)
+ } else {
+ if (temp.mode === "api") {
+ allLink.push(dlink);
+ content.find(".pl-main").append(`
+
${filename}
${base.sizeFormat(size)}
+
增强下载 (基于脚本跨域)
+
直接下载 (基于访问链接)
+
复制名称
+
复制链接
+
+
`);
+ }
+ if (temp.mode === "curl") {
+ let finalink = base.convertLinkToCurl(dlink, filename, convert?.curl);
+ allLink.push(finalink);
+ content.find(".pl-main").append(`
`);
+ }
+ if (temp.mode === "aria2") {
+ let finalink = base.convertLinkToAria2(dlink, filename, convert?.aria2);
+ allLink.push(finalink);
+ content.find(".pl-main").append(`
+
${filename}
${base.sizeFormat(size)}
+
推送链接到 Aria2 下载器
+
复制下载命令行
+
`);
+ }
+ if (temp.mode === "bitcomet") {
+ let finalink = base.convertLinkToBitComet(dlink, filename, convert?.bitcomet);
+ allLink.push(finalink);
+ content.find(".pl-main").append(`
+
${filename}
${base.sizeFormat(size)}
+
使用 BC 链接下载
+ ${mirror ? `
复制镜像` : ""}
+ 推送到下载器
+ `);
+ }
+ }
+ });
+
+ allLink = (allLink ? allLink.join("\r\n") : "")
+ if (temp.mode === "api" && list.length >= 2) {
+ content.find(".pl-extra").append(`
全部增强下载
+
复制全部链接`);
+
+ } else if (temp.mode === "curl") {
+ content.find(".pl-extra").append(`
修改终端类型(${temp.terminalType[base.getValue('setting_curl_terminal')]})`);
+ if (list.length >= 2) content.find(".pl-extra").append(`
复制全部命令行`);
+
+ } else if (temp.mode === 'aria2') {
+ let rpc = base.getValue("setting_aria2_rpc").find(i => i.default);
+ content.find(".pl-extra").append(`
修改服务参数`);
+ content.find(".pl-extra").append(`
查看下载任务`);
+ if (list.length >= 2) content.find(".pl-extra").append(`
推送全部到下载器`);
+ if (list.length >= 2) content.find(".pl-extra").append(`
复制全部命令行`);
+
+ } else if (temp.mode === "bitcomet") {
+ if (list.length >= 2) content.find(".pl-extra").append(`
复制全部 BC 链接`);
+ let rpc = base.getValue("setting_bitcomet_rpc").find(i => i.default);
+ content.find(".pl-extra").append(`
修改服务参数`);
+ if (list.length >= 2) content.find(".pl-extra").append(`
推送全部到下载器`);
+ }
+
+ function updateTooltip($element, value) {
+ if (!value) return;
+ $element.addClass("listener-tip");
+ if (value.startsWith('+')) {
+ // 追加模式:去掉开头的 '+',然后拼接到现有 data-title
+ const newValue = value.substring(1);
+ const existingTitle = $element.attr("data-title") || "";
+ $element.attr("data-title", existingTitle + newValue);
+ } else {
+ // 替换模式
+ $element.attr("data-title", value);
+ }
+ }
+ if (tooltip?.enhance) updateTooltip(content.find(".enhance"), tooltip.enhance);
+ if (tooltip?.normal) updateTooltip(content.find(".normal"), tooltip.normal);
+ if (tooltip?.copy) updateTooltip(content.find(".copy"), tooltip.copy);
+ if (tooltip?.filename) updateTooltip(content.find(".filename"), tooltip.filename);
+
+ let html = content.html();
+ content.remove();
+
+ return html;
+ },
+
/**
* 获取镜像列表
* @author 油小猴
@@ -2168,15 +2749,270 @@
* // https://mirror2.com/file.zip&
*/
getMirrorList(link, mirror, thread = 2) {
- let host = new URL(link).host;
- let mirrors = [];
- for (let i = 0; i < mirror.length; i++) {
- for (let j = 0; j < thread; j++) {
- let item = link.replace(host, mirror[i]) + '&'.repeat(j);
- mirrors.push(item);
+ try {
+ let host = new URL(link).host;
+ let mirrors = [];
+ for (let i = 0; i < mirror.length; i++) {
+ for (let j = 0; j < thread; j++) {
+ let item = link.replace(host, mirror[i]) + '&'.repeat(j);
+ mirrors.push(item);
+ }
}
+ return mirrors.join('\n');
+ } catch {
+ return undefined
}
- return mirrors.join('\n');
+ },
+
+ /**
+ * 添加页面元素监听
+ * @author 油小猴
+ * @author hmjz100
+ * @description 详见代码
+ */
+ addPageListener() {
+ temp.doc.on('click', '.listener-open-setting', () => {
+ base.showSetting();
+ });
+ temp.doc.on('click', '.listener-open-aria2-setting', (e) => {
+ base.showAria2Setting(e);
+ });
+ temp.doc.on('click', '.listener-open-bitcomet-setting', (e) => {
+ base.showBitcometSetting(e);
+ });
+ temp.doc.on('click', '.listener-open-updatelog', () => {
+ base.showUpdate();
+ });
+ temp.doc.on('click', '.listener-open-beautify', () => {
+ base.showBeautify();
+ });
+
+ temp.doc.on('click', '.listener-unregister', async function (e) {
+ message.warning("正在“注入”设置项目...");
+ let list = base.getValue("setting_init");
+ list.code = "";
+ list.license = "";
+ base.setValue('setting_init', list);
+ base.delValue('baidu_access_token');
+ if (location.host.includes("baidu")) base.delStorage('baiduyunPlugin_BDUSS');
+ location.reload();
+ });
+ temp.doc.on('change', '.listener-terminal', async function (e) {
+ base.setValue('setting_curl_terminal', e.currentTarget.value);
+ });
+ temp.doc.on('click', '.listener-color', async function (e) {
+ let element = $(e.currentTarget).closest('.listener-color').length > 0 ? $(e.currentTarget).closest('.listener-color') : $(e.currentTarget);
+ let parent = element.closest('.pl-color');
+ let mask = element.find(".mask");
+ let color = element.data('color');
+ if (color && parent.length > 0 && mask.length > 0) {
+ parent.find(".this").remove();
+ mask.append(`
`);
+ let list = base.getValue("setting_ui_theme")
+ list.color = color;
+ base.setValue("setting_ui_theme", list);
+ base.addPanLinkerStyle();
+ }
+ });
+ temp.doc.on('change', '.listener-theme', async function (e) {
+ let list = base.getValue("setting_ui_theme");
+ list.custom[e.currentTarget.dataset.type] = e.currentTarget.checked;
+ base.setValue("setting_ui_theme", list);
+ });
+
+ temp.doc.on('click', '.listener-api-download.normal', async function (e) {
+ e.preventDefault();
+ let dataset = e.currentTarget.dataset;
+ let href = dataset.link;
+ $('#downloadIframe').attr('src', href);
+ });
+
+ temp.doc.on('click', '.listener-retry', async function (e) {
+ let o = base._EventFactory(e);
+ o.tip.hide();
+ o.link.show();
+ o.directLink.show();
+ });
+
+ temp.doc.on('click', '.listener-stop', async function (e) {
+ let o = base._EventFactory(e);
+ let index = o.link[0].dataset.index;
+ if (temp.request[index]) {
+ temp.request[index].abort();
+ clearInterval(temp.ins[index]);
+ o.item.find('.pl-progress-inner-text').text('正在取消...');
+ o.item.find('.pl-progress-inner').css('width', 100 + '%');
+ await base.sleep(1050);
+ o.tip.hide();
+ o.back.hide();
+ o.link.show();
+ o.directLink.show();
+ o.copy.show();
+ o.progress.hide();
+ o.stop.hide();
+ }
+ });
+
+ temp.doc.on('click', '.listener-back', async function (e) {
+ let o = base._EventFactory(e);
+ o.progress.hide();
+ o.tip.hide();
+ o.link.show();
+ o.directLink.show();
+ o.copy.show();
+ o.stop.hide();
+ o.back.hide();
+ });
+
+ temp.doc.on('click', '.listener-download-all', async function (e) {
+ let target = $(e.currentTarget);
+ let originalHtml = target.html();
+ $('.pl-item-link.enhance').each((index, element) => {
+ if ($(element).css('display') !== 'none') {
+ $(element).click();
+ }
+ });
+ target.text('下载开始,进度见上方按钮哦~').animate({ opacity: '0.5' }, "slow");
+ await base.sleep(2000);
+ target.css('opacity', "");
+ target.html(originalHtml);
+ });
+ temp.doc.on('click', '.listener-send-rpc', async function (e) {
+ let target = $(e.currentTarget);
+ let originalHtml = target.html();
+ $(`.listener-${target.data("type")}-download`).each((index, element) => {
+ if ($(element).attr('data-processing') !== 'true') {
+ $(element).click();
+ }
+ });
+ target.text('发送完成,结果见上方按钮哦~').animate({ opacity: '0.5' }, "slow");
+ await base.sleep(2000);
+ target.css('opacity', "");
+ target.html(originalHtml);
+ });
+ temp.doc.on('click', '.listener-copy', async function (e) {
+ e.preventDefault();
+ let target = $(e.currentTarget);
+ let originalHtml = target.html();
+ let copy = target.data("copy");
+ if (copy) {
+ base.setClipboard(copy)
+ target.html(`
复制成功`).animate({ opacity: '0.5' }, "slow");
+ await base.sleep(2000);
+ target.css('opacity', "");
+ target.html(originalHtml);
+ }
+ });
+
+ temp.doc.on('click', '.listener-rpc-task', function (e) {
+ let rpc = base.getValue("setting_aria2_rpc").find(i => i.default);
+ let url = `${config.base.service.rpc}/?rpc=${base.encodeBase(JSON.stringify({ domain: rpc.domain, port: rpc.port }))}#${rpc.token}`;
+ GM_openInTab(url, { active: true });
+ });
+
+ temp.doc.on('change', '.listener-rpc-select', async function (e) {
+ let element = $(this);
+ let selectedIndex = element.val();
+ let type = element.data("type");
+ let list = base.getValue(`setting_${type}_rpc`);
+ if (selectedIndex === 'new') {
+ return $('.listener-rpc-input').val("");
+ } else if (list[selectedIndex]) {
+ list.forEach((item, index) => {
+ if (item.default) {
+ delete item.default;
+ }
+ });
+ list[selectedIndex].default = true;
+ base.setValue(`setting_${type}_rpc`, list);
+ $('.listener-rpc-input').each((index, element) => {
+ let type = $(element).data('type').split(".")[1];
+ $(element).val(list[selectedIndex][type] || "");
+ });
+ }
+ });
+ temp.doc.on('input', '.listener-rpc-input', async function (e) {
+ let type = $(this).data("type");
+ if (!type) return;
+ type = type.split(".")
+ let list = base.getValue(`setting_${type[0]}_rpc`);
+ let value = $(this).val();
+ let selectedIndex = $('.listener-rpc-select option:selected').val();
+ if (selectedIndex === 'new') {
+ list.forEach((item, index) => {
+ if (item.default) {
+ delete item.default;
+ }
+ });
+ list.push({
+ domain: "",
+ port: "",
+ path: "",
+ default: true
+ });
+ base.setValue(`setting_${type[0]}_rpc`, list);
+ selectedIndex = list.length - 1
+ }
+ list[selectedIndex][type[1]] = value;
+ base.setValue(`setting_${type[0]}_rpc`, list)
+ let select = $('.listener-rpc-select');
+ let options = list.map((item, index) => {
+ return `
${item.domain}:${item.port}${item.path} `;
+ }).join("");
+ select.html(`${options}
+ 创建新项目 `);
+ });
+ temp.doc.on('click', '.listener-rpc-delete', async function (e) {
+ let type = $(this).data("type");
+ let list = base.getValue(`setting_${type}_rpc`);
+ let selectedIndex = $('.listener-rpc-select option:selected').val();
+ if (selectedIndex === 'new' || !confirm('您确定要删除此项目吗?')) return;
+ list = list.filter((_, i) => i != selectedIndex);
+ if (list.length === 0) return alert('至少保留一个项目');
+ list[selectedIndex - 1].default = true;
+ base.setValue(`setting_${type}_rpc`, list);
+ let select = $('.listener-rpc-select');
+ let options = list.map((item, index) => {
+ return `
${item.domain}:${item.port}${item.path} `;
+ }).join("");
+ select.html(`${options}
+ 创建新项目 `);
+ $('.listener-rpc-input').each(function () {
+ let type = $(this).data('type').split(".");
+ $(this).val(list[selectedIndex - 1][type[1]] || "");
+ });
+ });
+ temp.doc.on('click', '.listener-rpc-test', async function (e) {
+ let element = $(this);
+ let type = element.data("type");
+ let selectedIndex = $('.listener-rpc-select option:selected').val();
+ let list = base.getValue(`setting_${type}_rpc`);
+ let text = element.find("span");
+ let originalHtml = text.html();
+ if (selectedIndex === 'new') return;
+ if (list[selectedIndex]) {
+ let selected = list.find(i => i.default);
+ let domain = selected.domain,
+ port = selected.port,
+ path = selected.path,
+ token = selected.token;
+ if (element.data("testing") === "true") return;
+ element.data("testing", "true");
+ text.html("等待");
+ element.css({ 'opacity': '0.9' });
+ let result = await base.testConnectToAria2(domain, port, path, token);
+ if (result === "success") {
+ text.html("成功");
+ element.css({ 'background-color': '#52c41a' });
+ } else {
+ text.html("失败");
+ element.css({ 'background-color': '#cb1616' });
+ }
+ element.css({ 'opacity': "" });
+ await base.sleep(3000);
+ element.data("testing", "false");
+ text.html(originalHtml);
+ element.css({ 'background-color': "" });
+ }
+ });
},
/**
@@ -2186,27 +3022,28 @@
* @description 为组件添加默认的公共样式,包括浅色和深色模式适配样式。
*/
addPanLinkerStyle() {
- color = base.getValue('setting_theme_color');
+ temp.color = base.getValue('setting_ui_theme').color;
- base.addStyle('swal-pub-style', 'style', `@media (prefers-color-scheme: light) {${GM_getResourceText('SwalLigt')}}`);
- base.addStyle('swal-pub-dark-style', 'style', `@media (prefers-color-scheme: dark) {${GM_getResourceText('SwalDark')}}`);
+ base.addStyle('swal-pub-style', 'style', `@media (prefers-color-scheme:light){${GM_getResourceText('SwalLigt')}}`);
+ base.addStyle('swal-pub-dark-style', 'style', `@media (prefers-color-scheme:dark){${GM_getResourceText('SwalDark').replace(/#19191a/, '#222226')}}`);
base.addStyle('swal-pub-custom-style', 'style', `
- .swal2-styled{transition: all 0.2s ease;}
- .swal2-loader{display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:${color} transparent }
+ .swal2-container *{vertical-align:baseline}
+ .swal2-styled{transition:all .2s}
+ .swal2-loader{display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:${temp.color} transparent }
.swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}
- .swal2-timer-progress-bar{width:100%;height:.25em;background:${color}33 }
- .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:${color};color:#fff;line-height:2em;text-align:center}
- .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:${color} }
- .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:${color}}
- .swal2-html-container {padding:1em 1.6em 0.3em;margin:0}
+ .swal2-timer-progress-bar{width:100%;height:.25em;background:${temp.color}33 }
+ .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:${temp.color};color:#fff;line-height:2em;text-align:center}
+ .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:${temp.color} }
+ .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:${temp.color}}
+ .swal2-html-container{padding:1em 1.6em 0.3em;margin:0}
+ .swal2-close,div:where(.swal2-container) button:where(.swal2-close){position:absolute;border-radius:10px;top:0;right:0;transition:all .2s}
+ .swal2-close:hover,div:where(.swal2-container) button:where(.swal2-close):hover{color:${temp.color};background-color:${temp.color}30;font-size:60px}
- .swal2-close,div:where(.swal2-container) button:where(.swal2-close) {position:absolute;top:1px;right:1px;transition: all 0.2s ease}
- .swal2-close:hover,div:where(.swal2-container) button:where(.swal2-close):hover {color:${color};font-size:60px}
+ .swal2-styled{display:flex;justify-content:center;align-items:center;gap:5px}
+ .swal2-styled.swal2-confirm,div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm){background-color:${temp.color};color:#fff}
- .swal2-styled.swal2-confirm,div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm){background-color:${color};color:#fff}
-
- .swal2-styled.swal2-confirm:focus,div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):focus{box-shadow:0 0 0 3px ${color}80}
+ .swal2-styled.swal2-confirm:focus,div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):focus{box-shadow:0 0 0 3px ${temp.color}80}
.swal2-styled.swal2-deny:focus,.swal2-close:focus,div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):focus{box-shadow:0 0 0 3px #dc374180}
.swal2-styled.swal2-cancel:focus,div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):focus{box-shadow:0 0 0 3px #6e788180}
@@ -2219,10 +3056,13 @@
{border-radius:50px}
div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:hover{opacity:0.7}
+ .swal2-backdrop-show,.swal2-noanimation,div:where(.swal2-container).swal2-backdrop-show, div:where(.swal2-container).swal2-noanimation{background:rgba(25,25,26,.75);transition:backdrop-filter .2s;backdrop-filter:blur(1px)}
+ body.swal2-toast-shown .swal2-container{backdrop-filter:none}
.swal2-popup,div:where(.swal2-container) div:where(.swal2-popup){padding-bottom:1em;border-radius:10px}
- div:where(.swal2-container) div:where(.swal2-html-container){padding:1.3em 1.3em 0.3em;margin:0}
+ .swal2-title,div:where(.swal2-container) h2:where(.swal2-title){height:auto}
+ .swal2-html-container,div:where(.swal2-container) div:where(.swal2-html-container){padding:1.3em 1.3em 0.3em;margin:0}
.swal2-footer,div:where(.swal2-container) div:where(.swal2-footer){flex-direction:column;justify-content:center;align-items:center}
- div:where(.swal2-icon) .swal2-icon-content {font-family: sans-serif;}
+ .swal2-icon-content,div:where(.swal2-icon) .swal2-icon-content{font-family:sans-serif}
.swal2-input, .swal2-file, swal2-select, .swal2-textarea,
div:where(.swal2-container) input:where(.swal2-input),
@@ -2241,45 +3081,61 @@
div:where(.swal2-container) input:where(.swal2-select):focus-visible,
div:where(.swal2-container) textarea:where(.swal2-textarea):focus,
div:where(.swal2-container) textarea:where(.swal2-textarea):focus-visible
- {outline:0;border:1px solid ${color};box-shadow:0 0 0 3px ${color}80}
-
+ {outline:0;border:1px solid ${temp.color};box-shadow:0 0 0 3px ${temp.color}80}
+
.swal2-checkbox, .swal2-file, .swal2-input, .swal2-radio, .swal2-select, .swal2-textarea,
div:where(.swal2-container) input:where(.swal2-input), div:where(.swal2-container) input:where(.swal2-file), div:where(.swal2-container) textarea:where(.swal2-textarea), div:where(.swal2-container) select:where(.swal2-select), div:where(.swal2-container) div:where(.swal2-radio), div:where(.swal2-container) label:where(.swal2-checkbox)
- {margin: 1em 2em}`);
+ {margin:1em 2em}`);
base.addStyle(`${mount}-main-style`, 'style', `
- ::-webkit-scrollbar{width:8px;height:8px;transition:all 0.2s ease}
+ ::-webkit-scrollbar{width:8px;height:8px}
::-webkit-scrollbar-track{border-radius:10px;background:#fff}
::-webkit-scrollbar-thumb,::-webkit-scrollbar-thumb:hover{border-radius:10px}
- ::-webkit-scrollbar-thumb{background-color:${color}90 !important}
- ::-webkit-scrollbar-thumb:hover{background-color:${color}D0 !important}
+ ::-webkit-scrollbar-thumb{background-color:${temp.color}90!important,transition:background-color .2s;will-change:background-color}
+ ::-webkit-scrollbar-thumb:hover{background-color:${temp.color}D0!important}
+
.swal2-popup{font-size:16px}
- .pl-a{vertical-align:baseline;color:${color}}
- .pl-a:hover{color:${color}90}
.pl-popup{font-size:12px;min-width:70%;max-width:95%}
- .pl-popup a:not(.pl-btn-primary){color:${color}}
- .pl-popup a:hover:not(.pl-btn-primary){color:${color}90}
+ .pl-popup a:not(.pl-btn-primary){color:${temp.color}}
+ .pl-popup a:hover:not(.pl-btn-primary){color:${temp.color}90}
.pl-header{padding:0;align-items:flex-start;border-bottom:1px solid #eee;margin:0 0 10px;padding:0 0 5px}
.pl-title{font-size:18px;white-space:nowrap;text-overflow:ellipsis}
.pl-content{padding:0;font-size:12px}
- .pl-main{background-color:${color}15;overflow:auto;border-radius:10px;max-height:calc(${document.documentElement.clientHeight}px - 250px)}
.pl-footer{font-size:15px;text-align:center;display:block}
- .pl-item{display:flex;align-items:center;background-color:${color}30;border-radius:5px;margin:8px 6px}
- .pl-item-name{flex:0 0 170px;text-align:left;margin:6px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;cursor:default;height:30px}
- .pl-item-link{flex:1;text-align:left;white-space:nowrap;text-overflow:ellipsis;cursor:pointer;overflow:hidden}
+ .pl-icon{width:15px;height:15px;vertical-align:-0.15em;fill:currentColor;overflow:hidden;font-size:18px}
+
+ .pl-main{background:${temp.color}15;border-radius:10px;display:flex;flex-direction:column;gap:8px;max-height:calc(${document.documentElement.clientHeight}px - 300px);overflow:auto;padding:8px 6px}
+
+ .pl-a{position:relative;vertical-align:baseline;color:${temp.color};border-bottom:2px solid ${temp.color};text-decoration:none;transition:color .3s,opacity .3s;will-change:color,opacity;overflow:hidden}
+ .pl-a::before{content:'';position:absolute;left:0;bottom:0;width:100%;height:100%;background-color:${temp.color};transform:scaleY(0);transform-origin:bottom center;transition:transform .15s, opacity .3s;will-change:transform;z-index:-1}
+ .pl-a:hover,.pl-a:focus{color:#fff}
+ .pl-a:hover::before,.pl-a:focus::before{transform:scaleY(1)}
+ .pl-a:active{color:#fff;opacity:0.8}
+ .pl-a .pl-icon{vertical-align:-0.05em;}
+
+ .pl-item{display:flex;align-items:center;background:${temp.color}30;border-radius:8px;padding:5px;gap:10px}
+ .pl-item-name{width:15%;text-align:left;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;cursor:default}
+ .pl-item-name>*{text-align:left;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
+ .pl-item-link{flex:1;cursor:pointer}
+ a.pl-item-link{text-align:left;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
.pl-item-tip{display:flex;justify-content:space-between;flex:1}
- .pl-ext{display:inline-block;width:44px;background:#999;color:#fff;height:16px;line-height:16px;font-size:12px;border-radius:3px}
- .pl-retry{padding:3px 10px;background:#cc3235;color:#fff;border-radius:3px;cursor:pointer}
+
.pl-item-progress{display:flex;flex:1;align-items:center}
.pl-progress{display:inline-block;vertical-align:middle;width:100%;box-sizing:border-box;line-height:1;position:relative;height:20px;margin:0 6px;flex:1}
.pl-progress-outer{height:20px;border-radius:100px;background-color:#c1c1c1a1;overflow:hidden;position:relative;vertical-align:middle}
- .pl-progress-inner{position:absolute;left:0;top:0;background-color:${color};border-radius:100px;line-height:1;white-space:nowrap;transition:width .6s ease;height:20px;display:inline-flex;text-align:center;align-items:center}
+ .pl-progress-inner{position:absolute;left:0;top:0;background-color:${temp.color};border-radius:100px;line-height:1;white-space:nowrap;transition:width .6s;height:20px;display:inline-flex;text-align:center;align-items:center}
.pl-progress-inner-text{display:inline-block;vertical-align:middle;cursor:default;color:#ffffff;font-size:12px;margin:0 5px;height:20px;width:100%}
.pl-progress-inner-text:after{display:inline-block;content:"";height:100%;vertical-align:middle}
- .pl-extra{margin-top:10px;background-color:${color}15;border-radius:10px;display:flex}
- .pl-extra button{flex:1}
- .pl-btn-primary{background:${color};border:0;border-radius:50px;color:#ffffff;cursor:pointer;font-size:12px;outline:none;display:flex;align-items:center;justify-content:center;margin:6px 6px;padding:0.625em 1.1em;transition:0.3s opacity}
- .pl-btn-primary:hover{opacity:0.8;transition:0.3s opacity}
- .pl-btn-primary:focus{box-shadow:0 0 0 3px ${color}80}
+
+ .pl-ext{display:inline-block;width:44px;background:#999;color:#fff;height:16px;line-height:16px;font-size:12px;border-radius:3px}
+ .pl-retry{padding:3px 10px;background:#cc3235;color:#fff;border-radius:3px;cursor:pointer}
+
+ .pl-extra{display:flex;background-color:${temp.color}15;border-radius:10px;gap:10px}
+ .pl-extra:has(>*){margin-top:1.25em;padding:8px 6px}
+ .pl-extra>*{flex:1}
+
+ .pl-btn-primary{color:#ffffff!important;background:${temp.color};border:0;border-radius:50px;cursor:pointer;font-size:12px;outline:none;display:flex;align-items:center;justify-content:center;gap:5px;padding:0.625em 1.1em;transition:opacity .2s,box-shadow .2s;will-change:opacity,box-shadow}
+ .pl-btn-primary:hover{opacity:0.8}
+ .pl-btn-primary:focus{box-shadow:0 0 0 3px ${temp.color}80}
.pl-btn-success{background:#55af28}
.pl-btn-success:focus{box-shadow:0 0 0 3px #55af2880}
.pl-btn-info{background:#606266}
@@ -2288,188 +3144,184 @@
.pl-btn-warning:focus{box-shadow:0 0 0 3px #da932880}
.pl-btn-danger{background:#cc3235}
.pl-btn-danger:focus{box-shadow:0 0 0 3px #cc323580}
- @keyframes easeOpacity { from {opacity: 1} 50% {opacity: 0.35} to {opacity: 1} }
- .pl-btn-opacity{animation:easeOpacity 1.2s 2;animation-fill-mode:forwards}
+ .pl-btn-opacity{animation:easeOpacity 1.2s 2;animation-fill-mode:forwards;will-change:opacity}
+ @keyframes easeOpacity{ from{opacity:1} 50%{opacity:0.35} to{opacity:1} }
+
.pl-button-mini{padding:5px 10px}
- .pl-dropdown-menu-item{height:30px;display:flex;align-items:center;justify-content:center;cursor:pointer;color:${color};transition:all 0.2s ease}
- .pl-dropdown-menu-item:hover{background-color:${color}15}
- .pl-button-mode{padding:0px;padding-left:0px !important;color:${color}!important;cursor:pointer;;transition:all 0.2s ease}
- .pl-button-mode:hover{background-color:${color}33 !important}
- .g-button-menu.pl-button-mode{padding:0px !important}
- .pl-button,.pl-dropdown-menu{transition:all 0.2s ease}
+ .pl-button,.pl-dropdown-menu{transition:all .2s}
.pl-button{position:relative}
- .pl-button .pl-dropdown-menu{opacity:0;pointer-events:none}
+ .pl-button .pl-dropdown-menu{opacity:0;pointer-events:none;will-change:opacity}
.pl-button:hover .pl-dropdown-menu{opacity:1;pointer-events:auto}
- @keyframes easeInitOpacity { from {opacity: 0.5} 50% {opacity: 1} to {opacity: 0.5} }
.pl-button-init{opacity:0.5;animation:easeInitOpacity 1.2s 5;animation-fill-mode:forwards}
+ @keyframes easeInitOpacity{ from{opacity:0.5} 50%{opacity:1} to{opacity:0.5} }
+
+ .pl-dropdown-menu{position:absolute;padding:5px 0;color:${temp.color};background:#fff;z-index:999;min-width:110px;border-radius:5px;box-shadow:0 1px 6px ${temp.color}33;-webkit-box-shadow:0 1px 6px ${temp.color}33;text-align:center;border:none}
+ @media (prefers-color-scheme:dark){ .pl-dropdown-menu{color:#fff;background:#222226} }
+ .pl-button-mode{height:30px;padding:0 10px!important;display:flex;align-items:center;justify-content:center;gap:5px;cursor:pointer;white-space:nowrap;transition:background-color .2s;will-change:background-color}
+ .pl-button-mode:hover{background-color:${temp.color}33!important}
header[style="display:none;"]~.pl-button{display:inline-block;position:fixed;top:0.6em;left:65%;z-index:99999}
- .baidu-button{background:${color}!important;border-color:${color}!important;border:1px solid ${color}!important;display:inline-flex}
- .baidu-button:hover{background:${color}b0 !important;border-color:${color}!important}
- .ali-button{background:${color};border:0 solid transparent;font-size:14px;margin-left:20px;padding:8px 16px;position:relative;height:32px;border-radius:100px;display:flex;align-items:center;justify-content:center;color:var(--basic_white);cursor:pointer;transition:all .3s ease}
- .ali-button:hover{background:${color}D0}
+ .color-button{background:${temp.color}!important;border-color:${temp.color}!important;border:1px solid ${temp.color}!important;display:inline-flex;transition:background .2s,border-color .2s;will-change:background,border-color}
+ .color-button:hover{background:${temp.color}b0!important;border-color:${temp.color}!important}
+ .ali-button{background:${temp.color};border:0 solid transparent;font-size:14px;margin-left:20px;padding:8px 16px;position:relative;height:32px;border-radius:100px;display:flex;align-items:center;justify-content:center;color:var(--basic_white);cursor:pointer;transition:background .2s;will-change:background}
+ .ali-button:hover{background:${temp.color}D0}
.ali-btn-icon{vertical-align:-0.2em}
- .tcloud-button{color:#fff;border:1px solid ${color};background:${color};position:relative;height:30px;padding:0 12px;margin-right:12px;font-size:12px;line-height:28px;cursor:pointer}
- .tcloud-button:hover{border-color:${color}b0;background:${color}b0}
- .mcloud-button{float:left;position:relative;margin:20px 24px 20px 0;width:110px;height:36px;background:${color};border-radius:2px;font-size:14px;color:#fff;line-height:39px;text-align:center;cursor:pointer}
- .mcloud-share-button{display:inline-block;position:relative;font-size:14px;line-height:36px;height:36px;text-align:center;color:#fff;border:1px solid ${color};border-radius:2px;padding:0 24px;background:${color}}
- .mcloud-share-button:hover{background:${color}b0}
- .mcloud-button:hover{background:${color}b0}
+ .mcloud-button{float:left;position:relative;margin:20px 24px 20px 0;width:110px;height:36px;background:${temp.color};border-radius:2px;font-size:14px;color:#fff;line-height:39px;text-align:center;cursor:pointer;will-change:background}
+ .mcloud-button:hover{background:${temp.color}b0}
+ .mcloud-share-button{display:inline-block;position:relative;font-size:14px;line-height:36px;height:36px;text-align:center;color:#fff;border:1px solid ${temp.color};border-radius:2px;padding:0 24px;background:${temp.color};will-change:background}
+ .mcloud-share-button:hover{background:${temp.color}b0}
.mcloud-btn{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAGNQTFRFAAAA////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////mkUNoAAAACF0Uk5TAAbHPP9AMRtr9PwrV8zqXfmNgDODHTLD4iJxhGJJ8Z269m0aDgAAAMZJREFUeJzd0ssOgyAQBVDUK74rWq0PFP3/ryxqTMdGqJtuvGHD5CTDTGDs3nFc17kEPcC7BH3At/Tjvk5AYbBU+NcrwghL4uQDk3gtRSF1KWCCQEpghkd+3jp/ICNQoDANU0AQCJQmWAJ3h8+q3mFdvSywQdttsGvRWGAPLReoHXrbG6WWAzBoJ+3DaCnWI39NLbcvszvLeuTB2fYoqbNBNo7sGjzk31BhMsEJitxmiKk8zSQwE8gFjBGcNuCzOmdqPrib5A2JRQ7qK9g+hQAAAABJRU5ErkJggg==");height:20px;line-height:20px;display:inline-block;background-repeat:no-repeat;background-size:20px 20px;text-indent:25px}
- .xunlei-button{display:inline-flex;align-items:center;justify-content:center;border:0 solid transparent;border-radius:5px;box-shadow:0 0 0 0 transparent;width:fit-content;white-space:nowrap;flex-shrink:0;font-size:14px;line-height:1.5;outline:0;touch-action:manipulation;transition:background .3s ease,color .3s ease,border .3s ease,box-shadow .3s ease;color:#fff;background:${color};margin-left:12px;padding:0px 12px;position:relative;cursor:pointer;height:36px}
- .xunlei-button:hover{background:${color}b0}
- .quark-button,.uc-button{padding:0 14px;background:${color}!important;background-color:${color}!important}
- .uc-button{padding:10px 20px!important}
- .quark-button:hover,.uc-button:hover{background:${color}b0 !important;background-color:${color}b0 !important}
+ .tcloud-button{color:#fff;border:1px solid ${temp.color};background:${temp.color};position:relative;height:30px;padding:0 12px;margin-right:12px;font-size:12px;line-height:28px;cursor:pointer;will-change:background,border-color}
+ .tcloud-button:hover{border-color:${temp.color}b0;background:${temp.color}b0}
+ .xunlei-button{display:inline-flex;align-items:center;justify-content:center;border:0 solid transparent;border-radius:5px;box-shadow:0 0 0 0 transparent;width:fit-content;white-space:nowrap;flex-shrink:0;font-size:14px;line-height:1.5;outline:0;touch-action:manipulation;transition:background .2s,color .2s,border .2s,box-shadow .2s;color:#fff;background:${temp.color};margin-left:12px;padding:0px 12px;position:relative;cursor:pointer;height:36px;will-change:background}
+ .xunlei-button:hover{background:${temp.color}b0}
+ .quark-button,.uc-button{padding:0 14px;background:${temp.color}!important;background-color:${temp.color}!important;will-change:background,background-color}
+ .quark-button:hover,.uc-button:hover{background:${temp.color}b0!important;background-color:${temp.color}b0!important}
.quark-btn-icon,.uc-btn-icon{width:20px;height:20px;vertical-align:-0.3em}
+ .uc-button{padding:10px 20px!important}
- .pointer{cursor:pointer}
- .pl-setting-label{display:flex;align-items:center;justify-content:space-between;padding-top:10px}
- .pl-label{flex:0 0 100px;text-align:left}
- .pl-input{flex:1;padding:8px 10px!important;border:1px solid #c2c2c2;border-radius:5px;font-size:14px!important;min-width:300px;margin:0;}
- .init-input{width:90%;text-align:center;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Ubuntu,"Helvetica Neue",sans-serif;font-weight:300}
- .pl-color{flex:1;display:flex;flex-wrap:wrap}
- .pl-color-box{width:55px;height:55px;margin:10px 10px 0 0;box-sizing:border-box;border:1px solid #fff;cursor:pointer}
- .pl-mask{width:53px;height:53px;opacity:0;transition:opacity 0.3s;color:#fff;font-size:13px;display:flex;align-items:center;justify-content:center;flex-direction:column}
- .pl-color-box:hover .pl-mask{opacity:1}
- .pl-close:focus{outline:0;box-shadow:none}
- .tag-danger{color:#cc3235;margin:0 5px}
- .pl-tooltip{position:absolute;color:#ffffff;max-width:600px;font-size:12px;padding:5px 10px;background:#333;border-radius:5px;z-index:110000;line-height:1.3;display:none;word-break:break-all}
+ .pl-setting-item{display:flex;align-items:center;justify-content:space-between;padding-top:1em}
+ .pl-setting-item > *:nth-child(2){max-width:80%;display:flex;justify-content:space-between;align-items:center}
+ .pl-setting-item .pl-setting-item{padding:0;gap:5px}
+ .pl-input{padding:8px 10px!important;border:1px solid #c2c2c2;border-radius:5px;font-size:14px!important;margin:0;-webkit-appearance:auto}
+ .pl-setting-item > .pl-input{width:80%}
+ .init-input{width:90%;margin:0;margin:10px 0;text-align:center;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Ubuntu,"Helvetica Neue",sans-serif;font-weight:300}
+ .pl-tooltip{position:absolute;z-index:110000;display:none;align-items:center;color:#ffffff;background:#333;font-size:12px;line-height:1.3;max-width:600px;border-radius:5px;word-break:break-all;will-change:display,top,left}
+ .pl-tooltip>*{padding:5px 10px}
+ .pl-tooltip>*:first-child{border:1px solid;border-top-left-radius:5px;border-bottom-left-radius:5px;border-top-color:#333;border-bottom-color:#333;border-left-color:#333;border-right-color:transparent}
+ .pl-tooltip>*:last-child{border:1px solid;border-top-right-radius:5px;border-bottom-right-radius:5px;border-top-color:#333;border-bottom-color:#333;border-left-color:transparent;border-right-color:#333}
.pl-loading-box>div>div{position:absolute;border-radius:50%}
.pl-loading-box>div>div:nth-child(1){top:9px;left:9px;width:82px;height:82px;background:#ffffff}
- @keyframes load{ 0% {transform: rotate(0deg)} 100% {transform: rotate(360deg)} }
- .pl-loading-box>div>div:nth-child(2){top:14px;left:38px;width:25px;height:25px;background:#666666;animation:load 1s linear infinite;transform-origin:12px 36px}
+ @keyframes load{ 0%{transform:rotate(0deg)} 100%{transform:rotate(360deg)} }
+ .pl-loading-box>div>div:nth-child(2){top:14px;left:38px;width:25px;height:25px;background:${temp.color};animation:load 1s linear infinite;transform-origin:12px 36px}
.pl-loading{width:16px;height:16px;display:inline-block;overflow:hidden;background:none}
.pl-loading-box{width:100%;height:100%;position:relative;transform:translateZ(0) scale(0.16);backface-visibility:hidden;transform-origin:0 0}
.pl-loading-box div{box-sizing:content-box}
- .pl-dropdown-menu{position:absolute;padding:5px 0;color:${color};background:#fff;z-index:999;width:110px;border-radius:5px;box-shadow:0 1px 6px ${color}33;-webkit-box-shadow:0 1px 6px ${color}33;text-align:center;border:none;transition:all 0.2s ease}
- @media (prefers-color-scheme: dark) { .pl-dropdown-menu{background:#19191a;} }
- .pl-button-save{background-color:${color}!important;color:#fff !important}
- .pl-button-save:hover{background-color:${color}D0 !important;color:#fff !important}
+ .pl-button-save{background-color:${temp.color}!important;color:#fff!important}
+ .pl-button-save:hover{background-color:${temp.color}D0!important;color:#fff!important}
.swal2-container{z-index:100000}
body.swal2-height-auto{height:inherit}
- svg.icon-rpc-devices{width:13px;height:13px}
- [class^="swal2-"],[class*="pl-btn"]{transition:all 0.3s ease}
+ [class^="swal2-"],[class*="pl-btn"]{transition:all .2s}
/* 适配(改)百度网盘会员青春版 */
- a.downloadSubtitle, button.downloadSubtitle{transition:all 0.3s ease;background-color:${color}}
- a.downloadSubtitle:hover, button.downloadSubtitle:hover{background-color:${color}D0}
- a.downloadSubtitle:disabled, button.downloadSubtitle:disabled {background-color: ${color}D0}
+ a.downloadSubtitle, button.downloadSubtitle{transition:all .2s;background-color:${temp.color}}
+ a.downloadSubtitle:hover, button.downloadSubtitle:hover{background-color:${temp.color}D0}
+ a.downloadSubtitle:disabled, button.downloadSubtitle:disabled{background-color:${temp.color}D0}
- /* RGB! */
- @keyframes RGB{ 0% {filter: hue-rotate()} to {filter: hue-rotate(-360deg)} }
+ /* 哪里都没用到的 RGB! */
+ @keyframes RGB{ 0%{filter:hue-rotate()} to{filter:hue-rotate(-360deg)} }
/* Webkit, Opera, IE9, Chrome*/
- ::selection, ::-webkit-selection, ::-moz-selection, ::-ms-selection,::-edge-selection {background-color:${color}!important;background:${color}!important;color:white!important;}
+ ::selection, ::-webkit-selection, ::-moz-selection, ::-ms-selection{background-color:${temp.color}!important;background:${temp.color}!important;color:white!important}
`);
- if (/(pan|yun).baidu.com/.test(location.host) && location.pathname !== '/disk/home' && base.getValue('setting_theme_baidu') === 'yes') {
+ if (/(pan|yun).baidu.com/.test(location.host) && $baidu.detectPage() !== 'home' && base.getValue('setting_ui_theme').custom.$baidu === true) {
base.setColors([
- ['#717fff', color],
- ['#717FFF', color],
- ['#06a8ff', color],
- ['#06A8FF', color],
- ['#06a7ff', color],
- ['#06A7FF', color],
- ['#dcdfe6', color],
- ['#DCDFE6', color],
- ['#0095ff', color],
- ['#0095FF', color],
- ['#09aaff', color],
- ['#09AAFF', color],
- ['#0ca6ff', color],
- ['#0CA6FF', color],
- ['#5040ff', color],
- ['#5040FF', color],
- ['#454d5a', color],
- ['#454D5A', color],
- ['#a2abbd', color],
- ['#A2ABBD', color],
- ['#030b1a', color],
- ['#030B1A', color],
- ['#afb3bf', color],
- ['#AFB3BF', color],
- ['#ff436a', color],
- ['#FF436A', color],
- ['#03081a', color],
- ['#03081A', color],
- ['#2974b6', color],
- ['#2974B6', color],
- ['#0596e6', color],
- ['#0596E6', color],
+ ['#717fff', temp.color],
+ ['#717FFF', temp.color],
+ ['#06a8ff', temp.color],
+ ['#06A8FF', temp.color],
+ ['#06a7ff', temp.color],
+ ['#06A7FF', temp.color],
+ ['#dcdfe6', temp.color],
+ ['#DCDFE6', temp.color],
+ ['#0095ff', temp.color],
+ ['#0095FF', temp.color],
+ ['#09aaff', temp.color],
+ ['#09AAFF', temp.color],
+ ['#0ca6ff', temp.color],
+ ['#0CA6FF', temp.color],
+ ['#5040ff', temp.color],
+ ['#5040FF', temp.color],
+ ['#454d5a', temp.color],
+ ['#454D5A', temp.color],
+ ['#a2abbd', temp.color],
+ ['#A2ABBD', temp.color],
+ ['#030b1a', temp.color],
+ ['#030B1A', temp.color],
+ ['#afb3bf', temp.color],
+ ['#AFB3BF', temp.color],
+ ['#ff436a', temp.color],
+ ['#FF436A', temp.color],
+ ['#03081a', temp.color],
+ ['#03081A', temp.color],
+ ['#2974b6', temp.color],
+ ['#2974B6', temp.color],
+ ['#0596e6', temp.color],
+ ['#0596E6', temp.color],
- ['#C3EAFF', color],
- ['#c0d9fe', `${color}50`],
- ['#0098EA', `${color}D0`],
+ ['#C3EAFF', temp.color],
+ ['#c0d9fe', `${temp.color}50`],
+ ['#0098EA', `${temp.color}D0`],
- ['#38b9ff', `${color}D0`],
- ['#38B9FF', `${color}D0`],
- ['#42d8ff', `${color}D0`],
- ['#42D8FF', `${color}D0`],
- ['#a48dff', `${color}D0`],
- ['#A48DFF', `${color}D0`],
- ['#6b79f2', `${color}D0`],
- ['#6B79F2', `${color}D0`],
+ ['#38b9ff', `${temp.color}D0`],
+ ['#38B9FF', `${temp.color}D0`],
+ ['#42d8ff', `${temp.color}D0`],
+ ['#42D8FF', `${temp.color}D0`],
+ ['#a48dff', `${temp.color}D0`],
+ ['#A48DFF', `${temp.color}D0`],
+ ['#6b79f2', `${temp.color}D0`],
+ ['#6B79F2', `${temp.color}D0`],
- ['#9c86f2', `${color}90`],
- ['#9C86F2', `${color}90`],
- ['#83d3ff', `${color}90`],
- ['#83D3FF', `${color}90`],
- ['#C4D8F4', `${color}90`],
+ ['#9c86f2', `${temp.color}90`],
+ ['#9C86F2', `${temp.color}90`],
+ ['#83d3ff', `${temp.color}90`],
+ ['#83D3FF', `${temp.color}90`],
+ ['#C4D8F4', `${temp.color}90`],
- ['#fafafc', `${color}20`],
- ['#FAFAFC', `${color}20`],
- ['#f5fbff', `${color}20`],
- ['#F5FBFF', `${color}20`],
- ['#b4e5ff', `${color}20`],
- ['#B4E5FF', `${color}20`],
- ['#f0faff', `${color}20`],
- ['#F0FAFF', `${color}20`],
- ['#c4d8f4', `${color}20`],
+ ['#fafafc', `${temp.color}20`],
+ ['#FAFAFC', `${temp.color}20`],
+ ['#f5fbff', `${temp.color}20`],
+ ['#F5FBFF', `${temp.color}20`],
+ ['#b4e5ff', `${temp.color}20`],
+ ['#B4E5FF', `${temp.color}20`],
+ ['#f0faff', `${temp.color}20`],
+ ['#F0FAFF', `${temp.color}20`],
+ ['#c4d8f4', `${temp.color}20`],
- ['#f1f3f8', `${color}15`],
- ['#F1F3F8', `${color}15`],
+ ['#f1f3f8', `${temp.color}15`],
+ ['#F1F3F8', `${temp.color}15`],
- ['#f2faff', `${color}10`],
- ['#F2FAFF', `${color}10`],
- ['#eef9fe', `${color}10`],
- ['#EEF9FE', `${color}10`],
- ['#f7f9fc', `${color}10`],
- ['#F7F9FC', `${color}10`],
- ['#f5f6fa', `${color}10`],
- ['#F5F6FA', `${color}10`],
- ['#b4e5ff', `${color}10`],
- ['#B4E5FF', `${color}10`],
- ['#e6f6ff', `${color}10`],
- ['#E6F6FF', `${color}10`],
+ ['#f2faff', `${temp.color}10`],
+ ['#F2FAFF', `${temp.color}10`],
+ ['#eef9fe', `${temp.color}10`],
+ ['#EEF9FE', `${temp.color}10`],
+ ['#f7f9fc', `${temp.color}10`],
+ ['#F7F9FC', `${temp.color}10`],
+ ['#f5f6fa', `${temp.color}10`],
+ ['#F5F6FA', `${temp.color}10`],
+ ['#b4e5ff', `${temp.color}10`],
+ ['#B4E5FF', `${temp.color}10`],
+ ['#e6f6ff', `${temp.color}10`],
+ ['#E6F6FF', `${temp.color}10`],
- ['0,149,255', base.hexToRgba(color)],
- ['30, 175, 255', base.hexToRgba(color)],
- ['6, 167, 255, 0.1', base.hexToRgba(`${color}1a`)],
- ['6,167,255,.1', base.hexToRgba(`${color}1a`)],
- ['6,167,255,.23', base.hexToRgba(`${color}3b`)],
- ['164,141,255,.2', base.hexToRgba(`${color}30`)],
- ['196,182,255,.2', base.hexToRgba(`${color}20`)],
- ['113,127,255,.2', base.hexToRgba(`${color}40`)],
- ['3,8,26,.6', base.hexToRgba(`${color}D0`)],
- ['255,32,102,.4', base.hexToRgba(`${color}66`)],
- ['72,166,248,.7', base.hexToRgba(`${color}66`)],
+ ['0,149,255', base.hexToRgba(temp.color)],
+ ['30, 175, 255', base.hexToRgba(temp.color)],
+ ['6, 167, 255, 0.1', base.hexToRgba(`${temp.color}1a`)],
+ ['6,167,255,.1', base.hexToRgba(`${temp.color}1a`)],
+ ['6,167,255,.23', base.hexToRgba(`${temp.color}3b`)],
+ ['164,141,255,.2', base.hexToRgba(`${temp.color}30`)],
+ ['196,182,255,.2', base.hexToRgba(`${temp.color}20`)],
+ ['113,127,255,.2', base.hexToRgba(`${temp.color}40`)],
+ ['3,8,26,.6', base.hexToRgba(`${temp.color}D0`)],
+ ['255,32,102,.4', base.hexToRgba(`${temp.color}66`)],
+ ['72,166,248,.7', base.hexToRgba(`${temp.color}66`)],
]);
};
- if (/(pan|yun).baidu.com/.test(location.host) && base.getValue('setting_theme_baidu') === 'yes') {
+ if (/(pan|yun).baidu.com/.test(location.host) && base.getValue('setting_ui_theme').custom.$baidu === true) {
base.addStyle(`${mount}-baidu`, 'style', `
#layoutMain,
- .DxdbeCb {
- border-radius: 10px;
- border-bottom-left-radius: 0;
- border-bottom-right-radius: 0;
- background: #ffffffA0 !important
+ .DxdbeCb{
+ border-radius:10px;
+ border-bottom-left-radius:0;
+ border-bottom-right-radius:0;
+ background:#ffffffA0!important
}
.KPDwCE,
.DxdbeCb .OFaPaO .tanwePYr,
.xGLMIab .fufHyA:hover,
- .module-search-timeline .form-box {
- background: #ffffffA0 !important;
+ .module-search-timeline .form-box{
+ background:#ffffffA0!important;
}
.KPDwCE .JDeHdxb,
.NHcGw .AuPKyz,
@@ -2478,284 +3330,270 @@
.cazEfA .yfHIsP,
.hscjZ4QL .bbxnZ0Bq .ehnyLxWZ span,
.module-topToolBar,
- .module-timeline-view .timeline-title-curday {
- background: transparent !important;
- border-bottom: 0;
+ .module-timeline-view .timeline-title-curday{
+ background:transparent!important;
+ border-bottom:0;
}
- .MdLxwM {
- background :#fff !important;
+ .MdLxwM{
+ background :#fff!important;
}
- .aside-absolute-container {
- position: absolute !important;
+ .aside-absolute-container{
+ position:absolute!important;
}
- .aside-absolute-container .QGOvsxb .remainingSpaceUi_span {
- background: #8af248 !important;
- border-radius: 10px 0 0 10px;
- border-right: #fff 1px solid;
- border-bottom: #fff 1px solid;
+ .aside-absolute-container .QGOvsxb .remainingSpaceUi_span{
+ background:#8af248!important;
+ border-radius:10px 0 0 10px;
+ border-right:#fff 1px solid;
+ border-bottom:#fff 1px solid;
}
- .xtJbHcb .CDaavKb .KQcHyA {
- background: rgb(244,207,0) !important;
- padding: 8px 15px;
+ .xtJbHcb .CDaavKb .KQcHyA{
+ background:rgb(244,207,0)!important;
+ padding:8px 15px;
}
- .xtJbHcb .web-header-nav-new-version-inner {
- background: ${color} !important;
- padding: 8px 15px;
- line-height: 15px;
- width: auto;
- height: auto;
+ .xtJbHcb .web-header-nav-new-version-inner{
+ background:${temp.color}!important;
+ padding:8px 15px;
+ line-height:15px;
+ width:auto;
+ height:auto;
}
- a {
- transition: all 0.2s ease !important;
+ a{
+ transition:all .2s!important;
}
- #bd-main .bd-left {
- margin: auto !important;
+ #bd-main .bd-left{
+ margin:auto!important;
}
- .verify-input input {
- padding-left: 0 !important;
- text-align: center !important;
+ .verify-input input{
+ padding-left:0!important;
+ text-align:center!important;
}
- .verify-input input:focus {
- border: 2px solid ${color} !important;
+ .verify-input input:focus{
+ border:2px solid ${temp.color}!important;
}
- [data-theme=light] .vp-video-page-card .vp-video-page-card__video-detail {
- color: #030b1a;
+ [data-theme=light] .vp-video-page-card .vp-video-page-card__video-detail{
+ color:#030b1a;
}
- dt.level-1 {
- background: #fd6d65 !important;
+ dt.level-1{
+ background:#fd6d65!important;
}
- dt.level-2 {
- background: #f3a723 !important;
+ dt.level-2{
+ background:#f3a723!important;
}
- dt.level-1 i.desc-arrow {
- border-bottom: 10px solid #dd6966 !important;
+ dt.level-1 i.desc-arrow{
+ border-bottom:10px solid #dd6966!important;
}
- dt.level-2 i.desc-arrow {
- border-bottom: 10px solid #d29633 !important;
+ dt.level-2 i.desc-arrow{
+ border-bottom:10px solid #d29633!important;
}
`, `.${mount}`);
base.setColors([
- ['#717fff', color],
- ['#717FFF', color],
- ['#06a8ff', color],
- ['#06A8FF', color],
- ['#06a7ff', color],
- ['#06A7FF', color],
- ['#dcdfe6', color],
- ['#DCDFE6', color],
- ['#0095ff', color],
- ['#0095FF', color],
- ['#09aaff', color],
- ['#09AAFF', color],
- ['#0ca6ff', color],
- ['#0CA6FF', color],
- ['#5040ff', color],
- ['#5040FF', color],
- ['#454d5a', color],
- ['#454D5A', color],
- ['#a2abbd', color],
- ['#A2ABBD', color],
- ['#030b1a', color],
- ['#030B1A', color],
- ['#afb3bf', color],
- ['#AFB3BF', color],
- ['#ff436a', color],
- ['#FF436A', color],
- ['#03081a', color],
- ['#03081A', color],
- ['#2974b6', color],
- ['#2974B6', color],
- ['#0596e6', color],
- ['#0596E6', color],
+ ['#717fff', temp.color],
+ ['#717FFF', temp.color],
+ ['#06a8ff', temp.color],
+ ['#06A8FF', temp.color],
+ ['#06a7ff', temp.color],
+ ['#06A7FF', temp.color],
+ ['#dcdfe6', temp.color],
+ ['#DCDFE6', temp.color],
+ ['#0095ff', temp.color],
+ ['#0095FF', temp.color],
+ ['#09aaff', temp.color],
+ ['#09AAFF', temp.color],
+ ['#0ca6ff', temp.color],
+ ['#0CA6FF', temp.color],
+ ['#5040ff', temp.color],
+ ['#5040FF', temp.color],
+ ['#454d5a', temp.color],
+ ['#454D5A', temp.color],
+ ['#a2abbd', temp.color],
+ ['#A2ABBD', temp.color],
+ ['#030b1a', temp.color],
+ ['#030B1A', temp.color],
+ ['#afb3bf', temp.color],
+ ['#AFB3BF', temp.color],
+ ['#ff436a', temp.color],
+ ['#FF436A', temp.color],
+ ['#03081a', temp.color],
+ ['#03081A', temp.color],
+ ['#2974b6', temp.color],
+ ['#2974B6', temp.color],
+ ['#0596e6', temp.color],
+ ['#0596E6', temp.color],
- ['#C3EAFF', color],
- ['#c0d9fe', `${color}50`],
- ['#0098EA', `${color}D0`],
+ ['#C3EAFF', temp.color],
+ ['#c0d9fe', `${temp.color}50`],
+ ['#0098EA', `${temp.color}D0`],
- ['#38b9ff', `${color}D0`],
- ['#38B9FF', `${color}D0`],
- ['#42d8ff', `${color}D0`],
- ['#42D8FF', `${color}D0`],
- ['#a48dff', `${color}D0`],
- ['#A48DFF', `${color}D0`],
- ['#6b79f2', `${color}D0`],
- ['#6B79F2', `${color}D0`],
+ ['#38b9ff', `${temp.color}D0`],
+ ['#38B9FF', `${temp.color}D0`],
+ ['#42d8ff', `${temp.color}D0`],
+ ['#42D8FF', `${temp.color}D0`],
+ ['#a48dff', `${temp.color}D0`],
+ ['#A48DFF', `${temp.color}D0`],
+ ['#6b79f2', `${temp.color}D0`],
+ ['#6B79F2', `${temp.color}D0`],
- ['#9c86f2', `${color}90`],
- ['#9C86F2', `${color}90`],
- ['#83d3ff', `${color}90`],
- ['#83D3FF', `${color}90`],
- ['#C4D8F4', `${color}90`],
+ ['#9c86f2', `${temp.color}90`],
+ ['#9C86F2', `${temp.color}90`],
+ ['#83d3ff', `${temp.color}90`],
+ ['#83D3FF', `${temp.color}90`],
+ ['#C4D8F4', `${temp.color}90`],
- ['#fafafc', `${color}20`],
- ['#FAFAFC', `${color}20`],
- ['#f5fbff', `${color}20`],
- ['#F5FBFF', `${color}20`],
- ['#b4e5ff', `${color}20`],
- ['#B4E5FF', `${color}20`],
- ['#f0faff', `${color}20`],
- ['#F0FAFF', `${color}20`],
- ['#c4d8f4', `${color}20`],
+ ['#fafafc', `${temp.color}20`],
+ ['#FAFAFC', `${temp.color}20`],
+ ['#f5fbff', `${temp.color}20`],
+ ['#F5FBFF', `${temp.color}20`],
+ ['#b4e5ff', `${temp.color}20`],
+ ['#B4E5FF', `${temp.color}20`],
+ ['#f0faff', `${temp.color}20`],
+ ['#F0FAFF', `${temp.color}20`],
+ ['#c4d8f4', `${temp.color}20`],
- ['#f1f3f8', `${color}15`],
- ['#F1F3F8', `${color}15`],
+ ['#f1f3f8', `${temp.color}15`],
+ ['#F1F3F8', `${temp.color}15`],
- ['#f2faff', `${color}10`],
- ['#F2FAFF', `${color}10`],
- ['#eef9fe', `${color}10`],
- ['#EEF9FE', `${color}10`],
- ['#f7f9fc', `${color}10`],
- ['#F7F9FC', `${color}10`],
- ['#f5f6fa', `${color}10`],
- ['#F5F6FA', `${color}10`],
- ['#b4e5ff', `${color}10`],
- ['#B4E5FF', `${color}10`],
- ['#e6f6ff', `${color}10`],
- ['#E6F6FF', `${color}10`],
+ ['#f2faff', `${temp.color}10`],
+ ['#F2FAFF', `${temp.color}10`],
+ ['#eef9fe', `${temp.color}10`],
+ ['#EEF9FE', `${temp.color}10`],
+ ['#f7f9fc', `${temp.color}10`],
+ ['#F7F9FC', `${temp.color}10`],
+ ['#f5f6fa', `${temp.color}10`],
+ ['#F5F6FA', `${temp.color}10`],
+ ['#b4e5ff', `${temp.color}10`],
+ ['#B4E5FF', `${temp.color}10`],
+ ['#e6f6ff', `${temp.color}10`],
+ ['#E6F6FF', `${temp.color}10`],
- ['0,149,255', base.hexToRgba(color)],
- ['30, 175, 255', base.hexToRgba(color)],
- ['6, 167, 255, 0.1', base.hexToRgba(`${color}1a`)],
- ['6,167,255,.1', base.hexToRgba(`${color}1a`)],
- ['6,167,255,.23', base.hexToRgba(`${color}3b`)],
- ['164,141,255,.2', base.hexToRgba(`${color}30`)],
- ['196,182,255,.2', base.hexToRgba(`${color}20`)],
- ['113,127,255,.2', base.hexToRgba(`${color}40`)],
- ['3,8,26,.6', base.hexToRgba(`${color}D0`)],
- ['255,32,102,.4', base.hexToRgba(`${color}66`)],
- ['72,166,248,.7', base.hexToRgba(`${color}66`)],
+ ['0,149,255', base.hexToRgba(temp.color)],
+ ['30, 175, 255', base.hexToRgba(temp.color)],
+ ['6, 167, 255, 0.1', base.hexToRgba(`${temp.color}1a`)],
+ ['6,167,255,.1', base.hexToRgba(`${temp.color}1a`)],
+ ['6,167,255,.23', base.hexToRgba(`${temp.color}3b`)],
+ ['164,141,255,.2', base.hexToRgba(`${temp.color}30`)],
+ ['196,182,255,.2', base.hexToRgba(`${temp.color}20`)],
+ ['113,127,255,.2', base.hexToRgba(`${temp.color}40`)],
+ ['3,8,26,.6', base.hexToRgba(`${temp.color}D0`)],
+ ['255,32,102,.4', base.hexToRgba(`${temp.color}66`)],
+ ['72,166,248,.7', base.hexToRgba(`${temp.color}66`)],
], "other");
};
- if (/www.(aliyundrive|alipan).com/.test(location.host) && base.getValue('setting_theme_ali') === 'yes') {
+ if (/www.(aliyundrive|alipan).com/.test(location.host) && base.getValue('setting_ui_theme').custom.$aliyun === true) {
base.setColors([
- ['#3763ff', color],
- ['#8664ff', `${color}D0`],
- ['99, 125, 255', base.hexToRgba(color)],
- ['132, 133, 141', base.hexToRgba(color)],
- ['112, 136, 255', base.hexToRgba(color)],
- ['97, 122, 250', base.hexToRgba(color)],
- ['68, 109, 255', base.hexToRgba(color)],
- ['82, 110, 250', base.hexToRgba(`${color}20`)],
- ['122, 144, 255', base.hexToRgba(`${color}D0`)],
- ['138, 157, 255', base.hexToRgba(`${color}D0`)],
+ ['#3763ff', temp.color],
+ ['#8664ff', `${temp.color}D0`],
+ ['99, 125, 255', base.hexToRgba(temp.color)],
+ ['132, 133, 141', base.hexToRgba(temp.color)],
+ ['112, 136, 255', base.hexToRgba(temp.color)],
+ ['97, 122, 250', base.hexToRgba(temp.color)],
+ ['68, 109, 255', base.hexToRgba(temp.color)],
+ ['82, 110, 250', base.hexToRgba(`${temp.color}20`)],
+ ['122, 144, 255', base.hexToRgba(`${temp.color}D0`)],
+ ['138, 157, 255', base.hexToRgba(`${temp.color}D0`)],
//['49, 49, 54', base.hexToRgba(color)],
]);
};
- if (/(yun|caiyun).139.com/.test(location.host) && base.getValue('setting_theme_mcloud') === 'yes') {
+ if (/(yun|caiyun).139.com/.test(location.host) && base.getValue('setting_ui_theme').custom.$mcloud === true) {
base.setColors([
- ['#3181f9', color],
- ['#5a9afa', color],
- ['#98c0fc', `${color}D0`],
- ['#2d76e5', `${color}D0`],
- ['49,129,249,.08', base.hexToRgba(`${color}20`)],
+ ['#3181f9', temp.color],
+ ['#5a9afa', temp.color],
+ ['#98c0fc', `${temp.color}D0`],
+ ['#2d76e5', `${temp.color}D0`],
+ ['49,129,249,.08', base.hexToRgba(`${temp.color}20`)],
]);
};
- if (/cloud.189.cn/.test(location.host) && base.getValue('setting_theme_tcloud') === 'yes') {
+ if (/cloud.189.cn/.test(location.host) && base.getValue('setting_ui_theme').custom.$tcloud === true) {
base.setColors([
- ['#2b89ea', color],
- ['#1874d3', `${color}F0`],
- ['#1890ff', color],
- ['#388fc9', color],
- ['#0087ff', color],
- ['#255697', color],
- ['#3ea6ff', `${color}80`],
- ['#1d52f2', color],
- ['#3699ff', `${color}D0`],
- ['#f4f9fe', `${color}10`],
- ['#eaf5ff', `${color}20`],
+ ['#2b89ea', temp.color],
+ ['#1874d3', `${temp.color}F0`],
+ ['#1890ff', temp.color],
+ ['#388fc9', temp.color],
+ ['#0087ff', temp.color],
+ ['#255697', temp.color],
+ ['#3ea6ff', `${temp.color}80`],
+ ['#1d52f2', temp.color],
+ ['#3699ff', `${temp.color}D0`],
+ ['#f4f9fe', `${temp.color}10`],
+ ['#eaf5ff', `${temp.color}20`],
], "other");
}
- if (/pan.xunlei.com/.test(location.host) && base.getValue('setting_theme_xunlei') === 'yes') {
+ if (/pan.xunlei.com/.test(location.host) && base.getValue('setting_ui_theme').custom.$xunlei === true) {
base.setColors([
- ['#3f85ff', color],
- ['63,133,255,.1', base.hexToRgba(`${color}20`)],
- ['#2670ea', `${color}D0`],
- ['#619bff', `${color}D0`],
- ['#ecf3ff', `${color}10`],
- ['#f6faff', `${color}10`],
- ['#1a2845', `${color}20`],
- ['#0f2035', `${color}20`],
- ['#308bfd', `${color}20`],
- ['#eee', `${color}20`],
+ ['#3f85ff', temp.color],
+ ['63,133,255,.1', base.hexToRgba(`${temp.color}20`)],
+ ['#2670ea', `${temp.color}D0`],
+ ['#619bff', `${temp.color}D0`],
+ ['#ecf3ff', `${temp.color}10`],
+ ['#f6faff', `${temp.color}10`],
+ ['#1a2845', `${temp.color}20`],
+ ['#0f2035', `${temp.color}20`],
+ ['#308bfd', `${temp.color}20`],
+ ['#eee', `${temp.color}20`],
], "other");
base.addStyle(`${mount}-xunlei`, 'style', `
- .web-header {
- background: linear-gradient(0deg,${color}D0,${color})
+ .web-header{
+ background:linear-gradient(0deg,${temp.color}D0,${temp.color})
}
`);
};
- if (/pan.quark.cn/.test(location.host) && base.getValue('setting_theme_quark') === 'yes') {
+ if (/pan.quark.cn/.test(location.host) && base.getValue('setting_ui_theme').custom.$quark === true) {
base.setColors([
- ['#0d53ff', color],
- ['#e6f1ff', `${color}20`],
- ['#f0faff', `${color}20`],
- ['#7da3ff', `${color}D0`],
- ['#ddd', `${color}D0`],
- ['17,17,17,.9', base.hexToRgba(`${color}D0`)],
- ['40,40,255,.04', base.hexToRgba(`${color}20`)],
+ ['#0d53ff', temp.color],
+ ['#e6f1ff', `${temp.color}20`],
+ ['#f0faff', `${temp.color}20`],
+ ['#7da3ff', `${temp.color}D0`],
+ ['#ddd', `${temp.color}D0`],
+ ['17,17,17,.9', base.hexToRgba(`${temp.color}D0`)],
+ ['40,40,255,.04', base.hexToRgba(`${temp.color}20`)],
['#f7f7ff', 'transparent'],
- ['238,247,255,0', base.hexToRgba(`${color}00`)],
+ ['238,247,255,0', base.hexToRgba(`${temp.color}00`)],
]);
base.addStyle(`${mount}-quark`, 'style', `
- .file-list .hover-oper .hover-transparent-bg {
- background: transparent !important;
+ .file-list .hover-oper .hover-transparent-bg{
+ background:transparent!important;
}
.ant-checkbox-wrapper .ant-checkbox-checked .ant-checkbox-inner,
- .ant-checkbox-wrapper .ant-checkbox-indeterminate .ant-checkbox-inner:after {
- background-color: ${color}!important;
+ .ant-checkbox-wrapper .ant-checkbox-indeterminate .ant-checkbox-inner:after{
+ background-color:${temp.color}!important;
}
`);
};
- if (/drive.uc.cn/.test(location.host) && base.getValue('setting_theme_uc') === 'yes') {
+ if (/drive.uc.cn/.test(location.host) && base.getValue('setting_ui_theme').custom.$uc === true) {
base.setColors([
- ['#12161a', color],
- ['#e6f1ff', `${color}20`],
- ['#f0faff', `${color}20`],
- ['#7da3ff', `${color}D0`],
- ['#ddd', `${color}D0`],
- ['17,17,17,.9', base.hexToRgba(`${color}D0`)],
- ['40,40,255,.04', base.hexToRgba(`${color}20`)],
+ ['#12161a', temp.color],
+ ['#e6f1ff', `${temp.color}20`],
+ ['#f0faff', `${temp.color}20`],
+ ['#7da3ff', `${temp.color}D0`],
+ ['#ddd', `${temp.color}D0`],
+ ['17,17,17,.9', base.hexToRgba(`${temp.color}D0`)],
+ ['40,40,255,.04', base.hexToRgba(`${temp.color}20`)],
['#f7f7ff', 'transparent'],
- ['238,247,255,0', base.hexToRgba(`${color}00`)],
+ ['238,247,255,0', base.hexToRgba(`${temp.color}00`)],
]);
base.addStyle(`${mount}-uc`, 'style', `
- .file-list .hover-oper .hover-transparent-bg {
- background: transparent !important;
+ .file-list .hover-oper .hover-transparent-bg{
+ background:transparent!important;
}
`);
};
- if (/www.(123(pan|684|865|952|912).com|123pan.cn)/.test(location.host) && base.getValue('setting_theme_123') === 'yes') {
+ if (/www.(123(pan|684|865|952|912).com|123pan.cn)/.test(location.host) && base.getValue('setting_ui_theme').custom.$123pan === true) {
base.setColors([
- ['#597dfc', color],
- ['#5a7cfc', color],
- ['#2A82E4', color],
- ['#51a1f0', color],
- ['#597DFC', color],
- ['#40a9ff', color],
- ['#3c80ff', color],
- ['#3C80FF', color],
- ['#1890ff', color],
- ['#f0f9ff', `${color}20`],
- ['#F2F5FF', `${color}20`],
- ['#325cf0', `${color}D0`],
- ['60, 128, 255', base.hexToRgba(color)],
- ['42, 130, 228', base.hexToRgba(color)],
+ ['#597dfc', temp.color],
+ ['#5a7cfc', temp.color],
+ ['#2A82E4', temp.color],
+ ['#51a1f0', temp.color],
+ ['#597DFC', temp.color],
+ ['#40a9ff', temp.color],
+ ['#3c80ff', temp.color],
+ ['#3C80FF', temp.color],
+ ['#1890ff', temp.color],
+ ['#f0f9ff', `${temp.color}20`],
+ ['#F2F5FF', `${temp.color}20`],
+ ['#325cf0', `${temp.color}D0`],
+ ['60, 128, 255', base.hexToRgba(temp.color)],
+ ['42, 130, 228', base.hexToRgba(temp.color)],
]);
}
- if (/.*.youxiaohou.com/.test(location.host)) {
- base.setColors([
- ['#00aefe', color],
- ['#4e6e8e', color],
- ['#009fe8', color],
- ['#008fd1', color],
- ['#05b0ff', `${color}D0`],
- ], "other");
- base.addStyle(`${mount}-youxiaohou`, 'style', `
- a[aria-label="View source on GitHub"] svg[style^="fill"] {
- fill: ${color} !important;
- }
- `);
- };
},
/**
@@ -2766,44 +3604,51 @@
* 支持输入特定数字触发彩蛋,并自动注入默认设置点亮功能。
* @returns {Promise
} 弹窗关闭后返回空值,可能触发页面刷新
*/
- async initDialog() {
+ async showInitDialog() {
let dialog = await Swal.fire({
- title: `请阅读完以下全文再继续`,
- allowOutsideClick: false,
+ ...temp.swalDefault,
+ title: `(◍•ᴗ•◍)/ 你好呀`,
+ html: `
+
“这里好像没什么好输入的…”
+
+
+ 但其实…你可以按下下方的 红色按钮 跳过流程
+ 或者继续输入一些神秘的 “恶臭数字” ,解锁隐藏彩蛋~
+
+
+ 如果您喜欢这个脚本的话
+ 请支持原作者 油小猴
+ 或给此改版点个 Star ?
+
+
+ 脚本不仅能精简网盘界面 点亮后还能修改多个网盘的主题色哦!
+
+
+
+ `,
showCloseButton: true,
showDenyButton: true,
- confirmButtonText: '确认',
- denyButtonText: '懒得输入...我要直接点亮!',
- html: `
-
- 你心想道: “没什么可以输入的”
-
- ↓
- 但你不知道的是...
- 你可以直接按下下方的红色按钮 来跳过这一有趣的流程
- 或者继续流程,输入某些恶臭的数字 查看彩蛋并点亮
- ↓
- 原作者 开发很辛苦,所以请有能力的你请支持下他的公众号
-
- 点亮后不仅能精简网盘界面 还能改变众多网盘主题色哦!
- `,
- ...swalDefault
+ denyButtonText: ' 懒得输入...我要直接点亮!',
+ allowOutsideClick: false,
});
if (dialog.isDenied) {
console.log("【LinkSwift】\n正在“注入”点亮按钮设置项目...");
message.warning("正在“注入”设置项目...");
await base.sleep(2500);
- base.setValue('setting_init_code', config.base.num);
- base.setValue('setting_init_license', config.base.license);
- message.success("“注入”成功了!");
+ let list = base.getValue("setting_init");
+ list.code = config.base.num;
+ list.license = config.base.license;
+ base.setValue("setting_init", list);
+ message.success("“注入”成功啦!");
await base.sleep(1500);
location.reload();
};
if (dialog.isConfirmed) {
if ($('#init').val() === '114514' || $('#init').val() === '1919810' || $('#init').val() === '1145141919810') {
await Swal.fire({
+ ...temp.swalDefault,
icon: 'error',
title: '1145141919810',
html: 'homo特有的数字当然不行啦 哼哼哼啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊 ',
@@ -2814,28 +3659,29 @@
showConfirmButton: false,
showDenyButton: true,
denyButtonText: '哼哼哼啊啊啊啊啊啊啊啊啊啊',
- ...swalDefault
});
message.info("成就:你触发了一个homo特有的彩蛋!");
await base.sleep(4000)
Swal.fire({
+ ...temp.swalDefault,
title: '1145141919810',
text: 'homo特有的数字当然不行啦...吗?',
icon: 'question',
imageUrl: 'https://lh1.hetaousercontent.com/img/7d4c1c0b4adb0e95.jpg',
showConfirmButton: false,
allowOutsideClick: false,
- ...swalDefault
});
await base.sleep(3000)
- base.setValue('setting_init_code', config.base.num);
- base.setValue('setting_init_license', config.base.license);
+ let list = base.getValue("setting_init");
+ list.code = config.base.num;
+ list.license = config.base.license;
+ base.setValue("setting_init", list);
message.success("成就:哼哼哼啊啊啊啊啊啊啊啊地注入成功(喜)");
await base.sleep(1500)
location.reload();
} else {
console.log("【LinkSwift】\n暗号错误")
- await this.initDialog();
+ await this.showInitDialog();
return;
};
}
@@ -2852,20 +3698,28 @@
*/
showMainDialog(title, html, footer) {
Swal.fire({
+ ...temp.swalDefault,
title,
html,
- footer: `${footer} `,
- customClass,
- confirmButtonText: '关闭',
+ footer: `${footer}${config.base.dom.footer}`,
+ customClass: {
+ popup: 'pl-popup',
+ header: 'pl-header',
+ title: 'pl-title',
+ closeButton: 'pl-close',
+ content: 'pl-content',
+ input: 'pl-input',
+ footer: 'pl-footer'
+ },
+ confirmButtonText: ` 关闭`,
showCloseButton: true,
allowOutsideClick: false,
allowEscapeKey: false,
allowEnterKey: false,
- willClose: function () {
+ willClose: () => {
base._resetAllData();
},
- ...swalDefault
- }).then(function () {
+ }).then(() => {
base._resetAllData();
});
},
@@ -2881,53 +3735,98 @@
* @param {string} [controlKey] - 控制唯一性的键名,用于避免重复处理
*/
waitForKeyElements(selectorElem, actionFunction, bWaitOnce, iframeSelector, controlKey) {
- if (!this.waitForKeyElements.controlObj) {
- this.waitForKeyElements.controlObj = {};
- }
- if (!this.waitForKeyElements.instanceCounter) {
- this.waitForKeyElements.instanceCounter = 0;
+ // 初始化管理器
+ const manager = this.waitForKeyElements.manager || (
+ this.waitForKeyElements.manager = {
+ observers: new WeakMap(),
+ tasks: new Map(),
+ instanceCounter: 0
+ }
+ );
+
+ const targetDoc = iframeSelector
+ ? $(iframeSelector).get(0)?.contentDocument
+ : document;
+
+ if (!targetDoc) return; // 无效文档直接返回
+
+ // 生成唯一控制键
+ controlKey = controlKey || `wkfe_${manager.instanceCounter++}`;
+
+ // 清理重复任务
+ const existingTask = manager.tasks.get(controlKey);
+ if (existingTask) {
+ existingTask.observer.disconnect();
+ manager.tasks.delete(controlKey);
}
- let targetNodes;
- if (typeof iframeSelector === "undefined") {
- targetNodes = $(selectorElem);
- } else {
- targetNodes = $(iframeSelector).contents().find(selectorElem);
- }
+ // 创建MutationObserver回调
+ const processElements = () => {
+ const elements = $(selectorElem, targetDoc);
+ let foundActive = false;
- let controlKeyNew = controlKey || `wkfe_${this.waitForKeyElements.instanceCounter++}`;
- let btargetsFound = false;
- if (targetNodes && targetNodes.length > 0) {
- targetNodes.each(function () {
- let jThis = $(this);
- let alreadyFound = jThis.data(controlKeyNew) || false;
+ elements.each((i, el) => {
+ const jEl = $(el);
+ const isProcessed = jEl.data(controlKey);
- if (!alreadyFound) {
- var cancelFound = actionFunction(jThis);
- if (cancelFound) {
- btargetsFound = true;
- } else if (bWaitOnce) {
- jThis.data(controlKeyNew, true);
- }
+ if (isProcessed) return true; // 跳过已处理元素
+
+ const cancelAction = actionFunction(jEl);
+ if (cancelAction) {
+ foundActive = true;
+ } else if (bWaitOnce) {
+ jEl.data(controlKey, true); // 标记已处理
}
});
- }
- let controlObj = this.waitForKeyElements.controlObj;
- let timeControl = controlObj[controlKeyNew];
+ // 一次性任务且找到有效元素时清理
+ if (bWaitOnce && foundActive) {
+ observer.disconnect();
+ manager.tasks.delete(controlKey);
+ }
+ };
- if (btargetsFound && bWaitOnce && timeControl) {
- clearInterval(timeControl);
- delete controlObj[controlKeyNew];
- } else if (!timeControl) {
- timeControl = setInterval(() => {
- this.waitForKeyElements(selectorElem, actionFunction, bWaitOnce, iframeSelector, controlKeyNew);
- }, 1000);
- controlObj[controlKeyNew] = timeControl;
- }
+ // 创建Observer实例
+ const observer = new MutationObserver(processElements);
- this.waitForKeyElements.controlObj = controlObj;
+ // 配置并启动观察
+ observer.observe(targetDoc.documentElement, {
+ childList: true,
+ subtree: true,
+ attributes: true,
+ characterData: true
+ });
+
+ // 注册任务
+ manager.tasks.set(controlKey, {
+ observer,
+ targetDoc
+ });
+
+ // 立即执行初始检查
+ processElements();
},
+ /**
+ * 状态工厂
+ * @author 油小猴
+ * @author hmjz100
+ * @description 接受被监听的 DOM 元素的状态,根据状态确定元素是谁
+ * @param {Event} event - 元素状态
+ */
+ _EventFactory(event) {
+ let target = $(event.target);
+ let item = target.parents('.pl-item');
+ let link = item.find('.pl-item-link.enhance');
+ let directLink = item.find('.pl-item-link.normal');
+ let progress = item.find('.pl-item-progress');
+ let tip = item.find('.pl-item-tip');
+ let copy = item.find('.pl-item-copy');
+ let back = item.find('.pl-progress-back');
+ let stop = item.find('.pl-progress-stop');
+ return {
+ item, link, directLink, progress, tip, copy, back, stop, target,
+ };
+ }
};
/**
@@ -2946,7 +3845,7 @@
if (reg.test(location.href)) {
return location.href.match(reg)[0];
}
- return '';
+ return "";
},
setBDUSS(custom) {
@@ -2978,25 +3877,25 @@
},
getBDUSS() {
- doc.find('.loading-popup .loading-title').html(`凭证获取中`);
- doc.find('.loading-popup .swal2-html-container').html(`正在获取当前账号凭证~
`);
- let baiduyunPlugin_BDUSS = base.getStorage('baiduyunPlugin_BDUSS') ? base.getStorage('baiduyunPlugin_BDUSS') : { BDUSS: '' };
- return baiduyunPlugin_BDUSS.BDUSS || '';
+ temp.doc.find('.loading-popup .loading-title').html(`凭证获取中`);
+ temp.doc.find('.loading-popup .swal2-html-container').html(`正在获取当前账号凭证~
`);
+ let baiduyunPlugin_BDUSS = base.getStorage('baiduyunPlugin_BDUSS') ? base.getStorage('baiduyunPlugin_BDUSS') : { BDUSS: "" };
+ return baiduyunPlugin_BDUSS.BDUSS || "";
},
async getToken() {
try {
- doc.find('.loading-popup .loading-title').html(`令牌获取中`);
- doc.find('.loading-popup .swal2-html-container').html(`正在获取授权状态~
`);
+ temp.doc.find('.loading-popup .loading-title').html(`令牌获取中`);
+ temp.doc.find('.loading-popup .swal2-html-container').html(`正在获取授权状态~
`);
// 获取授权状态
- let authorize = await base.getFinalUrl(config.$baidu.api.getAccessToken);
+ let authorize = await base.getFinalUrl(config.$baidu.api.getAccessToken, undefined, true);
// 判断授权情况
if (authorize.includes('authorize')) {
// 没授权,先获取授权的页面
- doc.find('.loading-popup .loading-title').html(`授权获取中`);
- doc.find('.loading-popup .swal2-html-container').html(`正在获取授权页面~
`);
+ temp.doc.find('.loading-popup .loading-title').html(`授权获取中`);
+ temp.doc.find('.loading-popup .swal2-html-container').html(`正在获取授权页面~
`);
let html = await base.get(config.$baidu.api.getAccessToken, {}, 'text');
@@ -3012,43 +3911,43 @@
grant_permissions: "basic,netdisk"
};
- doc.find('.loading-popup .loading-title').html(`授权获取中`);
- doc.find('.loading-popup .swal2-html-container').html(`正在自动确认授权~
`);
+ temp.doc.find('.loading-popup .loading-title').html(`授权获取中`);
+ temp.doc.find('.loading-popup .swal2-html-container').html(`正在自动确认授权~
`);
// 发送请求达到自动进行授权
await base.post(config.$baidu.api.getAccessToken, base.stringify(data), {
'Content-Type': 'application/x-www-form-urlencoded',
});
// 再次获取授权状态
- let res2 = await base.getFinalUrl(config.$baidu.api.getAccessToken);
+ let res2 = await base.getFinalUrl(config.$baidu.api.getAccessToken, undefined, true);
let accessToken = res2.match(/access_token=([^&]+)/)?.[1];
if (!!accessToken) {
- doc.find('.loading-popup .loading-title').html(`令牌获取中`);
- doc.find('.loading-popup .swal2-html-container').html(`授权成功,令牌已缓存~
`);
+ temp.doc.find('.loading-popup .loading-title').html(`令牌获取中`);
+ temp.doc.find('.loading-popup .swal2-html-container').html(`授权成功,令牌已缓存~
`);
base.setValue('baidu_access_token', accessToken);
return accessToken;
} else {
- doc.find('.loading-popup .loading-title').html(`令牌获取中`);
- doc.find('.loading-popup .swal2-html-container').html(`授权失败,等待下一步操作~
`);
- return '';
+ temp.doc.find('.loading-popup .loading-title').html(`令牌获取中`);
+ temp.doc.find('.loading-popup .swal2-html-container').html(`授权失败,等待下一步操作~
`);
+ return "";
}
} else if (authorize.includes('access_token=')) {
let accessToken = authorize.match(/access_token=([^&]+)/)?.[1];
if (!!accessToken) {
- doc.find('.loading-popup .loading-title').html(`令牌获取中`);
- doc.find('.loading-popup .swal2-html-container').html(`授权成功,令牌已缓存~
`);
+ temp.doc.find('.loading-popup .loading-title').html(`令牌获取中`);
+ temp.doc.find('.loading-popup .swal2-html-container').html(`授权成功,令牌已缓存~
`);
base.setValue('baidu_access_token', accessToken);
return accessToken;
} else {
- doc.find('.loading-popup .loading-title').html(`令牌获取中`);
- doc.find('.loading-popup .swal2-html-container').html(`授权失败,等待下一步操作~
`);
- return '';
+ temp.doc.find('.loading-popup .loading-title').html(`令牌获取中`);
+ temp.doc.find('.loading-popup .swal2-html-container').html(`授权失败,等待下一步操作~
`);
+ return "";
}
} else {
- return '';
+ return "";
}
} catch (error) {
- return '';
+ return "";
}
},
@@ -3057,26 +3956,11 @@
防止代码因其他原因被执行多次
这段代码出自 Via轻插件,作者谷花泰
*/
- const key = encodeURIComponent('LinkSwift:百度网盘');
+ let key = encodeURIComponent('LinkSwift:百度网盘');
if (window[key]) return;
window[key] = true;
- function _factory(e) {
- let target = $(e.target);
- let item = target.parents('.pl-item');
- let link = item.find('.pl-item-link.blob');
- let directLink = item.find('.pl-item-link.browser');
- let progress = item.find('.pl-item-progress');
- let tip = item.find('.pl-item-tip');
- let copy = item.find('.pl-item-copy');
- let back = item.find('.pl-progress-back');
- let stop = item.find('.pl-progress-stop');
- return {
- item, link, directLink, progress, tip, copy, back, stop, target,
- };
- }
-
- doc.on('mouseenter mouseleave click', '.pl-button.g-dropdown-button', function (e) {
+ temp.doc.on('mouseenter mouseleave click', '.pl-button.g-dropdown-button', function (e) {
if (e.type === 'mouseleave') {
$(e.currentTarget).removeClass('button-open');
} else {
@@ -3084,40 +3968,37 @@
$(e.currentTarget).find('.pl-dropdown-menu').show();
}
});
- doc.on('mouseleave', '.pl-button.g-dropdown-button .pl-dropdown-menu', function (e) {
+ temp.doc.on('mouseleave', '.pl-button.g-dropdown-button .pl-dropdown-menu', function (e) {
$(e.currentTarget).hide();
});
- doc.on('click', '.pl-button-mode', function (e) {
- mode = e.target.dataset.mode;
- if (!mode) return;
+ temp.doc.on('click', '.pl-button-mode', async function (e) {
+ temp.mode = e.currentTarget.dataset.mode;
+ if (!temp.mode) return;
$baidu.getLink();
});
- doc.on('click', '.pl-button-save', async function (e) {
+
+ temp.doc.on('click', '.pl-button-save', async function (e) {
e.preventDefault();
- selectList = $baidu.getSelectedList();
- if (selectList.length === 0) {
+ temp.selectList = $baidu.getSelectedList();
+ if (temp.selectList.length === 0) {
return message.error('提示: 请勾选要保存到网盘的文件哦~');
}
message.info('提示: 因网盘限制,请保存到自己网盘后再去下载哦~');
await base.sleep(500);
document.querySelector('.tools-share-save-hb').click();
});
- doc.on('click', '.listener-link-api.browser', async function (e) {
- e.preventDefault();
- let dataset = e.currentTarget.dataset;
- let href = dataset.link;
- $('#downloadIframe').attr('src', href);
- });
- doc.on('click', '.listener-link-api.blob', async function (e) {
+
+ temp.doc.on('click', '.listener-api-download.enhance', async function (e) {
e.preventDefault();
- const o = _factory(e);
- const $width = o.item.find('.pl-progress-inner');
- const $text = o.item.find('.pl-progress-inner-text');
- const filename = o.link[0].dataset.filename;
- const index = o.link[0].dataset.index;
- const size = Number(o.link[0].dataset.size) || 0;
+ let o = base._EventFactory(e);
+ let $width = o.item.find('.pl-progress-inner');
+ let $text = o.item.find('.pl-progress-inner-text');
+ let filename = o.link[0].dataset.filename;
+ let index = o.link[0].dataset.index;
+ let size = Number(o.link[0].dataset.size) || 0;
+ let originalHtml = o.link.html();
base._resetData(index);
base.get(o.link[0].dataset.link, { "User-Agent": config.$baidu.api.ua.downloadLink }, 'blob', { filename, index });
@@ -3126,9 +4007,9 @@
let prevLoaded = 0;
let prevTime = startTime;
- ins[index] = setInterval(async function () {
- const prog = +progress[index] || 0;
- const isIDM = !!idm[index];
+ temp.ins[index] = setInterval(async () => {
+ let prog = +temp.progress[index] || 0;
+ let isIDM = !!temp.idm[index];
if (isIDM) {
// IDM 捕获处理逻辑
@@ -3141,24 +4022,24 @@
.animate({ opacity: '0.5' }, "slow")
.show();
- clearInterval(ins[index]);
+ clearInterval(temp.ins[index]);
await base.sleep(2000);
- o.link.text('增强下载(基于浏览器文件流)').animate({ opacity: '1' }, "slow");
- idm[index] = false;
+ o.link.html(originalHtml).animate({ opacity: '1' }, "slow");
+ temp.idm[index] = false;
return;
}
- const currentTime = Date.now();
- const elapsedTime = currentTime - startTime;
- const loaded = prog * size / 100;
- const timeDiff = Math.max(currentTime - prevTime, 1); // 避免除零
- const speed = ((loaded - prevLoaded) / (timeDiff / 1000)) || 0;
+ let currentTime = Date.now();
+ let elapsedTime = currentTime - startTime;
+ let loaded = prog * size / 100;
+ let timeDiff = Math.max(currentTime - prevTime, 1); // 避免除零
+ let speed = ((loaded - prevLoaded) / (timeDiff / 1000)) || 0;
// 计算剩余时间(保护除零)
- const totalProgress = Math.max(prog / 100, 0.01);
- const totalElapsedSeconds = elapsedTime / 1000;
- const estTotalTime = totalElapsedSeconds / totalProgress;
- const remainingTime = estTotalTime - totalElapsedSeconds;
+ let totalProgress = Math.max(prog / 100, 0.01);
+ let totalElapsedSeconds = elapsedTime / 1000;
+ let estTotalTime = totalElapsedSeconds / totalProgress;
+ let remainingTime = estTotalTime - totalElapsedSeconds;
// 更新界面状态
o.link.hide();
@@ -3179,124 +4060,66 @@
// 下载完成
if (prog >= 100) {
await base.sleep(1000);
- clearInterval(ins[index]);
- progress[index] = 0;
+ clearInterval(temp.ins[index]);
+ temp.progress[index] = 0;
o.item.find('.pl-progress-stop').hide();
$text.text('下载完成~ 浏览器下载框应该弹出来了哦~');
o.back.show();
await base.sleep(3000);
- o.link.text('增强下载(基于浏览器文件流)').animate({ opacity: '1' }, "slow");
+ o.link.html(originalHtml).animate({ opacity: '1' }, "slow");
}
}, 500);
});
- doc.on('click', '.listener-retry', async function (e) {
- let o = _factory(e);
- o.tip.hide();
- o.link.show();
- o.directLink.show();
- });
- doc.on('click', '.listener-stop', async function (e) {
- let o = _factory(e);
- let index = o.link[0].dataset.index;
- if (request[index]) {
- request[index].abort();
- clearInterval(ins[index]);
- o.item.find('.pl-progress-inner-text').text('正在取消...');
- o.item.find('.pl-progress-inner').css('width', 100 + '%');
- setTimeout(function () {
- o.tip.hide();
- o.back.hide();
- o.link.show();
- o.directLink.show();
- o.copy.show();
- o.progress.hide();
- o.stop.hide();
- }, 1050)
- }
- });
- doc.on('click', '.listener-back', async function (e) {
- let o = _factory(e);
- o.progress.hide();
- o.tip.hide();
- o.link.show();
- o.directLink.show();
- o.copy.show();
- o.stop.hide();
- o.back.hide();
- });
- doc.on('click', '.listener-download-all', function (e) {
- $('.pl-item-link.blob').each(function () {
- if ($(this).css('display') !== 'none') {
- $(this).click();
- }
- });
- $(e.target).text('下载开始,下载进度见上方按钮哦~').animate({ opacity: '0.5' }, "slow");
- setTimeout(function () {
- $(e.target).text('全部增强下载').animate({ opacity: '1' }, "slow");
- }, 2000)
- });
- doc.on('click', '.listener-link-aria, .listener-copy-all', function (e) {
- e.preventDefault();
- if (!e.target.dataset.link) {
- $(e.target).removeClass('listener-copy-all').addClass('pl-btn-danger').html(`${config.base.assistant.message}👉点击此处安装 👈`);
- } else {
- base.setClipboard(decodeURIComponent(e.target.dataset.link));
- $(e.target).text('复制成功').animate({ opacity: '0.5' }, "slow");
- setTimeout(
- function () {
- $(e.target).text('重新复制').animate({ opacity: '1' }, "slow");
- }, 2000
- )
- }
- });
- doc.on('click', '.listener-link-rpc', async function (e) {
+
+ temp.doc.on('click', '.listener-aria2-download', async function (e) {
let target = $(e.currentTarget);
- target.find('.icon-rpc-devices').remove();
+ if (target.attr('data-processing') === 'true') return;
+ target.attr('data-processing', 'true');
+ let originalHtml = target.html();
+
+ target.find(".pl-icon").remove();
target.find('.pl-loading').remove();
target.prepend(base.createLoading());
let BDUSS = $baidu.getBDUSS();
- let res = await base.sendLinkToRPC(e.currentTarget.dataset.link, e.currentTarget.dataset.filename, [`User-Agent: ${config.$baidu.api.ua.downloadLink}`, `Cookie: BDUSS=${BDUSS}`]);
+ let res = await base.sendLinkToAria2(target.data("link"), target.data("filename"), [`User-Agent:${config.$baidu.api.ua.downloadLink}`, `Cookie:BDUSS=${BDUSS}`]);
if (res === 'success') {
- $('.listener-rpc-task').show();
- target.removeClass('pl-btn-danger').html('发送成功了!快去看看吧~').animate({ opacity: '0.5' }, "slow");
- } else if (res === 'assistant') {
- target.addClass('pl-btn-danger').html(`${config.base.assistant.message}👉点击此处安装 👈`);
+ target.removeClass('pl-btn-danger').html('发送成功啦!快去看看吧~').animate({ opacity: '0.5' }, "slow");
} else {
- target.addClass('pl-btn-danger').text('发送失败,检查一下您的RPC配置信息哦!').animate({ opacity: '0.5' }, "slow");
+ target.addClass('pl-btn-danger').text('发送失败,检查一下您的配置信息哦!').animate({ opacity: '0.5' }, "slow");
}
+
+ await base.sleep(3000);
+ target.removeClass('pl-btn-danger').removeAttr('data-processing').html(originalHtml).css('opacity', "");
});
- doc.on('click', '.listener-send-rpc', function (e) {
- $('.listener-link-rpc').click();
- $(e.target).text('发送完成,发送结果见上方按钮哦~').animate({ opacity: '0.5' }, "slow");
- });
- doc.on('click', '.listener-open-setting', function () {
- base.showSetting();
- });
- doc.on('click', '.listener-open-updatelog', function () {
- base.showUpdate();
- });
- doc.on('click', '.listener-open-beautify', function () {
- base.showBeautify();
- });
- doc.on('click', '.listener-rpc-task', function (e) {
- e.preventDefault();
- let rpc = JSON.stringify({
- domain: base.getValue('setting_rpc_domain'),
- port: base.getValue('setting_rpc_port'),
- }), url = `${config.base.service.rpc}/?rpc=${base.encodeBase(rpc)}#${base.getValue('setting_rpc_token')}`;
- GM_openInTab(url, { active: true });
- });
- document.documentElement.addEventListener('mouseup', function (e) {
- if (e.target.nodeName === 'A' && ~e.target.className.indexOf('pl-a')) {
- e.stopPropagation();
+
+ temp.doc.on('click', '.listener-bitcomet-download', async function (e) {
+ let target = $(e.currentTarget);
+
+ if (target.attr('data-processing') === 'true') return;
+ target.attr('data-processing', 'true');
+ let originalHtml = target.html();
+
+ target.find(".pl-icon").remove();
+ target.find('.pl-loading').remove();
+ target.prepend(base.createLoading());
+
+ let BDUSS = $baidu.getBDUSS();
+ let res = await base.sendLinkToBitcomet(target.data("link"), target.data("filename"), { "user_agent": config.$baidu.api.ua.downloadLink, "cookie": `BDUSS=${BDUSS}` });
+ if (res === 'success') {
+ target.removeClass('pl-btn-danger').html('发送成功啦!快去看看吧~').animate({ opacity: '0.5' }, "slow");
+ } else {
+ target.addClass('pl-btn-danger').text('发送失败,检查一下您的配置信息哦!').animate({ opacity: '0.5' }, "slow");
}
- }, true);
+
+ await base.sleep(3000);
+ target.removeClass('pl-btn-danger').removeAttr('data-processing').html(originalHtml).css('opacity', "");
+ });
},
greenerPage() {
- page = $baidu.detectPage();
+ temp.pege = $baidu.detectPage();
base.waitForKeyElements(".wp-s-header-user__vip-center", function (tag) {
tag.remove();
}, true);
@@ -3402,8 +4225,8 @@
tag.attr("linked", true)
}, true);
base.waitForKeyElements('dd[node-type="header-link"]', function (tag) {
- tag.children().each(function () {
- let tag = $(this);
+ tag.children().each((index, element) => {
+ let tag = $(element);
if (!tag.attr("node-type")) return;
let type = tag.attr("node-type");
if (
@@ -3420,7 +4243,7 @@
添加我的电脑
-
+
`);
}, true)
// 美化分享页面
- if (page === 'share') {
+ if (temp.pege === 'share') {
base.waitForKeyElements(`iframe[src^="/buy/ad"]`, function (tag) {
tag.fadeOut();
}, true)
base.addStyle(`${mount}-baiduShare`, 'style', `
- body, .theme-white.init-new, #layoutApp {
- background-color: #DCEFFE !important;
- background: #DCEFFE url(https://nd-static.bdstatic.com/m-static/disk-share/widget/pageModule/init-new/image/init-bg_1708266.png) no-repeat center center;
+ body, .theme-white.init-new, #layoutApp{
+ background-color:#DCEFFE!important;
+ background:#DCEFFE url(https://nd-static.bdstatic.com/m-static/disk-share/widget/pageModule/init-new/image/init-bg_1708266.png) no-repeat center center;
}
- #bd-main .bd-left {
- background: #ffffffC0;
- border-radius: 10px;
+ #bd-main .bd-left{
+ background:#ffffffC0;
+ border-radius:10px;
}
- iframe[src="/buy/ad/home"] {
- display: none !important;
+ iframe[src="/buy/ad/home"]{
+ display:none!important;
}
`, `.${mount}`);
base.waitForKeyElements(`.KPDwCE`, function (tag) {
@@ -3462,92 +4285,79 @@
addButton() {
base.waitForKeyElements(config.$baidu.mount.home, (element) => {
- page = $baidu.detectPage();
- if ($(".pl-button").length > 0 || !page || page !== 'home') return;
+ temp.pege = $baidu.detectPage();
+ if ($(".pl-button").length > 0 || !temp.pege || temp.pege !== 'home') return;
let $button = $(`
-