summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/wwwroot/Content/js/mods.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI.Web/wwwroot/Content/js/mods.js')
-rw-r--r--src/SMAPI.Web/wwwroot/Content/js/mods.js48
1 files changed, 8 insertions, 40 deletions
diff --git a/src/SMAPI.Web/wwwroot/Content/js/mods.js b/src/SMAPI.Web/wwwroot/Content/js/mods.js
index 874fbf25..130f60be 100644
--- a/src/SMAPI.Web/wwwroot/Content/js/mods.js
+++ b/src/SMAPI.Web/wwwroot/Content/js/mods.js
@@ -11,11 +11,7 @@ smapi.modList = function (mods, enableBeta) {
soon: 0,
broken: 0,
abandoned: 0,
- invalid: 0,
- smapi3_unknown: 0,
- smapi3_ok: 0,
- smapi3_broken: 0,
- smapi3_soon: 0
+ invalid: 0
};
var data = {
mods: mods,
@@ -52,16 +48,6 @@ smapi.modList = function (mods, enableBeta) {
nexus: { value: true, label: "Nexus" },
custom: { value: true }
}
- },
- smapi3: {
- label: "SMAPI 3.0",
- value: {
- // note: keys must match status returned by the API
- ok: { value: true, label: "ready" },
- soon: { value: true },
- broken: { value: true },
- unknown: { value: true }
- }
}
},
search: ""
@@ -87,8 +73,6 @@ smapi.modList = function (mods, enableBeta) {
else
delete data.filters.betaStatus;
- window.boop = data.filters;
-
// init mods
for (var i = 0; i < data.mods.length; i++) {
var mod = mods[i];
@@ -99,24 +83,6 @@ smapi.modList = function (mods, enableBeta) {
// set overall compatibility
mod.LatestCompatibility = mod.BetaCompatibility || mod.Compatibility;
- // set SMAPI 3.0 display text
- switch (mod.Smapi3Status) {
- case "ok":
- mod.Smapi3DisplayText = "✓ yes";
- mod.Smapi3Tooltip = "The latest version of this mod is compatible with SMAPI 3.0.";
- break;
-
- case "broken":
- mod.Smapi3DisplayText = "✖ no";
- mod.Smapi3Tooltip = "This mod will break in SMAPI 3.0; consider notifying the author.";
- break;
-
- default:
- mod.Smapi3DisplayText = "↻ " + mod.Smapi3Status;
- mod.Smapi3Tooltip = "This mod has a pending update for SMAPI 3.0 which hasn't been released yet.";
- break;
- }
-
// concatenate searchable text
mod.SearchableText = [mod.Name, mod.AlternateNames, mod.Author, mod.AlternateAuthors, mod.Compatibility.Summary, mod.BrokeIn];
if (mod.Compatibility.UnofficialVersion)
@@ -173,7 +139,6 @@ smapi.modList = function (mods, enableBeta) {
if (mod.Visible) {
stats.total++;
stats[this.getCompatibilityGroup(mod)]++;
- stats["smapi3_" + mod.Smapi3Status]++;
}
}
},
@@ -188,6 +153,10 @@ smapi.modList = function (mods, enableBeta) {
matchesFilters: function(mod, searchWords) {
var filters = data.filters;
+ // check hash
+ if (location.hash === "#" + mod.Slug)
+ return true;
+
// check source
if (!filters.source.value.open.value && mod.SourceUrl)
return false;
@@ -206,10 +175,6 @@ smapi.modList = function (mods, enableBeta) {
return false;
}
- // check SMAPI 3.0 compatibility
- if (filters.smapi3.value[mod.Smapi3Status] && !filters.smapi3.value[mod.Smapi3Status].value)
- return false;
-
// check download sites
var ignoreSites = [];
@@ -281,4 +246,7 @@ smapi.modList = function (mods, enableBeta) {
}
});
app.applyFilters();
+ window.addEventListener("hashchange", function () {
+ app.applyFilters();
+ });
};