2 Star 2 Fork 6

xyf007/namerena_scripts

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
ordered_digits.html 1.51 KB
一键复制 编辑 原始数据 按行查看 历史
xyf007 提交于 2020-11-12 19:43 . modify all the wrong 'for's.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>&#x6570;&#x5B57;&#x8D77;&#x70B9;&#x6A21;&#x5F0F;</title>
</head>
<body>
<pre>
const prefix = '';
const team = '';
const suffix = '';
let cur = 0;
const elite2 = false;
let names = '';
let result = '';
/**
* Reload names.
*/
function reload() {
names = team + '\n';
for (let i = 0; i < 10; i++) {
names += ` ${prefix}${cur}${suffix}\n`;
cur++;
}
document.querySelector('div>textarea').value = names;
document.querySelector('.goBtn').click();
}
/**
* Search for the names with elites.
*/
function maint() {
if (cw().document.querySelectorAll('div.name').length < 10) {
setTimeout(function() {
maint();
}, 100);
return;
}
const a = cw().document.querySelectorAll('.s_elite3');
for (const name of a) {
result += name.parentElement.previousElementSibling.textContent.replace(
/^\s+|\s+$/g, '') + '\n';
}
if (elite2) {
const a = cw().document.querySelectorAll('.s_elite2');
for (const name of a) {
result += name.parentElement.previousElementSibling.textContent.replace(
/^\s+|\s+$/g, '') + '\n';
}
}
document.querySelector('textarea#result').value = result;
reload();
setTimeout(function() {
maint();
}, 100);
}
const NW = document.createElement('textarea');
NW.id = 'result';
document.body.appendChild(NW);
NW.setAttribute('readonly', true);
document.getElementsByClassName('mdframe')[0].setAttribute('style',
'display:none;');
reload();
maint();
</pre>
</body>
</html>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/xyf0076/namerena_scripts.git
git@gitee.com:xyf0076/namerena_scripts.git
xyf0076
namerena_scripts
namerena_scripts
master

搜索帮助