mirror of
https://github.com/Kornstalx/5etools-mirror-2.github.io.git
synced 2026-03-09 01:04:54 -05:00
v1.202.0
This commit is contained in:
@@ -18,17 +18,18 @@ class _HtmlGenerator {
|
||||
|
||||
class _HtmlGeneratorListButtons extends _HtmlGenerator {
|
||||
static getBtnPreviewToggle () {
|
||||
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>`;
|
||||
return `<button type="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 () {
|
||||
return `<button class="sort btn btn-default btn-xs ve-grow" data-sort="source">Source</button>`;
|
||||
return `<button type="button" class="sort btn btn-default btn-xs ve-grow" data-sort="source">Source</button>`;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} width
|
||||
* @param {?string} sortIdent
|
||||
* @param {string} text
|
||||
* @param {?string} title
|
||||
* @param {?boolean} isDisabled
|
||||
* @param {?Array<string>} classListAdditional
|
||||
* @return {string}
|
||||
@@ -38,6 +39,7 @@ class _HtmlGeneratorListButtons extends _HtmlGenerator {
|
||||
width,
|
||||
sortIdent = null,
|
||||
text,
|
||||
title = null,
|
||||
isDisabled = false,
|
||||
classListAdditional = null,
|
||||
},
|
||||
@@ -45,28 +47,13 @@ class _HtmlGeneratorListButtons extends _HtmlGenerator {
|
||||
const attrs = [
|
||||
this._getAttrClass(`ve-col-${width} sort btn btn-default btn-xs`, {classListAdditional}),
|
||||
sortIdent ? `data-sort="${sortIdent}"` : null,
|
||||
title ? `title="${title}"` : null,
|
||||
isDisabled ? `disabled` : null,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(" ");
|
||||
|
||||
return `<button ${attrs}>${text}</button>`;
|
||||
}
|
||||
}
|
||||
|
||||
class _HtmlGeneratorListToken extends _HtmlGenerator {
|
||||
/**
|
||||
* @param {?Array<string>} classListAdditional
|
||||
* @return {string}
|
||||
*/
|
||||
static getWrpToken ({classListAdditional = null} = {}) {
|
||||
const attrs = [
|
||||
`id="float-token"`,
|
||||
this._getAttrClass(`relative`, {classListAdditional}),
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(" ");
|
||||
return `<div ${attrs}></div>`;
|
||||
return `<button type="button" ${attrs}>${text}</button>`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,9 +120,11 @@ class _PageGeneratorListBase extends _PageGeneratorBase {
|
||||
_isMultisource = false;
|
||||
_btnsList;
|
||||
_btnsSublist;
|
||||
_wrpToken;
|
||||
_isWrpToken;
|
||||
_onscrollPageContent;
|
||||
_styleListContainerAdditional;
|
||||
_styleContentWrapperAdditional;
|
||||
_stylePageContentAdditional;
|
||||
_isPrinterView = false;
|
||||
|
||||
_registerPartials () {
|
||||
@@ -158,6 +147,9 @@ class _PageGeneratorListBase extends _PageGeneratorBase {
|
||||
this._registerPartial({ident: "listScripts", filename: "list/template-list-scripts.hbs"});
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {object}
|
||||
*/
|
||||
_getData () {
|
||||
return {
|
||||
titlePage: this._titlePage,
|
||||
@@ -172,10 +164,12 @@ class _PageGeneratorListBase extends _PageGeneratorBase {
|
||||
isMultisource: this._isMultisource,
|
||||
btnsList: this._btnsList,
|
||||
btnsSublist: this._btnsSublist,
|
||||
wrpToken: this._wrpToken,
|
||||
isWrpToken: this._isWrpToken,
|
||||
onscrollPageContent: this._onscrollPageContent,
|
||||
isStyleBook: this._isStyleBook,
|
||||
styleListContainerAdditional: this._styleListContainerAdditional,
|
||||
styleContentWrapperAdditional: this._styleContentWrapperAdditional,
|
||||
stylePageContentAdditional: this._stylePageContentAdditional,
|
||||
identPartialListListcontainer: "listListcontainer",
|
||||
identPartialListContentwrapper: "listContentwrapper",
|
||||
isPrinterView: this._isPrinterView,
|
||||
@@ -475,6 +469,321 @@ class _PageGeneratorListTrapsHazards extends _PageGeneratorListBase {
|
||||
];
|
||||
}
|
||||
|
||||
class _PageGeneratorListRewards extends _PageGeneratorListBase {
|
||||
_page = UrlUtil.PG_REWARDS;
|
||||
_titlePage = "Supernatural Gifts & Rewards";
|
||||
_scriptIdentList = "rewards";
|
||||
|
||||
_btnsList = [
|
||||
_HtmlGeneratorListButtons.getBtnPreviewToggle(),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "2", sortIdent: "type", text: "Type"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "7-7", sortIdent: "name", text: "Name"}),
|
||||
_HtmlGeneratorListButtons.getBtnSource(),
|
||||
];
|
||||
|
||||
_btnsSublist = [
|
||||
_HtmlGeneratorListButtons.getBtn({width: "2", sortIdent: "type", text: "Type"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "10", sortIdent: "name", text: "Name"}),
|
||||
];
|
||||
}
|
||||
|
||||
class _PageGeneratorListLanguages extends _PageGeneratorListBase {
|
||||
_page = UrlUtil.PG_LANGUAGES;
|
||||
_titlePage = "Languages";
|
||||
_scriptIdentList = "languages";
|
||||
|
||||
_stylesheets = [
|
||||
"languages",
|
||||
];
|
||||
|
||||
_btnsList = [
|
||||
_HtmlGeneratorListButtons.getBtn({width: "6", sortIdent: "name", text: "Name"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "2", sortIdent: "type", text: "Type"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "2", sortIdent: "script", text: "Script"}),
|
||||
_HtmlGeneratorListButtons.getBtnSource(),
|
||||
];
|
||||
|
||||
_btnsSublist = [
|
||||
_HtmlGeneratorListButtons.getBtn({width: "8", sortIdent: "name", text: "Name"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "2", sortIdent: "type", text: "Type"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "2", sortIdent: "script", text: "Script"}),
|
||||
];
|
||||
}
|
||||
|
||||
class _PageGeneratorListObjects extends _PageGeneratorListBase {
|
||||
_page = UrlUtil.PG_OBJECTS;
|
||||
_titlePage = "Objects";
|
||||
_scriptIdentList = "objects";
|
||||
|
||||
_stylesheets = [
|
||||
"objects",
|
||||
];
|
||||
|
||||
_btnsList = [
|
||||
_HtmlGeneratorListButtons.getBtn({width: "8", sortIdent: "name", text: "Name"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "2", sortIdent: "size", text: "Size"}),
|
||||
_HtmlGeneratorListButtons.getBtnSource(),
|
||||
];
|
||||
|
||||
_btnsSublist = [
|
||||
_HtmlGeneratorListButtons.getBtn({width: "9", sortIdent: "name", text: "Name"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "3", sortIdent: "size", text: "Size"}),
|
||||
];
|
||||
|
||||
_isWrpToken = true;
|
||||
|
||||
_onscrollPageContent = `TokenUtil.handleStatblockScroll(event, this)`;
|
||||
}
|
||||
|
||||
class _PageGeneratorListOptionalFeatures extends _PageGeneratorListBase {
|
||||
_page = UrlUtil.PG_OPT_FEATURES;
|
||||
_titlePage = "Other Options and Features";
|
||||
_scriptIdentList = "optionalfeatures";
|
||||
|
||||
_isPrinterView = true;
|
||||
|
||||
_stylesheets = [
|
||||
"optionalfeatures",
|
||||
];
|
||||
|
||||
_styleListContainerAdditional = "ve-flex-6";
|
||||
_styleContentWrapperAdditional = "ve-flex-4";
|
||||
|
||||
_btnsList = [
|
||||
_HtmlGeneratorListButtons.getBtnPreviewToggle(),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "3", sortIdent: "name", text: "Name"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "1-5", sortIdent: "type", text: "Type"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "4-7", sortIdent: "prerequisite", text: "Prerequisite"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "1", sortIdent: "level", text: "Level"}),
|
||||
_HtmlGeneratorListButtons.getBtnSource(),
|
||||
];
|
||||
|
||||
_btnsSublist = [
|
||||
_HtmlGeneratorListButtons.getBtn({width: "4", sortIdent: "name", text: "Name"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "2", sortIdent: "type", text: "Type"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "4-5", sortIdent: "prerequisite", text: "Prerequisite"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "1-5", sortIdent: "level", text: "Level"}),
|
||||
];
|
||||
}
|
||||
|
||||
class _PageGeneratorListPsionics extends _PageGeneratorListBase {
|
||||
_page = UrlUtil.PG_PSIONICS;
|
||||
_titlePage = "Psionics";
|
||||
_scriptIdentList = "psionics";
|
||||
|
||||
_scriptsUtilsAdditional = [
|
||||
"utils-tableview.js",
|
||||
];
|
||||
|
||||
_btnsList = [
|
||||
_HtmlGeneratorListButtons.getBtn({width: "6", sortIdent: "name", text: "Name"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "2", sortIdent: "type", text: "Type"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "2", sortIdent: "order", text: "Order"}),
|
||||
_HtmlGeneratorListButtons.getBtnSource(),
|
||||
];
|
||||
|
||||
_btnsSublist = [
|
||||
_HtmlGeneratorListButtons.getBtn({width: "6", sortIdent: "name", text: "Name"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "3", sortIdent: "type", text: "Type"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "3", sortIdent: "order", text: "Order"}),
|
||||
];
|
||||
|
||||
_registerPartials () {
|
||||
super._registerPartials();
|
||||
|
||||
this._registerPartial({
|
||||
ident: "listContentwrapperPsionics",
|
||||
filename: "list/template-list-contentwrapper--psionics.hbs",
|
||||
});
|
||||
}
|
||||
|
||||
_getData () {
|
||||
return {
|
||||
...super._getData(),
|
||||
identPartialListContentwrapper: "listContentwrapperPsionics",
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
class _PageGeneratorListRaces extends _PageGeneratorListBase {
|
||||
_page = UrlUtil.PG_RACES;
|
||||
_titlePage = "Races";
|
||||
_scriptIdentList = "races";
|
||||
|
||||
_btnsList = [
|
||||
_HtmlGeneratorListButtons.getBtn({width: "4", sortIdent: "name", text: "Name"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "4", sortIdent: "ability", text: "Ability"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "2", sortIdent: "size", text: "Size"}),
|
||||
_HtmlGeneratorListButtons.getBtnSource(),
|
||||
];
|
||||
|
||||
_btnsSublist = [
|
||||
_HtmlGeneratorListButtons.getBtn({width: "5", sortIdent: "name", text: "Name"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "5", sortIdent: "ability", text: "Ability"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "2", sortIdent: "size", text: "Size"}),
|
||||
];
|
||||
|
||||
_isPrinterView = true;
|
||||
}
|
||||
|
||||
class _PageGeneratorListRecipes extends _PageGeneratorListBase {
|
||||
_page = UrlUtil.PG_RECIPES;
|
||||
_titlePage = "Recipes";
|
||||
_scriptIdentList = "recipes";
|
||||
|
||||
_stylesheets = [
|
||||
"recipes",
|
||||
];
|
||||
|
||||
_isStyleBook = true;
|
||||
|
||||
_styleListContainerAdditional = "ve-flex-4";
|
||||
_styleContentWrapperAdditional = "ve-flex-7";
|
||||
_stylePageContentAdditional = "recipes__tbl-recipes";
|
||||
|
||||
_btnsList = [
|
||||
_HtmlGeneratorListButtons.getBtn({width: "6", sortIdent: "name", text: "Name"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "4", sortIdent: "type", text: "Category"}),
|
||||
_HtmlGeneratorListButtons.getBtnSource(),
|
||||
];
|
||||
|
||||
_btnsSublist = [
|
||||
_HtmlGeneratorListButtons.getBtn({width: "9", sortIdent: "name", text: "Name"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "3", sortIdent: "type", text: "Category"}),
|
||||
];
|
||||
|
||||
_registerPartials () {
|
||||
super._registerPartials();
|
||||
|
||||
this._registerPartial({
|
||||
ident: "listContentwrapperRecipes",
|
||||
filename: "list/template-list-contentwrapper--recipes.hbs",
|
||||
});
|
||||
}
|
||||
|
||||
_getData () {
|
||||
return {
|
||||
...super._getData(),
|
||||
identPartialListContentwrapper: "listContentwrapperRecipes",
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
class _PageGeneratorListSpells extends _PageGeneratorListBase {
|
||||
_page = UrlUtil.PG_SPELLS;
|
||||
_titlePage = "Spells";
|
||||
_scriptIdentList = "spells";
|
||||
|
||||
_stylesheets = [
|
||||
"spells",
|
||||
];
|
||||
|
||||
_styleListContainerAdditional = "ve-flex-7";
|
||||
_styleContentWrapperAdditional = "ve-flex-5";
|
||||
|
||||
_isMultisource = true;
|
||||
|
||||
_scriptsUtilsAdditional = [
|
||||
"utils-tableview.js",
|
||||
];
|
||||
|
||||
_btnsList = [
|
||||
_HtmlGeneratorListButtons.getBtn({width: "2-9", sortIdent: "name", text: "Name"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "1-5", sortIdent: "level", text: "Level"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "1-7", sortIdent: "time", text: "Time"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "1-2", sortIdent: "school", text: "School"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "0-6", sortIdent: "concentration", title: "Concentration", text: "C."}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "2-4", sortIdent: "range", text: "Range"}),
|
||||
_HtmlGeneratorListButtons.getBtnSource(),
|
||||
];
|
||||
|
||||
_btnsSublist = [
|
||||
_HtmlGeneratorListButtons.getBtn({width: "3-2", sortIdent: "name", text: "Name"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "1-5", sortIdent: "level", text: "Level"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "1-8", sortIdent: "time", text: "Time"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "1-6", sortIdent: "school", text: "School"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "0-7", sortIdent: "concentration", title: "Concentration", text: "C."}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "3-2", sortIdent: "range", text: "Range"}),
|
||||
];
|
||||
|
||||
_registerPartials () {
|
||||
super._registerPartials();
|
||||
|
||||
this._registerPartial({
|
||||
ident: "listContentwrapperSpells",
|
||||
filename: "list/template-list-contentwrapper--spells.hbs",
|
||||
});
|
||||
}
|
||||
|
||||
_getData () {
|
||||
return {
|
||||
...super._getData(),
|
||||
identPartialListContentwrapper: "listContentwrapperSpells",
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
class _PageGeneratorListTables extends _PageGeneratorListBase {
|
||||
_page = UrlUtil.PG_TABLES;
|
||||
_titlePage = "Tables";
|
||||
_scriptIdentList = "tables";
|
||||
|
||||
_styleListContainerAdditional = "ve-flex-4";
|
||||
_styleContentWrapperAdditional = "ve-flex-6";
|
||||
|
||||
_btnsList = [
|
||||
_HtmlGeneratorListButtons.getBtn({width: "10", sortIdent: "sortName", text: "Name"}),
|
||||
_HtmlGeneratorListButtons.getBtnSource(),
|
||||
];
|
||||
|
||||
_btnsSublist = [
|
||||
_HtmlGeneratorListButtons.getBtn({width: "12", sortIdent: "sortName", text: "Name"}),
|
||||
];
|
||||
}
|
||||
|
||||
class _PageGeneratorListVariantRules extends _PageGeneratorListBase {
|
||||
_page = UrlUtil.PG_VARIANTRULES;
|
||||
_titlePage = "Optional, Variant, and Expanded Rules";
|
||||
_navbarTitle = "Optional/etc. Rules";
|
||||
_scriptIdentList = "variantrules";
|
||||
|
||||
_btnsList = [
|
||||
_HtmlGeneratorListButtons.getBtn({width: "7", sortIdent: "name", text: "Name"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "3", sortIdent: "ruleType", text: "Type"}),
|
||||
_HtmlGeneratorListButtons.getBtnSource(),
|
||||
];
|
||||
|
||||
_btnsSublist = [
|
||||
_HtmlGeneratorListButtons.getBtn({width: "9", sortIdent: "name", text: "Name"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "3", sortIdent: "ruleType", text: "Type"}),
|
||||
];
|
||||
}
|
||||
|
||||
class _PageGeneratorListVehicles extends _PageGeneratorListBase {
|
||||
_page = UrlUtil.PG_VEHICLES;
|
||||
_titlePage = "Vehicles";
|
||||
_scriptIdentList = "vehicles";
|
||||
|
||||
_stylesheets = [
|
||||
"vehicles",
|
||||
];
|
||||
|
||||
_btnsList = [
|
||||
_HtmlGeneratorListButtons.getBtn({width: "6", sortIdent: "type", text: "Type"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "4", sortIdent: "name", text: "Name"}),
|
||||
_HtmlGeneratorListButtons.getBtnSource(),
|
||||
];
|
||||
|
||||
_btnsSublist = [
|
||||
_HtmlGeneratorListButtons.getBtn({width: "8", sortIdent: "type", text: "Type"}),
|
||||
_HtmlGeneratorListButtons.getBtn({width: "4", sortIdent: "name", text: "Name"}),
|
||||
];
|
||||
|
||||
_isWrpToken = true;
|
||||
|
||||
_onscrollPageContent = `TokenUtil.handleStatblockScroll(event, this)`;
|
||||
}
|
||||
|
||||
const generators = [
|
||||
new _PageGeneratorListActions(),
|
||||
new _PageGeneratorListBackgrounds(),
|
||||
@@ -487,6 +796,17 @@ const generators = [
|
||||
new _PageGeneratorListFeats(),
|
||||
new _PageGeneratorListItems(),
|
||||
new _PageGeneratorListTrapsHazards(),
|
||||
new _PageGeneratorListRewards(),
|
||||
new _PageGeneratorListLanguages(),
|
||||
new _PageGeneratorListObjects(),
|
||||
new _PageGeneratorListOptionalFeatures(),
|
||||
new _PageGeneratorListPsionics(),
|
||||
new _PageGeneratorListRaces(),
|
||||
new _PageGeneratorListRecipes(),
|
||||
new _PageGeneratorListSpells(),
|
||||
new _PageGeneratorListTables(),
|
||||
new _PageGeneratorListVariantRules(),
|
||||
new _PageGeneratorListVehicles(),
|
||||
];
|
||||
|
||||
generators
|
||||
|
||||
Reference in New Issue
Block a user