Tower任务标题复制

任务标题一键复制功能

当前为 2025-06-24 提交的版本,查看 最新版本

// ==UserScript==
// @name         Tower任务标题复制
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  任务标题一键复制功能
// @author       ZJoker
// @match        https://tower.im/teams/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=tower.im
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    function copyTitle(e) {
        const contentDiv = e.target.parentNode.nextElementSibling.nextElementSibling
        const title = contentDiv.children[1].innerHTML
        let oInput = document.createElement('input')
        oInput.value = title
        document.body.appendChild(oInput)
        oInput.select()
        document.execCommand('Copy')
        oInput.remove()
    }

    setTimeout(() => {
        const todoList = document.querySelectorAll('.todo-actions')
        todoList.forEach(item => {
            const span = document.createElement('span')
            span.style.cursor = 'pointer'
            span.style.width = '25px'
            span.style.display = 'flex'
            span.style.alignItems = 'center'
            span.style.justifyContent = 'center'
            span.style.height = '100%'
            span.style.outlineColor = '#44acb6'
            span.style.color = '#44acb6'
            span.style.textDecoration = 'none'
            span.style.margin = '0'
            span.style.padding = '0'
            span.style.fontSize = '12px'
            span.style.verticalAlign = 'baseline'
            span.style.background = 'transparent'
            span.title = '复制'
            span.innerHTML = '复制'
            span.addEventListener('click', copyTitle)
            item.appendChild(span)
        })
    }, 1000)


})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址