在本地预览模式下用红色虚线显示原文

其它环境直接显示中文
This commit is contained in:
Zhicheng Wang 2016-05-13 15:16:55 +08:00
parent 9dccc57409
commit 478ead7d4d
2 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,7 @@
.lang-english {
.original-english {
display: none !important;
}
.original-english-debug {
border-bottom: 1px dashed red;
}

View File

@ -4,7 +4,11 @@
if (isTranslationResult(node)) {
var prevNode = node.previousElementSibling;
if (prevNode && isOriginalEnglish(prevNode.innerText) && !prevNode.classList.contains('nav-list-item')) {
prevNode.classList.add('lang-english');
if (location.hostname === 'localhost') {
prevNode.classList.add('original-english-debug');
} else {
prevNode.classList.add('original-english');
}
}
node.title = prevNode.innerText;
}