通达OA显示完整链接文字

Replaces truncated link text (...) with the full title attribute text on GUC notification pages.

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         通达OA显示完整链接文字
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Replaces truncated link text (...) with the full title attribute text on GUC notification pages.
// @author       AI Assistant
// @match        http://ow.guc.edu.cn:8090/general/notify/show*
// @grant        none
// @run-at       document-idle
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    /**
     * Finds all anchor tags within the table body that have a 'title' attribute
     * and whose text content ends with an ellipsis (...).
     * Replaces the truncated text with the full title text.
     */
    function fixTruncatedLinks() {
        // Select all <a> tags that are descendants of a <td> within the table row structure,
        // which is a good target for the article titles.
        const links = document.querySelectorAll('tr > td > a[title]');

        links.forEach(link => {
            const linkText = link.textContent.trim();
            const fullTitle = link.getAttribute('title');

            // 1. Check if the link text ends with an ellipsis
            // 2. Check if the full title is different from the current text
            if (linkText.endsWith('...') && fullTitle && fullTitle !== linkText) {
                // Replace the truncated text with the full text from the title attribute
                link.textContent = fullTitle;

                // Optional: You might want to remove the <font> tag's color
                // to make the full title blend in, or keep it, depending on the desired look.
                // The provided HTML snippet shows <font color="">, which is empty,
                // but if it had a color, this would be how to remove/change it:
                // const fontTag = link.querySelector('font');
                // if (fontTag) {
                //     fontTag.removeAttribute('color');
                // }
            }
        });
    }

    // Run the function after the page has loaded
    fixTruncatedLinks();

    // Since some content might load dynamically, you could also add a short
    // delay or an observer if the initial run doesn't catch all links.
    // For most static pages, running once should be enough.

})();