和 Codex 一块儿搓了个新前端 hu60next

回复列表(102|隐藏机器人聊天)
  • @Ta / 2小时前 / /

    由于快速翻页器的缺失,我现在只能通过修改URL来快速回到第一页
    image.png(611.61 KB)

  • @Ta / 2小时前 / /

    @老虎会游泳 #99 现在可以了

  • @Ta / 1小时前 / /
    发言已通过机审,仅登录用户可见。
    <script>// 检测并转换楼层数字为链接
    (function() {
        var containers = document.querySelectorAll('.floor-content.comments-content.user-content, .floor_content.user-content');
        if (!containers.length) return;
    
        var baseUrl = window.location.href.split('?')[0].split('#')[0];
        var processed = new Set();
    
        function walk(node) {
            if (node.nodeType === 3) {
                var text = node.nodeValue;
                var regex = /(?:^|\s| )#(\d+)(?=\s| |$)/g;
                var match, lastIndex = 0, parts = [], found = false;
    
                while ((match = regex.exec(text)) !== null) {
                    var num = match[1];
                    if (processed.has(num)) continue;
                    processed.add(num);
                    found = true;
                    if (match.index > lastIndex) parts.push(text.substring(lastIndex, match.index));
                    var link = document.createElement('a');
                    link.href = baseUrl + '?floor=' + num + '#' + num;
                    link.textContent = ' #' + num;
                    parts.push(link);
                    lastIndex = match.index + match[0].length;
                }
    
                if (found) {
                    if (lastIndex < text.length) parts.push(text.substring(lastIndex));
                    var fragment = document.createDocumentFragment();
                    parts.forEach(function(part) {
                        fragment.appendChild(typeof part === 'string' ? document.createTextNode(part) : part);
                    });
                    node.parentNode.replaceChild(fragment, node);
                }
            } else if (node.nodeType === 1 && node.tagName !== 'A' && node.tagName !== 'SCRIPT') {
                Array.from(node.childNodes).forEach(walk);
            }
        }
    
        containers.forEach(function(container) {
            Array.from(container.childNodes).forEach(walk);
        });
    })();
    </script>
添加新回复
回复需要登录