Greasy Fork

Greasy Fork is available in English.

Trello Chronological Comment Order

Order Trello comments by ascending date

当前为 2019-09-14 提交的版本,查看 最新版本

// ==UserScript==
// @name         Trello Chronological Comment Order
// @namespace    https://gist.github.com/kxlt
// @version      0.1
// @description  Order Trello comments by ascending date
// @author       kxlt (https://github.com/kxlt)
// @match        https://trello.com/*
// @grant        none
// ==/UserScript==

(function() {
  "use strict";

  function withDomReady(fn) {
    // If we're early to the party
    document.addEventListener("DOMContentLoaded", fn);
    // If late; I mean on time.
    if (
      document.readyState === "interactive" ||
      document.readyState === "complete"
    ) {
      fn();
    }
  }

  withDomReady(function() {
    const reverseCommentsCss = document.createElement("style");
    reverseCommentsCss.innerHTML = `
        .mod-card-back {
            display: flex;
            flex-direction: column-reverse;
        }
    `;
    document.head.appendChild(reverseCommentsCss);
  });
})();