Trello Time Stamp

Button to add current time to current item

目前为 2015-04-20 提交的版本。查看 最新版本

// ==UserScript==
// @name         Trello Time Stamp
// @version      1.1
// @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 timeStamp = currentdate.getHours() + ':' 
                + currentdate.getMinutes()
                console.log(timeStamp);
                $('.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();
            });
        }
    });
});