summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/wwwroot/Content
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2018-11-19 13:48:19 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2018-11-19 13:48:19 -0500
commit593723b7940ba72a786fc4c7366c56f9813d977b (patch)
tree4d23fbef5bc5a20115f10ca04ae3379df78cc8e1 /src/SMAPI.Web/wwwroot/Content
parent4f28ea33bd7cc65485402c5e85259083e86b49e1 (diff)
parent3dc27a5681dcfc4ae30e95570d9966f2e14a4dd7 (diff)
downloadSMAPI-593723b7940ba72a786fc4c7366c56f9813d977b.tar.gz
SMAPI-593723b7940ba72a786fc4c7366c56f9813d977b.tar.bz2
SMAPI-593723b7940ba72a786fc4c7366c56f9813d977b.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI.Web/wwwroot/Content')
-rw-r--r--src/SMAPI.Web/wwwroot/Content/css/index.css5
-rw-r--r--src/SMAPI.Web/wwwroot/Content/css/log-parser.css4
-rw-r--r--src/SMAPI.Web/wwwroot/Content/css/mods.css135
-rw-r--r--src/SMAPI.Web/wwwroot/Content/css/privacy.css3
-rw-r--r--src/SMAPI.Web/wwwroot/Content/js/mods.js205
5 files changed, 352 insertions, 0 deletions
diff --git a/src/SMAPI.Web/wwwroot/Content/css/index.css b/src/SMAPI.Web/wwwroot/Content/css/index.css
index 514e1a5c..979af4af 100644
--- a/src/SMAPI.Web/wwwroot/Content/css/index.css
+++ b/src/SMAPI.Web/wwwroot/Content/css/index.css
@@ -93,6 +93,11 @@ h1 {
display: block;
}
+.sublinks {
+ font-size: 0.9em;
+ margin-bottom: 1em;
+}
+
/*********
** Subsections
*********/
diff --git a/src/SMAPI.Web/wwwroot/Content/css/log-parser.css b/src/SMAPI.Web/wwwroot/Content/css/log-parser.css
index 1fcd1bff..2f3dd0a1 100644
--- a/src/SMAPI.Web/wwwroot/Content/css/log-parser.css
+++ b/src/SMAPI.Web/wwwroot/Content/css/log-parser.css
@@ -63,6 +63,10 @@ table#metadata, table#mods {
box-shadow: 1px 1px 1px 1px #dddddd;
}
+.invisible {
+ visibility: hidden;
+}
+
#mods {
min-width: 400px;
}
diff --git a/src/SMAPI.Web/wwwroot/Content/css/mods.css b/src/SMAPI.Web/wwwroot/Content/css/mods.css
new file mode 100644
index 00000000..730bfc2e
--- /dev/null
+++ b/src/SMAPI.Web/wwwroot/Content/css/mods.css
@@ -0,0 +1,135 @@
+/*********
+** Intro
+*********/
+#content {
+ max-width: calc(100% - 2em); /* allow for wider table if room available */
+}
+
+#intro {
+ width: 50em;
+}
+
+#beta-blurb {
+ margin-bottom: 2em;
+ padding: 1em;
+ border: 3px solid darkgreen;
+}
+
+table.wikitable {
+ background-color:#f8f9fa;
+ color:#222;
+ border:1px solid #a2a9b1;
+ border-collapse:collapse
+}
+
+table.wikitable > tr > th,
+table.wikitable > tr > td,
+table.wikitable > * > tr > th,
+table.wikitable > * > tr > td {
+ border:1px solid #a2a9b1;
+ padding:0.2em 0.4em
+}
+
+table.wikitable > tr > th,
+table.wikitable > * > tr > th {
+ background-color:#eaecf0;
+}
+
+table.wikitable > caption {
+ font-weight:bold
+}
+
+#options {
+ margin-bottom: 1em;
+}
+
+#options #filter-area {
+ opacity: 0.7;
+}
+
+#options #filters {
+ margin-left: 2em;
+ padding-left: 0.5em;
+ border-left: 2px solid gray;
+}
+
+#options #filters span {
+ padding: 2px;
+ margin: 2px;
+ display: inline-block;
+ border-radius: 3px;
+ color: #000;
+ border-color: #880000;
+ background-color: #fcc;
+ font-size: 0.9em;
+}
+
+#options #filters span.active {
+ background: #cfc;
+}
+
+#mod-count {
+ font-size: 0.8em;
+ opacity: 0.5;
+}
+
+#mod-list {
+ font-size: 0.9em;
+}
+
+#mod-list th.header {
+ background-repeat: no-repeat;
+ background-position: center right;
+ cursor: pointer;
+ background-image: url(data:image/gif;base64,R0lGODlhFQAJAIABAAAAAAAAACH/C1hNUCBEYXRhWE1QPD94cG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IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4B//79/Pv6+fj39vX08/Lx8O/u7ezr6uno5+bl5OPi4eDf3t3c29rZ2NfW1dTT0tHQz87NzMvKycjHxsXEw8LBwL++vby7urm4t7a1tLOysbCvrq2sq6qpqKempaSjoqGgn56dnJuamZiXlpWUk5KRkI+OjYyLiomIh4aFhIOCgYB/fn18e3p5eHd2dXRzcnFwb25tbGtqaWhnZmVkY2JhYF9eXVxbWllYV1ZVVFNSUVBPTk1MS0pJSEdGRURDQkFAPz49PDs6OTg3NjU0MzIxMC8uLSwrKikoJyYlJCMiISAfHh0cGxoZGBcWFRQTEhEQDw4NDAsKCQgHBgUEAwIBAAAh+QQBAAABACwAAAAAFQAJAAACF4yPgMsJ2mJ4VDKKrd4GVz5lYPeMiVUAADs=);
+ padding-right: 1.5em;
+}
+
+#mod-list th.headerSortUp {
+ background-image: url(data:image/gif;base64,R0lGODlhFQAEAIABAAAAAAAAACH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtbG5zOnhtcD0iaHR0cDovL25z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kUiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4B//79/Pv6+fj39vX08/Lx8O/u7ezr6uno5+bl5OPi4eDf3t3c29rZ2NfW1dTT0tHQz87NzMvKycjHxsXEw8LBwL++vby7urm4t7a1tLOysbCvrq2sq6qpqKempaSjoqGgn56dnJuamZiXlpWUk5KRkI+OjYyLiomIh4aFhIOCgYB/fn18e3p5eHd2dXRzcnFwb25tbGtqaWhnZmVkY2JhYF9eXVxbWllYV1ZVVFNSUVBPTk1MS0pJSEdGRURDQkFAPz49PDs6OTg3NjU0MzIxMC8uLSwrKikoJyYlJCMiISAfHh0cGxoZGBcWFRQTEhEQDw4NDAsKCQgHBgUEAwIBAAAh+QQBAAABACwAAAAAFQAEAAACDYyPAcmtsJyDVDKKWQEAOw==);
+}
+
+#mod-list .mod-page-links,
+#mod-list .mod-broke-in {
+ font-size: 0.9em;
+}
+
+#mod-list .mod-alt-authors,
+#mod-list .mod-alt-names {
+ font-size: 0.8em;
+}
+
+#mod-list .mod-alt-authors,
+#mod-list .mod-alt-names {
+ display: block;
+}
+
+#mod-list tr[data-status="ok"],
+#mod-list tr[data-status="optional"] {
+ background: #BFB;
+}
+
+#mod-list tr[data-status="workaround"],
+#mod-list tr[data-status="unofficial"] {
+ background: #FFFEC6;
+}
+
+#mod-list tr[data-status="broken"] {
+ background: #FBB;
+}
+
+#mod-list tr[data-status="obsolete"],
+#mod-list tr[data-status="abandoned"] {
+ background: #BBB;
+ opacity: 0.7;
+}
+
+#mod-list .mod-closed-source {
+ color: red;
+ font-size: 0.8em;
+ opacity: 0.5;
+}
diff --git a/src/SMAPI.Web/wwwroot/Content/css/privacy.css b/src/SMAPI.Web/wwwroot/Content/css/privacy.css
new file mode 100644
index 00000000..94bc68a9
--- /dev/null
+++ b/src/SMAPI.Web/wwwroot/Content/css/privacy.css
@@ -0,0 +1,3 @@
+h3 {
+ border: 0;
+}
diff --git a/src/SMAPI.Web/wwwroot/Content/js/mods.js b/src/SMAPI.Web/wwwroot/Content/js/mods.js
new file mode 100644
index 00000000..2cff551f
--- /dev/null
+++ b/src/SMAPI.Web/wwwroot/Content/js/mods.js
@@ -0,0 +1,205 @@
+/* globals $ */
+
+var smapi = smapi || {};
+var app;
+smapi.modList = function (mods) {
+ // init data
+ var data = {
+ mods: mods,
+ visibleCount: mods.length,
+ showAdvanced: false,
+ filters: {
+ source: {
+ open: {
+ label: "open",
+ id: "show-open-source",
+ value: true
+ },
+ closed: {
+ label: "closed",
+ id: "show-closed-source",
+ value: true
+ }
+ },
+ status: {
+ ok: {
+ label: "ok",
+ id: "show-status-ok",
+ value: true
+ },
+ optional: {
+ label: "optional",
+ id: "show-status-optional",
+ value: true
+ },
+ unofficial: {
+ label: "unofficial",
+ id: "show-status-unofficial",
+ value: true
+ },
+ workaround: {
+ label: "workaround",
+ id: "show-status-workaround",
+ value: true
+ },
+ broken: {
+ label: "broken",
+ id: "show-status-broken",
+ value: true
+ },
+ abandoned: {
+ label: "abandoned",
+ id: "show-status-abandoned",
+ value: true
+ },
+ obsolete: {
+ label: "obsolete",
+ id: "show-status-obsolete",
+ value: true
+ }
+ },
+ download: {
+ chucklefish: {
+ label: "Chucklefish",
+ id: "show-chucklefish",
+ value: true
+ },
+ nexus: {
+ label: "Nexus",
+ id: "show-nexus",
+ value: true
+ },
+ custom: {
+ label: "custom",
+ id: "show-custom",
+ value: true
+ }
+ }
+ },
+ search: ""
+ };
+ for (var i = 0; i < data.mods.length; i++) {
+ var mod = mods[i];
+
+ // set initial visibility
+ mod.Visible = true;
+
+ // concatenate searchable text
+ mod.SearchableText = [mod.Name, mod.AlternateNames, mod.Author, mod.AlternateAuthors, mod.Compatibility.Summary, mod.BrokeIn];
+ if (mod.Compatibility.UnofficialVersion)
+ mod.SearchableText.push(mod.Compatibility.UnofficialVersion);
+ if (mod.BetaCompatibility) {
+ mod.SearchableText.push(mod.BetaCompatibility.Summary);
+ if (mod.BetaCompatibility.UnofficialVersion)
+ mod.SearchableText.push(mod.BetaCompatibility.UnofficialVersion);
+ }
+ for (var p = 0; p < mod.ModPages; p++)
+ mod.SearchableField.push(mod.ModPages[p].Text);
+ mod.SearchableText = mod.SearchableText.join(" ").toLowerCase();
+ }
+
+ // init app
+ app = new Vue({
+ el: "#app",
+ data: data,
+ mounted: function() {
+ // enable table sorting
+ $("#mod-list").tablesorter({
+ cssHeader: "header",
+ cssAsc: "headerSortUp",
+ cssDesc: "headerSortDown"
+ });
+
+ // put focus in textbox for quick search
+ if (!location.hash)
+ $("#search-box").focus();
+
+ // jump to anchor (since table is added after page load)
+ if (location.hash) {
+ var row = $(location.hash).get(0);
+ if (row)
+ row.scrollIntoView();
+ }
+ },
+ methods: {
+ /**
+ * Update the visibility of all mods based on the current search text and filters.
+ */
+ applyFilters: function () {
+ // get search terms
+ var words = data.search.toLowerCase().split(" ");
+
+ // apply criteria
+ data.visibleCount = data.mods.length;
+ for (var i = 0; i < data.mods.length; i++) {
+ var mod = data.mods[i];
+ mod.Visible = true;
+
+ // check filters
+ if (!this.matchesFilters(mod)) {
+ mod.Visible = false;
+ data.visibleCount--;
+ continue;
+ }
+
+ // check search terms (all search words should match)
+ if (words.length) {
+ for (var w = 0; w < words.length; w++) {
+ if (mod.SearchableText.indexOf(words[w]) === -1) {
+ mod.Visible = false;
+ data.visibleCount--;
+ break;
+ }
+ }
+ }
+ }
+ },
+
+
+ /**
+ * Get whether a mod matches the current filters.
+ * @param {object} mod The mod to check.
+ * @returns {bool} Whether the mod matches the filters.
+ */
+ matchesFilters: function(mod) {
+ var filters = data.filters;
+
+ // check source
+ if (!filters.source.open.value && mod.SourceUrl)
+ return false;
+ if (!filters.source.closed.value && !mod.SourceUrl)
+ return false;
+
+ // check status
+ var status = (mod.BetaCompatibility || mod.Compatibility).Status;
+ if (filters.status[status] && !filters.status[status].value)
+ return false;
+
+ // check download sites
+ var ignoreSites = [];
+
+ if (!filters.download.chucklefish.value)
+ ignoreSites.push("Chucklefish");
+ if (!filters.download.nexus.value)
+ ignoreSites.push("Nexus");
+ if (!filters.download.custom.value)
+ ignoreSites.push("custom");
+
+ if (ignoreSites.length) {
+ var anyLeft = false;
+ for (var i = 0; i < mod.ModPageSites.length; i++) {
+ if (ignoreSites.indexOf(mod.ModPageSites[i]) === -1) {
+ anyLeft = true;
+ break;
+ }
+ }
+
+ if (!anyLeft)
+ return false;
+ }
+
+ return true;
+ }
+ }
+ });
+};