修复逻辑错误
This commit is contained in:
parent
4010b3e9db
commit
f72f2cbf06
@ -1,7 +1,7 @@
|
||||
// ==UserScript==
|
||||
// @name Torn翻译
|
||||
// @namespace WOOH
|
||||
// @version 0.1.1105a
|
||||
// @version 0.1.1106a
|
||||
// @description UI翻译
|
||||
// @author Woohoo-[2687093] sabrina_devil[2696209]
|
||||
// @match https://www.torn.com/*
|
||||
@ -180,14 +180,6 @@
|
||||
'Info':'信息',
|
||||
'Buy':'购买',
|
||||
};
|
||||
|
||||
titleTrans();
|
||||
|
||||
/**
|
||||
* 飞行
|
||||
*/
|
||||
if (window.location.href.indexOf('index.php') >= 0 &&
|
||||
$('.travelling h4').length !== 0) {
|
||||
const travelingDict = { // todo jsonify
|
||||
'Recruit Citizens': '招募玩家',
|
||||
'Events': '事件',
|
||||
@ -214,6 +206,14 @@
|
||||
"\nAt one point a Dual Wield Melee course was available at Torn City College for a fee of $50,000,000, but this was discontinued when Torn's citizens realized they were effectively paying to learn how to hold two things at once.\t": "托恩城市学院一度开设了双持近战课程,收费50,000,000美元,但当托恩的市民意识到他们实际上是在花钱学习如何同时持有两样东西时,这个课程就停止了。"
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 飞行
|
||||
*/
|
||||
if (window.location.href.indexOf('index.php') >= 0 &&
|
||||
$('.travelling h4').length !== 0) {
|
||||
titleTrans();
|
||||
|
||||
//如果在飞行页面
|
||||
if ($('span.remaining-time').length !== 0) {
|
||||
$('#skip-to-content')[0].firstChild.nodeValue = '飞行中';
|
||||
@ -340,6 +340,8 @@
|
||||
*/
|
||||
if (window.location.href.indexOf('index.php') >= 0 &&
|
||||
$('h4#skip-to-content').text().indexOf('Home') >= 0) {
|
||||
titleTrans();
|
||||
|
||||
let homeEvents = null;
|
||||
|
||||
$('h5.box-title').each((i, e) => {
|
||||
@ -371,6 +373,7 @@
|
||||
window.location.href.indexOf('personals.php') >= 0 ||
|
||||
window.location.href.indexOf('bounties.php') >= 0 ||
|
||||
window.location.href.indexOf('comics.php') >= 0) {
|
||||
titleTrans();
|
||||
let newspaperMenuOB = new MutationObserver(newspaperFunc);
|
||||
const isOnBountyPage = window.location.href.indexOf('bounties.php') >= 0;
|
||||
|
||||
@ -408,6 +411,7 @@
|
||||
* npc买房
|
||||
*/
|
||||
if (window.location.href.indexOf('estateagents.php') >= 0) {
|
||||
titleTrans();
|
||||
contentTitleLinksTrans();
|
||||
|
||||
return;
|
||||
@ -420,6 +424,7 @@
|
||||
const propertyOB=new MutationObserver(()=>{
|
||||
propertyOB.disconnect();
|
||||
|
||||
titleTrans();
|
||||
contentTitleLinksTrans();
|
||||
|
||||
// 黑框标题
|
||||
@ -468,6 +473,7 @@
|
||||
* 通知
|
||||
*/
|
||||
if (window.location.href.indexOf('events.php') >= 0) {
|
||||
titleTrans();
|
||||
let events;
|
||||
const eventMutation = new MutationObserver(() => {
|
||||
eventMutation.disconnect();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user