Asana

None

目前为 2020-08-28 提交的版本。查看 最新版本

// ==UserScript==
// @name         Asana
// @namespace    http://
// @version      2.1.1
// @description  None
// @author       Wes Foster
// @match        https://app.asana.com/*
// @grant        GM_addStyle
// ==/UserScript==

(function() {
    'use strict';

    // Remove Elements: TopBar, Portfolios Section
    //GM_addStyle("#topbar, .SidebarTopNavLinks-myPortfoliosbutton, .HarvestButton, .TopbarPageHeaderGlobalActions-upgradeButton, .TaskPremiumFeaturesSection { display: none !important; }");

    // Expand width of project description sidebar
    //GM_addStyle(".ProjectSideRail {width:35% !important;} .ql-editor{overflow:auto !important}");

    // Remove the "see more" project description link
    //GM_addStyle(".ProjectSideRailDescription-seeMoreLink {display:none !important}");

    // Custom Background image
    //GM_addStyle(".themeBackground-valley {background-image:url('https://proxy.duckduckgo.com/iu/?u=https%3A%2F%2Fs-media-cache-ak0.pinimg.com%2Foriginals%2Ff5%2Fcf%2F21%2Ff5cf21c88240a6245a11920e982af572.jpg&f=1&nofb=1')}");
    //GM_addStyle(".themeBackground-valley {background-image:url('https://i.pinimg.com/originals/f5/cf/21/f5cf21c88240a6245a11920e982af572.jpg') !important}");
    //--
    
    // Resize the left sidebar
    var asanaSidebarWidth = 350;
    GM_addStyle(".AsanaMain-sidebar {width: " + asanaSidebarWidth + "px !important;}");
    GM_addStyle(".AsanaMain-sidebar.AsanaMain-sidebar--isCollapsed {margin-left: " + asanaSidebarWidth*-1 + "px !important;}");
    
    // Remove harvest time-tracker icon
    gm_addStyle(".HarvestButton-timerIcon {display: none !important;}");

    // Recurring Interval in Asana
    var timerID = setInterval(performIntervalActions, 1000);
    function performIntervalActions() {
        var i;

        // Expand "Show More Projects"
        var projectLink = document.getElementsByClassName("SidebarTeamDetailsProjectsList-showMoreProjectsLink");
        for (i = 0; i < projectLink.length; i++) {
            projectLink[i].click();
        }

        // Expand Project Description
        var projectDescBox = document.getElementsByClassName('ql-editor');
        var sidebarHeightRestriction = 137; // Roughly the height of the header toolbar and margins
        for (i = 0; i < projectDescBox.length; i++) {
            projectDescBox[i].style.maxHeight = (document.getElementsByClassName('ProjectPageView')[0].clientHeight - sidebarHeightRestriction) + "px";
        }
    }
    setTimeout(function(){ clearInterval(timerID);} , 30000);
    //--

})();

QingJ © 2025

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