${userComment}
${newUserCommentHTML}// ==UserScript== // @name 【移动端】百度系优化 // @icon https://www.baidu.com/favicon.ico // @namespace https://greasyfork.org/zh-CN/scripts/418349 // @supportURL https://github.com/WhiteSevs/TamperMonkeyScript/issues // @version 2024.3.12 // @author WhiteSevs // @run-at document-start // @description 用于【移动端】的百度系列产品优化,包括【百度搜索】、【百家号】、【百度贴吧】、【百度文库】、【百度经验】、【百度百科】、【百度知道】、【百度翻译】、【百度图片】、【百度地图】、【百度好看视频】、【百度爱企查】、【百度问题】、【百度识图】等 // @match *://*.baidu.com/* // @match *://www.tieba.com/* // @match *://uf9kyh.smartapps.cn/* // @connect www.baidu.com // @connect m.baidu.com // @connect tieba.baidu.com // @connect www.tieba.com // @connect baike.baidu.com // @connect chat.baidu.com // @connect chat-ws.baidu.com // @grant GM_addStyle // @grant GM_registerMenuCommand // @grant GM_unregisterMenuCommand // @grant GM_getValue // @grant GM_setValue // @grant GM_deleteValue // @grant GM_xmlhttpRequest // @grant GM_info // @grant unsafeWindow // @require https://update.greasyfork.org/scripts/449471/1305484/Viewer.js // @require https://update.greasyfork.org/scripts/462234/1322684/Message.js // @require https://update.greasyfork.org/scripts/456485/1341796/pops.js // @require https://update.greasyfork.org/scripts/455186/1341797/WhiteSevsUtils.js // @require https://update.greasyfork.org/scripts/465772/1341795/DOMUtils.js // @require https://update.greasyfork.org/scripts/488179/1332779/showdown.js // @downloadURL none // ==/UserScript== (function () { if(typeof unsafeWindow === "undefined"){ unsafeWindow = globalThis; } /** * 是否为调试模式 */ const DEBUG = false; /** * @type {import("../库/pops")} */ const pops = window.pops; /** * @type {import("../库/Viewer")} */ const Viewer = window.Viewer; /** * @type {import("../库/Qmsg")} */ const Qmsg = window.Qmsg; /** * @type {import("../库/Utils")} */ const utils = window.Utils.noConflict(); /** * @type {import("../库/DOMUtils")} */ const DOMUtils = window.DOMUtils.noConflict(); /** * @type {import("../库/showdown")} */ const showdown = window.showdown; const log = new utils.Log(GM_info, unsafeWindow.console || console); log.config({ debug: DEBUG, logMaxCount: 20000, autoClearConsole: true, tag: true, }); const httpx = new utils.Httpx(GM_xmlhttpRequest); httpx.config({ logDetails: DEBUG, onabort() { Qmsg.warning("请求取消"); }, ontimeout() { Qmsg.error("请求超时"); }, onerror(response) { Qmsg.error("请求异常"); log.error(["httpx-onerror 请求异常", response]); }, }); Qmsg.config({ position: "bottom", html: true, maxNums: 5, autoClose: true, showClose: false, showReverse: true, }); /** * 菜单对象 */ let GM_Menu = new utils.GM_Menu({ GM_getValue, GM_setValue, GM_registerMenuCommand, GM_unregisterMenuCommand, }); class LoadingView { /** * * @param {boolean} withIcon 是否添加icon * @param {boolean} isEnd icon是否添加在后面 */ constructor(withIcon, isEnd) { this.config = { className: "whitesev-load-view", textClassName: "whitesev-load-view-text", iconClassName: "whitesev-load-view-icon", outSideClassName: "whitesev-load-view-icon-outside", withInClassName: "whitesev-load-view-icon-within", }; /** * @type {?HTMLElement} */ this.loadingViewElement = null; this.loadingViewHTML = `
${_pageText_}
${userComment}
${newUserCommentHTML}${time}
文心一言
", position: "center", html: true, }, content: { text: "", }, mask: { enable: true, clickEvent: { toHide: true, }, }, btn: { close: { enable: true, callback(event) { event.hide(); }, }, }, drag: true, dragLimit: true, width: "95vw", height: "90vh", style: ` .pops{ --container-title-height: 45px; --container-bottom-btn-height: 100px; --gpt-bg-color: #ffffff; --gpt-border-radius: 4px; } .pops-alert-content{ background: #ECEAF7; } .pops-alert-btn .ask-question{ width: 100%; height: 100%; display: flex; align-items: center; } .pops-alert-btn .ask-question textarea{ width: inherit; height: inherit; } .pops-alert-btn .ask-question textarea { vertical-align: bottom; position: relative; display: block; resize: none; padding: 5px 11px; line-height: 1.5; box-sizing: border-box; font-size: 16px; font-family: inherit; background-color: var(--gpt-bg-color); background-image: none; -webkit-appearance: none; appearance: none; box-shadow: 0 0 0 1px #dcdfe6 inset; border-radius: 0; transition: box-shadow .2s cubic-bezier(.645, .045, .355, 1); border: none; } .pops-alert-btn .ask-question textarea:hover{box-shadow:0 0 0 1px #c0c4cc inset} .pops-alert-btn .ask-question textarea:focus{outline:0;box-shadow:0 0 0 1px #409eff inset} .ask-container{ } .ask-container .user-question, .ask-container .gpt-answer{ display: flex; margin: 10px 10px; } .ask-container .user-question{ } .ask-container .gpt-answer{ } .ask-container .avatar-img{ } .ask-container .avatar-img img{ width: 30px; height: 30px; border-radius: 6px; background: var(--gpt-bg-color); } .ask-container .ask-text, .ask-container .answer-text{ background: var(--gpt-bg-color); border-radius: var(--gpt-border-radius); padding: 10px; margin-left: 10px; text-align: left; } .ask-container .ask-text{ width: auto; } .ask-container .answer-text{ } .ask-container .answer-text *{ text-wrap: wrap; } .gpt-btn-control{ display: flex; flex-direction: column; } .gpt-btn-control .pops-alert-btn-clear-history{ margin-bottom: 5px; } .gpt-btn-control .pops-alert-btn-ok{ margin-top: 5px; } .markdown-body .code-header{ align-items: center; background: #e3e8f6; border-radius: 7px 7px 0 0; display: flex; height: 34px; } .markdown-body .code-header+pre{ border-top-left-radius: 0px; border-top-right-radius: 0px; } .markdown-body span.code-lang{ color: #120649; flex: 1 0 auto; font-family: PingFangSC-Semibold; font-size: 16px; font-weight: 600; letter-spacing: 0; padding-left: 14px; text-align: justify; display: flex; } .markdown-body span.code-copy{ align-items: center; color: #7886a4; display: flex; font-family: PingFangSC-Regular; font-size: 13px; font-weight: 400; letter-spacing: 0; line-height: 14px; text-align: justify; user-select: none; } .markdown-body span.code-copy-text{ margin-left: 7px; margin-right: 20px; } .typing::after { content: '▌'; } .typing::after { animation: blinker 1s step-end infinite; } @keyframes blinker { 0% { visibility: visible; } 50% { visibility: hidden; } 100% { visibility: visible; } } `, }); YiYan.loadCSS( "https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/5.5.1/github-markdown.min.css" ); let $alertBtn = YiYan.dialogAlias.popsElement.querySelector(".pops-alert-btn"); $alertBtn.innerHTML = `