Last active
December 7, 2023 20:54
-
-
Save Berny23/45fe815d637e4097686ea907e974734c to your computer and use it in GitHub Desktop.
JS Snippet - Alle TA annehmen + Alle Karten auswählen (Zauberhogwarts)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Zauberhogwarts: Auto-TA + Card-Selector | |
Copyright © 2023 Berny23 | |
This file is released under the "MIT" license. | |
Go to "https://choosealicense.com/licenses/mit" for full license details. | |
*/ | |
// Alle TA annehmen/bestätigen: | |
$('input[type="checkbox"][name="delete[]"]').prop("checked", true); | |
var alreadySelectedCards = [] | |
$('div#tausch').each(function (index, element) { | |
var ownCard = $(element).find('.ownCard > img').first().attr('src'); | |
if (!alreadySelectedCards.includes(ownCard)) { | |
$(element).find('input[type="radio"][value="1"]').prop("checked", true); // Annehmen | |
$(element).find('textarea[placeholder="Kommentar (optional)"]').text("Liebe Grüße und frohes Sammeln! :)"); | |
alreadySelectedCards.push(ownCard); | |
} | |
}) | |
// Alle Karten (ohne Behalten) in Sammelalbum auswählen und Anzahl von Fehlern zeigen: | |
console.log(($('.alert.alert-danger').text().match(/, /g) || []).length + 1); | |
console.log($('.alert.alert-danger').text()); | |
$('#sammelalbum-content .bulk-mode img').trigger( "click" ); | |
$('#sammelalbum-content .bulk-mode .sort-hint-b > img, #sammelalbum-content .bulk-mode .sort-hint-t > img').trigger( "click" ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment