Difference between revisions of "Modding:Mod compatibility/barchart"
Jump to navigation
Jump to search
Pathoschild (talk | contribs) (→Script: update for unified stable/beta compatibility table) |
Pathoschild (talk | contribs) (fix) |
||
Line 35: | Line 35: | ||
if (total != entries.length) { | if (total != entries.length) { | ||
− | var unknown = entries.filter(":not([data-beta-status='ok'], [data-beta-status='optional'], [data-beta-status='workaround'], [data-beta-status='obsolete'], [data-beta-status='broken'], [data-beta-status='abandoned'])"); | + | var unknown = entries.filter(":not([data-beta-status='ok'], [data-beta-status='optional'], [data-beta-status='workaround'], [data-beta-status='unofficial'], [data-beta-status='obsolete'], [data-beta-status='broken'], [data-beta-status='abandoned'])"); |
console.log("found entries with unknown status:", unknown); | console.log("found entries with unknown status:", unknown); | ||
throw 'script failed'; | throw 'script failed'; |
Revision as of 20:41, 6 September 2018
0% are compatible or have a working alternative. | |
0% have an update coming soon. | |
0% are broken and not open-source.¹ |
¹ Many of these broke due to a Stardew Valley update. Some may be updated by their authors later.
Usage
List the counts for each group:
{{/barchart |ok = 135 |workaround = 33 |soon = 56 |broken = 33 |total = 257 }}
Script
This tiny script generates the template call when run from the parent page.
var entries = $("#mod-list .mod:not([data-beta-status='abandoned'], [data-beta-status='obsolete'])");
var ok = entries.filter("[data-beta-status='ok'], [data-beta-status='optional']").length;
var workaround = entries.filter("[data-beta-status='workaround'], [data-beta-status='unofficial']").length;
var soon = entries.filter("[data-beta-status='broken'][data-github], [data-beta-status='broken'][data-custom-source]").length;
var broken = entries.filter("[data-beta-status='broken']:not([data-github], [data-custom-source])").length;
var total = ok + workaround + soon + broken;
if (total != entries.length) {
var unknown = entries.filter(":not([data-beta-status='ok'], [data-beta-status='optional'], [data-beta-status='workaround'], [data-beta-status='unofficial'], [data-beta-status='obsolete'], [data-beta-status='broken'], [data-beta-status='abandoned'])");
console.log("found entries with unknown status:", unknown);
throw 'script failed';
}
`
{{/barchart
|ok = ${ok}
|workaround = ${workaround}
|soon = ${soon}
|broken = ${broken}
|total = ${total}
}}
`