Trello Time Stamp

Button to add current time to current item

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Trello Time Stamp
// @version      1.3
// @description  Button to add current time to current item
// @author       Evan Sutherland
// @description  Expands Trello cards for better viewing and editing on bigger screens.
// @match        https://*trello.com/b/*
// @match        https://*trello.com/c/*
// @include      https://*trello.com/b/*
// @include      https://*trello.com/c/*
// @grant        none
// @namespace TrelloTimeStamp
// ==/UserScript==
$(document).ajaxComplete(function() {
    $('.list-card').click(function(){
        var actionList = $('.other-actions').find('.u-clearfix');
        if(actionList.find('.fm-insert-date').length === 0){
            $(actionList).append('<a href="#" class="button-link fm-insert-date" title="insert current date time"><span class="icon-sm icon-calendar"></span>Time Stamp</a>').find('.fm-insert-date').click(function(){
                var currentDate = new Date(); 
                var hours = currentDate.getHours();
                var minutes = currentDate.getMinutes();
                if (hours   < 10) {hours   = "0"+hours;}
                if (minutes < 10) {minutes = "0"+minutes;}
                var timeStamp = hours+':'+minutes;

                $('.window-title-text').click();
                var currentText = $('.card-detail-window').find('.edit-heavy').find('textarea');
                currentText.val(currentText.val() + " " + timeStamp);
                $('.card-detail-window').find('.edit-heavy').find('input[type="submit"]').click();
                
                //mark with green label
                //$('.js-edit-labels').click();
                //$('.pop-over').find('.card-label-green').click();
                //$('.pop-over-header-close-btn').click();
                
                //close window
                //$('.dialog-close-button').click();
            });
        }
    });
});