Are you sure you want to rent this Castle
+for $4,000,000 for a period of 30 days?
+ Yes + No + + + +Are you sure you want to buy another Private Island
+for $1,705,000,000?
+ Yes + No + + */ + $('div[class="confirm-text"] span.question').each((i,e)=>{ + console.log($(e).text()); + }); + + propertyOB.observe($('div#properties-page-wrap')[0],{childList:true,subtree:true}); }); + + propertyOB.observe($('div#properties-page-wrap')[0],{childList:true,subtree:true}); + return; } /** @@ -355,8 +470,10 @@ if (window.location.href.indexOf('events.php') >= 0) { let events; const eventMutation = new MutationObserver(() => { + eventMutation.disconnect(); events = $('span.mail-link'); eventsTrans(events); + eventMutation.observe($('div#events-main-wrapper')[0], {childList: true, subtree: true}); }); //初始化中内容未加载 @@ -371,6 +488,16 @@ }, 1000); } + /** + * 升级页面 + */ + if (window.location.href.indexOf('level2.php') >= 0) { + } + + /** + * 通知翻译函数 + * @param events + */ function eventsTrans(events) { if (events.length === 0) return; events.each((i, e) => { @@ -776,8 +903,8 @@ * The education course you were taking has ended. Please click here. */ if ($(e).text().indexOf('edu') >= 0) { - if($(e).text().trim().split(' ')) - e.firstChild.firstChild.nodeValue = '你的课程已学习结束,请点此继续。'; + if ($(e).text().trim().split(' ')) + e.firstChild.firstChild.nodeValue = '你的课程已学习结束,请点此继续。'; return; } @@ -848,9 +975,22 @@ } /** - * 升级页面 + * 页标题按钮content-title-links */ - if (window.location.href.indexOf('level2.php') >= 0) { + function contentTitleLinksTrans() { + $('div.content-title-links a span:nth-child(2)').each((i, e) => { + if (titleLinksDict[$(e).text()]) + $(e).text(titleLinksDict[$(e).text()]); + }); + } + + /** + * 页标题翻译 + */ + function titleTrans(){ + if($('h4#skip-to-content').length===1) + if(titleDict[$('h4#skip-to-content').text().trim()]) + $('h4#skip-to-content').text(titleDict[$('h4#skip-to-content').text().trim()]); } })();