gym页面bug修复
This commit is contained in:
parent
f88e140655
commit
e190a5cb89
@ -25,9 +25,9 @@
|
|||||||
'Classified Ads': '分类广告',
|
'Classified Ads': '分类广告',
|
||||||
'Properties': '房产',
|
'Properties': '房产',
|
||||||
'City': '城市',
|
'City': '城市',
|
||||||
'Education':'教育',
|
'Education': '教育',
|
||||||
'Gym':'健身房',
|
'Gym': '健身房',
|
||||||
'Biology Modules':'生物学课程',
|
'Biology Modules': '生物学课程',
|
||||||
};
|
};
|
||||||
const titleLinksDict = {
|
const titleLinksDict = {
|
||||||
'Personal stats': '个人统计信息',
|
'Personal stats': '个人统计信息',
|
||||||
@ -38,7 +38,7 @@
|
|||||||
'City': '城市',
|
'City': '城市',
|
||||||
'Back to Estate Agents': '返回地产中介',
|
'Back to Estate Agents': '返回地产中介',
|
||||||
'Tutorial': '教程',
|
'Tutorial': '教程',
|
||||||
'Back to Education':'返回',
|
'Back to Education': '返回',
|
||||||
};
|
};
|
||||||
const sidebarDict = { // todo 从json加载
|
const sidebarDict = { // todo 从json加载
|
||||||
'Money': '现金',
|
'Money': '现金',
|
||||||
@ -261,15 +261,15 @@
|
|||||||
'Sort by:': '分类排序方式:',
|
'Sort by:': '分类排序方式:',
|
||||||
'Area': '地区',
|
'Area': '地区',
|
||||||
};
|
};
|
||||||
const gymDict={
|
const gymDict = {
|
||||||
'Strength':'力量 STR',
|
'Strength': '力量 STR',
|
||||||
'STR':'力量 STR',
|
'STR': '力量 STR',
|
||||||
'TRAIN':'锻炼',
|
'TRAIN': '锻炼',
|
||||||
'Welcome to':'欢迎来到 ',
|
'Welcome to': '欢迎来到 ',
|
||||||
'!':'!',
|
'!': '!',
|
||||||
'You walk into the gym and begin browsing the exercises available.':
|
'You walk into the gym and begin browsing the exercises available.':
|
||||||
'你走进健身房,开始浏览可用的健身器材。',
|
'你走进健身房,开始浏览可用的健身器材。',
|
||||||
'You have':'你有',
|
'You have': '你有',
|
||||||
'available to use.': '可用于锻炼。',
|
'available to use.': '可用于锻炼。',
|
||||||
'energy': '能量',
|
'energy': '能量',
|
||||||
'Estimated Energy progress:': '(TornTools) 预估健身房解锁进程:',
|
'Estimated Energy progress:': '(TornTools) 预估健身房解锁进程:',
|
||||||
@ -278,7 +278,6 @@
|
|||||||
'ACTIVATE MEMBERSHIP': '激活会员身份',
|
'ACTIVATE MEMBERSHIP': '激活会员身份',
|
||||||
'BUY MEMBERSHIP': '购买健身房会员',
|
'BUY MEMBERSHIP': '购买健身房会员',
|
||||||
'Cancel': '返回',
|
'Cancel': '返回',
|
||||||
//'Damage you make on impact':'',
|
|
||||||
'Chance of hitting opponent': '击中对手的概率',
|
'Chance of hitting opponent': '击中对手的概率',
|
||||||
"Ability to withstand damage": "承受伤害的能力",
|
"Ability to withstand damage": "承受伤害的能力",
|
||||||
"Damage you make on impact": "攻击时造成的伤害",
|
"Damage you make on impact": "攻击时造成的伤害",
|
||||||
@ -289,23 +288,24 @@
|
|||||||
'Boxing': '拳击',
|
'Boxing': '拳击',
|
||||||
'Are you sure you would like to buy this membership?': '确定购买这个健身房会员吗?',
|
'Are you sure you would like to buy this membership?': '确定购买这个健身房会员吗?',
|
||||||
'Not Available': '不可用',
|
'Not Available': '不可用',
|
||||||
|
'Unavailable': '不可用',
|
||||||
};
|
};
|
||||||
const eduDict={
|
const eduDict = {
|
||||||
'Biology':'生物学',
|
'Biology': '生物学',
|
||||||
'Biology Modules':'生物学课程',
|
'Biology Modules': '生物学课程',
|
||||||
'Introduction to Biochemistry':'生物化学概论',
|
'Introduction to Biochemistry': '生物化学概论',
|
||||||
'You do not meet the requirements for this course. Please complete the prerequisites first.':
|
'You do not meet the requirements for this course. Please complete the prerequisites first.':
|
||||||
'你不符合本课程的要求。请先学习前置课程。',
|
'你不符合本课程的要求。请先学习前置课程。',
|
||||||
'Description:':'描述:',
|
'Description:': '描述:',
|
||||||
'Learning outcomes:':'学习后可获得:',
|
'Learning outcomes:': '学习后可获得:',
|
||||||
'Prerequisites:':'前置课程:',
|
'Prerequisites:': '前置课程:',
|
||||||
'Parameters:':'课程参数:',
|
'Parameters:': '课程参数:',
|
||||||
'As the ultimate module - you will focus on maximum gym gain with the least amount of input.':'',
|
'As the ultimate module - you will focus on maximum gym gain with the least amount of input.': '',
|
||||||
'Ability to withdraw and deliver blood':'抽取和输送血液的能力(使用血包)',
|
'Ability to withdraw and deliver blood': '抽取和输送血液的能力(使用血包)',
|
||||||
'Gain {$1} {$2} upon completion':'获得{$1}点{$2}',
|
'Gain {$1} {$2} upon completion': '获得{$1}点{$2}',
|
||||||
'intelligence':'智力(INT)',
|
'intelligence': '智力(INT)',
|
||||||
'endurance':'耐心(END)',
|
'endurance': '耐心(END)',
|
||||||
'manual labor':'体力(MAN)',
|
'manual labor': '体力(MAN)',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -485,7 +485,6 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* city
|
* city
|
||||||
*/
|
*/
|
||||||
@ -571,73 +570,80 @@
|
|||||||
function gymTrans() {
|
function gymTrans() {
|
||||||
titleTrans();
|
titleTrans();
|
||||||
contentTitleLinksTrans();
|
contentTitleLinksTrans();
|
||||||
const gymName=$('div[class^="notificationText"] b').text();
|
const gymName = $('div[class^="notificationText"] b').text();
|
||||||
|
|
||||||
// 顶部提示信息
|
// 顶部提示信息
|
||||||
$('div[class^="notificationText"] p').contents().each((i,e)=>{
|
$('div[class^="notificationText"] p').contents().each((i, e) => {
|
||||||
if(e.childNodes.length===0 && gymDict[e.nodeValue.trim()])
|
if (e.childNodes.length === 0 && gymDict[e.nodeValue.trim()])
|
||||||
e.nodeValue=gymDict[e.nodeValue.trim()];
|
e.nodeValue = gymDict[e.nodeValue.trim()];
|
||||||
});
|
});
|
||||||
// 4属性标题
|
// 4属性标题
|
||||||
$('h3[class^="title"]').each((i,e)=>{
|
$('h3[class^="title"]').each((i, e) => {
|
||||||
if (gymDict[$(e).text().trim()])
|
if (gymDict[$(e).text().trim()])
|
||||||
$(e).text(gymDict[$(e).text().trim()]);
|
$(e).text(gymDict[$(e).text().trim()]);
|
||||||
});
|
});
|
||||||
// 4属性的介绍 与冰蛙冲突
|
// 4属性的介绍 与冰蛙冲突
|
||||||
$('div[class^="description"] p:nth-child(1)').each((i,e)=>{
|
$('div[class^="description"] p:nth-child(1)').each((i, e) => {
|
||||||
if (gymDict[$(e).text().trim()])
|
if (gymDict[$(e).text().trim()])
|
||||||
$(e).text(gymDict[$(e).text().trim()]);
|
$(e).text(gymDict[$(e).text().trim()]);
|
||||||
});
|
});
|
||||||
// 每次锻炼的花销
|
// 每次锻炼的花销
|
||||||
// $('div[class^="description"] p:nth-child(2)').each((i,e)=>{
|
$('div[class^="description"] p:nth-child(2)').each((i, e) => {
|
||||||
// const energyPerTrain=$(e).text().split(' ').length===4?$(e).text().split(' ')[0]:null;
|
if ($(e).text().split(' ').length === 1) {
|
||||||
// if(gymDict[$(e).text().replace(energyPerTrain,`{$}`)])
|
if (gymDict[$(e).text().trim()])
|
||||||
// $(e).text(gymDict[$(e).text().replace(energyPerTrain,`{$}`)].replace(`{$}`,energyPerTrain));
|
$(e).text(gymDict[$(e).text().trim()]);
|
||||||
// });
|
return;
|
||||||
|
}
|
||||||
|
const energyPerTrain = $(e).text().split(' ')[0];
|
||||||
|
if (gymDict[$(e).text().replace(energyPerTrain, `{$}`)]) {
|
||||||
|
e.firstChild.nodeValue = gymDict[$(e).text().replace(energyPerTrain, `{$}`)].replace(`{$}`, energyPerTrain);
|
||||||
|
e.lastChild.nodeValue = '';
|
||||||
|
}
|
||||||
|
});
|
||||||
// 锻炼页面所有按钮
|
// 锻炼页面所有按钮
|
||||||
$('button[class^="button"]').each((i,e)=>{
|
$('button[class^="button"]').each((i, e) => {
|
||||||
if (gymDict[$(e).text().trim()])
|
if (gymDict[$(e).text().trim()])
|
||||||
$(e).text(gymDict[$(e).text().trim()]);
|
$(e).text(gymDict[$(e).text().trim()]);
|
||||||
});
|
});
|
||||||
// cancel按钮
|
// cancel按钮
|
||||||
$('button[class^="cancel"]').each((i,e)=>{
|
$('button[class^="cancel"]').each((i, e) => {
|
||||||
if (gymDict[$(e).text().trim()])
|
if (gymDict[$(e).text().trim()])
|
||||||
$(e).text(gymDict[$(e).text().trim()]);
|
$(e).text(gymDict[$(e).text().trim()]);
|
||||||
});
|
});
|
||||||
// 锻炼的提示信息
|
// 锻炼的提示信息
|
||||||
$('div[class^="messageWrapper"] p').each((i,e)=>{
|
$('div[class^="messageWrapper"] p').each((i, e) => {
|
||||||
/**
|
/**
|
||||||
* todo
|
* todo
|
||||||
* <p>You dug deep and completed 15 minutes of incline sprints</p>
|
* <p>You dug deep and completed 15 minutes of incline sprints</p>
|
||||||
* <p role="alert" class="gained___3T_GZ">You gained 1,854.05 speed</p>
|
* <p role="alert" class="gained___3T_GZ">You gained 1,854.05 speed</p>
|
||||||
*/
|
*/
|
||||||
//$(e).attr('class').match(/gained/)
|
//$(e).attr('class').match(/gained/)
|
||||||
if(gymDict[$(e).text()])
|
if (gymDict[$(e).text()])
|
||||||
$(e).text(gymDict[$(e).text()]);
|
$(e).text(gymDict[$(e).text()]);
|
||||||
});
|
});
|
||||||
// 健身房信息 标题
|
// 健身房信息 标题
|
||||||
$('div[class^="gymTitle"] h3').each((i,e)=>{
|
$('div[class^="gymTitle"] h3').each((i, e) => {
|
||||||
if(gymDict[$(e).text()])
|
if (gymDict[$(e).text()])
|
||||||
$(e).text(gymDict[$(e).text()]);
|
$(e).text(gymDict[$(e).text()]);
|
||||||
});
|
});
|
||||||
// 健身房信息 属性名
|
// 健身房信息 属性名
|
||||||
$('ul[class^="gymInfo"] b').each((i,e)=>{
|
$('ul[class^="gymInfo"] b').each((i, e) => {
|
||||||
if(gymDict[$(e).text().trim()])
|
if (gymDict[$(e).text().trim()])
|
||||||
$(e).text(gymDict[$(e).text().trim()]);
|
$(e).text(gymDict[$(e).text().trim()]);
|
||||||
});
|
});
|
||||||
// 健身房信息 属性值
|
// 健身房信息 属性值
|
||||||
$('ul[class^="gymInfo"] span[class^="value"]').each((i,e)=>{
|
$('ul[class^="gymInfo"] span[class^="value"]').each((i, e) => {
|
||||||
if(gymDict[$(e).text().trim()])
|
if (gymDict[$(e).text().trim()])
|
||||||
$(e).text(gymDict[$(e).text().trim()]);
|
$(e).text(gymDict[$(e).text().trim()]);
|
||||||
});
|
});
|
||||||
// 健身房信息 具体锻炼项目
|
// 健身房信息 具体锻炼项目
|
||||||
$('span[class^="exerciseName"]').each((i,e)=>{
|
$('span[class^="exerciseName"]').each((i, e) => {
|
||||||
if(gymDict[$(e).text().trim()])
|
if (gymDict[$(e).text().trim()])
|
||||||
$(e).text(gymDict[$(e).text().trim()]);
|
$(e).text(gymDict[$(e).text().trim()]);
|
||||||
});
|
});
|
||||||
// 购买提示信息
|
// 购买提示信息
|
||||||
$('div[class^="confirmMessage"] p[role="alert"]').each((i,e)=>{
|
$('div[class^="confirmMessage"] p[role="alert"]').each((i, e) => {
|
||||||
if(gymDict[$(e).text().trim()])
|
if (gymDict[$(e).text().trim()])
|
||||||
$(e).text(gymDict[$(e).text().trim()]);
|
$(e).text(gymDict[$(e).text().trim()]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -664,36 +670,40 @@
|
|||||||
contentTitleLinksTrans();
|
contentTitleLinksTrans();
|
||||||
|
|
||||||
// 大科目、学院标题
|
// 大科目、学院标题
|
||||||
$('div.content-wrapper div.title').each((i,e)=>{
|
$('div.content-wrapper div.title').each((i, e) => {
|
||||||
if(eduDict[$(e).text().trim()])
|
if (eduDict[$(e).text().trim()])
|
||||||
e.firstChild.nodeValue=eduDict[$(e).text().trim()];
|
e.firstChild.nodeValue = eduDict[$(e).text().trim()];
|
||||||
|
});
|
||||||
|
// 教育主页提示内容
|
||||||
|
$('#info_wrapper div.msg').find('*').contents().each((i, e) => {
|
||||||
|
console.log(e.nodeValue)
|
||||||
});
|
});
|
||||||
// 学院详情标题
|
// 学院详情标题
|
||||||
$('div.content-wrapper div.title-black').each((i,e)=>{
|
$('div.content-wrapper div.title-black').each((i, e) => {
|
||||||
if(e.childNodes.length===3)
|
if (e.childNodes.length === 3)
|
||||||
if(eduDict[e.lastChild.nodeValue.trim()])
|
if (eduDict[e.lastChild.nodeValue.trim()])
|
||||||
e.lastChild.nodeValue=' '+eduDict[e.lastChild.nodeValue.trim()];
|
e.lastChild.nodeValue = ' ' + eduDict[e.lastChild.nodeValue.trim()];
|
||||||
if(eduDict[$(e).text().trim()])
|
if (eduDict[$(e).text().trim()])
|
||||||
$(e).text(eduDict[$(e).text().trim()]);
|
$(e).text(eduDict[$(e).text().trim()]);
|
||||||
});
|
});
|
||||||
// 学院详情 小课程标题
|
// 学院详情 小课程标题
|
||||||
$('div.content-wrapper span.module-name').each((i,e)=>{
|
$('div.content-wrapper span.module-name').each((i, e) => {
|
||||||
if(eduDict[$(e).text().trim()])
|
if (eduDict[$(e).text().trim()])
|
||||||
$(e).text(eduDict[$(e).text().trim()]);
|
$(e).text(eduDict[$(e).text().trim()]);
|
||||||
});
|
});
|
||||||
// 课程详情 7 标题
|
// 课程详情 7 标题
|
||||||
$('div.module-desc p.title').each((i,e)=>{
|
$('div.module-desc p.title').each((i, e) => {
|
||||||
if(eduDict[$(e).text().trim()])
|
if (eduDict[$(e).text().trim()])
|
||||||
$(e).text(eduDict[$(e).text().trim()]);
|
$(e).text(eduDict[$(e).text().trim()]);
|
||||||
});
|
});
|
||||||
// 学院详情 小课程提示信息
|
// 学院详情 小课程提示信息
|
||||||
$('div.content-wrapper div.msg-cont div').each((i,e)=>{
|
$('div.content-wrapper div.msg-cont div').each((i, e) => {
|
||||||
if(eduDict[$(e).text().trim()])
|
if (eduDict[$(e).text().trim()])
|
||||||
$(e).text(eduDict[$(e).text().trim()]);
|
$(e).text(eduDict[$(e).text().trim()]);
|
||||||
});
|
});
|
||||||
// 课程介绍中的所有li元素
|
// 课程介绍中的所有li元素
|
||||||
$('div.module-desc ul.info li').each((i,e)=>{
|
$('div.module-desc ul.info li').each((i, e) => {
|
||||||
if(e.childNodes.length===1) {
|
if (e.childNodes.length === 1) {
|
||||||
const spl = $(e).text().trim().split(' ');
|
const spl = $(e).text().trim().split(' ');
|
||||||
switch (spl[0]) {
|
switch (spl[0]) {
|
||||||
case 'Length:': {//Length
|
case 'Length:': {//Length
|
||||||
@ -712,27 +722,28 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case 'Gain': {
|
case 'Gain': {
|
||||||
if(isNumber(spl[1])) {//Gain 40 intelligence upon completion
|
if (typeof parseInt(spl[1]) === 'number') {//Gain 40 intelligence upon completion
|
||||||
const wsGained = spl.slice(2, -2).join(' ');
|
const wsGained = spl.slice(2, -2).join(' ');
|
||||||
if(eduDict[$(e).text().trim().replace(spl[1],'{$1}')
|
if (eduDict[$(e).text().trim().replace(spl[1], '{$1}')
|
||||||
.replace(wsGained,'{$2}')])
|
.replace(wsGained, '{$2}')])
|
||||||
$(e).text(eduDict[$(e).text().trim().replace(spl[1],'{$1}').replace(wsGained,'{$2}')]
|
$(e).text(eduDict[$(e).text().trim()
|
||||||
.replace('{$1}',spl[1]).replace('{$2}',eduDict[wsGained]?eduDict[wsGained]:wsGained));
|
.replace(spl[1], '{$1}')
|
||||||
}
|
.replace(wsGained, '{$2}')]
|
||||||
else{
|
.replace('{$1}', spl[1])
|
||||||
if(eduDict[$(e).text().trim()])
|
.replace('{$2}', eduDict[wsGained] ? eduDict[wsGained] : wsGained));
|
||||||
|
} else {
|
||||||
|
if (eduDict[$(e).text().trim()])
|
||||||
$(e).text(eduDict[$(e).text().trim()]);
|
$(e).text(eduDict[$(e).text().trim()]);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
default:{
|
default: {
|
||||||
if(eduDict[$(e).text().trim()])
|
if (eduDict[$(e).text().trim()])
|
||||||
$(e).text(eduDict[$(e).text().trim()]);
|
$(e).text(eduDict[$(e).text().trim()]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else { // 前置课程
|
||||||
else{ // 前置课程
|
if (eduDict[$(e).children().text().trim()])
|
||||||
if(eduDict[$(e).children().text().trim()])
|
|
||||||
$(e).children().text(eduDict[$(e).children().text().trim()]);
|
$(e).children().text(eduDict[$(e).children().text().trim()]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -1229,7 +1240,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($(e).find('a').text().toLowerCase().indexOf('someone') < 0 && // 避免玩家名带有someone字样
|
if ($(e).find('a').text().toLowerCase().indexOf('someone') < 0 && // 避免玩家名带有someone字样
|
||||||
$(e).text().split(' ')[0].toLowerCase()==='someone') { // 被匿名
|
$(e).text().split(' ')[0].toLowerCase() === 'someone') { // 被匿名
|
||||||
if (spl.length === 6 && spl[3] === 'hospitalized') { // 匿名hos
|
if (spl.length === 6 && spl[3] === 'hospitalized') { // 匿名hos
|
||||||
e.firstChild.nodeValue = '有人袭击你并安排你住院 [';
|
e.firstChild.nodeValue = '有人袭击你并安排你住院 [';
|
||||||
e.childNodes[1].firstChild.nodeValue = '查看';
|
e.childNodes[1].firstChild.nodeValue = '查看';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user