更新edu页面
This commit is contained in:
parent
54b8d9a951
commit
aea223b22c
@ -452,8 +452,8 @@
|
|||||||
'Racing Fitness': '竞速健身',
|
'Racing Fitness': '竞速健身',
|
||||||
'Complete Cardio': '完全有氧',
|
'Complete Cardio': '完全有氧',
|
||||||
// 'Legs, Bums and Tums': '腿,臀和腹部',
|
// 'Legs, Bums and Tums': '腿,臀和腹部',
|
||||||
'Legs, Bums and Tums': '下盘健身',
|
'Legs, Bums and Tums': '下盘训练',
|
||||||
'Deep Burn': '深度烧伤',
|
'Deep Burn': '深燃',
|
||||||
|
|
||||||
'Apollo Gym': '阿波罗健身',
|
'Apollo Gym': '阿波罗健身',
|
||||||
'Gun Shop': '枪支健身',
|
'Gun Shop': '枪支健身',
|
||||||
@ -475,8 +475,20 @@
|
|||||||
};
|
};
|
||||||
const eduDict = {
|
const eduDict = {
|
||||||
'Biology': '生物学',
|
'Biology': '生物学',
|
||||||
|
'Business': '商学',
|
||||||
|
'Combat Training': '战斗训练',
|
||||||
|
'Computer Science': '计算机科学',
|
||||||
|
'General Studies': '常规学科',
|
||||||
|
'Health & Fitness': '健康与健身',
|
||||||
|
'History': '历史学',
|
||||||
|
'Law': '法学',
|
||||||
|
'Mathematics': '数学',
|
||||||
|
'Psychology': '心理学',
|
||||||
|
'Self Defense': '自卫',
|
||||||
|
'Sports Science': '运动科学',
|
||||||
'Biology Modules': '生物学课程',
|
'Biology Modules': '生物学课程',
|
||||||
'Introduction to Biochemistry': '生物化学概论',
|
'Introduction to Biochemistry': '生物化学概论',
|
||||||
|
'Physiological Testing': '生理测试',
|
||||||
'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:': '描述:',
|
||||||
@ -497,7 +509,30 @@
|
|||||||
'[Leave course]': '[确认退出课程]',
|
'[Leave course]': '[确认退出课程]',
|
||||||
'Are you sure you want to leave the': '你确定你要退出',
|
'Are you sure you want to leave the': '你确定你要退出',
|
||||||
'course?': '课程吗?',
|
'course?': '课程吗?',
|
||||||
|
'course.': '课程。',
|
||||||
|
'course!': '课程!',
|
||||||
|
'It will take': '这将需要',
|
||||||
|
'to complete.': '来完成。',
|
||||||
|
'You have started the': '你已开始学习',
|
||||||
|
'You are currently taking this course.': '你目前正在学习这个课程。',
|
||||||
|
'You are currently taking an education course already. This course must be completed before you can start another.':
|
||||||
|
'你已经参加了一个课程。在你开始另一个课程之前,必须先完成这个课程。',
|
||||||
'The current progress will be canceled and you\'ll have to start all over again.': '目前的进度将被取消,你将需要重新开始。',
|
'The current progress will be canceled and you\'ll have to start all over again.': '目前的进度将被取消,你将需要重新开始。',
|
||||||
|
'Sports Science Modules': '运动科学模块',
|
||||||
|
'Introduction to Sports Science': '运动科学概论',
|
||||||
|
"Are you the missing link? At the end of this course you'll know more about Neanderthal man than the Discovery Channel.":
|
||||||
|
'你是缺失的那一环吗?在本课程结束时,你对尼安德特人的了解将超过探索频道的内容。',
|
||||||
|
"Congratulations! You have completed the":'恭喜!你已完成了',
|
||||||
|
"You have gained the following:":'你已经获得了以下:',
|
||||||
|
"upon completion":'于课程完成后',
|
||||||
|
"Gain":'获得',
|
||||||
|
"Length":'时长',
|
||||||
|
"Cost":'费用',
|
||||||
|
"Tier: 2":'级别: T2',
|
||||||
|
"Tier: 1":'级别: T1',
|
||||||
|
"Tier: 3":'级别: T3',
|
||||||
|
"Gain a 1% bonus to strength gains in the gym":'健身房锻炼时获得1%的力量增长增益',
|
||||||
|
"Bonus:":'增益:',
|
||||||
};
|
};
|
||||||
const headerDict = {
|
const headerDict = {
|
||||||
"User's Name / ID": '用户名或ID',
|
"User's Name / ID": '用户名或ID',
|
||||||
@ -1143,17 +1178,25 @@
|
|||||||
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) => {
|
$('div.content-wrapper div[class^="msg"]').find('*').contents().each((i, e) => {
|
||||||
if (e.nodeValue === null) return;
|
if (e.nodeValue === null) return;
|
||||||
if (eduDict[e.nodeValue.trim()]) {
|
if (eduDict[e.nodeValue.trim()]) {
|
||||||
e.nodeValue = eduDict[e.nodeValue.trim()];
|
e.nodeValue = eduDict[e.nodeValue.trim()];
|
||||||
} else if (e.nodeValue.indexOf('seconds') >= 0) {
|
} else if (e.nodeValue.indexOf('second') >= 0 ||
|
||||||
|
e.nodeValue.indexOf('minute') >= 0 ||
|
||||||
|
e.nodeValue.indexOf('hour') >= 0 ||
|
||||||
|
e.nodeValue.indexOf('day') >= 0 ) {
|
||||||
e.nodeValue = e.nodeValue
|
e.nodeValue = e.nodeValue
|
||||||
.replace(' days, ', '天')
|
.replace('days', '天')
|
||||||
.replace(' hours, ', '时')
|
.replace('day', '天')
|
||||||
.replace(' minutes and ', '分')
|
.replace('hours', '时')
|
||||||
.replace(' seconds', '秒');
|
.replace('hour', '时')
|
||||||
|
.replace('minutes', '分')
|
||||||
|
.replace('minute', '分')
|
||||||
|
.replace('and', '和')
|
||||||
|
.replace('seconds', '秒')
|
||||||
|
.replace('second', '秒');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// 学院详情标题
|
// 学院详情标题
|
||||||
@ -1174,55 +1217,34 @@
|
|||||||
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) => {
|
|
||||||
if (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').find('*').contents().each((i, e) => {
|
||||||
if (e.childNodes.length === 1) {
|
if (e.nodeValue === null) return;
|
||||||
const spl = $(e).text().trim().split(' ');
|
if (eduDict[e.nodeValue.trim()])
|
||||||
switch (spl[0]) {
|
e.nodeValue=eduDict[e.nodeValue.trim()];
|
||||||
case 'Length:': {//Length
|
else if (e.nodeValue.indexOf('Length')>=0){
|
||||||
const d = spl[1].slice(0, -1);
|
e.nodeValue=e.nodeValue.replace('Length',eduDict['Length'])
|
||||||
const h = spl[2].slice(0, -1);
|
.replace('d ','日')
|
||||||
const m = spl[3].slice(0, -1);
|
.replace('h ','时')
|
||||||
$(e).text('时长:' + d + '天' + h + '时' + m + '分');
|
.replace('m ','分');
|
||||||
return;
|
}
|
||||||
}
|
else if (e.nodeValue.indexOf('Cost')>=0){
|
||||||
case 'Cost:': {//Cost
|
e.nodeValue=e.nodeValue.replace('Cost',eduDict['Cost']);
|
||||||
$(e).text('费用:' + spl[1]);
|
}
|
||||||
return;
|
else if (e.nodeValue.indexOf('manual labor')>=0){
|
||||||
}
|
e.nodeValue=e.nodeValue.replace('manual labor',eduDict['manual labor'])
|
||||||
case 'Tier:': {//Tier
|
.replace('Gain',eduDict['Gain'])
|
||||||
$(e).text('级别:' + spl[1]);
|
.replace('upon completion',eduDict['upon completion']);
|
||||||
return;
|
}
|
||||||
}
|
else if (e.nodeValue.indexOf('endurance')>=0){
|
||||||
case 'Gain': {
|
e.nodeValue=e.nodeValue.replace('endurance',eduDict['endurance'])
|
||||||
if (typeof parseInt(spl[1]) === 'number') {//Gain 40 intelligence upon completion
|
.replace('Gain','获得')
|
||||||
const wsGained = spl.slice(2, -2).join(' ');
|
.replace('upon completion',eduDict['upon completion']);
|
||||||
if (eduDict[$(e).text().trim().replace(spl[1], '{$1}')
|
}
|
||||||
.replace(wsGained, '{$2}')])
|
else if (e.nodeValue.indexOf('intelligence')>=0){
|
||||||
$(e).text(eduDict[$(e).text().trim()
|
e.nodeValue=e.nodeValue.replace('intelligence',eduDict['intelligence'])
|
||||||
.replace(spl[1], '{$1}')
|
.replace('Gain','获得')
|
||||||
.replace(wsGained, '{$2}')]
|
.replace('upon completion',eduDict['upon completion']);
|
||||||
.replace('{$1}', spl[1])
|
|
||||||
.replace('{$2}', eduDict[wsGained] ? eduDict[wsGained] : wsGained));
|
|
||||||
} else {
|
|
||||||
if (eduDict[$(e).text().trim()])
|
|
||||||
$(e).text(eduDict[$(e).text().trim()]);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
default: {
|
|
||||||
if (eduDict[$(e).text().trim()])
|
|
||||||
$(e).text(eduDict[$(e).text().trim()]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else { // 前置课程
|
|
||||||
if (eduDict[$(e).children().text().trim()])
|
|
||||||
$(e).children().text(eduDict[$(e).children().text().trim()]);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -1303,7 +1325,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* npc买房
|
* npc买房 estateagents
|
||||||
*/
|
*/
|
||||||
if (window.location.href.indexOf('estateagents.php') >= 0) {
|
if (window.location.href.indexOf('estateagents.php') >= 0) {
|
||||||
titleTrans();
|
titleTrans();
|
||||||
@ -1323,10 +1345,12 @@
|
|||||||
const isRent = window.location.href.indexOf('rent') >= 0;
|
const isRent = window.location.href.indexOf('rent') >= 0;
|
||||||
const propertyOB = new MutationObserver(() => {
|
const propertyOB = new MutationObserver(() => {
|
||||||
propertyOB.disconnect();
|
propertyOB.disconnect();
|
||||||
|
|
||||||
titleTrans();
|
titleTrans();
|
||||||
contentTitleLinksTrans();
|
contentTitleLinksTrans();
|
||||||
|
propertyTrans();
|
||||||
|
propertyOB.observe($('div#properties-page-wrap')[0], {childList: true, subtree: true});
|
||||||
|
});
|
||||||
|
const propertyTrans=function propertyTrans(){
|
||||||
// 黑框标题
|
// 黑框标题
|
||||||
$('div.title-black span').each((i, e) => {
|
$('div.title-black span').each((i, e) => {
|
||||||
e.firstChild.nodeValue = '您想查看哪些房产?';
|
e.firstChild.nodeValue = '您想查看哪些房产?';
|
||||||
@ -1414,10 +1438,9 @@
|
|||||||
if (propertyDict[e.firstChild.nodeValue])
|
if (propertyDict[e.firstChild.nodeValue])
|
||||||
e.firstChild.nodeValue = propertyDict[e.firstChild.nodeValue];
|
e.firstChild.nodeValue = propertyDict[e.firstChild.nodeValue];
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
|
||||||
propertyOB.observe($('div#properties-page-wrap')[0], {childList: true, subtree: true});
|
propertyTrans();
|
||||||
});
|
|
||||||
|
|
||||||
propertyOB.observe($('div#properties-page-wrap')[0], {childList: true, subtree: true});
|
propertyOB.observe($('div#properties-page-wrap')[0], {childList: true, subtree: true});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user