AddAll

Add all items of a book list to the lesson queue

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         AddAll
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Add all items of a book list to the lesson queue
// @author       This is your fault
// @match        https://floflo.moe/singles/
// @match        https://floflo.moe/alchemizer/
// @grant        none
// ==/UserScript==

var delay = 100;
var buttonHTML = '<div class="elementor-widget-container" style="margin-top: 10px; margin-left: auto; text-align: center;"><div class="elementor-button-wrapper"> <a class="elementor-button elementor-size-lg elementor-animation-grow" role="button"> <span class="elementor-button-content-wrapper"> <span class="elementor-button-icon elementor-align-icon-left"> <i class="fa fa-bomb" aria-hidden="true"></i> </span> <span class="elementor-button-text">add all</span> </span> </a></div></div>';

function chilling(callback){
    console.log("chilling");
  if ( window.vocabTable.loading ){
      setTimeout(function(){chilling(callback);},500);
  } else {
      callback();
  }
}

function addingAll(){
        var addButtons = jQuery('button.col-12.col-md').filter(function() {return jQuery(this).text() === 'Add';});
        var len = addButtons.length;
        addButtons.each(function(index) {
            var button = jQuery(this);
            setTimeout(function(){
                button.click();
                if (index >= len -1) {
                    window.vocabTable.refreshTable();
                    chilling(addingAll);
                }
            },index*delay);
        });
}

(function() {
    'use strict';

    var target = jQuery(".unfortunate_soul .col-4");
    target.append(buttonHTML);
    var addAllButton = jQuery(".elementor-widget-container .elementor-button-wrapper a");
    addAllButton.css("background-color","#ffe400");
    //Some weird stuff happen while the page is being loaded. Make sure we have the right guy
    setTimeout(function(){console.log("trying");jQuery(".elementor-widget-container .elementor-button-wrapper a").on('click',addingAll);},2000);
})();