Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge dev into main #113

Merged
merged 2 commits into from
Nov 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions no_support/wfes-editChallengeCounter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @name Edit Challenge Counter
// @version 1.0.2
// @version 1.0.3
// @description Count Edit Contributions for the 2024 Wayfarer Edit Challenge
// @author AlterTobi

Expand Down Expand Up @@ -45,11 +45,11 @@
});

// Zählprozess
const startDate = new Date(START_DATE);
const endDate = new Date(END_DATE);
contributions.forEach(item => {
// Vergleiche Datum und Typ des Objekts
const itemDate = new Date(item.day);
const startDate = new Date(START_DATE);
const endDate = new Date(END_DATE);

if (itemDate >= startDate && itemDate <= endDate && TYPES.includes(item.type)) {
counts[item.type]++;
Expand Down Expand Up @@ -96,14 +96,14 @@
const contributions = window.wfes.g.nominationsList();

const result = countContributions(contributions);
const resultSum = result.PHOTO + result.EDIT_TITLE + result.EDIT_DESCRIPTION + result.EDIT_LOCATION;
let resultSum = 0;
TYPES.forEach(type => {
resultSum += result[type];
});
const resulttext = " (P" + result.PHOTO + " T" + result.EDIT_TITLE +
" D" + result.EDIT_DESCRIPTION + " L" + result.EDIT_LOCATION + ")";

createButton("2024 Edit Challenge", resulttext, resultSum);

// YOUR CODE HERE
// .catch((e) => {console.warn(GM_info.script.name, ": ", e);});
}

const init = () => {
Expand Down