mirror of
https://github.com/Kornstalx/5etools-mirror-2.github.io.git
synced 2025-10-28 20:45:35 -05:00
v1.201.0
This commit is contained in:
@@ -18,7 +18,7 @@ class _HtmlGenerator {
|
||||
|
||||
class _HtmlGeneratorListButtons extends _HtmlGenerator {
|
||||
static getBtnPreviewToggle () {
|
||||
return `<button class="col-0-3 btn btn-default btn-xs p-0 lst__btn-collapse-all-previews" name="list-toggle-all-previews">[+]</button>`;
|
||||
return `<button class="ve-col-0-3 btn btn-default btn-xs p-0 lst__btn-collapse-all-previews" name="list-toggle-all-previews">[+]</button>`;
|
||||
}
|
||||
|
||||
static getBtnSource () {
|
||||
@@ -43,7 +43,7 @@ class _HtmlGeneratorListButtons extends _HtmlGenerator {
|
||||
},
|
||||
) {
|
||||
const attrs = [
|
||||
this._getAttrClass(`col-${width} sort btn btn-default btn-xs`, {classListAdditional}),
|
||||
this._getAttrClass(`ve-col-${width} sort btn btn-default btn-xs`, {classListAdditional}),
|
||||
sortIdent ? `data-sort="${sortIdent}"` : null,
|
||||
isDisabled ? `disabled` : null,
|
||||
]
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
</div>
|
||||
|
||||
<div id="filtertools-mundane" class="ele-mundane input-group input-group--bottom ve-flex no-shrink">
|
||||
<button class="col-3-5 sort btn btn-default btn-xs" data-sort="name" data-sortby="asc">Name</button>
|
||||
<button class="col-4-5 sort btn btn-default btn-xs" data-sort="type" data-sortby="asc">Type</button>
|
||||
<button class="col-1-5 sort btn btn-default btn-xs" data-sort="cost" data-sortby="asc">Cost</button>
|
||||
<button class="col-1-5 sort btn btn-default btn-xs" data-sort="weight" data-sortby="asc">Weight</button>
|
||||
<button class="ve-col-3-5 sort btn btn-default btn-xs" data-sort="name" data-sortby="asc">Name</button>
|
||||
<button class="ve-col-4-5 sort btn btn-default btn-xs" data-sort="type" data-sortby="asc">Type</button>
|
||||
<button class="ve-col-1-5 sort btn btn-default btn-xs" data-sort="cost" data-sortby="asc">Cost</button>
|
||||
<button class="ve-col-1-5 sort btn btn-default btn-xs" data-sort="weight" data-sortby="asc">Weight</button>
|
||||
<button class="sort btn btn-default btn-xs ve-grow" data-sort="source" data-sortby="asc">Source</button>
|
||||
</div>
|
||||
|
||||
@@ -25,11 +25,11 @@
|
||||
<div class="no-shrink itm__list-divider ele-mundane-and-magic"></div>
|
||||
|
||||
<div id="filtertools-magic" class="ele-magic input-group input-group--bottom ve-flex no-shrink">
|
||||
<button class="fullborder col-3-5 sort btn btn-default btn-xs" data-sort="name" data-sortby="asc">Name</button>
|
||||
<button class="fullborder col-4 sort btn btn-default btn-xs" data-sort="type" data-sortby="asc">Type</button>
|
||||
<button class="fullborder col-1-5 sort btn btn-default btn-xs" data-sort="weight" data-sortby="asc">Weight</button>
|
||||
<button class="col-0-6 sort btn btn-default btn-xs" data-sort="attunement" title="Can Be Attuned">A.</button>
|
||||
<button class="fullborder col-1-4 sort btn btn-default btn-xs" data-sort="rarity" data-sortby="asc">Rarity</button>
|
||||
<button class="fullborder ve-col-3-5 sort btn btn-default btn-xs" data-sort="name" data-sortby="asc">Name</button>
|
||||
<button class="fullborder ve-col-4 sort btn btn-default btn-xs" data-sort="type" data-sortby="asc">Type</button>
|
||||
<button class="fullborder ve-col-1-5 sort btn btn-default btn-xs" data-sort="weight" data-sortby="asc">Weight</button>
|
||||
<button class="ve-col-0-6 sort btn btn-default btn-xs" data-sort="attunement" title="Can Be Attuned">A.</button>
|
||||
<button class="fullborder ve-col-1-4 sort btn btn-default btn-xs" data-sort="rarity" data-sortby="asc">Rarity</button>
|
||||
<button class="fullborder sort btn btn-default btn-xs ve-grow" data-sort="source" data-sortby="asc">Source</button>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
{{> "listSublist" }}
|
||||
|
||||
<div class="row best-ecgen__hidden ve-small">
|
||||
<span class="col-6 text-right pr-2">Total:</span>
|
||||
<span class="col-6 no-wrap pl-0" id="totalcr"></span>
|
||||
<span class="ve-col-6 text-right pr-2">Total:</span>
|
||||
<span class="ve-col-6 no-wrap pl-0" id="totalcr"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
{{> "listSublist" }}
|
||||
|
||||
<div class="row ve-small ve-flex-v-center">
|
||||
<span class="col-6 text-right pr-2">Total:</span>
|
||||
<span class="col-2 ve-text-center no-wrap" id="totalweight"></span>
|
||||
<span class="col-2 ve-text-center no-wrap clickable" id="totalvalue"></span>
|
||||
<span class="col-2 ve-text-center no-wrap pr-0" id="totalitems"></span>
|
||||
<span class="ve-col-6 text-right pr-2">Total:</span>
|
||||
<span class="ve-col-2 ve-text-center no-wrap" id="totalweight"></span>
|
||||
<span class="ve-col-2 ve-text-center no-wrap clickable" id="totalvalue"></span>
|
||||
<span class="ve-col-2 ve-text-center no-wrap pr-0" id="totalitems"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -12,6 +12,7 @@ import * as ut from "./util.js";
|
||||
|
||||
const IS_DEV_MODE = true; // !!process.env.VET_SEO_IS_DEV_MODE; // N.b.: disabled as all known deployments are "dev"
|
||||
const BASE_SITE_URL = process.env.VET_BASE_SITE_URL || "https://5e.tools/";
|
||||
const LOG_EVERY = 1000; // Certain stakeholders prefer less logspam
|
||||
const isSkipUaEtc = !!process.env.VET_SEO_IS_SKIP_UA_ETC;
|
||||
const isOnlyVanilla = !!process.env.VET_SEO_IS_ONLY_VANILLA;
|
||||
const version = ut.readJson("package.json").version;
|
||||
@@ -186,7 +187,7 @@ async function main () {
|
||||
fs.writeFileSync(`./${path}`, html, "utf-8");
|
||||
|
||||
total++;
|
||||
if (total % 100 === 0) console.log(`Wrote ${total} files...`);
|
||||
if (total % LOG_EVERY === 0) console.log(`Wrote ${total} files...`);
|
||||
});
|
||||
}));
|
||||
console.log(`Wrote ${total} files.`);
|
||||
|
||||
@@ -8,30 +8,31 @@ import "../js/utils-dataloader.js";
|
||||
import "../js/hist.js";
|
||||
|
||||
class GenTables {
|
||||
_doLoadAdventureData () {
|
||||
static BOOK_BLOCKLIST = {};
|
||||
static ADVENTURE_BLOCKLIST = {};
|
||||
|
||||
_getAdventureData () {
|
||||
return ut.readJson(`./data/adventures.json`).adventure
|
||||
.map(idx => {
|
||||
if (!GenTables.ADVENTURE_BLOCKLIST[idx.id]) {
|
||||
return {
|
||||
adventure: idx,
|
||||
adventureData: JSON.parse(fs.readFileSync(`./data/adventure/adventure-${idx.id.toLowerCase()}.json`, "utf-8")),
|
||||
};
|
||||
}
|
||||
if (GenTables.ADVENTURE_BLOCKLIST[idx.id]) return null;
|
||||
return {
|
||||
adventure: idx,
|
||||
adventureData: JSON.parse(fs.readFileSync(`./data/adventure/adventure-${idx.id.toLowerCase()}.json`, "utf-8")),
|
||||
};
|
||||
})
|
||||
.filter(it => it);
|
||||
.filter(Boolean);
|
||||
}
|
||||
|
||||
_doLoadBookData () {
|
||||
_getBookData () {
|
||||
return ut.readJson(`./data/books.json`).book
|
||||
.map(idx => {
|
||||
if (!GenTables.BOOK_BLOCKLIST[idx.id]) {
|
||||
return {
|
||||
book: idx,
|
||||
bookData: JSON.parse(fs.readFileSync(`./data/book/book-${idx.id.toLowerCase()}.json`, "utf-8")),
|
||||
};
|
||||
}
|
||||
if (GenTables.BOOK_BLOCKLIST[idx.id]) return null;
|
||||
return {
|
||||
book: idx,
|
||||
bookData: JSON.parse(fs.readFileSync(`./data/book/book-${idx.id.toLowerCase()}.json`, "utf-8")),
|
||||
};
|
||||
})
|
||||
.filter(it => it);
|
||||
.filter(Boolean);
|
||||
}
|
||||
|
||||
async pRun () {
|
||||
@@ -50,41 +51,40 @@ class GenTables {
|
||||
}
|
||||
|
||||
_addBookAndAdventureData (output) {
|
||||
const advDocs = this._doLoadAdventureData();
|
||||
const bookDocs = this._doLoadBookData();
|
||||
|
||||
advDocs.forEach(doc => {
|
||||
const {
|
||||
table: foundTables,
|
||||
tableGroup: foundTableGroups,
|
||||
} = UtilGenTables.getAdventureBookTables(
|
||||
doc,
|
||||
{
|
||||
[
|
||||
{
|
||||
data: this._getAdventureData(),
|
||||
options: {
|
||||
headProp: "adventure",
|
||||
bodyProp: "adventureData",
|
||||
isRequireIncludes: true,
|
||||
},
|
||||
);
|
||||
|
||||
output.tables.push(...foundTables);
|
||||
output.tableGroups.push(...foundTableGroups);
|
||||
});
|
||||
|
||||
bookDocs.forEach(doc => {
|
||||
const {
|
||||
table: foundTables,
|
||||
tableGroup: foundTableGroups,
|
||||
} = UtilGenTables.getAdventureBookTables(
|
||||
doc,
|
||||
{
|
||||
},
|
||||
{
|
||||
data: this._getBookData(),
|
||||
options: {
|
||||
headProp: "book",
|
||||
bodyProp: "bookData",
|
||||
},
|
||||
);
|
||||
},
|
||||
]
|
||||
.forEach(meta => {
|
||||
meta.data
|
||||
.forEach(doc => {
|
||||
const {
|
||||
table: foundTables,
|
||||
tableGroup: foundTableGroups,
|
||||
} = UtilGenTables.getAdventureBookTables(
|
||||
doc,
|
||||
{
|
||||
...meta.options,
|
||||
},
|
||||
);
|
||||
|
||||
output.tables.push(...foundTables);
|
||||
output.tableGroups.push(...foundTableGroups);
|
||||
});
|
||||
output.tables.push(...foundTables);
|
||||
output.tableGroups.push(...foundTableGroups);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
async _pAddClassData (output) {
|
||||
@@ -93,13 +93,15 @@ class GenTables {
|
||||
ut.unpatchLoadJson();
|
||||
|
||||
classData.class.forEach(cls => {
|
||||
const {table: foundTables} = UtilGenTables.getClassTables(cls);
|
||||
const {table: foundTables, tableGroup: foundTableGroups} = UtilGenTables.getClassTables(cls);
|
||||
output.tables.push(...foundTables);
|
||||
output.tableGroups.push(...foundTableGroups);
|
||||
});
|
||||
|
||||
classData.subclass.forEach(sc => {
|
||||
const {table: foundTables} = UtilGenTables.getSubclassTables(sc);
|
||||
const {table: foundTables, tableGroup: foundTableGroups} = UtilGenTables.getSubclassTables(sc);
|
||||
output.tables.push(...foundTables);
|
||||
output.tableGroups.push(...foundTableGroups);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -188,8 +190,6 @@ class GenTables {
|
||||
|
||||
// -----------------------
|
||||
}
|
||||
GenTables.BOOK_BLOCKLIST = {};
|
||||
GenTables.ADVENTURE_BLOCKLIST = {};
|
||||
|
||||
const generator = new GenTables();
|
||||
export default generator.pRun();
|
||||
|
||||
Reference in New Issue
Block a user