diff --git a/torn-trans-zhcn.user.js b/torn-trans-zhcn.user.js index a68fb72..567c290 100644 --- a/torn-trans-zhcn.user.js +++ b/torn-trans-zhcn.user.js @@ -1,8 +1,8 @@ // ==UserScript== -// @lastmodified 202201161732 +// @lastmodified 202201161843 // @name Torn翻译 // @namespace WOOH -// @version 0.2.0116a +// @version 0.2.0116b // @description Torn UI翻译 // @author Woohoo-[2687093] sabrina_devil[2696209] // @match https://www.torn.com/* @@ -15,13 +15,18 @@ ___window___.WHTRANS = true; const CC_set = /[\u4e00-\u9fa5]/; - const version = '0.2.0116a'; + const version = '0.2.0116b'; const changelist = [ { todo: true, cont: `翻译:baza npc商店、imarket、imarket搜索结果`, }, + { + ver: '0.2.0116b', + date: '20220116', + cont: `小窗口快速crime手机版错误修复`, + }, { ver: '0.2.0116a', date: '20220116', @@ -3343,7 +3348,9 @@ const cIframe = $popup.querySelector('iframe'); - const dom = `
快捷操作:
+ const mobile_prepend_node = document.createElement('div'); + mobile_prepend_node.classList.add('wh-translate'); + mobile_prepend_node.innerHTML = `
快捷操作:
@@ -3358,7 +3365,7 @@ -

` +

`; cIframe.onload = () => { const ifDocu = cIframe.contentWindow.document; @@ -3366,8 +3373,8 @@ const loading_node = $popup.querySelector('p'); window.whifdocu = ifDocu; if (!!loading_node) loading_node.remove(); - // console.log(ifDocu) cIframe.style.display = 'block'; + // 如果iframe内部未运行脚本 if (ifWH === undefined) { // 隐藏顶部 elementReady('#header-root', ifDocu).then(e => e.style.display = 'none'); @@ -3380,7 +3387,7 @@ // 调整容器位置 elementReady('.content-wrapper', ifDocu).then(e => { // 加入 - e.prepend(dom); + e.prepend(mobile_prepend_node); e.style.margin = '0px'; e.style.position = 'absolute'; e.style.top = '-35px';