Asana subtask auto loadmore

Asana subtask auto load more

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         Asana subtask auto loadmore
// @namespace    http://tampermonkey.net
// @description  Asana subtask auto load more
// @version      0.4
// @author       zhong666
// @match        https://app.asana.com/*
// @grant        none
// ==/UserScript==

(function () {
  'use strict';

  function debounce(func, wait, immediate) {
    var timeout;
    return function() {
      var context = this, args = arguments;
      clearTimeout(timeout);
      timeout = setTimeout(function() {
        timeout = null;
        if (!immediate) func.apply(context, args);
      }, wait);
      if (immediate && !timeout) func.apply(context, args);
    };
  }

  function dispatchClickLoadMore() {
    const $loadmore = document.querySelector('.SubtaskGrid.SingleTaskPaneSpreadsheet-subtaskGrid .SubtaskGrid-loadMore')
    if (!$loadmore) {
      return
    }
    $loadmore.click()
  }

  dispatchClickLoadMore = debounce(dispatchClickLoadMore, 50)

  const mobs = new MutationObserver((mutations) => {
    mutations.forEach(() => {
      dispatchClickLoadMore()
    })
  })

  mobs.observe(document.body, {
    subtree: true,
    childList: true,
  })
})();