MCPcopy Create free account
hub / github.com/XIU2/UserScript / topTime_

Function topTime_

Zhihu-Enhanced.user.js:1492–1502  ·  view source on GitHub ↗
(css, classs)

Source from the content-addressed store, hash-verified

1490// [完整显示时间 + 置顶显示时间] 功能修改自:https://greasyfork.org/scripts/402808(从 JQuery 改为原生 JavaScript,且精简、优化了代码)
1491// 完整显示时间 + 置顶显示时间
1492function topTime_(css, classs) {
1493 document.querySelectorAll(css).forEach(function(_this) {
1494 let t = _this.querySelector('.ContentItem-time'); if (!t) return
1495 if (!(t.classList.contains('full')) && t.querySelector('a') && t.querySelector('a').textContent != null) {
1496 // 完整显示时间
1497 topTime_allTime(t)
1498 // 发布时间置顶
1499 topTime_publishTop(t, _this, classs)
1500 }
1501 });
1502}
1503
1504
1505// 完整显示时间 + 置顶显示时间 - 文章

Callers 1

startFunction · 0.85

Calls 2

topTime_allTimeFunction · 0.85
topTime_publishTopFunction · 0.85

Tested by

no test coverage detected